@sme.up/ketchup2 2.0.0-SNAPSHOT-20250701082850 → 2.0.0-SNAPSHOT-20250701102314

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var Vr=Object.defineProperty;var Yr=(r,e,t)=>e in r?Vr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var de=(r,e,t)=>Yr(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),Ur=require("react-dom");function Wr(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const We=Wr(R);var Be={exports:{}},Ae={};/**
1
+ "use strict";var Yr=Object.defineProperty;var Ur=(r,e,t)=>e in r?Yr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var de=(r,e,t)=>Ur(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),Wr=require("react-dom");function Br(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Be=Br(R);var He={exports:{}},Ae={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var kt;function Br(){if(kt)return Ae;kt=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:r,type:n,key:i,ref:s!==void 0?s:null,props:a}}return Ae.Fragment=e,Ae.jsx=t,Ae.jsxs=t,Ae}var Ne={};/**
9
+ */var kt;function Hr(){if(kt)return Ae;kt=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:r,type:n,key:i,ref:s!==void 0?s:null,props:a}}return Ae.Fragment=e,Ae.jsx=t,Ae.jsxs=t,Ae}var Ne={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,37 +14,37 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Pt;function Hr(){return Pt||(Pt=1,process.env.NODE_ENV!=="production"&&function(){function r(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===D?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case y:return"Fragment";case E:return"Profiler";case S:return"StrictMode";case v:return"Suspense";case j:return"SuspenseList";case b:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case d:return"Portal";case w:return(h.displayName||"Context")+".Provider";case T:return(h._context.displayName||"Context")+".Consumer";case O:var x=h.render;return h=h.displayName,h||(h=x.displayName||x.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case M:return x=h.displayName||null,x!==null?x:r(h.type)||"Memo";case I:x=h._payload,h=h._init;try{return r(h(x))}catch{}}return null}function e(h){return""+h}function t(h){try{e(h);var x=!1}catch{x=!0}if(x){x=console;var _=x.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return _.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),e(h)}}function n(h){if(h===y)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===I)return"<...>";try{var x=r(h);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var h=N.A;return h===null?null:h.getOwner()}function a(){return Error("react-stack-top-frame")}function i(h){if(L.call(h,"key")){var x=Object.getOwnPropertyDescriptor(h,"key").get;if(x&&x.isReactWarning)return!1}return h.key!==void 0}function o(h,x){function _(){P||(P=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}_.isReactWarning=!0,Object.defineProperty(h,"key",{get:_,configurable:!0})}function l(){var h=r(this.type);return V[h]||(V[h]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),h=this.props.ref,h!==void 0?h:null}function c(h,x,_,C,$,A,W,H){return _=A.ref,h={$$typeof:m,type:h,key:x,props:A,_owner:$},(_!==void 0?_:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:l}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function f(h,x,_,C,$,A,W,H){var B=x.children;if(B!==void 0)if(C)if(k(B)){for(C=0;C<B.length;C++)u(B[C]);Object.freeze&&Object.freeze(B)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(B);if(L.call(x,"key")){B=r(h);var X=Object.keys(x).filter(function(se){return se!=="key"});C=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",U[B+C]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Pt;function Gr(){return Pt||(Pt=1,process.env.NODE_ENV!=="production"&&function(){function r(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===D?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case y:return"Fragment";case E:return"Profiler";case S:return"StrictMode";case v:return"Suspense";case j:return"SuspenseList";case b:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case d:return"Portal";case w:return(h.displayName||"Context")+".Provider";case T:return(h._context.displayName||"Context")+".Consumer";case O:var x=h.render;return h=h.displayName,h||(h=x.displayName||x.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case M:return x=h.displayName||null,x!==null?x:r(h.type)||"Memo";case I:x=h._payload,h=h._init;try{return r(h(x))}catch{}}return null}function e(h){return""+h}function t(h){try{e(h);var x=!1}catch{x=!0}if(x){x=console;var _=x.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return _.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),e(h)}}function n(h){if(h===y)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===I)return"<...>";try{var x=r(h);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var h=N.A;return h===null?null:h.getOwner()}function a(){return Error("react-stack-top-frame")}function i(h){if(L.call(h,"key")){var x=Object.getOwnPropertyDescriptor(h,"key").get;if(x&&x.isReactWarning)return!1}return h.key!==void 0}function o(h,x){function _(){P||(P=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}_.isReactWarning=!0,Object.defineProperty(h,"key",{get:_,configurable:!0})}function l(){var h=r(this.type);return V[h]||(V[h]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),h=this.props.ref,h!==void 0?h:null}function c(h,x,_,C,$,A,W,H){return _=A.ref,h={$$typeof:m,type:h,key:x,props:A,_owner:$},(_!==void 0?_:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:l}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function f(h,x,_,C,$,A,W,H){var B=x.children;if(B!==void 0)if(C)if(k(B)){for(C=0;C<B.length;C++)u(B[C]);Object.freeze&&Object.freeze(B)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(B);if(L.call(x,"key")){B=r(h);var X=Object.keys(x).filter(function(se){return se!=="key"});C=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",U[B+C]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,C,B,X,B),U[B+C]=!0)}if(B=null,_!==void 0&&(t(_),B=""+_),i(x)&&(t(x.key),B=""+x.key),"key"in x){_={};for(var K in x)K!=="key"&&(_[K]=x[K])}else _=x;return B&&o(_,typeof h=="function"?h.displayName||h.name||"Unknown":h),c(h,B,A,$,s(),_,W,H)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===m&&h._store&&(h._store.validated=1)}var p=R,m=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),w=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),N=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,k=Array.isArray,Y=console.createTask?console.createTask:function(){return null};p={"react-stack-bottom-frame":function(h){return h()}};var P,V={},z=p["react-stack-bottom-frame"].bind(p,a)(),J=Y(n(a)),U={};Ne.Fragment=y,Ne.jsx=function(h,x,_,C,$){var A=1e4>N.recentlyCreatedOwnerStacks++;return f(h,x,_,!1,C,$,A?Error("react-stack-top-frame"):z,A?Y(n(h)):J)},Ne.jsxs=function(h,x,_,C,$){var A=1e4>N.recentlyCreatedOwnerStacks++;return f(h,x,_,!0,C,$,A?Error("react-stack-top-frame"):z,A?Y(n(h)):J)}}()),Ne}var At;function Gr(){return At||(At=1,process.env.NODE_ENV==="production"?Be.exports=Br():Be.exports=Hr()),Be.exports}var g=Gr();const De=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return g.jsx("label",{className:n.container,htmlFor:t,children:r})},pe={"smp-layout":"_smp-layout_pdvd2_1","smp-layout-horizontal":"_smp-layout-horizontal_pdvd2_9","smp-layout-vertical":"_smp-layout-vertical_pdvd2_14","smp-layout-section-grid":"_smp-layout-section-grid_pdvd2_19","smp-layout-section-vertical":"_smp-layout-section-vertical_pdvd2_22","smp-layout-section-horizontal":"_smp-layout-section-horizontal_pdvd2_26","smp-layout-cell-container":"_smp-layout-cell-container_pdvd2_31","smp-layout-section-flex":"_smp-layout-section-flex_pdvd2_35","smp-grid-template-cols":"_smp-grid-template-cols_pdvd2_52","smp-grid-template-rows":"_smp-grid-template-rows_pdvd2_56","smp-layout-section-with-title":"_smp-layout-section-with-title_pdvd2_60","smp-layout-section-title":"_smp-layout-section-title_pdvd2_66"},Kr=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Er=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Er(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(i=t.content)!=null&&i.length&&t.columns&&+t.columns>1&&(n=Kr(t.content.filter(l=>e.includes(l.id)),+t.columns).map((l,c)=>({...t,id:`${t.id}-${c}`,content:l,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),Nt=(r,e)=>{if(!e)return{};const t=r.some(n=>n.dim)?r.map(n=>n.dim||"auto").join(" "):`repeat(${r.length}, 1fr)`;return{[e]:t}},Mt=r=>r.some(e=>e.dim&&!e.dim.endsWith("%"));function qr(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function tt(){return tt=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},tt.apply(null,arguments)}function wt(r,e){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},wt(r,e)}function zr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,wt(r,e)}function pt(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var He={};/*!
22
+ <%s key={someKey} {...props} />`,C,B,X,B),U[B+C]=!0)}if(B=null,_!==void 0&&(t(_),B=""+_),i(x)&&(t(x.key),B=""+x.key),"key"in x){_={};for(var K in x)K!=="key"&&(_[K]=x[K])}else _=x;return B&&o(_,typeof h=="function"?h.displayName||h.name||"Unknown":h),c(h,B,A,$,s(),_,W,H)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===m&&h._store&&(h._store.validated=1)}var p=R,m=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),w=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),N=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,k=Array.isArray,Y=console.createTask?console.createTask:function(){return null};p={"react-stack-bottom-frame":function(h){return h()}};var P,V={},z=p["react-stack-bottom-frame"].bind(p,a)(),J=Y(n(a)),U={};Ne.Fragment=y,Ne.jsx=function(h,x,_,C,$){var A=1e4>N.recentlyCreatedOwnerStacks++;return f(h,x,_,!1,C,$,A?Error("react-stack-top-frame"):z,A?Y(n(h)):J)},Ne.jsxs=function(h,x,_,C,$){var A=1e4>N.recentlyCreatedOwnerStacks++;return f(h,x,_,!0,C,$,A?Error("react-stack-top-frame"):z,A?Y(n(h)):J)}}()),Ne}var At;function Kr(){return At||(At=1,process.env.NODE_ENV==="production"?He.exports=Hr():He.exports=Gr()),He.exports}var g=Kr();const De=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return g.jsx("label",{className:n.container,htmlFor:t,children:r})},pe={"smp-layout":"_smp-layout_pdvd2_1","smp-layout-horizontal":"_smp-layout-horizontal_pdvd2_9","smp-layout-vertical":"_smp-layout-vertical_pdvd2_14","smp-layout-section-grid":"_smp-layout-section-grid_pdvd2_19","smp-layout-section-vertical":"_smp-layout-section-vertical_pdvd2_22","smp-layout-section-horizontal":"_smp-layout-section-horizontal_pdvd2_26","smp-layout-cell-container":"_smp-layout-cell-container_pdvd2_31","smp-layout-section-flex":"_smp-layout-section-flex_pdvd2_35","smp-grid-template-cols":"_smp-grid-template-cols_pdvd2_52","smp-grid-template-rows":"_smp-grid-template-rows_pdvd2_56","smp-layout-section-with-title":"_smp-layout-section-with-title_pdvd2_60","smp-layout-section-title":"_smp-layout-section-title_pdvd2_66"},qr=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Er=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Er(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(i=t.content)!=null&&i.length&&t.columns&&+t.columns>1&&(n=qr(t.content.filter(l=>e.includes(l.id)),+t.columns).map((l,c)=>({...t,id:`${t.id}-${c}`,content:l,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),Nt=(r,e)=>{if(!e)return{};const t=r.some(n=>n.dim)?r.map(n=>n.dim||"auto").join(" "):`repeat(${r.length}, 1fr)`;return{[e]:t}},Mt=r=>r.some(e=>e.dim&&!e.dim.endsWith("%"));function zr(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function tt(){return tt=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},tt.apply(null,arguments)}function wt(r,e){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},wt(r,e)}function Jr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,wt(r,e)}function pt(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var Ge={};/*!
23
23
  * content-type
24
24
  * Copyright(c) 2015 Douglas Christopher Wilson
25
25
  * MIT Licensed
26
- */var Ft;function Jr(){if(Ft)return He;Ft=1;var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,e=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,t=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,n=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;He.format=i,He.parse=o;function i(u){if(!u||typeof u!="object")throw new TypeError("argument obj is required");var p=u.parameters,m=u.type;if(!m||!a.test(m))throw new TypeError("invalid type");var d=m;if(p&&typeof p=="object")for(var y,S=Object.keys(p).sort(),E=0;E<S.length;E++){if(y=S[E],!t.test(y))throw new TypeError("invalid parameter name");d+="; "+y+"="+c(p[y])}return d}function o(u){if(!u)throw new TypeError("argument string is required");var p=typeof u=="object"?l(u):u;if(typeof p!="string")throw new TypeError("argument string is required to be a string");var m=p.indexOf(";"),d=m!==-1?p.slice(0,m).trim():p.trim();if(!a.test(d))throw new TypeError("invalid media type");var y=new f(d.toLowerCase());if(m!==-1){var S,E,T;for(r.lastIndex=m;E=r.exec(p);){if(E.index!==m)throw new TypeError("invalid parameter format");m+=E[0].length,S=E[1].toLowerCase(),T=E[2],T.charCodeAt(0)===34&&(T=T.slice(1,-1),T.indexOf("\\")!==-1&&(T=T.replace(n,"$1"))),y.parameters[S]=T}if(m!==p.length)throw new TypeError("invalid parameter format")}return y}function l(u){var p;if(typeof u.getHeader=="function"?p=u.getHeader("content-type"):typeof u.headers=="object"&&(p=u.headers&&u.headers["content-type"]),typeof p!="string")throw new TypeError("content-type header is missing from object");return p}function c(u){var p=String(u);if(t.test(p))return p;if(p.length>0&&!e.test(p))throw new TypeError("invalid parameter value");return'"'+p.replace(s,"\\$1")+'"'}function f(u){this.parameters=Object.create(null),this.type=u}return He}var Xr=Jr(),Ie=new Map,Tr=function(e){return e.cloneNode(!0)},Vt=function(){return window.location.protocol==="file:"},Or=function(e,t,n){var s=new XMLHttpRequest;s.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&s.readyState===2){var a=s.getResponseHeader("Content-Type");if(!a)throw new Error("Content type not found");var i=Xr.parse(a).type;if(!(i==="image/svg+xml"||i==="text/plain"))throw new Error("Invalid content type: ".concat(i))}if(s.readyState===4){if(s.status===404||s.responseXML===null)throw new Error(Vt()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(s.status===200||Vt()&&s.status===0)n(null,s);else throw new Error("There was a problem injecting the SVG: "+s.status+" "+s.statusText)}}catch(o){if(s.abort(),o instanceof Error)n(o,s);else throw o}},s.open("GET",e),s.withCredentials=t,s.overrideMimeType&&s.overrideMimeType("text/xml"),s.send()},xe={},Yt=function(e,t){xe[e]=xe[e]||[],xe[e].push(t)},Zr=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(xe[e])){var l=Ie.get(e),c=xe[e][i];l instanceof SVGSVGElement&&c(null,Tr(l)),l instanceof Error&&c(l),i===xe[e].length-1&&delete xe[e]}},0)},n=0,s=xe[e].length;n<s;n++)t(n)},Qr=function(e,t,n){if(Ie.has(e)){var s=Ie.get(e);if(s===void 0){Yt(e,n);return}if(s instanceof SVGSVGElement){n(null,Tr(s));return}}Ie.set(e,void 0),Yt(e,n),Or(e,t,function(a,i){var o;a?Ie.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Ie.set(e,i.responseXML.documentElement),Zr(e)})},en=function(e,t,n){Or(e,t,function(s,a){var i;s?n(s):((i=a.responseXML)===null||i===void 0?void 0:i.documentElement)instanceof SVGSVGElement&&n(null,a.responseXML.documentElement)})},tn=0,rn=function(){return++tn},ge=[],Ut={},nn="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xlink",Wt=function(e,t,n,s,a,i,o){var l=e.getAttribute("data-src")||e.getAttribute("src");if(!l){o(new Error("Invalid data-src or src attribute"));return}if(ge.indexOf(e)!==-1){ge.splice(ge.indexOf(e),1),e=null;return}ge.push(e),e.setAttribute("src","");var c=s?Qr:en;c(l,a,function(f,u){if(!u){ge.splice(ge.indexOf(e),1),e=null,o(f);return}var p=e.getAttribute("id");p&&u.setAttribute("id",p);var m=e.getAttribute("title");m&&u.setAttribute("title",m);var d=e.getAttribute("width");d&&u.setAttribute("width",d);var y=e.getAttribute("height");y&&u.setAttribute("height",y);var S=Array.from(new Set(pt(pt(pt([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",S);var E=e.getAttribute("style");E&&u.setAttribute("style",E),u.setAttribute("data-src",l);var T=[].filter.call(e.attributes,function(J){return/^data-\w[\w-]*$/.test(J.name)});if(Array.prototype.forEach.call(T,function(J){J.name&&J.value&&u.setAttribute(J.name,J.value)}),n){var w={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},O,v,j,M,I;Object.keys(w).forEach(function(J){O=J,j=w[J],v=u.querySelectorAll(O+"[id]");for(var U=function(C,$){M=v[C].id,I=M+"-"+rn();var A;Array.prototype.forEach.call(j,function(G){A=u.querySelectorAll("["+G+'*="'+M+'"]');for(var Z=0,re=A.length;Z<re;Z++){var ne=A[Z].getAttribute(G);ne&&!ne.match(new RegExp('url\\("?#'+M+'"?\\)'))||A[Z].setAttribute(G,"url(#"+I+")")}});for(var W=u.querySelectorAll("[*|href]"),H=[],B=0,X=W.length;B<X;B++){var K=W[B].getAttributeNS(ht,"href");K&&K.toString()==="#"+v[C].id&&H.push(W[B])}for(var se=0,F=H.length;se<F;se++)H[se].setAttributeNS(ht,"href","#"+I);v[C].id=I},h=0,x=v.length;h<x;h++)U(h)})}u.removeAttribute("xmlns:a");for(var b=u.querySelectorAll("script"),D=[],N,L,k=0,Y=b.length;k<Y;k++)L=b[k].getAttribute("type"),(!L||L==="application/ecmascript"||L==="application/javascript"||L==="text/javascript")&&(N=b[k].innerText||b[k].textContent,N&&D.push(N),u.removeChild(b[k]));if(D.length>0&&(t==="always"||t==="once"&&!Ut[l])){for(var P=0,V=D.length;P<V;P++)new Function(D[P])(window);Ut[l]=!0}var z=u.querySelectorAll("style");if(Array.prototype.forEach.call(z,function(J){J.textContent+=""}),u.setAttribute("xmlns",nn),u.setAttribute("xmlns:xlink",ht),i(u),!e.parentNode){ge.splice(ge.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),ge.splice(ge.indexOf(e),1),e=null,o(null,u)})},sn=function(e,t){var n=t===void 0?{}:t,s=n.afterAll,a=s===void 0?function(){}:s,i=n.afterEach,o=i===void 0?function(){}:i,l=n.beforeEach,c=l===void 0?function(){}:l,f=n.cacheRequests,u=f===void 0?!0:f,p=n.evalScripts,m=p===void 0?"never":p,d=n.httpRequestWithCredentials,y=d===void 0?!1:d,S=n.renumerateIRIElements,E=S===void 0?!0:S;if(e&&"length"in e)for(var T=0,w=0,O=e.length;w<O;w++)Wt(e[w],m,E,u,y,c,function(v,j){o(v,j),e&&"length"in e&&e.length===++T&&a(T)});else e?Wt(e,m,E,u,y,c,function(v,j){o(v,j),a(1),e=null}):a(0)},Ge={exports:{}},Ke={exports:{}},Q={};/** @license React v16.13.1
26
+ */var Ft;function Xr(){if(Ft)return Ge;Ft=1;var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,e=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,t=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,n=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Ge.format=i,Ge.parse=o;function i(u){if(!u||typeof u!="object")throw new TypeError("argument obj is required");var p=u.parameters,m=u.type;if(!m||!a.test(m))throw new TypeError("invalid type");var d=m;if(p&&typeof p=="object")for(var y,S=Object.keys(p).sort(),E=0;E<S.length;E++){if(y=S[E],!t.test(y))throw new TypeError("invalid parameter name");d+="; "+y+"="+c(p[y])}return d}function o(u){if(!u)throw new TypeError("argument string is required");var p=typeof u=="object"?l(u):u;if(typeof p!="string")throw new TypeError("argument string is required to be a string");var m=p.indexOf(";"),d=m!==-1?p.slice(0,m).trim():p.trim();if(!a.test(d))throw new TypeError("invalid media type");var y=new f(d.toLowerCase());if(m!==-1){var S,E,T;for(r.lastIndex=m;E=r.exec(p);){if(E.index!==m)throw new TypeError("invalid parameter format");m+=E[0].length,S=E[1].toLowerCase(),T=E[2],T.charCodeAt(0)===34&&(T=T.slice(1,-1),T.indexOf("\\")!==-1&&(T=T.replace(n,"$1"))),y.parameters[S]=T}if(m!==p.length)throw new TypeError("invalid parameter format")}return y}function l(u){var p;if(typeof u.getHeader=="function"?p=u.getHeader("content-type"):typeof u.headers=="object"&&(p=u.headers&&u.headers["content-type"]),typeof p!="string")throw new TypeError("content-type header is missing from object");return p}function c(u){var p=String(u);if(t.test(p))return p;if(p.length>0&&!e.test(p))throw new TypeError("invalid parameter value");return'"'+p.replace(s,"\\$1")+'"'}function f(u){this.parameters=Object.create(null),this.type=u}return Ge}var Zr=Xr(),Ie=new Map,Tr=function(e){return e.cloneNode(!0)},Vt=function(){return window.location.protocol==="file:"},Or=function(e,t,n){var s=new XMLHttpRequest;s.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&s.readyState===2){var a=s.getResponseHeader("Content-Type");if(!a)throw new Error("Content type not found");var i=Zr.parse(a).type;if(!(i==="image/svg+xml"||i==="text/plain"))throw new Error("Invalid content type: ".concat(i))}if(s.readyState===4){if(s.status===404||s.responseXML===null)throw new Error(Vt()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(s.status===200||Vt()&&s.status===0)n(null,s);else throw new Error("There was a problem injecting the SVG: "+s.status+" "+s.statusText)}}catch(o){if(s.abort(),o instanceof Error)n(o,s);else throw o}},s.open("GET",e),s.withCredentials=t,s.overrideMimeType&&s.overrideMimeType("text/xml"),s.send()},xe={},Yt=function(e,t){xe[e]=xe[e]||[],xe[e].push(t)},Qr=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(xe[e])){var l=Ie.get(e),c=xe[e][i];l instanceof SVGSVGElement&&c(null,Tr(l)),l instanceof Error&&c(l),i===xe[e].length-1&&delete xe[e]}},0)},n=0,s=xe[e].length;n<s;n++)t(n)},en=function(e,t,n){if(Ie.has(e)){var s=Ie.get(e);if(s===void 0){Yt(e,n);return}if(s instanceof SVGSVGElement){n(null,Tr(s));return}}Ie.set(e,void 0),Yt(e,n),Or(e,t,function(a,i){var o;a?Ie.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Ie.set(e,i.responseXML.documentElement),Qr(e)})},tn=function(e,t,n){Or(e,t,function(s,a){var i;s?n(s):((i=a.responseXML)===null||i===void 0?void 0:i.documentElement)instanceof SVGSVGElement&&n(null,a.responseXML.documentElement)})},rn=0,nn=function(){return++rn},ge=[],Ut={},sn="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xlink",Wt=function(e,t,n,s,a,i,o){var l=e.getAttribute("data-src")||e.getAttribute("src");if(!l){o(new Error("Invalid data-src or src attribute"));return}if(ge.indexOf(e)!==-1){ge.splice(ge.indexOf(e),1),e=null;return}ge.push(e),e.setAttribute("src","");var c=s?en:tn;c(l,a,function(f,u){if(!u){ge.splice(ge.indexOf(e),1),e=null,o(f);return}var p=e.getAttribute("id");p&&u.setAttribute("id",p);var m=e.getAttribute("title");m&&u.setAttribute("title",m);var d=e.getAttribute("width");d&&u.setAttribute("width",d);var y=e.getAttribute("height");y&&u.setAttribute("height",y);var S=Array.from(new Set(pt(pt(pt([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",S);var E=e.getAttribute("style");E&&u.setAttribute("style",E),u.setAttribute("data-src",l);var T=[].filter.call(e.attributes,function(J){return/^data-\w[\w-]*$/.test(J.name)});if(Array.prototype.forEach.call(T,function(J){J.name&&J.value&&u.setAttribute(J.name,J.value)}),n){var w={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},O,v,j,M,I;Object.keys(w).forEach(function(J){O=J,j=w[J],v=u.querySelectorAll(O+"[id]");for(var U=function(C,$){M=v[C].id,I=M+"-"+nn();var A;Array.prototype.forEach.call(j,function(G){A=u.querySelectorAll("["+G+'*="'+M+'"]');for(var Z=0,re=A.length;Z<re;Z++){var ne=A[Z].getAttribute(G);ne&&!ne.match(new RegExp('url\\("?#'+M+'"?\\)'))||A[Z].setAttribute(G,"url(#"+I+")")}});for(var W=u.querySelectorAll("[*|href]"),H=[],B=0,X=W.length;B<X;B++){var K=W[B].getAttributeNS(ht,"href");K&&K.toString()==="#"+v[C].id&&H.push(W[B])}for(var se=0,F=H.length;se<F;se++)H[se].setAttributeNS(ht,"href","#"+I);v[C].id=I},h=0,x=v.length;h<x;h++)U(h)})}u.removeAttribute("xmlns:a");for(var b=u.querySelectorAll("script"),D=[],N,L,k=0,Y=b.length;k<Y;k++)L=b[k].getAttribute("type"),(!L||L==="application/ecmascript"||L==="application/javascript"||L==="text/javascript")&&(N=b[k].innerText||b[k].textContent,N&&D.push(N),u.removeChild(b[k]));if(D.length>0&&(t==="always"||t==="once"&&!Ut[l])){for(var P=0,V=D.length;P<V;P++)new Function(D[P])(window);Ut[l]=!0}var z=u.querySelectorAll("style");if(Array.prototype.forEach.call(z,function(J){J.textContent+=""}),u.setAttribute("xmlns",sn),u.setAttribute("xmlns:xlink",ht),i(u),!e.parentNode){ge.splice(ge.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),ge.splice(ge.indexOf(e),1),e=null,o(null,u)})},an=function(e,t){var n=t===void 0?{}:t,s=n.afterAll,a=s===void 0?function(){}:s,i=n.afterEach,o=i===void 0?function(){}:i,l=n.beforeEach,c=l===void 0?function(){}:l,f=n.cacheRequests,u=f===void 0?!0:f,p=n.evalScripts,m=p===void 0?"never":p,d=n.httpRequestWithCredentials,y=d===void 0?!1:d,S=n.renumerateIRIElements,E=S===void 0?!0:S;if(e&&"length"in e)for(var T=0,w=0,O=e.length;w<O;w++)Wt(e[w],m,E,u,y,c,function(v,j){o(v,j),e&&"length"in e&&e.length===++T&&a(T)});else e?Wt(e,m,E,u,y,c,function(v,j){o(v,j),a(1),e=null}):a(0)},Ke={exports:{}},qe={exports:{}},Q={};/** @license React v16.13.1
27
27
  * react-is.production.min.js
28
28
  *
29
29
  * Copyright (c) Facebook, Inc. and its affiliates.
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Bt;function an(){if(Bt)return Q;Bt=1;var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,d=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,S=r?Symbol.for("react.fundamental"):60117,E=r?Symbol.for("react.responder"):60118,T=r?Symbol.for("react.scope"):60119;function w(v){if(typeof v=="object"&&v!==null){var j=v.$$typeof;switch(j){case e:switch(v=v.type,v){case l:case c:case n:case a:case s:case u:return v;default:switch(v=v&&v.$$typeof,v){case o:case f:case d:case m:case i:return v;default:return j}}case t:return j}}}function O(v){return w(v)===c}return Q.AsyncMode=l,Q.ConcurrentMode=c,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=f,Q.Fragment=n,Q.Lazy=d,Q.Memo=m,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,Q.isAsyncMode=function(v){return O(v)||w(v)===l},Q.isConcurrentMode=O,Q.isContextConsumer=function(v){return w(v)===o},Q.isContextProvider=function(v){return w(v)===i},Q.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Q.isForwardRef=function(v){return w(v)===f},Q.isFragment=function(v){return w(v)===n},Q.isLazy=function(v){return w(v)===d},Q.isMemo=function(v){return w(v)===m},Q.isPortal=function(v){return w(v)===t},Q.isProfiler=function(v){return w(v)===a},Q.isStrictMode=function(v){return w(v)===s},Q.isSuspense=function(v){return w(v)===u},Q.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===c||v===a||v===s||v===u||v===p||typeof v=="object"&&v!==null&&(v.$$typeof===d||v.$$typeof===m||v.$$typeof===i||v.$$typeof===o||v.$$typeof===f||v.$$typeof===S||v.$$typeof===E||v.$$typeof===T||v.$$typeof===y)},Q.typeOf=w,Q}var ee={};/** @license React v16.13.1
33
+ */var Bt;function on(){if(Bt)return Q;Bt=1;var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,d=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,S=r?Symbol.for("react.fundamental"):60117,E=r?Symbol.for("react.responder"):60118,T=r?Symbol.for("react.scope"):60119;function w(v){if(typeof v=="object"&&v!==null){var j=v.$$typeof;switch(j){case e:switch(v=v.type,v){case l:case c:case n:case a:case s:case u:return v;default:switch(v=v&&v.$$typeof,v){case o:case f:case d:case m:case i:return v;default:return j}}case t:return j}}}function O(v){return w(v)===c}return Q.AsyncMode=l,Q.ConcurrentMode=c,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=f,Q.Fragment=n,Q.Lazy=d,Q.Memo=m,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,Q.isAsyncMode=function(v){return O(v)||w(v)===l},Q.isConcurrentMode=O,Q.isContextConsumer=function(v){return w(v)===o},Q.isContextProvider=function(v){return w(v)===i},Q.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Q.isForwardRef=function(v){return w(v)===f},Q.isFragment=function(v){return w(v)===n},Q.isLazy=function(v){return w(v)===d},Q.isMemo=function(v){return w(v)===m},Q.isPortal=function(v){return w(v)===t},Q.isProfiler=function(v){return w(v)===a},Q.isStrictMode=function(v){return w(v)===s},Q.isSuspense=function(v){return w(v)===u},Q.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===c||v===a||v===s||v===u||v===p||typeof v=="object"&&v!==null&&(v.$$typeof===d||v.$$typeof===m||v.$$typeof===i||v.$$typeof===o||v.$$typeof===f||v.$$typeof===S||v.$$typeof===E||v.$$typeof===T||v.$$typeof===y)},Q.typeOf=w,Q}var ee={};/** @license React v16.13.1
34
34
  * react-is.development.js
35
35
  *
36
36
  * Copyright (c) Facebook, Inc. and its affiliates.
37
37
  *
38
38
  * This source code is licensed under the MIT license found in the
39
39
  * LICENSE file in the root directory of this source tree.
40
- */var Ht;function on(){return Ht||(Ht=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,d=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,S=r?Symbol.for("react.fundamental"):60117,E=r?Symbol.for("react.responder"):60118,T=r?Symbol.for("react.scope"):60119;function w(F){return typeof F=="string"||typeof F=="function"||F===n||F===c||F===a||F===s||F===u||F===p||typeof F=="object"&&F!==null&&(F.$$typeof===d||F.$$typeof===m||F.$$typeof===i||F.$$typeof===o||F.$$typeof===f||F.$$typeof===S||F.$$typeof===E||F.$$typeof===T||F.$$typeof===y)}function O(F){if(typeof F=="object"&&F!==null){var G=F.$$typeof;switch(G){case e:var Z=F.type;switch(Z){case l:case c:case n:case a:case s:case u:return Z;default:var re=Z&&Z.$$typeof;switch(re){case o:case f:case d:case m:case i:return re;default:return G}}case t:return G}}}var v=l,j=c,M=o,I=i,b=e,D=f,N=n,L=d,k=m,Y=t,P=a,V=s,z=u,J=!1;function U(F){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),h(F)||O(F)===l}function h(F){return O(F)===c}function x(F){return O(F)===o}function _(F){return O(F)===i}function C(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){return O(F)===f}function A(F){return O(F)===n}function W(F){return O(F)===d}function H(F){return O(F)===m}function B(F){return O(F)===t}function X(F){return O(F)===a}function K(F){return O(F)===s}function se(F){return O(F)===u}ee.AsyncMode=v,ee.ConcurrentMode=j,ee.ContextConsumer=M,ee.ContextProvider=I,ee.Element=b,ee.ForwardRef=D,ee.Fragment=N,ee.Lazy=L,ee.Memo=k,ee.Portal=Y,ee.Profiler=P,ee.StrictMode=V,ee.Suspense=z,ee.isAsyncMode=U,ee.isConcurrentMode=h,ee.isContextConsumer=x,ee.isContextProvider=_,ee.isElement=C,ee.isForwardRef=$,ee.isFragment=A,ee.isLazy=W,ee.isMemo=H,ee.isPortal=B,ee.isProfiler=X,ee.isStrictMode=K,ee.isSuspense=se,ee.isValidElementType=w,ee.typeOf=O}()),ee}var Gt;function _r(){return Gt||(Gt=1,process.env.NODE_ENV==="production"?Ke.exports=an():Ke.exports=on()),Ke.exports}/*
40
+ */var Ht;function ln(){return Ht||(Ht=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,d=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,S=r?Symbol.for("react.fundamental"):60117,E=r?Symbol.for("react.responder"):60118,T=r?Symbol.for("react.scope"):60119;function w(F){return typeof F=="string"||typeof F=="function"||F===n||F===c||F===a||F===s||F===u||F===p||typeof F=="object"&&F!==null&&(F.$$typeof===d||F.$$typeof===m||F.$$typeof===i||F.$$typeof===o||F.$$typeof===f||F.$$typeof===S||F.$$typeof===E||F.$$typeof===T||F.$$typeof===y)}function O(F){if(typeof F=="object"&&F!==null){var G=F.$$typeof;switch(G){case e:var Z=F.type;switch(Z){case l:case c:case n:case a:case s:case u:return Z;default:var re=Z&&Z.$$typeof;switch(re){case o:case f:case d:case m:case i:return re;default:return G}}case t:return G}}}var v=l,j=c,M=o,I=i,b=e,D=f,N=n,L=d,k=m,Y=t,P=a,V=s,z=u,J=!1;function U(F){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),h(F)||O(F)===l}function h(F){return O(F)===c}function x(F){return O(F)===o}function _(F){return O(F)===i}function C(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function $(F){return O(F)===f}function A(F){return O(F)===n}function W(F){return O(F)===d}function H(F){return O(F)===m}function B(F){return O(F)===t}function X(F){return O(F)===a}function K(F){return O(F)===s}function se(F){return O(F)===u}ee.AsyncMode=v,ee.ConcurrentMode=j,ee.ContextConsumer=M,ee.ContextProvider=I,ee.Element=b,ee.ForwardRef=D,ee.Fragment=N,ee.Lazy=L,ee.Memo=k,ee.Portal=Y,ee.Profiler=P,ee.StrictMode=V,ee.Suspense=z,ee.isAsyncMode=U,ee.isConcurrentMode=h,ee.isContextConsumer=x,ee.isContextProvider=_,ee.isElement=C,ee.isForwardRef=$,ee.isFragment=A,ee.isLazy=W,ee.isMemo=H,ee.isPortal=B,ee.isProfiler=X,ee.isStrictMode=K,ee.isSuspense=se,ee.isValidElementType=w,ee.typeOf=O}()),ee}var Gt;function _r(){return Gt||(Gt=1,process.env.NODE_ENV==="production"?qe.exports=on():qe.exports=ln()),qe.exports}/*
41
41
  object-assign
42
42
  (c) Sindre Sorhus
43
43
  @license MIT
44
- */var mt,Kt;function ln(){if(Kt)return mt;Kt=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return mt=s()?Object.assign:function(a,i){for(var o,l=n(a),c,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var u in o)e.call(o,u)&&(l[u]=o[u]);if(r){c=r(o);for(var p=0;p<c.length;p++)t.call(o,c[p])&&(l[c[p]]=o[c[p]])}}return l},mt}var gt,qt;function Dt(){if(qt)return gt;qt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return gt=r,gt}var yt,zt;function Rr(){return zt||(zt=1,yt=Function.call.bind(Object.prototype.hasOwnProperty)),yt}var bt,Jt;function cn(){if(Jt)return bt;Jt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=Dt(),t={},n=Rr();r=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,l,c){if(process.env.NODE_ENV!=="production"){for(var f in a)if(n(a,f)){var u;try{if(typeof a[f]!="function"){var p=Error((l||"React class")+": "+o+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}u=a[f](i,f,l,o,null,e)}catch(d){u=d}if(u&&!(u instanceof Error)&&r((l||"React class")+": type specification of "+o+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in t)){t[u.message]=!0;var m=c?c():"";r("Failed "+o+" type: "+u.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},bt=s,bt}var vt,Xt;function un(){if(Xt)return vt;Xt=1;var r=_r(),e=ln(),t=Dt(),n=Rr(),s=cn(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return vt=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(h){var x=h&&(c&&h[c]||h[f]);if(typeof x=="function")return x}var p="<<anonymous>>",m={array:E("array"),bigint:E("bigint"),bool:E("boolean"),func:E("function"),number:E("number"),object:E("object"),string:E("string"),symbol:E("symbol"),any:T(),arrayOf:w,element:O(),elementType:v(),instanceOf:j,node:D(),objectOf:I,oneOf:M,oneOfType:b,shape:L,exact:k};function d(h,x){return h===x?h!==0||1/h===1/x:h!==h&&x!==x}function y(h,x){this.message=h,this.data=x&&typeof x=="object"?x:{},this.stack=""}y.prototype=Error.prototype;function S(h){if(process.env.NODE_ENV!=="production")var x={},_=0;function C(A,W,H,B,X,K,se){if(B=B||p,K=K||H,se!==t){if(l){var F=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw F.name="Invariant Violation",F}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var G=B+":"+H;!x[G]&&_<3&&(a("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+B+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),x[G]=!0,_++)}}return W[H]==null?A?W[H]===null?new y("The "+X+" `"+K+"` is marked as required "+("in `"+B+"`, but its value is `null`.")):new y("The "+X+" `"+K+"` is marked as required in "+("`"+B+"`, but its value is `undefined`.")):null:h(W,H,B,X,K)}var $=C.bind(null,!1);return $.isRequired=C.bind(null,!0),$}function E(h){function x(_,C,$,A,W,H){var B=_[C],X=V(B);if(X!==h){var K=z(B);return new y("Invalid "+A+" `"+W+"` of type "+("`"+K+"` supplied to `"+$+"`, expected ")+("`"+h+"`."),{expectedType:h})}return null}return S(x)}function T(){return S(i)}function w(h){function x(_,C,$,A,W){if(typeof h!="function")return new y("Property `"+W+"` of component `"+$+"` has invalid PropType notation inside arrayOf.");var H=_[C];if(!Array.isArray(H)){var B=V(H);return new y("Invalid "+A+" `"+W+"` of type "+("`"+B+"` supplied to `"+$+"`, expected an array."))}for(var X=0;X<H.length;X++){var K=h(H,X,$,A,W+"["+X+"]",t);if(K instanceof Error)return K}return null}return S(x)}function O(){function h(x,_,C,$,A){var W=x[_];if(!o(W)){var H=V(W);return new y("Invalid "+$+" `"+A+"` of type "+("`"+H+"` supplied to `"+C+"`, expected a single ReactElement."))}return null}return S(h)}function v(){function h(x,_,C,$,A){var W=x[_];if(!r.isValidElementType(W)){var H=V(W);return new y("Invalid "+$+" `"+A+"` of type "+("`"+H+"` supplied to `"+C+"`, expected a single ReactElement type."))}return null}return S(h)}function j(h){function x(_,C,$,A,W){if(!(_[C]instanceof h)){var H=h.name||p,B=U(_[C]);return new y("Invalid "+A+" `"+W+"` of type "+("`"+B+"` supplied to `"+$+"`, expected ")+("instance of `"+H+"`."))}return null}return S(x)}function M(h){if(!Array.isArray(h))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),i;function x(_,C,$,A,W){for(var H=_[C],B=0;B<h.length;B++)if(d(H,h[B]))return null;var X=JSON.stringify(h,function(se,F){var G=z(F);return G==="symbol"?String(F):F});return new y("Invalid "+A+" `"+W+"` of value `"+String(H)+"` "+("supplied to `"+$+"`, expected one of "+X+"."))}return S(x)}function I(h){function x(_,C,$,A,W){if(typeof h!="function")return new y("Property `"+W+"` of component `"+$+"` has invalid PropType notation inside objectOf.");var H=_[C],B=V(H);if(B!=="object")return new y("Invalid "+A+" `"+W+"` of type "+("`"+B+"` supplied to `"+$+"`, expected an object."));for(var X in H)if(n(H,X)){var K=h(H,X,$,A,W+"."+X,t);if(K instanceof Error)return K}return null}return S(x)}function b(h){if(!Array.isArray(h))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var x=0;x<h.length;x++){var _=h[x];if(typeof _!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(_)+" at index "+x+"."),i}function C($,A,W,H,B){for(var X=[],K=0;K<h.length;K++){var se=h[K],F=se($,A,W,H,B,t);if(F==null)return null;F.data&&n(F.data,"expectedType")&&X.push(F.data.expectedType)}var G=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new y("Invalid "+H+" `"+B+"` supplied to "+("`"+W+"`"+G+"."))}return S(C)}function D(){function h(x,_,C,$,A){return Y(x[_])?null:new y("Invalid "+$+" `"+A+"` supplied to "+("`"+C+"`, expected a ReactNode."))}return S(h)}function N(h,x,_,C,$){return new y((h||"React class")+": "+x+" type `"+_+"."+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+$+"`.")}function L(h){function x(_,C,$,A,W){var H=_[C],B=V(H);if(B!=="object")return new y("Invalid "+A+" `"+W+"` of type `"+B+"` "+("supplied to `"+$+"`, expected `object`."));for(var X in h){var K=h[X];if(typeof K!="function")return N($,A,W,X,z(K));var se=K(H,X,$,A,W+"."+X,t);if(se)return se}return null}return S(x)}function k(h){function x(_,C,$,A,W){var H=_[C],B=V(H);if(B!=="object")return new y("Invalid "+A+" `"+W+"` of type `"+B+"` "+("supplied to `"+$+"`, expected `object`."));var X=e({},_[C],h);for(var K in X){var se=h[K];if(n(h,K)&&typeof se!="function")return N($,A,W,K,z(se));if(!se)return new y("Invalid "+A+" `"+W+"` key `"+K+"` supplied to `"+$+"`.\nBad object: "+JSON.stringify(_[C],null," ")+`
45
- Valid keys: `+JSON.stringify(Object.keys(h),null," "));var F=se(H,K,$,A,W+"."+K,t);if(F)return F}return null}return S(x)}function Y(h){switch(typeof h){case"number":case"string":case"undefined":return!0;case"boolean":return!h;case"object":if(Array.isArray(h))return h.every(Y);if(h===null||o(h))return!0;var x=u(h);if(x){var _=x.call(h),C;if(x!==h.entries){for(;!(C=_.next()).done;)if(!Y(C.value))return!1}else for(;!(C=_.next()).done;){var $=C.value;if($&&!Y($[1]))return!1}}else return!1;return!0;default:return!1}}function P(h,x){return h==="symbol"?!0:x?x["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&x instanceof Symbol:!1}function V(h){var x=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":P(x,h)?"symbol":x}function z(h){if(typeof h>"u"||h===null)return""+h;var x=V(h);if(x==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return x}function J(h){var x=z(h);switch(x){case"array":case"object":return"an "+x;case"boolean":case"date":case"regexp":return"a "+x;default:return x}}function U(h){return!h.constructor||!h.constructor.name?p:h.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},vt}var xt,Zt;function fn(){if(Zt)return xt;Zt=1;var r=Dt();function e(){}function t(){}return t.resetWarningCache=e,xt=function(){function n(i,o,l,c,f,u){if(u!==r){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},xt}var Qt;function dn(){if(Qt)return Ge.exports;if(Qt=1,process.env.NODE_ENV!=="production"){var r=_r(),e=!0;Ge.exports=un()(r.isElement,e)}else Ge.exports=fn()();return Ge.exports}var ie=dn(),pn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},hn=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},mn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],qe="http://www.w3.org/2000/svg",er="http://www.w3.org/1999/xlink",ke=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}zr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof pn(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,l=a.httpRequestWithCredentials,c=a.renumerateIRIElements,f=a.src,u=a.title,p=a.useRequestCache,m=this.props.onError,d=this.props.beforeInjection,y=this.props.afterInjection,S=this.props.wrapper,E,T;S==="svg"?(E=document.createElementNS(qe,S),E.setAttribute("xmlns",qe),E.setAttribute("xmlns:xlink",er),T=document.createElementNS(qe,S)):(E=document.createElement(S),T=document.createElement(S)),E.appendChild(T),T.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(E);var w=function(M){if(s.removeSVG(),!s._isMounted){m(M);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){m(M)})},O=function(M,I){if(M){w(M);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{y(I)}catch(b){w(b)}})},v=function(M){if(M.setAttribute("role","img"),i){var I=M.querySelector(":scope > desc");I&&M.removeChild(I);var b=document.createElement("desc");b.innerHTML=i,M.prepend(b)}if(u){var D=M.querySelector(":scope > title");D&&M.removeChild(D);var N=document.createElement("title");N.innerHTML=u,M.prepend(N)}try{d(M)}catch(L){w(L)}};sn(T,{afterEach:O,beforeEach:v,cacheRequests:p,evalScripts:o,httpRequestWithCredentials:l,renumerateIRIElements:c})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;hn(tt({},s),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},t.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},t.render=function(){var s=this.props;s.afterInjection,s.beforeInjection,s.desc,s.evalScripts;var a=s.fallback;s.httpRequestWithCredentials;var i=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var o=s.wrapper,l=qr(s,mn),c=o;return We.createElement(c,tt({},l,{ref:this.refCallback},o==="svg"?{xmlns:qe,xmlnsXlink:er}:{}),this.state.isLoading&&i&&We.createElement(i,null),this.state.hasError&&a&&We.createElement(a,null))},e}(We.Component);ke.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};ke.propTypes={afterInjection:ie.func,beforeInjection:ie.func,desc:ie.string,evalScripts:ie.oneOf(["always","once","never"]),fallback:ie.oneOfType([ie.func,ie.object,ie.string]),httpRequestWithCredentials:ie.bool,loading:ie.oneOfType([ie.func,ie.object,ie.string]),onError:ie.func,renumerateIRIElements:ie.bool,src:ie.string.isRequired,title:ie.string,useRequestCache:ie.bool,wrapper:ie.oneOf(["div","span","svg"])};let Et={assets:"/"};const gn=r=>{Et={...Et,...r}},tr=r=>`${Et.assets}/${r}`.replace(/\/+/g,"/"),oe=R.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:l,isInteractable:c=!1,spin:f=!1,title:u,tabIndex:p})=>{const[m,d]=R.useState(r),y=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),S=y&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),E=tr(`assets/svg/${r}.svg`),T=tr(`assets/svg/${n}.svg`),w={img:`${c?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${c?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},O=()=>{!a&&c&&l&&l()},v=j=>{!a&&c&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),O())};return g.jsx(g.Fragment,{children:S?g.jsx(ke,{src:r,fallback:()=>g.jsx(ke,{src:T,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:w.svg,onClick:O,onKeyDown:v,tabIndex:p}):y?g.jsx("img",{src:m,width:e||"16px",height:t||"auto",alt:u,onError:()=>d(T),onClick:O,className:w.img,title:u,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&O()}}):g.jsx(ke,{src:E,fallback:()=>g.jsx(ke,{src:T,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:w.svg,onClick:O,onKeyDown:v,tabIndex:p})})}),rr=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],nr=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Se=({bindValue:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:l=!0,showText:c=!0,fullWidth:f=!1,loading:u=!1,justify:p="center",title:m,optionalDisplayValue:d,squared:y=!1,submit:S=!1})=>{const E={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${f?"smp-button-fullWidth":""} smp-justifyContent-${p} ${y&&!c?"smp-button-squared":""}`};return g.jsx("button",{"data-component":"button",type:S?"submit":"button",className:E.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":u,title:m||d,children:u?g.jsx(oe,{icon:"spinner",state:nr(i),spin:!0}):g.jsxs(g.Fragment,{children:[n&&l&&g.jsx(oe,{icon:n,disabled:s,state:nr(i),width:rr(a),height:rr(a)}),c&&g.jsx("span",{children:d||r})]})})},yn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},_e=({variant:r="body",bindValue:e,color:t,...n})=>{const s=yn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return g.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},ye={"smp-tabbar-container":"_smp-tabbar-container_1scvh_1","smp-tabbar-scroll-button":"_smp-tabbar-scroll-button_1scvh_8","smp-tabbar-scroll-buttonRight":"_smp-tabbar-scroll-buttonRight_1scvh_13","smp-tabbar-scroll-buttonLeft":"_smp-tabbar-scroll-buttonLeft_1scvh_17","smp-tabbar-list-wrapper":"_smp-tabbar-list-wrapper_1scvh_21","smp-tabbar-list":"_smp-tabbar-list_1scvh_21","smp-tabbar-tab":"_smp-tabbar-tab_1scvh_38","smp-active":"_smp-active_1scvh_62","smp-tabbar-tab-extraSmall":"_smp-tabbar-tab-extraSmall_1scvh_75","smp-tabbar-tab-small":"_smp-tabbar-tab-small_1scvh_80","smp-tabbar-tab-base":"_smp-tabbar-tab-base_1scvh_85","smp-tabbar-tab-large":"_smp-tabbar-tab-large_1scvh_90","smp-tabbar-tab-extraLarge":"_smp-tabbar-tab-extraLarge_1scvh_95"},bn=({data:r,sizing:e="large",toolbar:t=!0,selectedIndex:n,onTabChange:s})=>{const[a,i]=R.useState(0),o=n??a,[l,c]=R.useState(!1),[f,u]=R.useState(!1),p=R.useRef(null);if(R.useEffect(()=>{const w=p.current;if(!w)return;S();const O=()=>S();return w.addEventListener("scroll",O),window.addEventListener("resize",S),()=>{w.removeEventListener("scroll",O),window.removeEventListener("resize",S)}},[]),!r.children||r.children.length===0)return g.jsx("div",{className:"tab-bar-empty",children:"No tabs available"});const m={container:ye["smp-tabbar-container"],listWrapper:ye["smp-tabbar-list-wrapper"],list:ye["smp-tabbar-list"],tab:`${ye["smp-tabbar-tab"]} ${e?ye[`smp-tabbar-tab-${e}`]:""}`,scrollButtonRight:`${ye["smp-tabbar-scroll-button"]} ${ye["smp-tabbar-scroll-buttonRight"]}`,scrollButtonLeft:`${ye["smp-tabbar-scroll-button"]} ${ye["smp-tabbar-scroll-buttonLeft"]}`,active:ye["smp-active"]},d=100,y=2,S=()=>{const w=p.current;w&&(c(w.scrollLeft>0),u(w.scrollLeft+w.clientWidth<w.scrollWidth-y))},E=()=>{var w;(w=p.current)==null||w.scrollBy({left:-d,behavior:"smooth"})},T=()=>{var w;(w=p.current)==null||w.scrollBy({left:d,behavior:"smooth"})};return g.jsxs("div",{className:m.container,role:"tabpanel","data-component":"tab-bar",children:[l&&g.jsx("div",{className:m.scrollButtonLeft,children:g.jsx(Se,{bindValue:"",optionalDisplayValue:"<",onClick:E,variant:"base",sizing:e})}),g.jsx("div",{className:m.listWrapper,children:g.jsx("div",{className:m.list,ref:p,role:"tablist",children:r.children.map((w,O)=>g.jsxs("button",{className:`${O===a?m.active:""} ${m.tab} `,role:"tab","aria-selected":O===o,tabIndex:O===o?0:-1,onClick:()=>{s&&s(O),i(O)},children:[w.icon&&g.jsx(oe,{icon:w.icon,placeholderIcon:w.placeholderIcon}),g.jsx(_e,{variant:"body",bindValue:w.decode||"Tab[object Object]"}),t&&(o===O?g.jsx(oe,{icon:"more_vert",placeholderIcon:w.placeholderIcon,isInteractable:!0,onClick:()=>{console.log("clicked icon")}}):g.jsx(oe,{icon:"empty"}))]},O))})}),f&&g.jsx("div",{className:m.scrollButtonRight,children:g.jsx(Se,{bindValue:"",optionalDisplayValue:">",onClick:T,variant:"base",sizing:e})})]})},rt=({children:r,layout:e={horizontal:!1,sectionsType:"tab",sections:[{id:"1",content:Array.isArray(r)?r.map(t=>({id:t.props.id})):[{id:r.props.id}]}]}})=>{const[t,n]=R.useState(0),s={};R.Children.forEach(r,d=>{R.isValidElement(d)&&(s[d.props.id]=d)});const a="--smp-grid-template-cols",i="--smp-grid-template-rows",o=Er(e.sections??[],Object.keys(s)),l=d=>d.reduce((y,S)=>{var v,j;let E="",T={},w={},O="";return(v=S.sections)!=null&&v.length?(E=pe["smp-layout-section-grid"],T=l(S.sections),S.gridCols===void 0&&(O=pe[S.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(S.horizontal||Mt(S.sections))&&(w=Nt(S.sections,S.horizontal?a:i)))):(j=S.content)!=null&&j.length&&(S.gridCols!==void 0&&S.gridCols>0?(E=pe["smp-layout-section-grid"],O=pe["smp-grid-template-cols"],w={[a]:`repeat(${S.gridCols}, 1fr)`}):E=pe["smp-layout-section-flex"]),{...y,...T,[S.id]:{classes:`${E} ${pe[S.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${O} ${S.justify?`smp-justifyContent-${S.justify}`:""} ${S.align?`smp-alignItems-${S.align}`:""}`,styles:w}}},{}),c=l(o),f=`${pe["smp-layout"]} ${e.horizontal?pe["smp-layout-horizontal"]:pe["smp-layout-vertical"]}`,u=e.horizontal||Mt(e.sections||[])?Nt(o,e.horizontal?a:i):{},p=(d,y)=>{var E,T;const S=g.jsx("div",{"smp-id":`section-${d.id}`,className:c[d.id].classes,style:c[d.id].styles,children:(E=d.sections)!=null&&E.length?d.sections.map(w=>p(w)):(T=d.content)==null?void 0:T.map(w=>m(w,d.justify,d.align))},`section-${d.id}`);return d.title&&!y?g.jsxs("div",{className:pe["smp-layout-section-with-title"],children:[g.jsx("span",{className:`${pe["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:g.jsx(De,{label:d.title})}),S]},`title-section-${d.id}`):S},m=(d,y,S)=>{const E=s[d.id];if(!E)return null;const w={gridColumnStart:(d.colSpan&&d.colSpan>0?`span ${d.colSpan}`:d.colStart&&d.colStart<1?"1":void 0)??d.colStart,gridColumnEnd:d.colEnd&&d.colEnd>0?d.colEnd:void 0},O=`${pe["smp-layout-cell-container"]} ${y?`smp-justifyContent-${y}`:""} ${S?`smp-alignItems-${S}`:""}`;return g.jsx("div",{className:O,style:w,"smp-id":d.id,children:E},d.id)};return g.jsxs("div",{className:f,style:u,"smp-id":"layout",children:[e.sectionsType==="tab"&&e.sections&&(e==null?void 0:e.sections.length)>1&&g.jsx(bn,{data:{type:"SmeupDataTree",children:o.map(d=>({decode:d.title||d.id||"Tab",obj:{t:"",p:"",k:""},placeholderIcon:"tab",cells:{},children:[],shape:void 0}))},selectedIndex:t,onTabChange:n,toolbar:!1}),e.sectionsType?p(o[t],!0):o.map(d=>p(d))]})},te={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",INPUT_NUMBER:"INR",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",RADIO:"RAD",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",TIME:"TIM",PASSWORD:"PWD"},vn=r=>r.t=="D8",xn=r=>r.t=="I1",Sn=r=>{if(r){const e=r.split(";");if(e.length==3)return{t:e[0],p:e[1],k:e[2]}}return{t:"",p:"",k:""}};class nt{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new nt(e,e.k=="1"||e.k=="true")}getValue(){return this.value}getLegacyValue(){if(this.class.t=="V2"){if(this.class.p=="SI/NO")return this.value?"1":" ";if(this.class.p=="ON/OFF")return this.value?"1":"0"}return this.value?"true":"false"}}function wn(r,e){if(jt(r)){const f=new Date(r);if(!isNaN(f.getTime()))return f}const t=new Date,n=r.replaceAll("/","").replaceAll("-","");let s="DDMMYYYY";e==="en"&&(s="MMDDYYYY");const a=s.indexOf("DD"),i=s.indexOf("MM");let o=0,l=0,c="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),ze(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(l)):a===0&&(t.setMonth(l-1),t.setDate(o)),ze(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),Number(n.substring(4))>50?c="19"+n.substring(4):c="20"+n.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Tt(o,u,parseInt(c))&&ze(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),c=n.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Tt(f,u,parseInt(c))&&ze(t)?t:r}}return r}function jt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function ze(r){return r instanceof Date&&!isNaN(r.getTime())}function En(r){if(!/^\d{8}$/.test(r))return!1;const e=parseInt(r.slice(0,4),10),t=parseInt(r.slice(4,6),10),n=parseInt(r.slice(6,8),10);return Tt(n,t-1,e)}function Tt(r,e,t){const n=[31,Tn(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Tn(r){return r%4===0&&(r%100!==0||r%400===0)}function On(r){const e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return isNaN(e)||isNaN(Number(t))||isNaN(Number(n))?r.toString():`${e}-${t}-${n}`}class st{constructor(e,t){de(this,"class");de(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=sr.get(`${e.t}${e.p}`);if(t)return new st(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=sr.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.date);throw new Error(`Date object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.date}}const sr=new Map([["D8*YYMD",{legacyToIso(r){return En(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return jt(r)&&r.replaceAll("-","")||r}}]]);function ct({position:r="bottom",enabled:e=!0}){const t=R.useRef(null),n=R.useRef(null),[s,a]=R.useState(0),i=R.useCallback(()=>{const o=t.current,l=n.current;if(!o||!l)return;const{top:c,left:f,width:u,height:p}=o.getBoundingClientRect();a(u);const m=l.offsetHeight,d=l.offsetWidth;if(d===0||m===0){requestAnimationFrame(i);return}let y=c+window.scrollY,S=f+window.scrollX;switch(r){case"top":y-=m;break;case"bottom":y+=p;break;case"left":S-=d;break;case"right":S+=u;break}requestAnimationFrame(()=>{l.style.transform=`translate(${S}px, ${y}px)`,l.style.opacity="1"})},[r]);return R.useLayoutEffect(()=>{if(!e)return;let o;const l=()=>{const f=t.current,u=n.current;f&&u?i():o=requestAnimationFrame(l)};o=requestAnimationFrame(l);const c=new MutationObserver(()=>{i()});return n.current&&c.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),c.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const Pe=(r,e,t)=>{if(r=="")return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},Dr=({helperText:r,disabled:e,state:t,id:n})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return g.jsx("label",{className:s.container,id:n,children:r})},he={"smp-textfield-wrapper":"_smp-textfield-wrapper_ep1c3_4","smp-textfield":"_smp-textfield_ep1c3_4","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_ep1c3_29","smp-textfield-extraSmall":"_smp-textfield-extraSmall_ep1c3_35","smp-textfield-small":"_smp-textfield-small_ep1c3_40","smp-textfield-medium":"_smp-textfield-medium_ep1c3_45","smp-textfield-large":"_smp-textfield-large_ep1c3_50","smp-textfield-extraLarge":"_smp-textfield-extraLarge_ep1c3_55","smp-textfield-input":"_smp-textfield-input_ep1c3_61","smp-textfield-outlined":"_smp-textfield-outlined_ep1c3_84","smp-textfield-danger":"_smp-textfield-danger_ep1c3_95","smp-textfield-readOnly":"_smp-textfield-readOnly_ep1c3_99","smp-textfield-disabled":"_smp-textfield-disabled_ep1c3_114","smp-textfield-fullWidth":"_smp-textfield-fullWidth_ep1c3_123","smp-textfield-top-right-indicator":"_smp-textfield-top-right-indicator_ep1c3_127"},we=({disabled:r,bindValue:e,icon:t,placeholder:n,isEditable:s=!0,shapeIcon:a,sizing:i,state:o,variant:l,tooltip:c=!1,rotatedShapeIcon:f=!1,ref:u,inputRef:p,inputType:m="text",ariaLabel:d="input field",label:y,helperText:S=!1,error:E,appearance:T="base",fullWidth:w=!1,_dataComponent:O="textfield",min:v,max:j,step:M,inputMode:I="text",width:b,autocomplete:D,size:N,maxLength:L,onBlur:k,onChange:Y,onKeyDown:P,onShapeIconClick:V,onClick:z})=>{const J=R.useId(),U=`${J}-helper`,h=E?"danger":o,x=E||o=="danger"?"error":a,_=S||!!E,C=W=>{Y==null||Y(W.target.value)},$={wrapper:`${he["smp-textfield-wrapper"]} ${w?he["smp-textfield-fullWidth"]:""}`,container:`${he["smp-textfield"]} ${r?he["smp-textfield-disabled"]:""} ${n?he["smp-textfield-placeholder"]:""} ${i?he[`smp-textfield-${i}`]:""} ${h?he[`smp-textfield-${h}`]:""} ${T?he[`smp-textfield-${T}`]:""} ${s?"":he["smp-textfield-readOnly"]} ${c?he["smp-textfield-top-right-indicator"]:""}`,input:`${he["smp-textfield-input"]}`};if(l&&(l!=="notSelectable"||s)){const W=he[`smp-textfield-variant-${l}`];W&&($.container+=` ${W}`)}const A=b?{"--smp-textField-width-base":b}:void 0;return g.jsxs("div",{className:$.wrapper,"data-component":O,children:[y&&g.jsx(De,{label:y,disabled:r,htmlFor:J}),g.jsxs("div",{className:$.container,ref:u,style:A,children:[t&&g.jsx(oe,{icon:t,disabled:r}),g.jsx("input",{id:J,type:m,value:e,placeholder:n,onChange:C,onBlur:k,className:$.input,disabled:r,readOnly:!s,onKeyDown:P,"aria-label":d,ref:p,"aria-describedby":_?U:void 0,min:v,max:j,step:M,inputMode:I,autoComplete:D,size:N,maxLength:L,onClick:z}),x&&g.jsx(oe,{icon:x,disabled:r,state:h,onClick:V,rotated:f,isInteractable:s,tabIndex:0})]}),_&&g.jsx(Dr,{helperText:E,disabled:r,state:h,id:U})]})};function jr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=R.useState(0),i=R.useRef(null),o=r.length*e,l=Math.max(0,Math.floor(s/e)-n),c=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let m=l;m<=c;m++)f.push({item:r[m],index:m,offsetTop:m*e});const u=R.useCallback(m=>{const d=m.target.scrollTop;a(d)},[]),p=m=>{if(!i.current)return;const d=m*e,y=d+e,S=i.current,E=S.scrollTop,T=E+t;d<E?S.scrollTop=d:y>T&&(S.scrollTop=y-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:u},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:l,endIndex:c},scrollToIndex:p}}const Je={"smp-list":"_smp-list_6ni6l_1","smp-list-container":"_smp-list-container_6ni6l_12","smp-list-listItem":"_smp-list-listItem_6ni6l_17"};function _n(r,e,t="14px IBM Plex Sans, sans-serif",n=32){const a=document.createElement("canvas").getContext("2d");if(!a)return 200;a.font=t;let i=0;for(const o of r){const l=Pe(o.id,o.label,e),c=a.measureText(l);i=Math.max(i,c.width)}return Math.ceil(i+n)}const Rn=10,$r=({id:r,options:e,displayMode:t="Both",ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:l,onKeyDown:c,isOpen:f})=>{var Y;const[u,p]=R.useState(""),m=40,[d,y]=R.useState(a!==null?a:-1),[S,E]=R.useState(o||200),T=R.useRef(null),w=s!==void 0?s:e.length>Rn,O=u?e.filter(P=>P.label.toLowerCase().includes(u.toLowerCase())):e,v=P=>{p(P)},{virtualItems:j,containerProps:M,innerProps:I,scrollToIndex:b}=jr({items:O,itemHeight:m,containerHeight:200,overscan:5});R.useEffect(()=>{a!==null&&a!==d&&y(a)},[a]),R.useEffect(()=>{d>=0&&d<O.length&&b(d)},[d,O]),R.useEffect(()=>{f&&(T!=null&&T.current)&&T.current.focus()},[f,T]),R.useEffect(()=>{const P=_n(e,t);E(P)},[e,t]);const D=P=>{if(P.key==="ArrowDown"||P.key==="ArrowUp"){P.preventDefault();let V=d;P.key==="ArrowDown"?V=d<O.length-1?d+1:0:P.key==="ArrowUp"&&(V=d>0?d-1:O.length-1),y(V)}else P.key==="Enter"?d>=0&&d<O.length&&(l==null||l(O[d])):P.key==="Escape"&&(P.preventDefault(),P.stopPropagation());c&&c(P)},N=P=>{D(P)},L=P=>{D(P)},k={wrapper:`${Je["smp-list"]}`,container:`${Je["smp-list-container"]}`,virtualScroll:`${Je["smp-list-virtualScroll"]}`,listItem:`${Je["smp-list-listItem"]}`};return g.jsxs("div",{id:r,ref:n,className:k.wrapper,"data-component":"list",style:{width:S,minWidth:o},children:[w&&g.jsx(we,{bindValue:u,placeholder:"Search...",fullWidth:!0,onChange:v,onKeyDown:N,inputRef:T}),g.jsx("div",{...M,className:k.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:L,"aria-activedescendant":d>=0&&d<O.length?(Y=O[d])==null?void 0:Y.id:void 0,children:g.jsx("div",{...I,className:k.virtualScroll,children:j.map(({item:P,index:V,offsetTop:z})=>{const J=i.includes(P.id);return g.jsxs("li",{role:"option",id:P.id,"aria-selected":d===V?"true":"false",tabIndex:-1,className:`${k.listItem} ${d===V?"selected-item":""}`,"aria-label":P.id+"-"+P.label,style:{height:`${m}px`,lineHeight:`calc(${m}px - 2*2px)`,transform:`translateY(${z}px)`},onClick:()=>{l==null||l(P),y(V)},children:[Pe(P.id,P.label,t),J&&g.jsx(oe,{icon:"check",width:16})]},P.id)})})})]})},$t=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=R.useState(Pe(e,t,r));return R.useEffect(()=>{a(e)},[e]),R.useEffect(()=>{a(Pe(e,t,r))},[t,r]),g.jsx(we,{...n,bindValue:s})},Dn=r=>{const e=R.useRef(null);return R.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}};function ut({children:r}){const[e,t]=R.useState(!1);return R.useEffect(()=>{t(!0)},[]),e?Ur.createPortal(r,document.body):null}const ft=(r,e,t)=>{R.useEffect(()=>{if(!e)return;const n=s=>{(r==null?void 0:r.some(i=>{if(typeof i=="object"&&i!==null&&"current"in i){const o=i==null?void 0:i.current;return o&&o.contains(s.target)}}))||t()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[r,t,e])},q=r=>typeof r=="string",Me=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},ar=r=>r==null?"":""+r,jn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},$n=/###/g,ir=r=>r&&r.indexOf("###")>-1?r.replace($n,"."):r,or=r=>!r||q(r),Fe=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(or(r))return{};const a=ir(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return or(r)?{}:{obj:r,k:ir(n[s])}},lr=(r,e,t)=>{const{obj:n,k:s}=Fe(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=Fe(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Fe(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},Cn=(r,e,t,n)=>{const{obj:s,k:a}=Fe(r,e,Object);s[a]=s[a]||[],s[a].push(t)},at=(r,e)=>{const{obj:t,k:n}=Fe(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},In=(r,e,t)=>{const n=at(r,t);return n!==void 0?n:at(e,t)},Cr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?q(r[n])||r[n]instanceof String||q(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Cr(r[n],e[n],t):r[n]=e[n]);return r},Ce=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ln={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const kn=r=>q(r)?r.replace(/[&<>"'\/]/g,e=>Ln[e]):r;class Pn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const An=[" ",",","?","!",";"],Nn=new Pn(20),Mn=(r,e,t)=>{e=e||"",t=t||"";const n=An.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=Nn.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},Ot=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let l=a;l<n.length;++l)if(l!==a&&(o+=t),o+=n[l],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&l<n.length-1)continue;a+=l-a+1;break}s=i}return s},Ve=r=>r==null?void 0:r.replace("_","-"),Fn={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class it{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Fn,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(q(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new it(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new it(this.logger,e)}}var be=new it;class dt{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class cr extends dt{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var c,f;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):q(n)&&a?o.push(...n.split(a)):o.push(n)));const l=at(this.data,o);return!l&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),l||!i||!q(n)?l:Ot((f=(c=this.data)==null?void 0:c[e])==null?void 0:f[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),lr(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(q(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let l=at(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Cr(l,n,a):l={...l,...n},lr(this.data,o,l),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var Ir={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const ur={},fr=r=>!q(r)&&typeof r!="boolean"&&typeof r!="number";class ot extends dt{constructor(e,t={}){super(),jn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=be.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Mn(e,n,s);if(i&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:q(a)?[a]:a};const c=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.join(s)}return{key:e,namespaces:q(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],s),c=l[l.length-1];let f=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const u=s.lng||this.language,p=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode")return p?a?{res:`${c}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:o;const m=this.resolve(e,s);let d=m==null?void 0:m.res;const y=(m==null?void 0:m.usedKey)||o,S=(m==null?void 0:m.exactUsedKey)||o,E=["[object Number]","[object Function]","[object RegExp]"],T=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,O=s.count!==void 0&&!q(s.count),v=ot.hasDefaultValue(s),j=O?this.pluralResolver.getSuffix(u,s.count,s):"",M=s.ordinal&&O?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",I=O&&!s.ordinal&&s.count===0,b=I&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${j}`]||s[`defaultValue${M}`]||s.defaultValue;let D=d;w&&!d&&v&&(D=b);const N=fr(D),L=Object.prototype.toString.apply(D);if(w&&D&&N&&E.indexOf(L)<0&&!(q(T)&&Array.isArray(D))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,D,{...s,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(m.res=k,m.usedParams=this.getUsedParamsDetails(s),m):k}if(i){const k=Array.isArray(D),Y=k?[]:{},P=k?S:y;for(const V in D)if(Object.prototype.hasOwnProperty.call(D,V)){const z=`${P}${i}${V}`;v&&!d?Y[V]=this.translate(z,{...s,defaultValue:fr(b)?b[V]:void 0,joinArrays:!1,ns:l}):Y[V]=this.translate(z,{...s,joinArrays:!1,ns:l}),Y[V]===z&&(Y[V]=D[V])}d=Y}}else if(w&&q(T)&&Array.isArray(d))d=d.join(T),d&&(d=this.extendTranslation(d,e,s,n));else{let k=!1,Y=!1;!this.isValidLookup(d)&&v&&(k=!0,d=b),this.isValidLookup(d)||(Y=!0,d=o);const V=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Y?void 0:d,z=v&&b!==d&&this.options.updateMissing;if(Y||k||z){if(this.logger.log(z?"updateKey":"missingKey",u,c,o,z?b:d),i){const x=this.resolve(o,{...s,keySeparator:!1});x&&x.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let J=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let x=0;x<U.length;x++)J.push(U[x]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(s.lng||this.language):J.push(s.lng||this.language);const h=(x,_,C)=>{var A;const $=v&&C!==d?C:V;this.options.missingKeyHandler?this.options.missingKeyHandler(x,c,_,$,z,s):(A=this.backendConnector)!=null&&A.saveMissing&&this.backendConnector.saveMissing(x,c,_,$,z,s),this.emit("missingKey",x,c,_,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?J.forEach(x=>{const _=this.pluralResolver.getSuffixes(x,s);I&&s[`defaultValue${this.options.pluralSeparator}zero`]&&_.indexOf(`${this.options.pluralSeparator}zero`)<0&&_.push(`${this.options.pluralSeparator}zero`),_.forEach(C=>{h([x],o+C,s[`defaultValue${C}`]||b)})}):h(J,o,b))}d=this.extendTranslation(d,e,s,m,n),Y&&d===o&&this.options.appendNamespaceToMissingKey&&(d=`${c}${f}${o}`),(Y||k)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${f}${o}`:o,k?d:void 0,s))}return a?(m.res=d,m.usedParams=this.getUsedParamsDetails(s),m):d}extendTranslation(e,t,n,s,a){var l,c;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const f=q(e)&&(((c=n==null?void 0:n.interpolation)==null?void 0:c.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(f){const m=e.match(this.interpolator.nestingRegexp);u=m&&m.length}let p=n.replace&&!q(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,n.lng||this.language||s.usedLng,n),f){const m=e.match(this.interpolator.nestingRegexp),d=m&&m.length;u<d&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...m)=>(a==null?void 0:a[0])===m[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`),null):this.translate(...m,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=q(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Ir.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return q(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,t),f=c.key;s=f;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const p=t.count!==void 0&&!q(t.count),m=p&&!t.ordinal&&t.count===0,d=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(S=>{var E,T;this.isValidLookup(n)||(o=S,!ur[`${y[0]}-${S}`]&&((E=this.utils)!=null&&E.hasLoadedNamespace)&&!((T=this.utils)!=null&&T.hasLoadedNamespace(o))&&(ur[`${y[0]}-${S}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(w=>{var j;if(this.isValidLookup(n))return;i=w;const O=[f];if((j=this.i18nFormat)!=null&&j.addLookupKeys)this.i18nFormat.addLookupKeys(O,f,w,S,t);else{let M;p&&(M=this.pluralResolver.getSuffix(w,t.count,t));const I=`${this.options.pluralSeparator}zero`,b=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(O.push(f+M),t.ordinal&&M.indexOf(b)===0&&O.push(f+M.replace(b,this.options.pluralSeparator)),m&&O.push(f+I)),d){const D=`${f}${this.options.contextSeparator}${t.context}`;O.push(D),p&&(O.push(D+M),t.ordinal&&M.indexOf(b)===0&&O.push(D+M.replace(b,this.options.pluralSeparator)),m&&O.push(D+I))}}let v;for(;v=O.pop();)this.isValidLookup(n)||(a=v,n=this.getResource(w,S,v,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!q(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class dr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=be.create("languageUtils")}getScriptPartFromCode(e){if(e=Ve(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Ve(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(q(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),q(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return q(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):q(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const pr={zero:0,one:1,two:2,few:3,many:4,other:5},hr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Vn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=be.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ve(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),hr;if(!e.match(/-|_/))return hr;const l=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(l,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>pr[s]-pr[a]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const mr=(r,e,t,n=".",s=!0)=>{let a=In(r,e,t);return!a&&s&&q(t)&&(a=Ot(r,t,n),a===void 0&&(a=Ot(e,t,n))),a},St=r=>r.replace(/\$/g,"$$$$");class Yn{constructor(e={}){var t;this.logger=be.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:l,formatSeparator:c,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:p,nestingPrefixEscaped:m,nestingSuffix:d,nestingSuffixEscaped:y,nestingOptionsSeparator:S,maxReplaces:E,alwaysFormat:T}=e.interpolation;this.escape=t!==void 0?t:kn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Ce(a):i||"{{",this.suffix=o?Ce(o):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=p?Ce(p):m||Ce("$t("),this.nestingSuffix=d?Ce(d):y||Ce(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=E||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var m;let a,i,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=d=>{if(d.indexOf(this.formatSeparator)<0){const T=mr(t,l,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,n,{...s,...t,interpolationkey:d}):T}const y=d.split(this.formatSeparator),S=y.shift().trim(),E=y.join(this.formatSeparator).trim();return this.format(mr(t,l,S,this.options.keySeparator,this.options.ignoreJSONStructure),E,n,{...s,...t,interpolationkey:S})};this.resetRegExp();const f=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=((m=s==null?void 0:s.interpolation)==null?void 0:m.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>St(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?St(this.escape(d)):St(d)}].forEach(d=>{for(o=0;a=d.regex.exec(e);){const y=a[1].trim();if(i=c(y),i===void 0)if(typeof f=="function"){const E=f(e,a,s);i=q(E)?E:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=ar(i));const S=d.safeValue(i);if(e=e.replace(a[0],S),u?(d.regex.lastIndex+=i.length,d.regex.lastIndex-=a[0].length):d.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(l,c)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const u=l.split(new RegExp(`${f}[ ]*{`));let p=`{${u[1]}`;l=u[0],p=this.interpolate(p,i);const m=p.match(/'/g),d=p.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!d||d.length%2!==0)&&(p=p.replace(/'/g,'"'));try{i=JSON.parse(p),c&&(i={...c,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${f}${p}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];i={...n},i=i.replace&&!q(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let c=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(u=>u.trim());s[1]=f.shift(),l=f,c=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=ar(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),c&&(a=l.reduce((f,u)=>this.format(f,u,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const Un=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...l]=i.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=c),c==="false"&&(t[f]=!1),c==="true"&&(t[f]=!0),isNaN(c)||(t[f]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},gr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Ve(n),s),e[i]=o),o(t)}},Wn=r=>(e,t,n)=>r(Ve(t),n)(e);class Bn{constructor(e={}){this.logger=be.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?gr:Wn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=gr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,l)=>{var u;const{formatName:c,formatOptions:f}=Un(l);if(this.formats[c]){let p=o;try{const m=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},d=m.locale||m.lng||s.locale||s.lng||n;p=this.formats[c](o,d,{...f,...s,...m})}catch(m){this.logger.warn(m)}return p}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const Hn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Gn extends dt{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=be.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},l={};return e.forEach(c=>{let f=!0;t.forEach(u=>{const p=`${c}|${u}`;!n.reload&&this.store.hasResourceBundle(c,u)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?i[p]===void 0&&(i[p]=!0):(this.state[p]=1,f=!1,i[p]===void 0&&(i[p]=!0),a[p]===void 0&&(a[p]=!0),l[u]===void 0&&(l[u]=!0)))}),f||(o[c]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,t,n){const s=e.split("|"),a=s[0],i=s[1];t&&this.emit("failedLoading",a,i,t),!t&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(l=>{Cn(l.loaded,[a],i),Hn(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{o[c]||(o[c]={});const f=l.loaded[c];f.length&&f.forEach(u=>{o[c][u]===void 0&&(o[c][u]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,t,n,s=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:i});return}this.readingCalls++;const o=(c,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(c&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(c,f)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(e,t);c&&typeof c.then=="function"?c.then(f=>o(null,f)).catch(o):o(null,c)}catch(c){o(c)}return}return l(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();q(e)&&(e=this.languageUtils.toResolveHierarchy(e)),q(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var l,c,f,u,p;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((u=(f=this.services)==null?void 0:f.utils)!=null&&u.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((p=this.backend)!=null&&p.create){const m={...i,isUpdate:a},d=this.backend.create.bind(this.backend);if(d.length<6)try{let y;d.length===5?y=d(e,t,n,s,m):y=d(e,t,n,s),y&&typeof y.then=="function"?y.then(S=>o(null,S)).catch(o):o(null,y)}catch(y){o(y)}else d(e,t,n,s,o,m)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const yr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),q(r[1])&&(e.defaultValue=r[1]),q(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),br=r=>{var e,t;return q(r.ns)&&(r.ns=[r.ns]),q(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),q(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},Xe=()=>{},Kn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Ye extends dt{constructor(e={},t){if(super(),this.options=br(e),this.services={},this.logger=be,this.modules={external:[]},Kn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(q(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=yr();this.options={...n,...this.options,...br(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?be.init(s(this.modules.logger),this.options):be.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Bn;const f=new dr(this.options);this.store=new cr(this.options.resources,this.options);const u=this.services;u.logger=be,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new Vn(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=s(c),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Yn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Gn(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.languageDetector&&(u.languageDetector=s(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=s(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new ot(this.services,this.options),this.translator.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Xe),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...f)=>this.store[c](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...f)=>(this.store[c](...f),this)});const o=Me(),l=()=>{const c=(f,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(u),t(f,u)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,t=Xe){var a,i;let n=t;const s=q(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?l(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,c=>l(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(c)})}else n(null)}reloadResources(e,t,n){const s=Me();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Xe),this.services.backendConnector.reload(e,t,a=>{s.resolve(),n(a)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Ir.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Me();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,l)=>{l?this.isLanguageChangingTo===e&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),t&&t(o,(...c)=>this.t(...c))},i=o=>{var f,u;!e&&!o&&this.services.languageDetector&&(o=[]);const l=q(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,c)),this.loadResources(c,p=>{a(p,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,t,n){const s=(a,i,...o)=>{let l;typeof i!="object"?l=this.options.overloadTranslationOptionHandler([a,i].concat(o)):l={...i},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||s.keyPrefix);const c=this.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${l.keyPrefix}${c}${u}`):f=l.keyPrefix?`${l.keyPrefix}${c}${a}`:a,this.t(f,l)};return q(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,l)=>{const c=this.services.backendConnector.state[`${o}|${l}`];return c===-1||c===0||c===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=Me();return this.options.ns?(q(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Me();q(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new dr(yr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Ye(e,t)}cloneInstance(e={},t=Xe){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Ye(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((f,u)=>(f[u]={...l[c][u]},f),l[c]),l),{});a.store=new cr(o,s),a.services.resourceStore=a.store}return a.translator=new ot(a.services,s),a.translator.on("*",(o,...l)=>{a.emit(o,...l)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=Ye.createInstance();ae.createInstance=Ye.createInstance;ae.createInstance;ae.dir;ae.init;ae.loadResources;ae.reloadResources;ae.use;ae.changeLanguage;ae.getFixedT;ae.t;ae.exists;ae.setDefaultNamespace;ae.hasLoadedNamespace;ae.loadNamespaces;ae.loadLanguages;const qn={Friday:"Venerdì",FridayShort:"Ven",Monday:"Lunedì",MondayShort:"Lun",Saturday:"Sabato",SaturdayShort:"Sab",Sunday:"Domenica",SundayShort:"Dom",Tuesday:"Martedì",TuesdayShort:"Mar",Thursday:"Giovedì",ThursdayShort:"Gio",Wednesday:"Mercoledì",WednesdayShort:"Mer"},zn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Jn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido",ConfirmButton:"Conferma",AutocompleteDefaultPlaceholder:"Inserisci codice o descrizione"},Xn={Date:{NextDay:"Giorno Successivo",NextMonth:"Mese Successivo",NextWeek:"Settimana Successiva",NextYear:"Anno Successivo",PreviousDay:"Giorno Precedente",PreviousMonth:"Mese Precedente",PreviousWeek:"Settimana Precedente",PreviousYear:"Anno Precedente",Today:"Oggi",Tomorrow:"Domani",Yesterday:"Ieri"},Day:qn,Month:zn,Generic:Jn},Zn={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},Qn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},es={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid",ConfirmButton:"Confirm",AutocompleteDefaultPlaceholder:"Type code or description"},ts={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:Zn,Month:Qn,Generic:es};function vr(r,e){return new RegExp(rs(r),e)}function rs(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ns=(r,e,t)=>{let n=r;return isNaN(n)||(e!=null&&(n=Math.max(n,e)),t!=null&&(n=Math.min(n,t))),n},ss=(r,e)=>{var i,o;const n=Intl.NumberFormat(r).formatToParts(1000.1),s=((i=n.find(l=>l.type==="group"))==null?void 0:i.value)??",",a=e??((o=n.find(l=>l.type==="decimal"))==null?void 0:o.value)??".";return{groupingChar:s,decimalChar:a}};function as(r,e,t,n){let s=e;const a=ls(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=cs(s);return new Intl.NumberFormat(n,i).format(a)}const is=(r,e,t)=>{const n=r.lastIndexOf(t);if(n!==-1)return r.length-n-1;const s=t==="."?",":".",a=r.lastIndexOf(s);return a!==-1&&!(s===e&&r.length-a-1===3)?r.length-a-1:0},os=(r,e,t)=>{if(!r)return NaN;let n=r.replace(/\s/g,""),s=t;const a=(n.match(/\./g)||[]).length,i=(n.match(/,/g)||[]).length;if(a&&i)s=n.lastIndexOf(".")>n.lastIndexOf(",")?".":",";else if(!n.includes(t)){const l=n.includes(".")?".":",",c=l==="."?a:i;c>1||c===1&&l===e&&n.length-n.lastIndexOf(l)-1===3||(s=l)}const o=s==="."?",":".";return n=n.replace(new RegExp(`\\${o}`,"g"),""),s!=="."&&(n=n.replace(new RegExp(`\\${s}`,"g"),".")),parseFloat(n)};function ls(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const l=o=="."?",":".";a=a.replace(vr(l,"g"),""),a=a.replace(vr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function cs(r){const e={};r.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const t=r.indexOf(".");if(t>-1){const s=(r.substring(t+1).match(/0/g)||[]).length;e.minimumFractionDigits=s,e.maximumFractionDigits=s}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}ae.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(r,e,t,n)=>{const s=(n==null?void 0:n.type)??"number";try{switch(s){case"date":{const a=r instanceof Date?r:new Date(r);return new Intl.DateTimeFormat(t,{dateStyle:e||"short"}).format(a)}default:case"number":{const a=(n==null?void 0:n.inputIsLocalized)??!1;return as(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:ts},it:{translation:Xn}}});const us=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),fs=(r,e)=>ae.t(r,e);function je(){const r=R.useCallback((n,s,a,i)=>us(n,s,a||void 0,i),[]),e=R.useCallback(()=>ae.languages[0],[]),t=R.useCallback((n,s)=>fs(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var Te=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",r.CONFIRM_BUTTON="Generic.ConfirmButton",r.AUTOCOMPLETE_DEFAULT_PLACEHOLDER="Generic.AutocompleteDefaultPlaceholder",r))(Te||{}),le=(r=>(r.MONDAY="Day.Monday",r.MONDAY_SHORT="Day.MondayShort",r.TUESDAY="Day.Tuesday",r.TUESDAY_SHORT="Day.TuesdayShort",r.WEDNESDAY="Day.Wednesday",r.WEDNESDAY_SHORT="Day.WednesdayShort",r.THURSDAY="Day.Thursday",r.THURSDAY_SHORT="Day.ThursdayShort",r.FRIDAY="Day.Friday",r.FRIDAY_SHORT="Day.FridayShort",r.SATURDAY="Day.Saturday",r.SATURDAY_SHORT="Day.SaturdayShort",r.SUNDAY="Day.Sunday",r.SUNDAY_SHORT="Day.SundayShort",r))(le||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),_t=(r=>(r.PREVIOUS_DAY="Date.PreviousDay",r.PREVIOUS_WEEK="Date.PreviousWeek",r.PREVIOUS_MONTH="Date.PreviousMonth",r.PREVIOUS_YEAR="Date.PreviousYear",r.NEXT_DAY="Date.NextDay",r.NEXT_WEEK="Date.NextWeek",r.NEXT_MONTH="Date.NextMonth",r.NEXT_YEAR="Date.NextYear",r.YESTERDAY="Date.Yesterday",r.TODAY="Date.Today",r.TOMORROW="Date.Tomorrow",r))(_t||{});const Ct=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,fun:o,_changeOnEnter:l=!1,onChange:c,onOptionsRequest:f,onBlur:u,_multiActiveIndex:p,...m})=>{const d=R.useRef(null),[y,S]=R.useState(r),[E,T]=R.useState(e),{translate:w}=je(),[O,v]=R.useState(!1),[j,M]=R.useState(t||[]),[I,b]=R.useState(0),[D,N]=R.useState([r]),{anchorRef:L,targetRef:k,anchorWidth:Y}=ct({position:"bottom",enabled:O}),P=R.useCallback(()=>{var _;v(!1),(_=d==null?void 0:d.current)==null||_.focus()},[]);ft([k],O,()=>P());const V=Dn(400),z=_=>{_.length>=a?o&&f&&V(async()=>{const C=await f(o,_);M(C),b(C.length>0?0:-1),v(!0)}):P(),S(_),T(e),l||c==null||c(_,e)},J=()=>{O||u==null||u()},U=_=>{l?(S(""),T("")):(S(_.id),T(_.label)),c==null||c(_.id,_.label);const C=j.findIndex($=>$.id===_.id);b(C),N([_.id]),P()},h=_=>{_.key==="Escape"&&(P(),b(-1))},x=_=>{if((_.key==="ArrowDown"||_.key==="ArrowUp")&&(_.preventDefault(),O)){const C=_.key==="ArrowDown"?(I+1)%j.length:(I-1+j.length)%j.length;b(C)}switch(_.key){case"Enter":I>=0&&I<j.length?U(j[I]):l&&(c==null||c(y,""),P(),S(""),T(""));break;case"Escape":P(),b(-1);break}};return g.jsxs("div",{"data-component":"autocomplete",children:[g.jsx($t,{...m,bindValue:y,optionalDisplayValue:E,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:w(Te.AUTOCOMPLETE_DEFAULT_PLACEHOLDER),ref:L,inputRef:d,onChange:z,onKeyDown:x,onBlur:J,"aria-autocomplete":"list"}),O&&g.jsx(ut,{children:g.jsx($r,{options:j,displayMode:s,onClick:U,ref:k,selectedIndex:I,activeIndex:p||D,width:Y,showFilter:!1,onKeyDown:h,isOpen:O})})]})},Lr=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,justify:u,squared:p,onClick:m,onOptionsRequest:d})=>{const[y,S]=R.useState(r);R.useEffect(()=>{!y&&d&&e&&d(e,void 0).then(w=>S(w)).catch(w=>{console.error("Errore nel caricamento delle opzioni per ButtonList",w)})},[y,e,d]);const E={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},T=y==null?void 0:y.map((w,O)=>{const v={bindValue:w.id,optionalDisplayValue:w.label,fun:w.fun,icon:w.icon,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,sizing:s,justify:u,squared:p,onClick:()=>{m==null||m(w.id,w.fun)}};return g.jsx(Se,{...v},`button-${O}`)});return g.jsx("div",{role:"list","data-component":"button-list",className:E.container,children:T})},ds={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},kr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const l=R.useId(),c=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${ds["smp-checkbox-wrapper"]}`};return g.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&g.jsx(De,{label:n,disabled:t,htmlFor:l}),g.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:c,onBlur:i,role:o==="switch"?"switch":"checkbox",id:l})]})},It=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,l]=R.useState(null),c={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=m=>{n==null||n(r.filter((d,y)=>y!==m))},u=m=>{l(m)},p=m=>{if(o===null||o===m)return;const d=[...r],[y]=d.splice(o,1);d.splice(m,0,y),n==null||n(d),l(null)};return g.jsx("div",{className:c.container,role:"list","data-component":"chip",children:r.flatMap((m,d)=>{const y=Pe(m.bindValue,m.optionalDisplayValue,t),S=g.jsxs("div",{className:c.element,role:"listitem",draggable:i,onDragStart:()=>u(d),onDragOver:T=>i&&T.preventDefault(),onDrop:()=>i&&p(d),style:{"--smp-chips-backgroundColor-base":a},children:[i&&g.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),g.jsx(_e,{variant:"label",bindValue:y,color:s}),e&&g.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(d),color:s})]},`chip-${d}`),E=i&&d<r.length-1?g.jsx(oe,{icon:"chevron-right",color:s},`separator-${d}`):null;return[S,E].filter(Boolean)})})};function Lt(r,e){const t=R.useRef(null);R.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled")&&c.offsetParent!==null):[];(()=>{const c=s();c.length>0&&requestAnimationFrame(()=>c[0].focus())})();const i=c=>{if(c.key==="Escape"||c.key!=="Tab")return;const f=s();if(f.length===0)return;const u=f[0],p=f[f.length-1];c.shiftKey&&document.activeElement===u?(c.preventDefault(),p.focus()):!c.shiftKey&&document.activeElement===p&&(c.preventDefault(),u.focus())},o=c=>{if(n&&!n.contains(c.target)){c.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=l,t.current&&requestAnimationFrame(()=>{var c;(c=t.current)==null||c.focus()})}},[r,e])}const Pr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:l,multiActiveIndex:c,...f})=>{const u=R.useRef(null),[p,m]=R.useState(!1),[d,y]=R.useState(t),[S,E]=R.useState(-1),[T,w]=R.useState([r]),O=R.useId(),{anchorRef:v,targetRef:j,anchorWidth:M}=ct({position:"bottom",enabled:p}),I=R.useCallback(()=>{var k;m(!1),(k=u==null?void 0:u.current)==null||k.focus()},[]);ft([j,v],p,()=>I()),Lt(p,j);const b=k=>{e==null||e(k.id,k.label);const Y=d.findIndex(P=>P.id===k.id);E(Y),w([k.id]),I()},D=k=>{k.key==="Escape"&&(I(),E(-1))},N=k=>{(k.key==="ArrowDown"||k.key==="ArrowUp")&&(k.preventDefault(),L())},L=()=>{s&&(o&&l?p?m(!1):l(o,void 0).then(k=>{y(k),E(k.length>0?0:-1),m(!0)}):m(k=>!k))};return g.jsxs("div",{role:"combobox","aria-expanded":p,"aria-controls":O,"aria-owns":O,"data-component":"combobox",children:[g.jsx($t,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:L,onKeyDown:N,onClick:L,shapeIcon:"arrow_drop_down",rotatedShapeIcon:p,isEditable:s,ref:v,inputRef:u,"aria-autocomplete":"list",variant:"notSelectable"}),p&&g.jsx(ut,{children:g.jsx($r,{id:O,options:d,displayMode:i,ref:j,isOpen:p,selectedIndex:S,activeIndex:c||T,width:M,onClick:b,onKeyDown:D})})]})},ps={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1lf9g_1"};function hs({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=je(),i=()=>{if(!n)return;const U=new Date(n);return isNaN(U.getTime())?void 0:U},[o]=R.useState(new Date),[l,c]=R.useState(r||i()||new Date),[f,u]=R.useState(l?l.getMonth():new Date().getMonth()),[p,m]=R.useState(l?l.getFullYear():new Date().getFullYear()),[d,y]=R.useState(l?l.getDate():null),S=R.useRef(null),E=R.useRef([]),T=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],w=[{value:a(le.SUNDAY_SHORT),full:a(le.SUNDAY)},{value:a(le.MONDAY_SHORT),full:a(le.MONDAY)},{value:a(le.TUESDAY_SHORT),full:a(le.TUESDAY)},{value:a(le.WEDNESDAY_SHORT),full:a(le.WEDNESDAY)},{value:a(le.THURSDAY_SHORT),full:a(le.THURSDAY)},{value:a(le.FRIDAY_SHORT),full:a(le.FRIDAY)},{value:a(le.SATURDAY_SHORT),full:a(le.SATURDAY)}],O=U=>t.some(h=>{const x=h.start.getTime(),_=h.end.getTime(),C=U.getTime();return C>=x&&C<=_}),v=U=>{O(U)||(c(U),y(U.getDate()),e&&e(On(U)))},j=()=>{f===0?(u(11),m(p-1)):u(f-1),y(1)},M=()=>{f===11?(u(0),m(p+1)):u(f+1),y(1)},I=(U,h)=>new Date(U,h+1,0).getDate(),b=(U,h)=>new Date(U,h,1).getDay(),D=U=>{var x;const h=Y.findIndex(_=>_!==null&&_.getDate()===U);h!==-1&&E.current[h]&&((x=E.current[h])==null||x.focus(),y(U))},N=(U,h)=>{const x=Y[h];if(!x)return;const _=I(p,f),C=x.getDate();switch(U.key){case"ArrowRight":U.preventDefault();{let $=C+1,A=new Date(p,f,$);if($>_){const W=f===11?p+1:p,H=f===11?0:f+1;$=1,A=new Date(W,H,$),M(),setTimeout(()=>{L(1,"forward")},0);return}O(A)?L($,"forward"):D($)}break;case"Tab":break;case"ArrowLeft":U.preventDefault();{let $=C-1,A=new Date(p,f,$);if($<1){const W=f===0?p-1:p,H=f===0?11:f-1,B=I(W,H);$=B,A=new Date(W,H,$),j(),setTimeout(()=>{L(B,"backward")},0);return}O(A)?L($,"backward"):D($)}break;case"ArrowUp":U.preventDefault();{let $=C-7,A=new Date(p,f,$);if($<1){const W=f===0?p-1:p,H=f===0?11:f-1;$=I(W,H)+$,A=new Date(W,H,$),j(),setTimeout(()=>{L($,"backward")},0);return}O(A)?L($,"backward"):D($)}break;case"ArrowDown":U.preventDefault();{let $=C+7,A=new Date(p,f,$);if($>_){const W=f===11?p+1:p,H=f===11?0:f+1;$=$-_,A=new Date(W,H,$),M(),setTimeout(()=>{L($,"forward")},0);return}O(A)?L($,"forward"):D($)}break;case"Home":U.preventDefault(),L(1,"forward");break;case"End":U.preventDefault(),L(_,"backward");break;case"PageUp":U.preventDefault(),j(),setTimeout(()=>{const $=I(f===0?p-1:p,f===0?11:f-1),A=Math.min(C,$);L(A,"forward")},0);break;case"PageDown":U.preventDefault(),M(),setTimeout(()=>{const $=I(f===11?p+1:p,f===11?0:f+1),A=Math.min(C,$);L(A,"forward")},0);break;case" ":case"Space":if(O(x))return;y(x.getDate()),c(x);break;case"Enter":U.preventDefault(),v(x);break}},L=(U,h)=>{const x=I(p,f);if(h==="forward"){for(let _=U;_<=x;_++){const C=new Date(p,f,_);if(!O(C)){D(_);return}}M(),setTimeout(()=>{L(1,"forward")},0)}else{for(let A=U;A>=1;A--){const W=new Date(p,f,A);if(!O(W)){D(A);return}}const _=f===0?p-1:p,C=f===0?11:f-1,$=I(_,C);j(),setTimeout(()=>{L($,"backward")},0)}},Y=(()=>{const U=I(p,f),h=b(p,f),x=[];for(let _=0;_<h;_++)x.push(null);for(let _=1;_<=U;_++){const C=new Date(p,f,_);x.push(C)}return x})(),P=[];let V=[];Y.forEach((U,h)=>{if(V.push(U),V.length===7||h===Y.length-1){for(;V.length<7;)V.push(null);P.push(V),V=[]}}),R.useEffect(()=>{var U;if(d!==null){const h=Y.findIndex(x=>x!==null&&x.getDate()===d);h!==-1&&E.current[h]&&((U=E.current[h])==null||U.focus())}},[f,p,d,Y]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${ps["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(U,h,x,_)=>`smp-datepickercalendar-td
44
+ */var mt,Kt;function cn(){if(Kt)return mt;Kt=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return mt=s()?Object.assign:function(a,i){for(var o,l=n(a),c,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var u in o)e.call(o,u)&&(l[u]=o[u]);if(r){c=r(o);for(var p=0;p<c.length;p++)t.call(o,c[p])&&(l[c[p]]=o[c[p]])}}return l},mt}var gt,qt;function Dt(){if(qt)return gt;qt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return gt=r,gt}var yt,zt;function Rr(){return zt||(zt=1,yt=Function.call.bind(Object.prototype.hasOwnProperty)),yt}var bt,Jt;function un(){if(Jt)return bt;Jt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=Dt(),t={},n=Rr();r=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,l,c){if(process.env.NODE_ENV!=="production"){for(var f in a)if(n(a,f)){var u;try{if(typeof a[f]!="function"){var p=Error((l||"React class")+": "+o+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}u=a[f](i,f,l,o,null,e)}catch(d){u=d}if(u&&!(u instanceof Error)&&r((l||"React class")+": type specification of "+o+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in t)){t[u.message]=!0;var m=c?c():"";r("Failed "+o+" type: "+u.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},bt=s,bt}var vt,Xt;function fn(){if(Xt)return vt;Xt=1;var r=_r(),e=cn(),t=Dt(),n=Rr(),s=un(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return vt=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(h){var x=h&&(c&&h[c]||h[f]);if(typeof x=="function")return x}var p="<<anonymous>>",m={array:E("array"),bigint:E("bigint"),bool:E("boolean"),func:E("function"),number:E("number"),object:E("object"),string:E("string"),symbol:E("symbol"),any:T(),arrayOf:w,element:O(),elementType:v(),instanceOf:j,node:D(),objectOf:I,oneOf:M,oneOfType:b,shape:L,exact:k};function d(h,x){return h===x?h!==0||1/h===1/x:h!==h&&x!==x}function y(h,x){this.message=h,this.data=x&&typeof x=="object"?x:{},this.stack=""}y.prototype=Error.prototype;function S(h){if(process.env.NODE_ENV!=="production")var x={},_=0;function C(A,W,H,B,X,K,se){if(B=B||p,K=K||H,se!==t){if(l){var F=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw F.name="Invariant Violation",F}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var G=B+":"+H;!x[G]&&_<3&&(a("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+B+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),x[G]=!0,_++)}}return W[H]==null?A?W[H]===null?new y("The "+X+" `"+K+"` is marked as required "+("in `"+B+"`, but its value is `null`.")):new y("The "+X+" `"+K+"` is marked as required in "+("`"+B+"`, but its value is `undefined`.")):null:h(W,H,B,X,K)}var $=C.bind(null,!1);return $.isRequired=C.bind(null,!0),$}function E(h){function x(_,C,$,A,W,H){var B=_[C],X=V(B);if(X!==h){var K=z(B);return new y("Invalid "+A+" `"+W+"` of type "+("`"+K+"` supplied to `"+$+"`, expected ")+("`"+h+"`."),{expectedType:h})}return null}return S(x)}function T(){return S(i)}function w(h){function x(_,C,$,A,W){if(typeof h!="function")return new y("Property `"+W+"` of component `"+$+"` has invalid PropType notation inside arrayOf.");var H=_[C];if(!Array.isArray(H)){var B=V(H);return new y("Invalid "+A+" `"+W+"` of type "+("`"+B+"` supplied to `"+$+"`, expected an array."))}for(var X=0;X<H.length;X++){var K=h(H,X,$,A,W+"["+X+"]",t);if(K instanceof Error)return K}return null}return S(x)}function O(){function h(x,_,C,$,A){var W=x[_];if(!o(W)){var H=V(W);return new y("Invalid "+$+" `"+A+"` of type "+("`"+H+"` supplied to `"+C+"`, expected a single ReactElement."))}return null}return S(h)}function v(){function h(x,_,C,$,A){var W=x[_];if(!r.isValidElementType(W)){var H=V(W);return new y("Invalid "+$+" `"+A+"` of type "+("`"+H+"` supplied to `"+C+"`, expected a single ReactElement type."))}return null}return S(h)}function j(h){function x(_,C,$,A,W){if(!(_[C]instanceof h)){var H=h.name||p,B=U(_[C]);return new y("Invalid "+A+" `"+W+"` of type "+("`"+B+"` supplied to `"+$+"`, expected ")+("instance of `"+H+"`."))}return null}return S(x)}function M(h){if(!Array.isArray(h))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),i;function x(_,C,$,A,W){for(var H=_[C],B=0;B<h.length;B++)if(d(H,h[B]))return null;var X=JSON.stringify(h,function(se,F){var G=z(F);return G==="symbol"?String(F):F});return new y("Invalid "+A+" `"+W+"` of value `"+String(H)+"` "+("supplied to `"+$+"`, expected one of "+X+"."))}return S(x)}function I(h){function x(_,C,$,A,W){if(typeof h!="function")return new y("Property `"+W+"` of component `"+$+"` has invalid PropType notation inside objectOf.");var H=_[C],B=V(H);if(B!=="object")return new y("Invalid "+A+" `"+W+"` of type "+("`"+B+"` supplied to `"+$+"`, expected an object."));for(var X in H)if(n(H,X)){var K=h(H,X,$,A,W+"."+X,t);if(K instanceof Error)return K}return null}return S(x)}function b(h){if(!Array.isArray(h))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var x=0;x<h.length;x++){var _=h[x];if(typeof _!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(_)+" at index "+x+"."),i}function C($,A,W,H,B){for(var X=[],K=0;K<h.length;K++){var se=h[K],F=se($,A,W,H,B,t);if(F==null)return null;F.data&&n(F.data,"expectedType")&&X.push(F.data.expectedType)}var G=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new y("Invalid "+H+" `"+B+"` supplied to "+("`"+W+"`"+G+"."))}return S(C)}function D(){function h(x,_,C,$,A){return Y(x[_])?null:new y("Invalid "+$+" `"+A+"` supplied to "+("`"+C+"`, expected a ReactNode."))}return S(h)}function N(h,x,_,C,$){return new y((h||"React class")+": "+x+" type `"+_+"."+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+$+"`.")}function L(h){function x(_,C,$,A,W){var H=_[C],B=V(H);if(B!=="object")return new y("Invalid "+A+" `"+W+"` of type `"+B+"` "+("supplied to `"+$+"`, expected `object`."));for(var X in h){var K=h[X];if(typeof K!="function")return N($,A,W,X,z(K));var se=K(H,X,$,A,W+"."+X,t);if(se)return se}return null}return S(x)}function k(h){function x(_,C,$,A,W){var H=_[C],B=V(H);if(B!=="object")return new y("Invalid "+A+" `"+W+"` of type `"+B+"` "+("supplied to `"+$+"`, expected `object`."));var X=e({},_[C],h);for(var K in X){var se=h[K];if(n(h,K)&&typeof se!="function")return N($,A,W,K,z(se));if(!se)return new y("Invalid "+A+" `"+W+"` key `"+K+"` supplied to `"+$+"`.\nBad object: "+JSON.stringify(_[C],null," ")+`
45
+ Valid keys: `+JSON.stringify(Object.keys(h),null," "));var F=se(H,K,$,A,W+"."+K,t);if(F)return F}return null}return S(x)}function Y(h){switch(typeof h){case"number":case"string":case"undefined":return!0;case"boolean":return!h;case"object":if(Array.isArray(h))return h.every(Y);if(h===null||o(h))return!0;var x=u(h);if(x){var _=x.call(h),C;if(x!==h.entries){for(;!(C=_.next()).done;)if(!Y(C.value))return!1}else for(;!(C=_.next()).done;){var $=C.value;if($&&!Y($[1]))return!1}}else return!1;return!0;default:return!1}}function P(h,x){return h==="symbol"?!0:x?x["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&x instanceof Symbol:!1}function V(h){var x=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":P(x,h)?"symbol":x}function z(h){if(typeof h>"u"||h===null)return""+h;var x=V(h);if(x==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return x}function J(h){var x=z(h);switch(x){case"array":case"object":return"an "+x;case"boolean":case"date":case"regexp":return"a "+x;default:return x}}function U(h){return!h.constructor||!h.constructor.name?p:h.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},vt}var xt,Zt;function dn(){if(Zt)return xt;Zt=1;var r=Dt();function e(){}function t(){}return t.resetWarningCache=e,xt=function(){function n(i,o,l,c,f,u){if(u!==r){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},xt}var Qt;function pn(){if(Qt)return Ke.exports;if(Qt=1,process.env.NODE_ENV!=="production"){var r=_r(),e=!0;Ke.exports=fn()(r.isElement,e)}else Ke.exports=dn()();return Ke.exports}var ie=pn(),hn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},mn=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},gn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],ze="http://www.w3.org/2000/svg",er="http://www.w3.org/1999/xlink",ke=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}Jr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof hn(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,l=a.httpRequestWithCredentials,c=a.renumerateIRIElements,f=a.src,u=a.title,p=a.useRequestCache,m=this.props.onError,d=this.props.beforeInjection,y=this.props.afterInjection,S=this.props.wrapper,E,T;S==="svg"?(E=document.createElementNS(ze,S),E.setAttribute("xmlns",ze),E.setAttribute("xmlns:xlink",er),T=document.createElementNS(ze,S)):(E=document.createElement(S),T=document.createElement(S)),E.appendChild(T),T.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(E);var w=function(M){if(s.removeSVG(),!s._isMounted){m(M);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){m(M)})},O=function(M,I){if(M){w(M);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{y(I)}catch(b){w(b)}})},v=function(M){if(M.setAttribute("role","img"),i){var I=M.querySelector(":scope > desc");I&&M.removeChild(I);var b=document.createElement("desc");b.innerHTML=i,M.prepend(b)}if(u){var D=M.querySelector(":scope > title");D&&M.removeChild(D);var N=document.createElement("title");N.innerHTML=u,M.prepend(N)}try{d(M)}catch(L){w(L)}};an(T,{afterEach:O,beforeEach:v,cacheRequests:p,evalScripts:o,httpRequestWithCredentials:l,renumerateIRIElements:c})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;mn(tt({},s),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},t.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},t.render=function(){var s=this.props;s.afterInjection,s.beforeInjection,s.desc,s.evalScripts;var a=s.fallback;s.httpRequestWithCredentials;var i=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var o=s.wrapper,l=zr(s,gn),c=o;return Be.createElement(c,tt({},l,{ref:this.refCallback},o==="svg"?{xmlns:ze,xmlnsXlink:er}:{}),this.state.isLoading&&i&&Be.createElement(i,null),this.state.hasError&&a&&Be.createElement(a,null))},e}(Be.Component);ke.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};ke.propTypes={afterInjection:ie.func,beforeInjection:ie.func,desc:ie.string,evalScripts:ie.oneOf(["always","once","never"]),fallback:ie.oneOfType([ie.func,ie.object,ie.string]),httpRequestWithCredentials:ie.bool,loading:ie.oneOfType([ie.func,ie.object,ie.string]),onError:ie.func,renumerateIRIElements:ie.bool,src:ie.string.isRequired,title:ie.string,useRequestCache:ie.bool,wrapper:ie.oneOf(["div","span","svg"])};let Et={assets:"/"};const yn=r=>{Et={...Et,...r}},tr=r=>`${Et.assets}/${r}`.replace(/\/+/g,"/"),oe=R.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:l,isInteractable:c=!1,spin:f=!1,title:u,tabIndex:p})=>{const[m,d]=R.useState(r),y=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),S=y&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),E=tr(`assets/svg/${r}.svg`),T=tr(`assets/svg/${n}.svg`),w={img:`${c?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${c?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},O=()=>{!a&&c&&l&&l()},v=j=>{!a&&c&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),O())};return g.jsx(g.Fragment,{children:S?g.jsx(ke,{src:r,fallback:()=>g.jsx(ke,{src:T,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:w.svg,onClick:O,onKeyDown:v,tabIndex:p}):y?g.jsx("img",{src:m,width:e||"16px",height:t||"auto",alt:u,onError:()=>d(T),onClick:O,className:w.img,title:u,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&O()}}):g.jsx(ke,{src:E,fallback:()=>g.jsx(ke,{src:T,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:w.svg,onClick:O,onKeyDown:v,tabIndex:p})})}),rr=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],nr=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Se=({bindValue:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:l=!0,showText:c=!0,fullWidth:f=!1,loading:u=!1,justify:p="center",title:m,optionalDisplayValue:d,squared:y=!1,submit:S=!1})=>{const E={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${f?"smp-button-fullWidth":""} smp-justifyContent-${p} ${y&&!c?"smp-button-squared":""}`};return g.jsx("button",{"data-component":"button",type:S?"submit":"button",className:E.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":u,title:m||d,children:u?g.jsx(oe,{icon:"spinner",state:nr(i),spin:!0}):g.jsxs(g.Fragment,{children:[n&&l&&g.jsx(oe,{icon:n,disabled:s,state:nr(i),width:rr(a),height:rr(a)}),c&&g.jsx("span",{children:d||r})]})})},bn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},_e=({variant:r="body",bindValue:e,color:t,...n})=>{const s=bn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return g.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},ye={"smp-tabbar-container":"_smp-tabbar-container_1scvh_1","smp-tabbar-scroll-button":"_smp-tabbar-scroll-button_1scvh_8","smp-tabbar-scroll-buttonRight":"_smp-tabbar-scroll-buttonRight_1scvh_13","smp-tabbar-scroll-buttonLeft":"_smp-tabbar-scroll-buttonLeft_1scvh_17","smp-tabbar-list-wrapper":"_smp-tabbar-list-wrapper_1scvh_21","smp-tabbar-list":"_smp-tabbar-list_1scvh_21","smp-tabbar-tab":"_smp-tabbar-tab_1scvh_38","smp-active":"_smp-active_1scvh_62","smp-tabbar-tab-extraSmall":"_smp-tabbar-tab-extraSmall_1scvh_75","smp-tabbar-tab-small":"_smp-tabbar-tab-small_1scvh_80","smp-tabbar-tab-base":"_smp-tabbar-tab-base_1scvh_85","smp-tabbar-tab-large":"_smp-tabbar-tab-large_1scvh_90","smp-tabbar-tab-extraLarge":"_smp-tabbar-tab-extraLarge_1scvh_95"},Dr=({data:r,sizing:e="large",toolbar:t=!0,selectedIndex:n,onTabChange:s})=>{const[a,i]=R.useState(0),o=n??a,[l,c]=R.useState(!1),[f,u]=R.useState(!1),p=R.useRef(null);if(R.useEffect(()=>{const w=p.current;if(!w)return;S();const O=()=>S();return w.addEventListener("scroll",O),window.addEventListener("resize",S),()=>{w.removeEventListener("scroll",O),window.removeEventListener("resize",S)}},[]),!r.children||r.children.length===0)return g.jsx("div",{className:"tab-bar-empty",children:"No tabs available"});const m={container:ye["smp-tabbar-container"],listWrapper:ye["smp-tabbar-list-wrapper"],list:ye["smp-tabbar-list"],tab:`${ye["smp-tabbar-tab"]} ${e?ye[`smp-tabbar-tab-${e}`]:""}`,scrollButtonRight:`${ye["smp-tabbar-scroll-button"]} ${ye["smp-tabbar-scroll-buttonRight"]}`,scrollButtonLeft:`${ye["smp-tabbar-scroll-button"]} ${ye["smp-tabbar-scroll-buttonLeft"]}`,active:ye["smp-active"]},d=100,y=2,S=()=>{const w=p.current;w&&(c(w.scrollLeft>0),u(w.scrollLeft+w.clientWidth<w.scrollWidth-y))},E=()=>{var w;(w=p.current)==null||w.scrollBy({left:-d,behavior:"smooth"})},T=()=>{var w;(w=p.current)==null||w.scrollBy({left:d,behavior:"smooth"})};return g.jsxs("div",{className:m.container,role:"tabpanel","data-component":"tab-bar",children:[l&&g.jsx("div",{className:m.scrollButtonLeft,children:g.jsx(Se,{bindValue:"",optionalDisplayValue:"<",onClick:E,variant:"base",sizing:e})}),g.jsx("div",{className:m.listWrapper,children:g.jsx("div",{className:m.list,ref:p,role:"tablist",children:r.children.map((w,O)=>g.jsxs("button",{type:"button",className:`${O===a?m.active:""} ${m.tab} `,role:"tab","aria-selected":O===o,tabIndex:O===o?0:-1,onClick:()=>{s&&s(O),i(O)},children:[w.icon&&g.jsx(oe,{icon:w.icon,placeholderIcon:w.placeholderIcon}),g.jsx(_e,{variant:"body",bindValue:w.decode||"Tab[object Object]"}),t&&(o===O?g.jsx(oe,{icon:"more_vert",placeholderIcon:w.placeholderIcon,isInteractable:!0,onClick:()=>{console.log("clicked icon")}}):g.jsx(oe,{icon:"empty"}))]},O))})}),f&&g.jsx("div",{className:m.scrollButtonRight,children:g.jsx(Se,{bindValue:"",optionalDisplayValue:">",onClick:T,variant:"base",sizing:e})})]})},rt=({children:r,layout:e={horizontal:!1,sectionsType:"tab",sections:[{id:"1",content:Array.isArray(r)?r.map(t=>({id:t.props.id})):[{id:r.props.id}]}]}})=>{const[t,n]=R.useState(0),s={};R.Children.forEach(r,d=>{R.isValidElement(d)&&(s[d.props.id]=d)});const a="--smp-grid-template-cols",i="--smp-grid-template-rows",o=Er(e.sections??[],Object.keys(s)),l=d=>d.reduce((y,S)=>{var v,j;let E="",T={},w={},O="";return(v=S.sections)!=null&&v.length?(E=pe["smp-layout-section-grid"],T=l(S.sections),S.gridCols===void 0&&(O=pe[S.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(S.horizontal||Mt(S.sections))&&(w=Nt(S.sections,S.horizontal?a:i)))):(j=S.content)!=null&&j.length&&(S.gridCols!==void 0&&S.gridCols>0?(E=pe["smp-layout-section-grid"],O=pe["smp-grid-template-cols"],w={[a]:`repeat(${S.gridCols}, 1fr)`}):E=pe["smp-layout-section-flex"]),{...y,...T,[S.id]:{classes:`${E} ${pe[S.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${O} ${S.justify?`smp-justifyContent-${S.justify}`:""} ${S.align?`smp-alignItems-${S.align}`:""}`,styles:w}}},{}),c=l(o),f=`${pe["smp-layout"]} ${e.horizontal?pe["smp-layout-horizontal"]:pe["smp-layout-vertical"]}`,u=e.horizontal||Mt(e.sections||[])?Nt(o,e.horizontal?a:i):{},p=(d,y)=>{var E,T;const S=g.jsx("div",{"smp-id":`section-${d.id}`,className:c[d.id].classes,style:c[d.id].styles,children:(E=d.sections)!=null&&E.length?d.sections.map(w=>p(w)):(T=d.content)==null?void 0:T.map(w=>m(w,d.justify,d.align))},`section-${d.id}`);return d.title&&!y?g.jsxs("div",{className:pe["smp-layout-section-with-title"],children:[g.jsx("span",{className:`${pe["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:g.jsx(De,{label:d.title})}),S]},`title-section-${d.id}`):S},m=(d,y,S)=>{const E=s[d.id];if(!E)return null;const w={gridColumnStart:(d.colSpan&&d.colSpan>0?`span ${d.colSpan}`:d.colStart&&d.colStart<1?"1":void 0)??d.colStart,gridColumnEnd:d.colEnd&&d.colEnd>0?d.colEnd:void 0},O=`${pe["smp-layout-cell-container"]} ${y?`smp-justifyContent-${y}`:""} ${S?`smp-alignItems-${S}`:""}`;return g.jsx("div",{className:O,style:w,"smp-id":d.id,children:E},d.id)};return g.jsxs("div",{className:f,style:u,"smp-id":"layout",children:[e.sectionsType==="tab"&&e.sections&&(e==null?void 0:e.sections.length)>1&&g.jsx(Dr,{data:{type:"SmeupDataTree",children:o.map(d=>({decode:d.title||d.id||"Tab",obj:{t:"",p:"",k:""},placeholderIcon:"tab",cells:{},children:[],shape:void 0}))},selectedIndex:t,onTabChange:n,toolbar:!1}),e.sectionsType?p(o[t],!0):o.map(d=>p(d))]})},te={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",INPUT_NUMBER:"INR",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",RADIO:"RAD",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",TIME:"TIM",PASSWORD:"PWD"},vn=r=>r.t=="D8",xn=r=>r.t=="I1",Sn=r=>{if(r){const e=r.split(";");if(e.length==3)return{t:e[0],p:e[1],k:e[2]}}return{t:"",p:"",k:""}};class nt{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new nt(e,e.k=="1"||e.k=="true")}getValue(){return this.value}getLegacyValue(){if(this.class.t=="V2"){if(this.class.p=="SI/NO")return this.value?"1":" ";if(this.class.p=="ON/OFF")return this.value?"1":"0"}return this.value?"true":"false"}}function wn(r,e){if(jt(r)){const f=new Date(r);if(!isNaN(f.getTime()))return f}const t=new Date,n=r.replaceAll("/","").replaceAll("-","");let s="DDMMYYYY";e==="en"&&(s="MMDDYYYY");const a=s.indexOf("DD"),i=s.indexOf("MM");let o=0,l=0,c="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),Je(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(l)):a===0&&(t.setMonth(l-1),t.setDate(o)),Je(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),Number(n.substring(4))>50?c="19"+n.substring(4):c="20"+n.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Tt(o,u,parseInt(c))&&Je(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),c=n.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Tt(f,u,parseInt(c))&&Je(t)?t:r}}return r}function jt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function Je(r){return r instanceof Date&&!isNaN(r.getTime())}function En(r){if(!/^\d{8}$/.test(r))return!1;const e=parseInt(r.slice(0,4),10),t=parseInt(r.slice(4,6),10),n=parseInt(r.slice(6,8),10);return Tt(n,t-1,e)}function Tt(r,e,t){const n=[31,Tn(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Tn(r){return r%4===0&&(r%100!==0||r%400===0)}function On(r){const e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return isNaN(e)||isNaN(Number(t))||isNaN(Number(n))?r.toString():`${e}-${t}-${n}`}class st{constructor(e,t){de(this,"class");de(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=sr.get(`${e.t}${e.p}`);if(t)return new st(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=sr.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.date);throw new Error(`Date object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.date}}const sr=new Map([["D8*YYMD",{legacyToIso(r){return En(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return jt(r)&&r.replaceAll("-","")||r}}]]);function ct({position:r="bottom",enabled:e=!0}){const t=R.useRef(null),n=R.useRef(null),[s,a]=R.useState(0),i=R.useCallback(()=>{const o=t.current,l=n.current;if(!o||!l)return;const{top:c,left:f,width:u,height:p}=o.getBoundingClientRect();a(u);const m=l.offsetHeight,d=l.offsetWidth;if(d===0||m===0){requestAnimationFrame(i);return}let y=c+window.scrollY,S=f+window.scrollX;switch(r){case"top":y-=m;break;case"bottom":y+=p;break;case"left":S-=d;break;case"right":S+=u;break}requestAnimationFrame(()=>{l.style.transform=`translate(${S}px, ${y}px)`,l.style.opacity="1"})},[r]);return R.useLayoutEffect(()=>{if(!e)return;let o;const l=()=>{const f=t.current,u=n.current;f&&u?i():o=requestAnimationFrame(l)};o=requestAnimationFrame(l);const c=new MutationObserver(()=>{i()});return n.current&&c.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),c.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const Pe=(r,e,t)=>{if(r==""&&(e==""||e==null))return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},jr=({helperText:r,disabled:e,state:t,id:n})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return g.jsx("label",{className:s.container,id:n,children:r})},he={"smp-textfield-wrapper":"_smp-textfield-wrapper_ep1c3_4","smp-textfield":"_smp-textfield_ep1c3_4","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_ep1c3_29","smp-textfield-extraSmall":"_smp-textfield-extraSmall_ep1c3_35","smp-textfield-small":"_smp-textfield-small_ep1c3_40","smp-textfield-medium":"_smp-textfield-medium_ep1c3_45","smp-textfield-large":"_smp-textfield-large_ep1c3_50","smp-textfield-extraLarge":"_smp-textfield-extraLarge_ep1c3_55","smp-textfield-input":"_smp-textfield-input_ep1c3_61","smp-textfield-outlined":"_smp-textfield-outlined_ep1c3_84","smp-textfield-danger":"_smp-textfield-danger_ep1c3_95","smp-textfield-readOnly":"_smp-textfield-readOnly_ep1c3_99","smp-textfield-disabled":"_smp-textfield-disabled_ep1c3_114","smp-textfield-fullWidth":"_smp-textfield-fullWidth_ep1c3_123","smp-textfield-top-right-indicator":"_smp-textfield-top-right-indicator_ep1c3_127"},we=({disabled:r,bindValue:e,icon:t,placeholder:n,isEditable:s=!0,shapeIcon:a,sizing:i,state:o,variant:l,tooltip:c=!1,rotatedShapeIcon:f=!1,ref:u,inputRef:p,inputType:m="text",ariaLabel:d="input field",label:y,helperText:S=!1,error:E,appearance:T="base",fullWidth:w=!1,_dataComponent:O="textfield",min:v,max:j,step:M,inputMode:I="text",width:b,autocomplete:D,size:N,maxLength:L,onBlur:k,onChange:Y,onKeyDown:P,onShapeIconClick:V,onClick:z})=>{const J=R.useId(),U=`${J}-helper`,h=E?"danger":o,x=E||o=="danger"?"error":a,_=S||!!E,C=W=>{Y==null||Y(W.target.value)},$={wrapper:`${he["smp-textfield-wrapper"]} ${w?he["smp-textfield-fullWidth"]:""}`,container:`${he["smp-textfield"]} ${r?he["smp-textfield-disabled"]:""} ${n?he["smp-textfield-placeholder"]:""} ${i?he[`smp-textfield-${i}`]:""} ${h?he[`smp-textfield-${h}`]:""} ${T?he[`smp-textfield-${T}`]:""} ${s?"":he["smp-textfield-readOnly"]} ${c?he["smp-textfield-top-right-indicator"]:""}`,input:`${he["smp-textfield-input"]}`};if(l&&(l!=="notSelectable"||s)){const W=he[`smp-textfield-variant-${l}`];W&&($.container+=` ${W}`)}const A=b?{"--smp-textField-width-base":b}:void 0;return g.jsxs("div",{className:$.wrapper,"data-component":O,children:[y&&g.jsx(De,{label:y,disabled:r,htmlFor:J}),g.jsxs("div",{className:$.container,ref:u,style:A,children:[t&&g.jsx(oe,{icon:t,disabled:r}),g.jsx("input",{id:J,type:m,value:e,placeholder:n,onChange:C,onBlur:k,className:$.input,disabled:r,readOnly:!s,onKeyDown:P,"aria-label":d,ref:p,"aria-describedby":_?U:void 0,min:v,max:j,step:M,inputMode:I,autoComplete:D,size:N,maxLength:L,onClick:z}),x&&g.jsx(oe,{icon:x,disabled:r,state:h,onClick:V,rotated:f,isInteractable:s,tabIndex:0})]}),_&&g.jsx(jr,{helperText:E,disabled:r,state:h,id:U})]})};function $r({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=R.useState(0),i=R.useRef(null),o=r.length*e,l=Math.max(0,Math.floor(s/e)-n),c=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let m=l;m<=c;m++)f.push({item:r[m],index:m,offsetTop:m*e});const u=R.useCallback(m=>{const d=m.target.scrollTop;a(d)},[]),p=m=>{if(!i.current)return;const d=m*e,y=d+e,S=i.current,E=S.scrollTop,T=E+t;d<E?S.scrollTop=d:y>T&&(S.scrollTop=y-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:u},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:l,endIndex:c},scrollToIndex:p}}const Xe={"smp-list":"_smp-list_6ni6l_1","smp-list-container":"_smp-list-container_6ni6l_12","smp-list-listItem":"_smp-list-listItem_6ni6l_17"};function _n(r,e,t="14px IBM Plex Sans, sans-serif",n=32){const a=document.createElement("canvas").getContext("2d");if(!a)return 200;a.font=t;let i=0;for(const o of r){const l=Pe(o.id,o.label,e),c=a.measureText(l);i=Math.max(i,c.width)}return Math.ceil(i+n)}const Rn=10,Cr=({id:r,options:e,displayMode:t="Both",ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:l,onKeyDown:c,isOpen:f})=>{var Y;const[u,p]=R.useState(""),m=40,[d,y]=R.useState(a!==null?a:-1),[S,E]=R.useState(o||200),T=R.useRef(null),w=s!==void 0?s:e.length>Rn,O=u?e.filter(P=>P.label.toLowerCase().includes(u.toLowerCase())):e,v=P=>{p(P)},{virtualItems:j,containerProps:M,innerProps:I,scrollToIndex:b}=$r({items:O,itemHeight:m,containerHeight:200,overscan:5});R.useEffect(()=>{a!==null&&a!==d&&y(a)},[a]),R.useEffect(()=>{d>=0&&d<O.length&&b(d)},[d,O]),R.useEffect(()=>{f&&(T!=null&&T.current)&&T.current.focus()},[f,T]),R.useEffect(()=>{const P=_n(e,t);E(P)},[e,t]);const D=P=>{if(P.key==="ArrowDown"||P.key==="ArrowUp"){P.preventDefault();let V=d;P.key==="ArrowDown"?V=d<O.length-1?d+1:0:P.key==="ArrowUp"&&(V=d>0?d-1:O.length-1),y(V)}else P.key==="Enter"?d>=0&&d<O.length&&(l==null||l(O[d])):P.key==="Escape"&&(P.preventDefault(),P.stopPropagation());c&&c(P)},N=P=>{D(P)},L=P=>{D(P)},k={wrapper:`${Xe["smp-list"]}`,container:`${Xe["smp-list-container"]}`,virtualScroll:`${Xe["smp-list-virtualScroll"]}`,listItem:`${Xe["smp-list-listItem"]}`};return g.jsxs("div",{id:r,ref:n,className:k.wrapper,"data-component":"list",style:{width:S,minWidth:o},children:[w&&g.jsx(we,{bindValue:u,placeholder:"Search...",fullWidth:!0,onChange:v,onKeyDown:N,inputRef:T}),g.jsx("div",{...M,className:k.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:L,"aria-activedescendant":d>=0&&d<O.length?(Y=O[d])==null?void 0:Y.id:void 0,children:g.jsx("div",{...I,className:k.virtualScroll,children:j.map(({item:P,index:V,offsetTop:z})=>{const J=i.includes(P.id);return g.jsxs("li",{role:"option",id:P.id,"aria-selected":d===V?"true":"false",tabIndex:-1,className:`${k.listItem} ${d===V?"selected-item":""}`,"aria-label":P.id+"-"+P.label,style:{height:`${m}px`,lineHeight:`calc(${m}px - 2*2px)`,transform:`translateY(${z}px)`},onClick:()=>{l==null||l(P),y(V)},children:[Pe(P.id,P.label,t),J&&g.jsx(oe,{icon:"check",width:16})]},P.id)})})})]})},$t=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=R.useState(Pe(e,t,r));return R.useEffect(()=>{a(e)},[e]),R.useEffect(()=>{a(Pe(e,t,r))},[t,r]),g.jsx(we,{...n,bindValue:s})},Dn=r=>{const e=R.useRef(null);return R.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}};function ut({children:r}){const[e,t]=R.useState(!1);return R.useEffect(()=>{t(!0)},[]),e?Wr.createPortal(r,document.body):null}const ft=(r,e,t)=>{R.useEffect(()=>{if(!e)return;const n=s=>{(r==null?void 0:r.some(i=>{if(typeof i=="object"&&i!==null&&"current"in i){const o=i==null?void 0:i.current;return o&&o.contains(s.target)}}))||t()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[r,t,e])},q=r=>typeof r=="string",Me=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},ar=r=>r==null?"":""+r,jn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},$n=/###/g,ir=r=>r&&r.indexOf("###")>-1?r.replace($n,"."):r,or=r=>!r||q(r),Ve=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(or(r))return{};const a=ir(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return or(r)?{}:{obj:r,k:ir(n[s])}},lr=(r,e,t)=>{const{obj:n,k:s}=Ve(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=Ve(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Ve(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},Cn=(r,e,t,n)=>{const{obj:s,k:a}=Ve(r,e,Object);s[a]=s[a]||[],s[a].push(t)},at=(r,e)=>{const{obj:t,k:n}=Ve(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},In=(r,e,t)=>{const n=at(r,t);return n!==void 0?n:at(e,t)},Ir=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?q(r[n])||r[n]instanceof String||q(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Ir(r[n],e[n],t):r[n]=e[n]);return r},Ce=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ln={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const kn=r=>q(r)?r.replace(/[&<>"'\/]/g,e=>Ln[e]):r;class Pn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const An=[" ",",","?","!",";"],Nn=new Pn(20),Mn=(r,e,t)=>{e=e||"",t=t||"";const n=An.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=Nn.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},Ot=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let l=a;l<n.length;++l)if(l!==a&&(o+=t),o+=n[l],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&l<n.length-1)continue;a+=l-a+1;break}s=i}return s},Ye=r=>r==null?void 0:r.replace("_","-"),Fn={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class it{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Fn,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(q(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new it(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new it(this.logger,e)}}var be=new it;class dt{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class cr extends dt{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var c,f;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):q(n)&&a?o.push(...n.split(a)):o.push(n)));const l=at(this.data,o);return!l&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),l||!i||!q(n)?l:Ot((f=(c=this.data)==null?void 0:c[e])==null?void 0:f[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),lr(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(q(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let l=at(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Ir(l,n,a):l={...l,...n},lr(this.data,o,l),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var Lr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const ur={},fr=r=>!q(r)&&typeof r!="boolean"&&typeof r!="number";class ot extends dt{constructor(e,t={}){super(),jn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=be.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Mn(e,n,s);if(i&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:q(a)?[a]:a};const c=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.join(s)}return{key:e,namespaces:q(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],s),c=l[l.length-1];let f=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const u=s.lng||this.language,p=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode")return p?a?{res:`${c}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:o;const m=this.resolve(e,s);let d=m==null?void 0:m.res;const y=(m==null?void 0:m.usedKey)||o,S=(m==null?void 0:m.exactUsedKey)||o,E=["[object Number]","[object Function]","[object RegExp]"],T=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,O=s.count!==void 0&&!q(s.count),v=ot.hasDefaultValue(s),j=O?this.pluralResolver.getSuffix(u,s.count,s):"",M=s.ordinal&&O?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",I=O&&!s.ordinal&&s.count===0,b=I&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${j}`]||s[`defaultValue${M}`]||s.defaultValue;let D=d;w&&!d&&v&&(D=b);const N=fr(D),L=Object.prototype.toString.apply(D);if(w&&D&&N&&E.indexOf(L)<0&&!(q(T)&&Array.isArray(D))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,D,{...s,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(m.res=k,m.usedParams=this.getUsedParamsDetails(s),m):k}if(i){const k=Array.isArray(D),Y=k?[]:{},P=k?S:y;for(const V in D)if(Object.prototype.hasOwnProperty.call(D,V)){const z=`${P}${i}${V}`;v&&!d?Y[V]=this.translate(z,{...s,defaultValue:fr(b)?b[V]:void 0,joinArrays:!1,ns:l}):Y[V]=this.translate(z,{...s,joinArrays:!1,ns:l}),Y[V]===z&&(Y[V]=D[V])}d=Y}}else if(w&&q(T)&&Array.isArray(d))d=d.join(T),d&&(d=this.extendTranslation(d,e,s,n));else{let k=!1,Y=!1;!this.isValidLookup(d)&&v&&(k=!0,d=b),this.isValidLookup(d)||(Y=!0,d=o);const V=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Y?void 0:d,z=v&&b!==d&&this.options.updateMissing;if(Y||k||z){if(this.logger.log(z?"updateKey":"missingKey",u,c,o,z?b:d),i){const x=this.resolve(o,{...s,keySeparator:!1});x&&x.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let J=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let x=0;x<U.length;x++)J.push(U[x]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(s.lng||this.language):J.push(s.lng||this.language);const h=(x,_,C)=>{var A;const $=v&&C!==d?C:V;this.options.missingKeyHandler?this.options.missingKeyHandler(x,c,_,$,z,s):(A=this.backendConnector)!=null&&A.saveMissing&&this.backendConnector.saveMissing(x,c,_,$,z,s),this.emit("missingKey",x,c,_,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?J.forEach(x=>{const _=this.pluralResolver.getSuffixes(x,s);I&&s[`defaultValue${this.options.pluralSeparator}zero`]&&_.indexOf(`${this.options.pluralSeparator}zero`)<0&&_.push(`${this.options.pluralSeparator}zero`),_.forEach(C=>{h([x],o+C,s[`defaultValue${C}`]||b)})}):h(J,o,b))}d=this.extendTranslation(d,e,s,m,n),Y&&d===o&&this.options.appendNamespaceToMissingKey&&(d=`${c}${f}${o}`),(Y||k)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${f}${o}`:o,k?d:void 0,s))}return a?(m.res=d,m.usedParams=this.getUsedParamsDetails(s),m):d}extendTranslation(e,t,n,s,a){var l,c;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const f=q(e)&&(((c=n==null?void 0:n.interpolation)==null?void 0:c.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(f){const m=e.match(this.interpolator.nestingRegexp);u=m&&m.length}let p=n.replace&&!q(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,n.lng||this.language||s.usedLng,n),f){const m=e.match(this.interpolator.nestingRegexp),d=m&&m.length;u<d&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...m)=>(a==null?void 0:a[0])===m[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`),null):this.translate(...m,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=q(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Lr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return q(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,t),f=c.key;s=f;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const p=t.count!==void 0&&!q(t.count),m=p&&!t.ordinal&&t.count===0,d=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(S=>{var E,T;this.isValidLookup(n)||(o=S,!ur[`${y[0]}-${S}`]&&((E=this.utils)!=null&&E.hasLoadedNamespace)&&!((T=this.utils)!=null&&T.hasLoadedNamespace(o))&&(ur[`${y[0]}-${S}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(w=>{var j;if(this.isValidLookup(n))return;i=w;const O=[f];if((j=this.i18nFormat)!=null&&j.addLookupKeys)this.i18nFormat.addLookupKeys(O,f,w,S,t);else{let M;p&&(M=this.pluralResolver.getSuffix(w,t.count,t));const I=`${this.options.pluralSeparator}zero`,b=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(O.push(f+M),t.ordinal&&M.indexOf(b)===0&&O.push(f+M.replace(b,this.options.pluralSeparator)),m&&O.push(f+I)),d){const D=`${f}${this.options.contextSeparator}${t.context}`;O.push(D),p&&(O.push(D+M),t.ordinal&&M.indexOf(b)===0&&O.push(D+M.replace(b,this.options.pluralSeparator)),m&&O.push(D+I))}}let v;for(;v=O.pop();)this.isValidLookup(n)||(a=v,n=this.getResource(w,S,v,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!q(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class dr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=be.create("languageUtils")}getScriptPartFromCode(e){if(e=Ye(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Ye(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(q(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),q(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return q(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):q(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const pr={zero:0,one:1,two:2,few:3,many:4,other:5},hr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Vn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=be.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ye(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),hr;if(!e.match(/-|_/))return hr;const l=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(l,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>pr[s]-pr[a]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const mr=(r,e,t,n=".",s=!0)=>{let a=In(r,e,t);return!a&&s&&q(t)&&(a=Ot(r,t,n),a===void 0&&(a=Ot(e,t,n))),a},St=r=>r.replace(/\$/g,"$$$$");class Yn{constructor(e={}){var t;this.logger=be.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:l,formatSeparator:c,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:p,nestingPrefixEscaped:m,nestingSuffix:d,nestingSuffixEscaped:y,nestingOptionsSeparator:S,maxReplaces:E,alwaysFormat:T}=e.interpolation;this.escape=t!==void 0?t:kn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Ce(a):i||"{{",this.suffix=o?Ce(o):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=p?Ce(p):m||Ce("$t("),this.nestingSuffix=d?Ce(d):y||Ce(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=E||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var m;let a,i,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=d=>{if(d.indexOf(this.formatSeparator)<0){const T=mr(t,l,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,n,{...s,...t,interpolationkey:d}):T}const y=d.split(this.formatSeparator),S=y.shift().trim(),E=y.join(this.formatSeparator).trim();return this.format(mr(t,l,S,this.options.keySeparator,this.options.ignoreJSONStructure),E,n,{...s,...t,interpolationkey:S})};this.resetRegExp();const f=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=((m=s==null?void 0:s.interpolation)==null?void 0:m.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>St(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?St(this.escape(d)):St(d)}].forEach(d=>{for(o=0;a=d.regex.exec(e);){const y=a[1].trim();if(i=c(y),i===void 0)if(typeof f=="function"){const E=f(e,a,s);i=q(E)?E:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=ar(i));const S=d.safeValue(i);if(e=e.replace(a[0],S),u?(d.regex.lastIndex+=i.length,d.regex.lastIndex-=a[0].length):d.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(l,c)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const u=l.split(new RegExp(`${f}[ ]*{`));let p=`{${u[1]}`;l=u[0],p=this.interpolate(p,i);const m=p.match(/'/g),d=p.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!d||d.length%2!==0)&&(p=p.replace(/'/g,'"'));try{i=JSON.parse(p),c&&(i={...c,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${f}${p}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];i={...n},i=i.replace&&!q(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let c=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(u=>u.trim());s[1]=f.shift(),l=f,c=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=ar(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),c&&(a=l.reduce((f,u)=>this.format(f,u,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const Un=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...l]=i.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=c),c==="false"&&(t[f]=!1),c==="true"&&(t[f]=!0),isNaN(c)||(t[f]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},gr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Ye(n),s),e[i]=o),o(t)}},Wn=r=>(e,t,n)=>r(Ye(t),n)(e);class Bn{constructor(e={}){this.logger=be.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?gr:Wn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=gr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,l)=>{var u;const{formatName:c,formatOptions:f}=Un(l);if(this.formats[c]){let p=o;try{const m=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},d=m.locale||m.lng||s.locale||s.lng||n;p=this.formats[c](o,d,{...f,...s,...m})}catch(m){this.logger.warn(m)}return p}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const Hn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Gn extends dt{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=be.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},l={};return e.forEach(c=>{let f=!0;t.forEach(u=>{const p=`${c}|${u}`;!n.reload&&this.store.hasResourceBundle(c,u)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?i[p]===void 0&&(i[p]=!0):(this.state[p]=1,f=!1,i[p]===void 0&&(i[p]=!0),a[p]===void 0&&(a[p]=!0),l[u]===void 0&&(l[u]=!0)))}),f||(o[c]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,t,n){const s=e.split("|"),a=s[0],i=s[1];t&&this.emit("failedLoading",a,i,t),!t&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(l=>{Cn(l.loaded,[a],i),Hn(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{o[c]||(o[c]={});const f=l.loaded[c];f.length&&f.forEach(u=>{o[c][u]===void 0&&(o[c][u]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,t,n,s=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:i});return}this.readingCalls++;const o=(c,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(c&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(c,f)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(e,t);c&&typeof c.then=="function"?c.then(f=>o(null,f)).catch(o):o(null,c)}catch(c){o(c)}return}return l(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();q(e)&&(e=this.languageUtils.toResolveHierarchy(e)),q(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var l,c,f,u,p;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((u=(f=this.services)==null?void 0:f.utils)!=null&&u.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((p=this.backend)!=null&&p.create){const m={...i,isUpdate:a},d=this.backend.create.bind(this.backend);if(d.length<6)try{let y;d.length===5?y=d(e,t,n,s,m):y=d(e,t,n,s),y&&typeof y.then=="function"?y.then(S=>o(null,S)).catch(o):o(null,y)}catch(y){o(y)}else d(e,t,n,s,o,m)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const yr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),q(r[1])&&(e.defaultValue=r[1]),q(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),br=r=>{var e,t;return q(r.ns)&&(r.ns=[r.ns]),q(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),q(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},Ze=()=>{},Kn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Ue extends dt{constructor(e={},t){if(super(),this.options=br(e),this.services={},this.logger=be,this.modules={external:[]},Kn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(q(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=yr();this.options={...n,...this.options,...br(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?be.init(s(this.modules.logger),this.options):be.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Bn;const f=new dr(this.options);this.store=new cr(this.options.resources,this.options);const u=this.services;u.logger=be,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new Vn(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=s(c),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Yn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Gn(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.languageDetector&&(u.languageDetector=s(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=s(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new ot(this.services,this.options),this.translator.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ze),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...f)=>this.store[c](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...f)=>(this.store[c](...f),this)});const o=Me(),l=()=>{const c=(f,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(u),t(f,u)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,t=Ze){var a,i;let n=t;const s=q(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?l(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,c=>l(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(c)})}else n(null)}reloadResources(e,t,n){const s=Me();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ze),this.services.backendConnector.reload(e,t,a=>{s.resolve(),n(a)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Lr.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Me();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,l)=>{l?this.isLanguageChangingTo===e&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),t&&t(o,(...c)=>this.t(...c))},i=o=>{var f,u;!e&&!o&&this.services.languageDetector&&(o=[]);const l=q(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,c)),this.loadResources(c,p=>{a(p,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,t,n){const s=(a,i,...o)=>{let l;typeof i!="object"?l=this.options.overloadTranslationOptionHandler([a,i].concat(o)):l={...i},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||s.keyPrefix);const c=this.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${l.keyPrefix}${c}${u}`):f=l.keyPrefix?`${l.keyPrefix}${c}${a}`:a,this.t(f,l)};return q(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,l)=>{const c=this.services.backendConnector.state[`${o}|${l}`];return c===-1||c===0||c===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=Me();return this.options.ns?(q(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Me();q(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new dr(yr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Ue(e,t)}cloneInstance(e={},t=Ze){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Ue(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((f,u)=>(f[u]={...l[c][u]},f),l[c]),l),{});a.store=new cr(o,s),a.services.resourceStore=a.store}return a.translator=new ot(a.services,s),a.translator.on("*",(o,...l)=>{a.emit(o,...l)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=Ue.createInstance();ae.createInstance=Ue.createInstance;ae.createInstance;ae.dir;ae.init;ae.loadResources;ae.reloadResources;ae.use;ae.changeLanguage;ae.getFixedT;ae.t;ae.exists;ae.setDefaultNamespace;ae.hasLoadedNamespace;ae.loadNamespaces;ae.loadLanguages;const qn={Friday:"Venerdì",FridayShort:"Ven",Monday:"Lunedì",MondayShort:"Lun",Saturday:"Sabato",SaturdayShort:"Sab",Sunday:"Domenica",SundayShort:"Dom",Tuesday:"Martedì",TuesdayShort:"Mar",Thursday:"Giovedì",ThursdayShort:"Gio",Wednesday:"Mercoledì",WednesdayShort:"Mer"},zn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Jn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido",ConfirmButton:"Conferma",AutocompleteDefaultPlaceholder:"Inserisci codice o descrizione"},Xn={Date:{NextDay:"Giorno Successivo",NextMonth:"Mese Successivo",NextWeek:"Settimana Successiva",NextYear:"Anno Successivo",PreviousDay:"Giorno Precedente",PreviousMonth:"Mese Precedente",PreviousWeek:"Settimana Precedente",PreviousYear:"Anno Precedente",Today:"Oggi",Tomorrow:"Domani",Yesterday:"Ieri"},Day:qn,Month:zn,Generic:Jn},Zn={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},Qn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},es={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid",ConfirmButton:"Confirm",AutocompleteDefaultPlaceholder:"Type code or description"},ts={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:Zn,Month:Qn,Generic:es};function vr(r,e){return new RegExp(rs(r),e)}function rs(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ns=(r,e,t)=>{let n=r;return isNaN(n)||(e!=null&&(n=Math.max(n,e)),t!=null&&(n=Math.min(n,t))),n},ss=(r,e)=>{var i,o;const n=Intl.NumberFormat(r).formatToParts(1000.1),s=((i=n.find(l=>l.type==="group"))==null?void 0:i.value)??",",a=e??((o=n.find(l=>l.type==="decimal"))==null?void 0:o.value)??".";return{groupingChar:s,decimalChar:a}};function as(r,e,t,n){let s=e;const a=ls(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=cs(s);return new Intl.NumberFormat(n,i).format(a)}const is=(r,e,t)=>{const n=r.lastIndexOf(t);if(n!==-1)return r.length-n-1;const s=t==="."?",":".",a=r.lastIndexOf(s);return a!==-1&&!(s===e&&r.length-a-1===3)?r.length-a-1:0},os=(r,e,t)=>{if(!r)return NaN;let n=r.replace(/\s/g,""),s=t;const a=(n.match(/\./g)||[]).length,i=(n.match(/,/g)||[]).length;if(a&&i)s=n.lastIndexOf(".")>n.lastIndexOf(",")?".":",";else if(!n.includes(t)){const l=n.includes(".")?".":",",c=l==="."?a:i;c>1||c===1&&l===e&&n.length-n.lastIndexOf(l)-1===3||(s=l)}const o=s==="."?",":".";return n=n.replace(new RegExp(`\\${o}`,"g"),""),s!=="."&&(n=n.replace(new RegExp(`\\${s}`,"g"),".")),parseFloat(n)};function ls(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const l=o=="."?",":".";a=a.replace(vr(l,"g"),""),a=a.replace(vr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function cs(r){const e={};r.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const t=r.indexOf(".");if(t>-1){const s=(r.substring(t+1).match(/0/g)||[]).length;e.minimumFractionDigits=s,e.maximumFractionDigits=s}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}ae.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(r,e,t,n)=>{const s=(n==null?void 0:n.type)??"number";try{switch(s){case"date":{const a=r instanceof Date?r:new Date(r);return new Intl.DateTimeFormat(t,{dateStyle:e||"short"}).format(a)}default:case"number":{const a=(n==null?void 0:n.inputIsLocalized)??!1;return as(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:ts},it:{translation:Xn}}});const us=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),fs=(r,e)=>ae.t(r,e);function je(){const r=R.useCallback((n,s,a,i)=>us(n,s,a||void 0,i),[]),e=R.useCallback(()=>ae.languages[0],[]),t=R.useCallback((n,s)=>fs(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var Te=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",r.CONFIRM_BUTTON="Generic.ConfirmButton",r.AUTOCOMPLETE_DEFAULT_PLACEHOLDER="Generic.AutocompleteDefaultPlaceholder",r))(Te||{}),le=(r=>(r.MONDAY="Day.Monday",r.MONDAY_SHORT="Day.MondayShort",r.TUESDAY="Day.Tuesday",r.TUESDAY_SHORT="Day.TuesdayShort",r.WEDNESDAY="Day.Wednesday",r.WEDNESDAY_SHORT="Day.WednesdayShort",r.THURSDAY="Day.Thursday",r.THURSDAY_SHORT="Day.ThursdayShort",r.FRIDAY="Day.Friday",r.FRIDAY_SHORT="Day.FridayShort",r.SATURDAY="Day.Saturday",r.SATURDAY_SHORT="Day.SaturdayShort",r.SUNDAY="Day.Sunday",r.SUNDAY_SHORT="Day.SundayShort",r))(le||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),_t=(r=>(r.PREVIOUS_DAY="Date.PreviousDay",r.PREVIOUS_WEEK="Date.PreviousWeek",r.PREVIOUS_MONTH="Date.PreviousMonth",r.PREVIOUS_YEAR="Date.PreviousYear",r.NEXT_DAY="Date.NextDay",r.NEXT_WEEK="Date.NextWeek",r.NEXT_MONTH="Date.NextMonth",r.NEXT_YEAR="Date.NextYear",r.YESTERDAY="Date.Yesterday",r.TODAY="Date.Today",r.TOMORROW="Date.Tomorrow",r))(_t||{});const Ct=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,fun:o,_changeOnEnter:l=!1,onChange:c,onOptionsRequest:f,onBlur:u,_multiActiveIndex:p,...m})=>{const d=R.useRef(null),[y,S]=R.useState(r),[E,T]=R.useState(e),{translate:w}=je(),[O,v]=R.useState(!1),[j,M]=R.useState(t||[]),[I,b]=R.useState(0),[D,N]=R.useState([r]),{anchorRef:L,targetRef:k,anchorWidth:Y}=ct({position:"bottom",enabled:O}),P=R.useCallback(()=>{var _;v(!1),(_=d==null?void 0:d.current)==null||_.focus()},[]);ft([k],O,()=>P());const V=Dn(400),z=_=>{_.length>=a?o&&f&&V(async()=>{const C=await f(o,_);M(C),b(C.length>0?0:-1),v(!0)}):P(),S(_),T(e),l||c==null||c(_,e)},J=()=>{O||u==null||u()},U=_=>{l?(S(""),T("")):(S(_.id),T(_.label)),c==null||c(_.id,_.label);const C=j.findIndex($=>$.id===_.id);b(C),N([_.id]),P()},h=_=>{_.key==="Escape"&&(P(),b(-1))},x=_=>{if((_.key==="ArrowDown"||_.key==="ArrowUp")&&(_.preventDefault(),O)){const C=_.key==="ArrowDown"?(I+1)%j.length:(I-1+j.length)%j.length;b(C)}switch(_.key){case"Enter":I>=0&&I<j.length?U(j[I]):l&&(c==null||c(y,""),P(),S(""),T(""));break;case"Escape":P(),b(-1);break}};return g.jsxs("div",{"data-component":"autocomplete",children:[g.jsx($t,{...m,bindValue:y,optionalDisplayValue:E,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:w(Te.AUTOCOMPLETE_DEFAULT_PLACEHOLDER),ref:L,inputRef:d,onChange:z,onKeyDown:x,onBlur:J,"aria-autocomplete":"list"}),O&&g.jsx(ut,{children:g.jsx(Cr,{options:j,displayMode:s,onClick:U,ref:k,selectedIndex:I,activeIndex:p||D,width:Y,showFilter:!1,onKeyDown:h,isOpen:O})})]})},kr=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,justify:u,squared:p,onClick:m,onOptionsRequest:d})=>{const[y,S]=R.useState(r);R.useEffect(()=>{!y&&d&&e&&d(e,void 0).then(w=>S(w)).catch(w=>{console.error("Errore nel caricamento delle opzioni per ButtonList",w)})},[y,e,d]);const E={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},T=y==null?void 0:y.map((w,O)=>{const v={bindValue:w.id,optionalDisplayValue:w.label,fun:w.fun,icon:w.icon,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,sizing:s,justify:u,squared:p,onClick:()=>{m==null||m(w.id,w.fun)}};return g.jsx(Se,{...v},`button-${O}`)});return g.jsx("div",{role:"list","data-component":"button-list",className:E.container,children:T})},ds={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},Pr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const l=R.useId(),c=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${ds["smp-checkbox-wrapper"]}`};return g.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&g.jsx(De,{label:n,disabled:t,htmlFor:l}),g.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:c,onBlur:i,role:o==="switch"?"switch":"checkbox",id:l})]})},It=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,l]=R.useState(null),c={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=m=>{n==null||n(r.filter((d,y)=>y!==m))},u=m=>{l(m)},p=m=>{if(o===null||o===m)return;const d=[...r],[y]=d.splice(o,1);d.splice(m,0,y),n==null||n(d),l(null)};return g.jsx("div",{className:c.container,role:"list","data-component":"chip",children:r.flatMap((m,d)=>{const y=Pe(m.bindValue,m.optionalDisplayValue,t),S=g.jsxs("div",{className:c.element,role:"listitem",draggable:i,onDragStart:()=>u(d),onDragOver:T=>i&&T.preventDefault(),onDrop:()=>i&&p(d),style:{"--smp-chips-backgroundColor-base":a},children:[i&&g.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),g.jsx(_e,{variant:"label",bindValue:y,color:s}),e&&g.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(d),color:s})]},`chip-${d}`),E=i&&d<r.length-1?g.jsx(oe,{icon:"chevron-right",color:s},`separator-${d}`):null;return[S,E].filter(Boolean)})})};function Lt(r,e){const t=R.useRef(null);R.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled")&&c.offsetParent!==null):[];(()=>{const c=s();c.length>0&&requestAnimationFrame(()=>c[0].focus())})();const i=c=>{if(c.key==="Escape"||c.key!=="Tab")return;const f=s();if(f.length===0)return;const u=f[0],p=f[f.length-1];c.shiftKey&&document.activeElement===u?(c.preventDefault(),p.focus()):!c.shiftKey&&document.activeElement===p&&(c.preventDefault(),u.focus())},o=c=>{if(n&&!n.contains(c.target)){c.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=l,t.current&&requestAnimationFrame(()=>{var c;(c=t.current)==null||c.focus()})}},[r,e])}const Ar=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:l,multiActiveIndex:c,...f})=>{const u=R.useRef(null),[p,m]=R.useState(!1),[d,y]=R.useState(t),[S,E]=R.useState(-1),[T,w]=R.useState([r]),O=R.useId(),{anchorRef:v,targetRef:j,anchorWidth:M}=ct({position:"bottom",enabled:p}),I=R.useCallback(()=>{var k;m(!1),(k=u==null?void 0:u.current)==null||k.focus()},[]);ft([j,v],p,()=>I()),Lt(p,j);const b=k=>{e==null||e(k.id,k.label);const Y=d.findIndex(P=>P.id===k.id);E(Y),w([k.id]),I()},D=k=>{k.key==="Escape"&&(I(),E(-1))},N=k=>{(k.key==="ArrowDown"||k.key==="ArrowUp")&&(k.preventDefault(),L())},L=()=>{s&&(o&&l?p?m(!1):l(o,void 0).then(k=>{y(k),E(k.length>0?0:-1),m(!0)}):m(k=>!k))};return g.jsxs("div",{role:"combobox","aria-expanded":p,"aria-controls":O,"aria-owns":O,"data-component":"combobox",children:[g.jsx($t,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:L,onKeyDown:N,onClick:L,shapeIcon:"arrow_drop_down",rotatedShapeIcon:p,isEditable:s,ref:v,inputRef:u,"aria-autocomplete":"list",variant:"notSelectable"}),p&&g.jsx(ut,{children:g.jsx(Cr,{id:O,options:d,displayMode:i,ref:j,isOpen:p,selectedIndex:S,activeIndex:c||T,width:M,onClick:b,onKeyDown:D})})]})},ps={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1lf9g_1"};function hs({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=je(),i=()=>{if(!n)return;const U=new Date(n);return isNaN(U.getTime())?void 0:U},[o]=R.useState(new Date),[l,c]=R.useState(r||i()||new Date),[f,u]=R.useState(l?l.getMonth():new Date().getMonth()),[p,m]=R.useState(l?l.getFullYear():new Date().getFullYear()),[d,y]=R.useState(l?l.getDate():null),S=R.useRef(null),E=R.useRef([]),T=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],w=[{value:a(le.SUNDAY_SHORT),full:a(le.SUNDAY)},{value:a(le.MONDAY_SHORT),full:a(le.MONDAY)},{value:a(le.TUESDAY_SHORT),full:a(le.TUESDAY)},{value:a(le.WEDNESDAY_SHORT),full:a(le.WEDNESDAY)},{value:a(le.THURSDAY_SHORT),full:a(le.THURSDAY)},{value:a(le.FRIDAY_SHORT),full:a(le.FRIDAY)},{value:a(le.SATURDAY_SHORT),full:a(le.SATURDAY)}],O=U=>t.some(h=>{const x=h.start.getTime(),_=h.end.getTime(),C=U.getTime();return C>=x&&C<=_}),v=U=>{O(U)||(c(U),y(U.getDate()),e&&e(On(U)))},j=()=>{f===0?(u(11),m(p-1)):u(f-1),y(1)},M=()=>{f===11?(u(0),m(p+1)):u(f+1),y(1)},I=(U,h)=>new Date(U,h+1,0).getDate(),b=(U,h)=>new Date(U,h,1).getDay(),D=U=>{var x;const h=Y.findIndex(_=>_!==null&&_.getDate()===U);h!==-1&&E.current[h]&&((x=E.current[h])==null||x.focus(),y(U))},N=(U,h)=>{const x=Y[h];if(!x)return;const _=I(p,f),C=x.getDate();switch(U.key){case"ArrowRight":U.preventDefault();{let $=C+1,A=new Date(p,f,$);if($>_){const W=f===11?p+1:p,H=f===11?0:f+1;$=1,A=new Date(W,H,$),M(),setTimeout(()=>{L(1,"forward")},0);return}O(A)?L($,"forward"):D($)}break;case"Tab":break;case"ArrowLeft":U.preventDefault();{let $=C-1,A=new Date(p,f,$);if($<1){const W=f===0?p-1:p,H=f===0?11:f-1,B=I(W,H);$=B,A=new Date(W,H,$),j(),setTimeout(()=>{L(B,"backward")},0);return}O(A)?L($,"backward"):D($)}break;case"ArrowUp":U.preventDefault();{let $=C-7,A=new Date(p,f,$);if($<1){const W=f===0?p-1:p,H=f===0?11:f-1;$=I(W,H)+$,A=new Date(W,H,$),j(),setTimeout(()=>{L($,"backward")},0);return}O(A)?L($,"backward"):D($)}break;case"ArrowDown":U.preventDefault();{let $=C+7,A=new Date(p,f,$);if($>_){const W=f===11?p+1:p,H=f===11?0:f+1;$=$-_,A=new Date(W,H,$),M(),setTimeout(()=>{L($,"forward")},0);return}O(A)?L($,"forward"):D($)}break;case"Home":U.preventDefault(),L(1,"forward");break;case"End":U.preventDefault(),L(_,"backward");break;case"PageUp":U.preventDefault(),j(),setTimeout(()=>{const $=I(f===0?p-1:p,f===0?11:f-1),A=Math.min(C,$);L(A,"forward")},0);break;case"PageDown":U.preventDefault(),M(),setTimeout(()=>{const $=I(f===11?p+1:p,f===11?0:f+1),A=Math.min(C,$);L(A,"forward")},0);break;case" ":case"Space":if(O(x))return;y(x.getDate()),c(x);break;case"Enter":U.preventDefault(),v(x);break}},L=(U,h)=>{const x=I(p,f);if(h==="forward"){for(let _=U;_<=x;_++){const C=new Date(p,f,_);if(!O(C)){D(_);return}}M(),setTimeout(()=>{L(1,"forward")},0)}else{for(let A=U;A>=1;A--){const W=new Date(p,f,A);if(!O(W)){D(A);return}}const _=f===0?p-1:p,C=f===0?11:f-1,$=I(_,C);j(),setTimeout(()=>{L($,"backward")},0)}},Y=(()=>{const U=I(p,f),h=b(p,f),x=[];for(let _=0;_<h;_++)x.push(null);for(let _=1;_<=U;_++){const C=new Date(p,f,_);x.push(C)}return x})(),P=[];let V=[];Y.forEach((U,h)=>{if(V.push(U),V.length===7||h===Y.length-1){for(;V.length<7;)V.push(null);P.push(V),V=[]}}),R.useEffect(()=>{var U;if(d!==null){const h=Y.findIndex(x=>x!==null&&x.getDate()===d);h!==-1&&E.current[h]&&((U=E.current[h])==null||U.focus())}},[f,p,d,Y]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${ps["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(U,h,x,_)=>`smp-datepickercalendar-td
46
46
  ${U?"smp-datepickercalendar-td-today":""}
47
47
  ${h?"smp-datepickercalendar-td-selected":""}
48
48
  ${x?"smp-datepickercalendar-td-focused":""}
49
- ${_?"smp-datepickercalendar-td-disabled":""}`},J=()=>`${T[f]} ${p.toString()}`;return g.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[g.jsx(Se,{onClick:j,ariaLabel:a(_t.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),g.jsx("div",{"aria-label":J(),className:z.label,children:J()}),g.jsx(Se,{onClick:M,ariaLabel:a(_t.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),g.jsxs("table",{ref:S,role:"grid","aria-label":`${a(Te.CALENDAR_FOR)} ${T[f]} ${p}`,className:z.table,children:[g.jsx("thead",{children:g.jsx("tr",{children:w.map(U=>g.jsx("th",{scope:"col",abbr:U.full,className:z.th,children:U.value},U.value))})}),g.jsx("tbody",{children:P.map((U,h)=>g.jsx("tr",{children:U.map((x,_)=>{const C=h*7+_;if(x===null)return g.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${_}`);const $=x.getDate()===o.getDate()&&x.getMonth()===o.getMonth()&&x.getFullYear()===o.getFullYear(),A=l&&x.getDate()===l.getDate()&&x.getMonth()===l.getMonth()&&x.getFullYear()===l.getFullYear(),W=d===x.getDate(),H=O(x);return g.jsx("td",{role:"gridcell","aria-selected":A,tabIndex:W?0:-1,onClick:()=>v(x),onKeyDown:B=>N(B,C),"aria-label":`${x.getDate()} ${T[x.getMonth()]} ${x.getFullYear()}`,"data-selected":A,"aria-disabled":H,ref:B=>{E.current[C]=B},className:z.td($,A,W,H),children:x.getDate()},`day-${_}`)})},`week-${h}`))})]})]})}const Ar=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const i=R.useRef(null),[o,l]=R.useState(!1),[c,f]=R.useState(r||""),[u,p]=R.useState(""),{anchorRef:m,targetRef:d}=ct({position:"bottom",enabled:o}),y=R.useCallback(()=>{var b;l(!1),(b=i==null?void 0:i.current)==null||b.focus()},[]);ft([d,m],o,()=>{y()}),Lt(o,d);const{format:S,getCurrentLanguage:E}=je(),T=R.useCallback(b=>{const D=b.length>5&&wn(b,E())||b,N=S(D,void 0,void 0,{type:"date"}),L=typeof D!="string",k=L&&D.toISOString().substring(0,10)||"";return{isValid:L,formattedDate:N,isoDate:k,normalizedDate:D}},[E,S]);R.useEffect(()=>{const{formattedDate:b,isoDate:D,isValid:N}=T(r);f(N&&D||r),p(N&&b||r)},[r,S,T]);const w=()=>l(b=>!b),O=()=>{j(u)},v=b=>{j(b),y()},j=b=>{const{isoDate:D,isValid:N}=T(b);t&&t(N&&D||b)},M=b=>{p(b)},I=b=>{b.key==="Enter"&&(b.preventDefault(),j(u))};return g.jsxs("div",{"data-component":"date-picker",children:[g.jsx(we,{...a,bindValue:u,placeholder:e,onBlur:O,onChange:M,onKeyDown:I,shapeIcon:"calendar",onShapeIconClick:w,ref:m,inputRef:i,isEditable:s,size:10,maxLength:a.maxLength?a.maxLength:10}),o&&g.jsx(ut,{children:g.jsx(hs,{disabledDateRanges:n,onDateChange:v,initialValue:jt(c)&&c||"",targetRef:d})})]})},ms=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:l,error:c,onOptionsRequest:f,onChange:u,onBlur:p})=>{const m=r.map(S=>S.bindValue),d=(S,E)=>{const T=[...r];if(S=="")T.pop();else{const w=T.findIndex(O=>O.bindValue===S&&O.optionalDisplayValue===E);w>=0?T.splice(w,1):T.push({bindValue:S,optionalDisplayValue:E})}u==null||u(T)},y={container:"smp-multipleAutocomplete-container"};return g.jsxs("div",{className:y.container,"data-component":"multiple-autocomplete",children:[i&&g.jsx(De,{label:i,disabled:o}),g.jsx(It,{elements:r,displayMode:e,isEditable:s,onChange:S=>{u==null||u(S)}}),g.jsx(Ct,{bindValue:"",fun:l,isEditable:s,onChange:d,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:m,error:c,onBlur:p})]})},Nr=({...r})=>{const[e,t]=R.useState(!1),n=e?"visibility-off":"visibility";return g.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},gs=({...r})=>{const[e,t]=R.useState(r.bindValue),{translate:n}=je(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return g.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(Te.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},ys=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?g.jsxs("div",{className:n.wrapper,children:[g.jsx(De,{label:t}),g.jsx(_e,{variant:"body",bindValue:e||r})]}):g.jsx(_e,{variant:"body",bindValue:e||r})};class Re{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Re(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Re({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Le=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),xr=r=>{const e=Re.fromDataObj(r.obj),t=r.decode?Re.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},bs=(r,e)=>{const t=new Re(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Re(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Le(r,t,n)},vs=({min:r,max:e,step:t=1,inputMode:n="decimal",dSep:s,bindValue:a,onChange:i,onEnter:o,...l})=>{const{getCurrentLanguage:c}=je(),f=R.useRef(null),u=c(),{groupingChar:p,decimalChar:m}=R.useMemo(()=>ss(u,s),[u,s]),d=R.useCallback((L,k)=>new Intl.NumberFormat(u,{minimumFractionDigits:k,maximumFractionDigits:k,useGrouping:!0}).format(L),[u]),y=R.useCallback(os,[p,m]),S=R.useCallback(ns,[r,e]),E=a!=null&&a.toString().includes(".")?a.toString().split(".")[1].length:0,[T,w]=R.useState(E),[O,v]=R.useState(a!=null?d(a,T):""),j=R.useRef(a??null);R.useEffect(()=>{if(a==null){v(""),j.current=null;return}const L=a.toString().includes(".")?a.toString().split(".")[1].length:0,k=L===0?T:L;k!==T&&w(k),v(d(a,k)),j.current=a},[a,d]);const M=R.useCallback((L,k=!1)=>{if(L.trim()===""){v(""),j.current=null,i==null||i(void 0,""),k&&(o==null||o(void 0));return}const Y=y(L,p,m);if(isNaN(Y))if(j.current!=null){const P=d(j.current,T);v(P)}else v("");else{const P=S(Y,r,e),V=is(L,p,m);w(V);const z=d(P,V);v(z),j.current=P,i==null||i(P,z),k&&(o==null||o(P))}},[y,p,m,S,r,e,d,i,o,T]),I=L=>v(L),b=()=>M(O),D=L=>{if(L.key==="Enter"){L.preventDefault(),M(O,!0);return}if(L.key==="ArrowUp"||L.key==="ArrowDown"){L.preventDefault();const k=L.key==="ArrowUp"?1:-1,Y=j.current??0,P=S(Y+k*t,r,e);M(d(P,T))}},N=L=>{if(!L.currentTarget.contains(document.activeElement))return;L.preventDefault();const k=L.deltaY<0?1:-1,Y=j.current??0,P=S(Y+k*t,r,e);M(d(P,T))};return g.jsx("div",{ref:f,"data-component":"input-number",onWheel:N,children:g.jsx(we,{...l,"aria-valuemin":r,"aria-valuemax":e,"aria-valuenow":j.current??void 0,bindValue:O,inputType:"text",inputMode:n,min:r,max:e,step:t,onChange:I,onBlur:b,onKeyDown:D})})};class Ue{constructor(e,t,n="."){de(this,"class");de(this,"value");de(this,"decimalSeparator");this.class=e,this.value=t,this.decimalSeparator=n}static fromDataObj(e,t){const n=t==="."?",":".";if(e.k=="")return new Ue(e,void 0,t);const s=e.k.replace(new RegExp(`\\${n}`,"g"),""),a=parseFloat(s.replace(t,"."));return new Ue(e,a,t)}getLegacyValue(){return this.value!=null?this.value.toString().replace(".",this.decimalSeparator):""}getValue(){return this.value}}const xs=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:l,helperText:c,error:f,onBlur:u,onKeyDown:p,rows:m=10,cols:d=150})=>{const y=R.useId(),S=`${y}-helper`,E=f?"danger":s,T=c||!!f,w=v=>{t==null||t(v.target.value)},O={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${E?`smp-textarea-${E}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return g.jsxs("div",{className:O.wrapper,"data-component":"textarea",children:[o&&g.jsx(De,{htmlFor:y,label:o,disabled:r}),g.jsx("textarea",{id:y,value:e,placeholder:n,onChange:w,onBlur:u,className:O.container,disabled:r,readOnly:!i,onKeyDown:p,"aria-label":o?void 0:l,"aria-labelledby":o?y:void 0,"aria-describedby":T?S:void 0,rows:m,cols:d}),T&&g.jsx(Dr,{id:S,helperText:f,disabled:r,state:E})]})};var Rt=(r=>(r.PAGE_DIRECTION="pageDirection",r.LINE_DIRECTION="lineDirection",r))(Rt||{});const Ze={"smp-radio":"_smp-radio_1vo2u_1","smp-radio-horizontal":"_smp-radio-horizontal_1vo2u_10","smp-radio-element":"_smp-radio-element_1vo2u_14","smp-radio-disabled":"_smp-radio-disabled_1vo2u_20"},Ss=({disabled:r=!1,displayMode:e="DescOnly",RadLay:t=Rt.PAGE_DIRECTION,options:n,onOptionsRequest:s,fun:a,label:i,...o})=>{const[l,c]=R.useState(n),f=R.useId();R.useEffect(()=>{!l&&s&&a&&s(a,void 0).then(y=>c(y)).catch(y=>{console.error("Error during loading options (radio)",y)})},[l,s,a]);const u={container:`${Ze["smp-radio"]} ${t==Rt.LINE_DIRECTION?Ze["smp-radio-horizontal"]:""}`,option:`${Ze["smp-radio-element"]} ${r?Ze["smp-radio-disabled"]:""}`},p=()=>{var y;r||(y=o.onBlur)==null||y.call(o)},m=y=>{var S;r||(S=o.onChange)==null||S.call(o,y.id,y.label)},d=R.useId();return g.jsxs("div",{"smp-id":"radio-container",className:u.container,id:f,children:[i&&g.jsx(De,{label:i,disabled:r,htmlFor:f}),l==null?void 0:l.map((y,S)=>g.jsxs("label",{className:u.option,children:[g.jsx("input",{type:"radio",name:d,value:y.id,disabled:r,checked:y.id===o.bindValue,onChange:()=>m(y),onBlur:p}),g.jsx(_e,{variant:"body",bindValue:Pe(y.id,y.label,e)})]},S))]})},ws=({value:r,onChange:e,targetRef:t,isOpen:n})=>{const s=R.useRef(null);R.useEffect(()=>{n&&(s!=null&&s.current)&&s.current.focus()},[n,s]);const[a,i,o]=r,l=c=>Array.from({length:c},(f,u)=>g.jsx("option",{value:u,children:u.toString().padStart(2,"0")},u));return g.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[g.jsx("select",{value:a,ref:s,onChange:c=>e(+c.target.value,i,o),id:"time-picker-hours",children:l(24)}),":",g.jsx("select",{value:i,onChange:c=>e(a,+c.target.value,o),id:"time-picker-minutes",children:l(60)}),":",g.jsx("select",{value:o||0,onChange:c=>e(a,i,+c.target.value),id:"time-picker-seconds",children:l(60)})]})},Sr=r=>{const e=r.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);if(!e)return!1;const[,t,n,s]=e,a=parseInt(t,10),i=parseInt(n,10),o=s?parseInt(s,10):0;return a>=0&&a<=23&&i>=0&&i<=59&&(s===void 0||o>=0&&o<=59)},Es=r=>{const e=r.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},Ts=(r,e,t)=>{const n=r!=null&&!isNaN(r)?r.toString().padStart(2,"0"):"",s=e!=null&&!isNaN(e)?e.toString().padStart(2,"0"):"",a=t!=null&&!isNaN(t)?t.toString().padStart(2,"0"):"";return n&&s?`${n}:${s}:${a}`:s?`${s}:${a}`:a},Os=({bindValue:r,placeholder:e="HH:MM:SS",onChange:t,isEditable:n=!0,...s})=>{const a=R.useRef(null),[i,o]=R.useState(!1),[l,c]=R.useState(r||""),[f,u]=R.useState(""),{anchorRef:p,targetRef:m}=ct({position:"bottom",enabled:i}),d=R.useCallback(()=>{var v;o(!1),(v=a==null?void 0:a.current)==null||v.focus()},[]);ft([m,p],i,()=>o(!1)),Lt(i,m),R.useEffect(()=>{const v=r||"",j=Sr(v)?v:r||"";c(v),u(j)},[r]),R.useEffect(()=>{const v=j=>{j.key==="Escape"&&o(!1)};return i&&document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i]);const y=()=>{n&&o(v=>!v)},S=v=>{u(v)},E=(v,j,M)=>{const I=Ts(v,j,M);c(I),u(I),t==null||t(I),d()},T=()=>{O(f)},w=v=>{v.key==="Enter"&&(v.preventDefault(),O(f))},O=v=>{if(v.trim()===""){c(""),u(""),t==null||t("");return}Sr(v)?(c(v),u(v),t==null||t(v)):u(v)};return g.jsxs("div",{"data-component":"time-picker",children:[g.jsx($t,{...s,bindValue:f,placeholder:e,onChange:S,onBlur:T,onKeyDown:w,shapeIcon:"clock",onShapeIconClick:y,isEditable:n,ref:p,inputRef:a}),i&&g.jsx(ut,{children:g.jsx(ws,{value:Es(l),onChange:E,targetRef:m,isOpen:i})})]})};function _s(r){return typeof r=="string"&&/^\d{6}$/.test(r)}class lt{constructor(e,t){de(this,"class");de(this,"time");this.class=e,this.time=t}static fromDataObj(e){const t=wr.get(`${e.t}${e.p}`);if(t)return new lt(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=wr.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.time);throw new Error(`Time object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.time}}const wr=new Map([["I12",{legacyToIso(r){return _s(r)&&`${r.substring(0,2)}:${r.substring(2,4)}:${r.substring(4,6)}`||r},isoToLegacy(r){return r.replaceAll(":","")||r}}]]),Rs={"smp-cell-wrapper":"_smp-cell-wrapper_mdlkz_1"},Oe=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,tooltip:l,options:c,onChange:f,onClick:u,onEnter:p,onBlur:m,onOptionsRequest:d,onContextMenu:y,isEditable:S})=>{const E={obj:t,shape:e,decode:r,icon:s,fun:a},T={onBlur:m,onOptionsRequest:d,fun:a,icon:s,tooltip:l,label:o,isEditable:S,...n},w=(b,D,N)=>vn(t)?Le(b,new st(t,D).getLegacyValue()):xn(t)?Le(b,new lt(t,D).getLegacyValue()):Le(b,D,N),O=(b,D)=>Le(b,new Ue(t,D,".").getLegacyValue()),v=b=>Le(E,new nt(t,b).getLegacyValue()),j=b=>bs(E,b),M=()=>{switch(e){case te.AUTOCOMPLETE:{const b={...T,bindValue:t.k,optionalDisplayValue:r,onChange:(D,N)=>{f==null||f(w(E,D,N))}};return g.jsx(Ct,{...b})}case te.BUTTON:{const b={...T,bindValue:t.k,optionalDisplayValue:n!=null&&n.label&&typeof n.label=="string"?n.label:void 0,title:r,onClick:()=>{u==null||u(w(E,t.k))}};return g.jsx(Se,{...b})}case te.BUTTON_LIST:{const b={...T,options:c,onClick:(D,N)=>{const L={...E,fun:N};u==null||u(w(L,D))}};return g.jsx(Lr,{...b})}case te.CHIP:{const b={...T,elements:xr(E)};return g.jsx(It,{...b})}case te.CHECKBOX:case te.SWITCH:{const b=e===te.SWITCH,D={...T,bindValue:nt.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:N=>{f==null||f(v(N))},...b&&{variant:"switch"}};return g.jsx(kr,{...D})}case te.COMBOBOX:{const b={...T,bindValue:t.k,optionalDisplayValue:r,onChange:(D,N)=>{f==null||f(w(E,D,N))}};return g.jsx(Pr,{...b})}case te.DATE:{const b={...T,bindValue:st.fromDataObj(t).getValue(),onChange:D=>{f==null||f(w(E,D))}};return g.jsx(Ar,{...b})}case te.ICON:case te.IMAGE:{const b={...T,icon:s,placeholderIcon:i,isInteractable:!!T.fun,onClick:()=>{u==null||u(w(E,t.k))}};return g.jsx(oe,{...b})}case te.INPUT_NUMBER:{const b={...T,bindValue:Ue.fromDataObj(t,".").getValue(),onChange:D=>{f==null||f(O(E,D))}};return g.jsx(vs,{...b})}case te.MEMO:{const b={...T,bindValue:t.k,optionalDisplayValue:r,onChange:D=>{f==null||f(w(E,D))}};return g.jsx(xs,{...b})}case te.MULTI_AUTOCOMPLETE:{const b={...T,elements:xr(E),onChange:D=>{f==null||f(j(D))}};return g.jsx(ms,{...b})}case te.PASSWORD:{const b={...T,bindValue:t.k,onChange:D=>{f==null||f(w(E,D))}};return g.jsx(Nr,{...b})}case te.RADIO:{const b={...T,bindValue:t.k,onChange:(D,N)=>{f==null||f(w(E,D,N))}};return g.jsx(Ss,{...b})}case te.SPOTLIGHT:{const b={...T,bindValue:t.k,onEnter:D=>{p==null||p(w(E,D))}};return g.jsx(gs,{...b})}case te.TEXT_FIELD:{const b={...T,bindValue:t.k,optionalDisplayValue:r,onChange:D=>{f==null||f(w(E,D))}};return g.jsx(we,{...b})}case te.TIME:{const b={...T,bindValue:lt.fromDataObj(t).getValue(),onChange:D=>{f==null||f(w(E,D))}};return g.jsx(Os,{...b})}default:{const b={...T,bindValue:t.k,optionalDisplayValue:r};return g.jsx(ys,{...b})}}},I={wrapper:`${Rs["smp-cell-wrapper"]}`};return g.jsx("span",{className:I.wrapper,onContextMenu:b=>{y&&l&&(b.preventDefault(),y(E,b.currentTarget))},children:M()})},Ds=({data:r,onClick:e,onEnter:t,onContextMenu:n})=>{var o,l;const[s,a]=R.useState(),i=R.useCallback(c=>{var u,p;if(!((u=c.rows)!=null&&u.length)||!((p=c.columns)!=null&&p.length))return{};const f=c.rows[0];return c.columns.filter(m=>m.visible).reduce((m,d)=>{const y=f.cells[d.name],S={...y,id:d.name,onChange:E=>{a(T=>T&&{...T,[d.name]:{...T[d.name],obj:{...T[d.name].obj,k:E.obj.k}}})},onClick:()=>{y.fun&&e&&e({...y})},onEnter:E=>{t&&t(E)},onContextMenu:(E,T)=>{n&&n(E,T)}};return{...m,[d.name]:S}},{})},[e,t,n]);return R.useEffect(()=>{r&&a(i(r))},[r,i]),!((o=r==null?void 0:r.rows)!=null&&o.length)||!((l=r.columns)!=null&&l.length)?null:s&&g.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(s).map(c=>g.jsx(Oe,{...c}))})})},js=r=>{var e;return(e=r.children)!=null&&e.length?r.children.map(t=>{var n,s;return{id:((n=t.obj)==null?void 0:n.k)??"",label:t.decode??t.value??((s=t.obj)==null?void 0:s.k)??"",fun:t.fun,icon:t.icon}}):[]},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,$s=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:l,onContextMenu:c})=>{var O,v;const[f,u]=R.useState(),[p,m]=R.useState(t??!0),d=R.useRef(null),y=s.trim()?s:"100vh",S=R.useCallback(j=>{var I,b;if(!((I=j==null?void 0:j.rows)!=null&&I.length)||!((b=j==null?void 0:j.columns)!=null&&b.length))return{};const M=j.rows[0];return j.columns.filter(D=>D.visible??!0).reduce((D,N)=>{const L=M.cells[N.name];if(!L||!p&&ce(n)&&L.shape!==te.BUTTON&&L.shape!==te.BUTTON_LIST)return D;const k={...L,id:N.name,onChange:Y=>{u(P=>{const V={...P};return V!=null&&V[N.name]&&(V[N.name].obj.k=Y.obj.k),V})},onClick:Y=>{Y.fun&&a&&a(Y)},onEnter:Y=>{i&&i(Y)},onContextMenu:(Y,P)=>{c&&c(Y,P)}};return l&&L.shape==te.BUTTON_LIST&&(k.onOptionsRequest=(Y,P)=>l(Y,P).then(V=>js(V))),!p&&ce(n)&&(k.data={...k.data,showText:!1,justify:"center",squared:!0}),{...D,[N.name]:k}},{})},[p,n,a,i,l,c]),E=R.useCallback(()=>{o==null||o()},[o]),T=()=>{ce(n)?m(j=>!j):(m(!1),o==null||o())};if(R.useEffect(()=>{u(S(r))},[r]),R.useEffect(()=>{if(!d.current)return;if(!ce(n)){u(S(r));return}const j=getComputedStyle(d.current).getPropertyValue("--smp-drawer-slide-transition");let M=Number(j);j.endsWith("ms")?M=parseFloat(j):j.endsWith("s")&&(M=parseFloat(j)*1e3),setTimeout(()=>{u(S(r))},M/2)},[p,n]),R.useEffect(()=>{t!==void 0&&!ce(n)&&m(t)},[n,t]),!((O=r==null?void 0:r.rows)!=null&&O.length)||!((v=r.columns)!=null&&v.length))return null;const w={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${p?"smp-drawer-open":""} ${!ce(n)&&!p?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${p?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${p?"smp-drawer-backdrop-open":""}`};return f&&g.jsxs(g.Fragment,{children:[!ce(n)&&g.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:w.backdrop,onClick:E}),g.jsx("aside",{ref:d,className:w.drawer,style:{height:y},"aria-label":"Drawer","smp-id":"drawer",children:g.jsxs("div",{className:w.container,children:[g.jsxs("div",{className:w.containerHeader,children:[e&&g.jsx("div",{className:w.containerLogo,children:g.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),g.jsx("div",{className:w.containerIcon,children:g.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!p,isInteractable:!0,onClick:T,width:20,height:20})})]}),g.jsx("div",{className:w.containerLayout,children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(f).map(j=>g.jsx(Oe,{...j}))})})]})})]})},Cs=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:l,IconColName:c,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:p,UmColName:m,UmColor:d="var(--smp-dashList-color-base)",ForceValue:y,ValueColName:S,ValueColor:E="var(--smp-dashList-color-base)",SelectLayout:T="1",onClick:w})=>{const O="N/A",v=(e==null?void 0:e.columns)||[],j=(e==null?void 0:e.rows)||[],M=j.length>0,I="--smp-dashList-color",b="smp-layout",D="descr",N="icon",L="um",k="value",Y=i||"1em",P="18px",V="--smp-dashList-columns",z="--smp-dashList-fontSize",J={dash:(G="1")=>{const Z=h(G),re=Z,ne=x(Z,D),fe=x(Z,N),ve=x(Z,L),me=x(Z,k);return{container:re,descr:ne,icon:fe,um:ve,value:me}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
50
- ${ce(o)?"smp-dash-list-horizontal":""}`},{format:U}=je(),h=G=>`${b}-${G}`,x=(G,Z)=>`${G}__${Z}`,_=G=>`${I}-${G}`,C=G=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(G)){const ne=G.match(Z)||[];if((ne==null?void 0:ne.length)>3)return"rgb("+ne[1]+","+ne[2]+","+ne[3]+")"}return G},$=G=>{if(!u)return G;const[Z,re]=A(u).map($e=>parseInt($e||"0")),ne="0,0"+(re?"."+"0".repeat(re):""),fe=U(G,ne,"it");if(!Z)return fe;const[ve,me]=fe.split(",");return ve+(me?`,${me}`:"")},A=G=>G.includes(";")?G.split(";"):[G],W=G=>{const Z=ne=>{var fe;if(ne)return(fe=G==null?void 0:G.cells[ne])==null?void 0:fe.obj.k},re=ne=>{var fe,ve;if(!(v.length<=ne))return(ve=(fe=G==null?void 0:G.cells[v[ne].name])==null?void 0:fe.obj)==null?void 0:ve.k};return{descr:t||Z(n)||re(2)||"",icon:l||Z(c)||re(3)||"",um:p||Z(m)||re(1)||"",value:y||Z(S)||re(0)||""}},H=G=>{w==null||w(G)},B=(G,Z)=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),G.stopPropagation(),H(Z))},K=(G=>{const Z=J.dash(G);return{className:Z,descr:re=>g.jsx("div",{className:Z.descr,children:re},`${G}-${D}`),icon:re=>g.jsx("div",{className:Z.icon,children:g.jsx(oe,{color:f,height:P,icon:re,width:P})},`${G}-${N}`),um:re=>g.jsx("div",{className:Z.um,children:re},`${G}-${L}`),value:re=>g.jsx("div",{className:Z.value,children:re},`${G}-${k}`)}})(T),se=G=>{const{descr:Z,icon:re,um:ne,value:fe}=W(G),ve={[_(D)]:C(s),[_(L)]:C(d),[_(k)]:C(E)},me=[],$e=$(fe);switch(T){case"2":re&&me.push(K.icon(re)),me.push(K.descr(Z)),me.push(K.value(ne?$e+" "+ne:$e));break;default:case"1":me.push(K.descr(Z)),me.push(K.value(ne?$e+" "+ne:$e))}return g.jsx("div",{className:K.className.container,role:"button",style:ve,tabIndex:0,onClick:()=>H(G),onKeyDown:Fr=>B(Fr,G),children:me},G.rowId)},F={[V]:String(r),[z]:Y};return g.jsx("div",{className:J.dashList,style:F,children:M?j.map(G=>se(G)):O})},Qe={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},Is="_rowContent_20wit_2",Ls="_clickable_20wit_21",ks="_indent_20wit_26",Ps="_toggle_20wit_32",As="_cell_20wit_38",Ns="_leftSection_20wit_46",Ee={rowContent:Is,clickable:Ls,indent:ks,toggle:Ps,cell:As,leftSection:Ns};function et(r){return!!r&&"children"in r}function Ms(r){return!et(r)}function Fs(r){const e=JSON.stringify(r,Object.keys(r).sort());let t=0,n,s;if(e.length===0)return t.toString();for(n=0;n<e.length;n++)s=e.charCodeAt(n),t=(t<<5)-t+s,t|=0;return Math.abs(t).toString()}const Mr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var T;const[a,i]=R.useState(!1),o=et(r)&&!!((T=r.children)!=null&&T.length),l=r.cells&&Object.keys(r.cells).length>0,c=o,f=t*20,u=()=>{o&&i(!a)},p={content:`${Ee.rowContent} ${o?Ee.clickable:""}`,toggle:`${Ee.toggle}`,indent:`${Ee.indent}`,cell:`${Ee.cell}`},m=w=>g.jsx(Oe,{...w}),d=()=>g.jsx("span",{className:p.toggle,children:c&&g.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),y=()=>g.jsx("span",{className:p.indent,style:{width:`${f}px`},"aria-hidden":"true"}),S=()=>{const w=Ms(r)?"":r.decode||(l?"":"Untitled"),O=s??n*t;return g.jsxs("tr",{className:p.content,onClick:u,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${O}px)`},children:[et(r)&&g.jsxs("td",{className:Ee.leftSection,style:{height:`${n}px`},children:[y(),d(),g.jsx("span",{className:Ee.rowLabel,children:w})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([v,j])=>g.jsx("td",{className:p.cell,style:{width:e[v],minWidth:e[v],height:`${n}px`},children:m({...j,id:v})},Fs(j)||v))]})},E=()=>{var w;return a||!o?null:g.jsx(g.Fragment,{children:et(r)&&((w=r.children)==null?void 0:w.map((O,v)=>g.jsx(Mr,{row:O,level:t+1},`child-${v}`)))})};return g.jsxs(g.Fragment,{children:[S(),E()]})},Vs=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return g.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:g.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[g.jsx(oe,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),g.jsx(_e,{variant:"title",bindValue:r})]})})};function Ys(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function Us(r,e){return r.map(t=>{const n=e.find(s=>s.column===t.bindValue);return{column:t.bindValue,visible:(n==null?void 0:n.visible)??!0}})}function Ws(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(u,p,m){if(p>=e.length){f(u);return}const d=e[p].column,y=o(u,d);for(const[S,E]of y){const T=[...m,S],w=l(T,p),O=n.has(w);s.push(c(S,w,p,O)),a+=t,O&&i(E,p+1,T)}}function o(u,p){var d;const m=new Map;for(const y of u){const S=((d=y.cells[p])==null?void 0:d.decode)??"N/D";m.has(S)||m.set(S,[]),m.get(S).push(y)}return m}function l(u,p){return`group-${u.join("-")}-${p}`}function c(u,p,m,d){return{isGroup:!0,value:u,cells:{},rowId:p,level:m,isExpanded:d}}function f(u){for(const p of u)s.push(p),a+=t}}const Bs=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return g.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[g.jsx("td",{children:g.jsx(oe,{icon:"groups"})}),g.jsx("td",{children:g.jsx(It,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},Hs=({columns:r,columnWidths:e})=>g.jsx("tfoot",{children:g.jsx("tr",{children:r.map(t=>t.visible&&g.jsx("td",{className:Qe["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),Gs=({columns:r,rows:e,containerRef:t,sizingMode:n})=>{const[s,a]=R.useState({});return R.useEffect(()=>{var i,o;if(!(!r||r.length===0)){if(n==="fixed"){const c=Object.fromEntries(r.map(f=>[f.name,120]));a(c)}else if(n==="fit-grid"){const l=((i=t.current)==null?void 0:i.offsetWidth)||800,c=r.filter(p=>p.visible!==!1),f=l/c.length,u=Object.fromEntries(c.map(p=>[p.name,f]));a(u)}else if(n==="fit-content"){const l={};for(const c of r){if(!c.visible)continue;const f=((o=c.title)==null?void 0:o.length)||0,u=Math.max(...e.map(p=>{var m,d,y,S;return`${((d=(m=p.cells)==null?void 0:m[c.name])==null?void 0:d.decode)||((S=(y=p.cells)==null?void 0:y[c.name])==null?void 0:S.value)||""}`.length}),f);l[c.name]=u*8+24}a(l)}}},[r,e,t,n]),[s,a]},Ks=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var M;const[i,o]=R.useState(r??{columns:[],rows:[]}),[l,c]=R.useState(n||[]),[f,u]=R.useState(new Set),p=R.useRef(null),[m,d]=Gs({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:p,sizingMode:s});R.useEffect(()=>{if(l!=null&&l.length&&r.rows){const{flatRows:I}=Ws(r.rows,l,e,f);o({...r,rows:I})}else o(r)},[r,l,f,e]);const y=I=>{c(Us(I,l))},S=I=>{I.preventDefault();const b=I.dataTransfer.getData("text/plain");if(!b||l.some(L=>L.column===b))return;const N=[...l,{column:b,visible:!0}];c(N)},E=I=>{I.preventDefault()},{virtualItems:T,containerProps:w,innerProps:O}=jr({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),v=(I,b)=>{const D=I.clientX,N=m[b],L=Y=>{const P=Y.clientX-D,V=Math.max(50,N+P);d(z=>({...z,[b]:V}))},k=()=>{window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",k)};window.addEventListener("mousemove",L),window.addEventListener("mouseup",k)},j={smpTable:`${Qe["smp-table"]}`,headerCell:`${Qe["smp-headerCell"]}`,resizer:`${Qe["smp-resizer"]}`};return i&&g.jsx("div",{className:j.smpTable,...w,ref:p,children:g.jsxs("table",{children:[g.jsxs("thead",{children:[(n||a)&&g.jsx(Bs,{groups:l,onChange:y,onDrop:S,onDragOver:E}),g.jsx("tr",{children:i.columns&&((M=i.columns)==null?void 0:M.map(I=>I.visible&&g.jsxs("th",{className:j.headerCell,draggable:!0,onDragStart:b=>{b.dataTransfer.setData("text/plain",I.name)},style:{width:m[I.name],minWidth:m[I.name],maxWidth:m[I.name]},children:[g.jsx(_e,{variant:"title",bindValue:I.title}),g.jsx("div",{className:j.resizer,onMouseDown:b=>v(b,I.name),role:"region"})]},I.name)))})]}),g.jsx("tbody",{...O,children:T.map(({item:I,index:b,offsetTop:D})=>{const N=I.rowId||I.value||`${I.isGroup?"group":"row"}-${b}`;return I.isGroup?g.jsx(Vs,{label:I.value||"",rowHeight:e,offsetTop:D,level:I.level,onClick:()=>{const L=I.rowId;L&&u(k=>Ys(k,L))},isExpanded:I.isExpanded},`group-${N}`):g.jsx(Mr,{row:I,columnWidths:m,rowHeight:e,offsetTop:D,isGroup:!1},`row-${N}`)})}),g.jsx(Hs,{columns:i.columns,columnWidths:m})]})})},qs=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:l,onOptionsRequest:c})=>{const[f,u]=R.useState();R.useEffect(()=>{u(()=>{if(!r)return;const y={...r};return e&&(y.shape=e),y.shape==null&&(y.shape=te.TEXT_FIELD),s&&(y.obj=Sn(s)),y})},[r,s,e]);const m={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},d=()=>{ce(t)||o==null||o(f)};if(f)return g.jsxs("div",{className:m.container,children:[g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:g.jsx(Oe,{...f,id:"FLD",onChange:u,onOptionsRequest:c,fun:r==null?void 0:r.fun,onBlur:d,label:a,labelPosition:i})}),ce(t)&&g.jsx(Se,{optionalDisplayValue:"Confirm",onClick:()=>l==null?void 0:l(f),bindValue:"Confirm"})]})},zs=r=>(r==null?void 0:r.type)==="SmeupDataTree",Js=r=>(r==null?void 0:r.type)==="SmeupDataTable",Xs=r=>zs(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Js(r)?r.rows.map(e=>{const t=e.cells||e.cells,[n,s]=Object.keys(t);return{id:t[n].obj.k,label:t[s].value||t[s].obj.k}}):[],Zs=({data:r,id:e,readOnly:t=!1,hiddenSubmitButton:n=!1,updateOnClick:s=!1,decimalSeparator:a=".",optionsHandler:i,onSubmit:o,onCheck:l,onCheckObj:c,onContextMenu:f,onButtonClick:u})=>{var M,I;const[p,m]=R.useState({}),{translate:d}=je(),y=R.useId();R.useEffect(()=>{m(O(r))},[r]);const S=(b,D)=>{m(N=>({...N,[b]:{...N[b],obj:{...N[b].obj,k:D.obj.k},decode:D.decode,data:{...N[b].data,error:void 0},value:D.obj.k}})),s&&(D.shape==te.CHECKBOX||D.shape==te.SWITCH)&&E()},E=b=>{const D=v();o({value:D,cell:b})},T=(b,D)=>{u==null||u({cellId:b,currentState:{type:"SmeupDataTable",columns:r.columns,rows:[{cells:p}]},fun:D||""})},w=async b=>{var D,N;if(p[b].obj.k!=r.rows[0].cells[b].obj.k&&((D=p[b].inputSettings)!=null&&D.checkObject&&c&&((await c({obj:p[b].obj,fun:p[b].fun,cellId:b})).valid||m(k=>({...k,[b]:{...k[b],data:{...k[b].data,error:d(Te.CHECK_OBJECT_WRONG_VALIDATION)}}}))),(N=p[b].inputSettings)!=null&&N.checkValueOnExit)){const L=v();l==null||l({value:L,cell:b})}},O=b=>{var N,L,k;if(!((N=b.rows)!=null&&N.length)||!((L=b.columns)!=null&&L.length))return{};const D=(k=b.rows)==null?void 0:k[0];return b.columns.filter(Y=>Y.visible??!0).reduce((Y,P)=>{const V={...D.cells[P.name],id:P.name,label:P.title,data:{...D.cells[P.name].data,dSep:a}};return V.fun&&(V.onOptionsRequest=async(z,J)=>Xs(await i(z,J,r,P.name))),V.isEditable==null&&(V.isEditable=!0),t&&(V.isEditable=!1),V.isEditable&&V.shape==null&&(V.shape=te.TEXT_FIELD),{...Y,[P.name]:V}},{})},v=()=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(p))}]}}),j=((I=(M=r.setup)==null?void 0:M.commands)==null?void 0:I.map((b,D)=>R.createElement(Oe,{...b,decode:b.value,data:{label:b.value},id:`command-${D}`,key:`command-${D}`,shape:te.BUTTON,onClick:()=>E(b.obj.k)})))||[];return n||j.unshift(g.jsx(Oe,{decode:d(Te.CONFIRM_BUTTON),shape:te.BUTTON,id:"",obj:{t:"",p:"",k:""},data:{submit:!0,label:d(Te.CONFIRM_BUTTON)}},"submit-command")),p&&g.jsxs("form",{"data-component":"input-panel",id:e||y,onSubmit:b=>{b.preventDefault(),E()},children:[g.jsx("div",{style:{padding:"1em 0"},children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(p).map(b=>g.jsx(Oe,{...b,onChange:D=>S(b.id,D),onBlur:()=>w(b.id),onContextMenu:f,onClick:()=>{b.shape=="BTN"&&T(b.id,b.fun)},data:{...b.data,autocomplete:"off"}}))})}),j.length>0&&g.jsx(rt,{layout:{sections:[{id:"1",horizontal:!0,justify:"start",content:j.map(b=>({id:b.props.id}))}]},children:j})]})};exports.AppBar=Ds;exports.Autocomplete=Ct;exports.Button=Se;exports.ButtonList=Lr;exports.Checkbox=kr;exports.Combobox=Pr;exports.DashList=Cs;exports.DataTableComponent=Ks;exports.DatePicker=Ar;exports.Drawer=$s;exports.Field=qs;exports.Icon=oe;exports.InputPanel=Zs;exports.Password=Nr;exports.Textfield=we;exports.configurePaths=gn;
49
+ ${_?"smp-datepickercalendar-td-disabled":""}`},J=()=>`${T[f]} ${p.toString()}`;return g.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[g.jsx(Se,{onClick:j,ariaLabel:a(_t.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),g.jsx("div",{"aria-label":J(),className:z.label,children:J()}),g.jsx(Se,{onClick:M,ariaLabel:a(_t.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),g.jsxs("table",{ref:S,role:"grid","aria-label":`${a(Te.CALENDAR_FOR)} ${T[f]} ${p}`,className:z.table,children:[g.jsx("thead",{children:g.jsx("tr",{children:w.map(U=>g.jsx("th",{scope:"col",abbr:U.full,className:z.th,children:U.value},U.value))})}),g.jsx("tbody",{children:P.map((U,h)=>g.jsx("tr",{children:U.map((x,_)=>{const C=h*7+_;if(x===null)return g.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${_}`);const $=x.getDate()===o.getDate()&&x.getMonth()===o.getMonth()&&x.getFullYear()===o.getFullYear(),A=l&&x.getDate()===l.getDate()&&x.getMonth()===l.getMonth()&&x.getFullYear()===l.getFullYear(),W=d===x.getDate(),H=O(x);return g.jsx("td",{role:"gridcell","aria-selected":A,tabIndex:W?0:-1,onClick:()=>v(x),onKeyDown:B=>N(B,C),"aria-label":`${x.getDate()} ${T[x.getMonth()]} ${x.getFullYear()}`,"data-selected":A,"aria-disabled":H,ref:B=>{E.current[C]=B},className:z.td($,A,W,H),children:x.getDate()},`day-${_}`)})},`week-${h}`))})]})]})}const Nr=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const i=R.useRef(null),[o,l]=R.useState(!1),[c,f]=R.useState(r||""),[u,p]=R.useState(""),{anchorRef:m,targetRef:d}=ct({position:"bottom",enabled:o}),y=R.useCallback(()=>{var b;l(!1),(b=i==null?void 0:i.current)==null||b.focus()},[]);ft([d,m],o,()=>{y()}),Lt(o,d);const{format:S,getCurrentLanguage:E}=je(),T=R.useCallback(b=>{const D=b.length>5&&wn(b,E())||b,N=S(D,void 0,void 0,{type:"date"}),L=typeof D!="string",k=L&&D.toISOString().substring(0,10)||"";return{isValid:L,formattedDate:N,isoDate:k,normalizedDate:D}},[E,S]);R.useEffect(()=>{const{formattedDate:b,isoDate:D,isValid:N}=T(r);f(N&&D||r),p(N&&b||r)},[r,S,T]);const w=()=>l(b=>!b),O=()=>{j(u)},v=b=>{j(b),y()},j=b=>{const{isoDate:D,isValid:N}=T(b);t&&t(N&&D||b)},M=b=>{p(b)},I=b=>{b.key==="Enter"&&(b.preventDefault(),j(u))};return g.jsxs("div",{"data-component":"date-picker",children:[g.jsx(we,{...a,bindValue:u,placeholder:e,onBlur:O,onChange:M,onKeyDown:I,shapeIcon:"calendar",onShapeIconClick:w,ref:m,inputRef:i,isEditable:s,size:10,maxLength:a.maxLength?a.maxLength:10}),o&&g.jsx(ut,{children:g.jsx(hs,{disabledDateRanges:n,onDateChange:v,initialValue:jt(c)&&c||"",targetRef:d})})]})},ms=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:l,error:c,onOptionsRequest:f,onChange:u,onBlur:p})=>{const m=r.map(S=>S.bindValue),d=(S,E)=>{const T=[...r];if(S=="")T.pop();else{const w=T.findIndex(O=>O.bindValue===S&&O.optionalDisplayValue===E);w>=0?T.splice(w,1):T.push({bindValue:S,optionalDisplayValue:E})}u==null||u(T)},y={container:"smp-multipleAutocomplete-container"};return g.jsxs("div",{className:y.container,"data-component":"multiple-autocomplete",children:[i&&g.jsx(De,{label:i,disabled:o}),g.jsx(It,{elements:r,displayMode:e,isEditable:s,onChange:S=>{u==null||u(S)}}),g.jsx(Ct,{bindValue:"",fun:l,isEditable:s,onChange:d,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:m,error:c,onBlur:p})]})},Mr=({...r})=>{const[e,t]=R.useState(!1),n=e?"visibility-off":"visibility";return g.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},gs=({...r})=>{const[e,t]=R.useState(r.bindValue),{translate:n}=je(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return g.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(Te.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},ys=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?g.jsxs("div",{className:n.wrapper,children:[g.jsx(De,{label:t}),g.jsx(_e,{variant:"body",bindValue:e||r})]}):g.jsx(_e,{variant:"body",bindValue:e||r})};class Re{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Re(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Re({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Le=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),xr=r=>{const e=Re.fromDataObj(r.obj),t=r.decode?Re.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},bs=(r,e)=>{const t=new Re(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Re(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Le(r,t,n)},vs=({min:r,max:e,step:t=1,inputMode:n="decimal",dSep:s,bindValue:a,onChange:i,onEnter:o,...l})=>{const{getCurrentLanguage:c}=je(),f=R.useRef(null),u=c(),{groupingChar:p,decimalChar:m}=R.useMemo(()=>ss(u,s),[u,s]),d=R.useCallback((L,k)=>new Intl.NumberFormat(u,{minimumFractionDigits:k,maximumFractionDigits:k,useGrouping:!0}).format(L),[u]),y=R.useCallback(os,[p,m]),S=R.useCallback(ns,[r,e]),E=a!=null&&a.toString().includes(".")?a.toString().split(".")[1].length:0,[T,w]=R.useState(E),[O,v]=R.useState(a!=null?d(a,T):""),j=R.useRef(a??null);R.useEffect(()=>{if(a==null){v(""),j.current=null;return}const L=a.toString().includes(".")?a.toString().split(".")[1].length:0,k=L===0?T:L;k!==T&&w(k),v(d(a,k)),j.current=a},[a,d]);const M=R.useCallback((L,k=!1)=>{if(L.trim()===""){v(""),j.current=null,i==null||i(void 0,""),k&&(o==null||o(void 0));return}const Y=y(L,p,m);if(isNaN(Y))if(j.current!=null){const P=d(j.current,T);v(P)}else v("");else{const P=S(Y,r,e),V=is(L,p,m);w(V);const z=d(P,V);v(z),j.current=P,i==null||i(P,z),k&&(o==null||o(P))}},[y,p,m,S,r,e,d,i,o,T]),I=L=>v(L),b=()=>M(O),D=L=>{if(L.key==="Enter"){L.preventDefault(),M(O,!0);return}if(L.key==="ArrowUp"||L.key==="ArrowDown"){L.preventDefault();const k=L.key==="ArrowUp"?1:-1,Y=j.current??0,P=S(Y+k*t,r,e);M(d(P,T))}},N=L=>{if(!L.currentTarget.contains(document.activeElement))return;L.preventDefault();const k=L.deltaY<0?1:-1,Y=j.current??0,P=S(Y+k*t,r,e);M(d(P,T))};return g.jsx("div",{ref:f,"data-component":"input-number",onWheel:N,children:g.jsx(we,{...l,"aria-valuemin":r,"aria-valuemax":e,"aria-valuenow":j.current??void 0,bindValue:O,inputType:"text",inputMode:n,min:r,max:e,step:t,onChange:I,onBlur:b,onKeyDown:D})})};class We{constructor(e,t,n="."){de(this,"class");de(this,"value");de(this,"decimalSeparator");this.class=e,this.value=t,this.decimalSeparator=n}static fromDataObj(e,t){const n=t==="."?",":".";if(e.k=="")return new We(e,void 0,t);const s=e.k.replace(new RegExp(`\\${n}`,"g"),""),a=parseFloat(s.replace(t,"."));return new We(e,a,t)}getLegacyValue(){return this.value!=null?this.value.toString().replace(".",this.decimalSeparator):""}getValue(){return this.value}}const xs=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:l,helperText:c,error:f,onBlur:u,onKeyDown:p,rows:m=10,cols:d=150})=>{const y=R.useId(),S=`${y}-helper`,E=f?"danger":s,T=c||!!f,w=v=>{t==null||t(v.target.value)},O={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${E?`smp-textarea-${E}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return g.jsxs("div",{className:O.wrapper,"data-component":"textarea",children:[o&&g.jsx(De,{htmlFor:y,label:o,disabled:r}),g.jsx("textarea",{id:y,value:e,placeholder:n,onChange:w,onBlur:u,className:O.container,disabled:r,readOnly:!i,onKeyDown:p,"aria-label":o?void 0:l,"aria-labelledby":o?y:void 0,"aria-describedby":T?S:void 0,rows:m,cols:d}),T&&g.jsx(jr,{id:S,helperText:f,disabled:r,state:E})]})};var Rt=(r=>(r.PAGE_DIRECTION="pageDirection",r.LINE_DIRECTION="lineDirection",r))(Rt||{});const Fe={"smp-radio":"_smp-radio_1wj31_1","smp-radio-options-container":"_smp-radio-options-container_1wj31_10","smp-radio-horizontal":"_smp-radio-horizontal_1wj31_16","smp-radio-element":"_smp-radio-element_1wj31_20","smp-radio-disabled":"_smp-radio-disabled_1wj31_26"},Ss=({disabled:r=!1,displayMode:e="DescOnly",RadLay:t=Rt.PAGE_DIRECTION,options:n,onOptionsRequest:s,fun:a,label:i,...o})=>{const[l,c]=R.useState(n),f=R.useId();R.useEffect(()=>{!l&&s&&a&&s(a,void 0).then(y=>c(y)).catch(y=>{console.error("Error during loading options (radio)",y)})},[l,s,a]);const u={container:Fe["smp-radio"],optionsContainer:`${Fe["smp-radio-options-container"]} ${t==Rt.LINE_DIRECTION?Fe["smp-radio-horizontal"]:""}`,option:`${Fe["smp-radio-element"]} ${r?Fe["smp-radio-disabled"]:""}`},p=()=>{var y;r||(y=o.onBlur)==null||y.call(o)},m=y=>{var S;r||(S=o.onChange)==null||S.call(o,y.id,y.label)},d=R.useId();return g.jsxs("div",{"smp-id":"radio-container",className:u.container,id:f,children:[i&&g.jsx(De,{label:i,disabled:r,htmlFor:f}),g.jsx("div",{className:u.optionsContainer,children:l==null?void 0:l.map((y,S)=>g.jsxs("label",{className:u.option,children:[g.jsx("input",{type:"radio",name:d,value:y.id,disabled:r,checked:y.id===o.bindValue,onChange:()=>m(y),onBlur:p}),g.jsx(_e,{variant:"body",bindValue:Pe(y.id,y.label,e)})]},S))})]})},ws=({value:r,onChange:e,targetRef:t,isOpen:n})=>{const s=R.useRef(null);R.useEffect(()=>{n&&(s!=null&&s.current)&&s.current.focus()},[n,s]);const[a,i,o]=r,l=c=>Array.from({length:c},(f,u)=>g.jsx("option",{value:u,children:u.toString().padStart(2,"0")},u));return g.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[g.jsx("select",{value:a,ref:s,onChange:c=>e(+c.target.value,i,o),id:"time-picker-hours",children:l(24)}),":",g.jsx("select",{value:i,onChange:c=>e(a,+c.target.value,o),id:"time-picker-minutes",children:l(60)}),":",g.jsx("select",{value:o||0,onChange:c=>e(a,i,+c.target.value),id:"time-picker-seconds",children:l(60)})]})},Sr=r=>{const e=r.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);if(!e)return!1;const[,t,n,s]=e,a=parseInt(t,10),i=parseInt(n,10),o=s?parseInt(s,10):0;return a>=0&&a<=23&&i>=0&&i<=59&&(s===void 0||o>=0&&o<=59)},Es=r=>{const e=r.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},Ts=(r,e,t)=>{const n=r!=null&&!isNaN(r)?r.toString().padStart(2,"0"):"",s=e!=null&&!isNaN(e)?e.toString().padStart(2,"0"):"",a=t!=null&&!isNaN(t)?t.toString().padStart(2,"0"):"";return n&&s?`${n}:${s}:${a}`:s?`${s}:${a}`:a},Os=({bindValue:r,placeholder:e="HH:MM:SS",onChange:t,isEditable:n=!0,...s})=>{const a=R.useRef(null),[i,o]=R.useState(!1),[l,c]=R.useState(r||""),[f,u]=R.useState(""),{anchorRef:p,targetRef:m}=ct({position:"bottom",enabled:i}),d=R.useCallback(()=>{var v;o(!1),(v=a==null?void 0:a.current)==null||v.focus()},[]);ft([m,p],i,()=>o(!1)),Lt(i,m),R.useEffect(()=>{const v=r||"",j=Sr(v)?v:r||"";c(v),u(j)},[r]),R.useEffect(()=>{const v=j=>{j.key==="Escape"&&o(!1)};return i&&document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i]);const y=()=>{n&&o(v=>!v)},S=v=>{u(v)},E=(v,j,M)=>{const I=Ts(v,j,M);c(I),u(I),t==null||t(I),d()},T=()=>{O(f)},w=v=>{v.key==="Enter"&&(v.preventDefault(),O(f))},O=v=>{if(v.trim()===""){c(""),u(""),t==null||t("");return}Sr(v)?(c(v),u(v),t==null||t(v)):u(v)};return g.jsxs("div",{"data-component":"time-picker",children:[g.jsx($t,{...s,bindValue:f,placeholder:e,onChange:S,onBlur:T,onKeyDown:w,shapeIcon:"clock",onShapeIconClick:y,isEditable:n,ref:p,inputRef:a}),i&&g.jsx(ut,{children:g.jsx(ws,{value:Es(l),onChange:E,targetRef:m,isOpen:i})})]})};function _s(r){return typeof r=="string"&&/^\d{6}$/.test(r)}class lt{constructor(e,t){de(this,"class");de(this,"time");this.class=e,this.time=t}static fromDataObj(e){const t=wr.get(`${e.t}${e.p}`);if(t)return new lt(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=wr.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.time);throw new Error(`Time object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.time}}const wr=new Map([["I12",{legacyToIso(r){return _s(r)&&`${r.substring(0,2)}:${r.substring(2,4)}:${r.substring(4,6)}`||r},isoToLegacy(r){return r.replaceAll(":","")||r}}]]),Rs={"smp-cell-wrapper":"_smp-cell-wrapper_mdlkz_1"},Oe=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,tooltip:l,options:c,onChange:f,onClick:u,onEnter:p,onBlur:m,onOptionsRequest:d,onContextMenu:y,isEditable:S})=>{const E={obj:t,shape:e,decode:r,icon:s,fun:a},T={onBlur:m,onOptionsRequest:d,fun:a,icon:s,tooltip:l,label:o,isEditable:S,...n},w=(b,D,N)=>vn(t)?Le(b,new st(t,D).getLegacyValue()):xn(t)?Le(b,new lt(t,D).getLegacyValue()):Le(b,D,N),O=(b,D)=>Le(b,new We(t,D,".").getLegacyValue()),v=b=>Le(E,new nt(t,b).getLegacyValue()),j=b=>bs(E,b),M=()=>{switch(e){case te.AUTOCOMPLETE:{const b={...T,bindValue:t.k,optionalDisplayValue:r,onChange:(D,N)=>{f==null||f(w(E,D,N))}};return g.jsx(Ct,{...b})}case te.BUTTON:{const b={...T,bindValue:t.k,optionalDisplayValue:n!=null&&n.label&&typeof n.label=="string"?n.label:void 0,title:r,onClick:()=>{u==null||u(w(E,t.k))}};return g.jsx(Se,{...b})}case te.BUTTON_LIST:{const b={...T,options:c,onClick:(D,N)=>{const L={...E,fun:N};u==null||u(w(L,D))}};return g.jsx(kr,{...b})}case te.CHIP:{const b={...T,elements:xr(E)};return g.jsx(It,{...b})}case te.CHECKBOX:case te.SWITCH:{const b=e===te.SWITCH,D={...T,bindValue:nt.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:N=>{f==null||f(v(N))},...b&&{variant:"switch"}};return g.jsx(Pr,{...D})}case te.COMBOBOX:{const b={...T,bindValue:t.k,optionalDisplayValue:r,onChange:(D,N)=>{f==null||f(w(E,D,N))}};return g.jsx(Ar,{...b})}case te.DATE:{const b={...T,bindValue:st.fromDataObj(t).getValue(),onChange:D=>{f==null||f(w(E,D))}};return g.jsx(Nr,{...b})}case te.ICON:case te.IMAGE:{const b={...T,icon:s,placeholderIcon:i,isInteractable:!!T.fun,onClick:()=>{u==null||u(w(E,t.k))}};return g.jsx(oe,{...b})}case te.INPUT_NUMBER:{const b={...T,bindValue:We.fromDataObj(t,".").getValue(),onChange:D=>{f==null||f(O(E,D))}};return g.jsx(vs,{...b})}case te.MEMO:{const b={...T,bindValue:t.k,optionalDisplayValue:r,onChange:D=>{f==null||f(w(E,D))}};return g.jsx(xs,{...b})}case te.MULTI_AUTOCOMPLETE:{const b={...T,elements:xr(E),onChange:D=>{f==null||f(j(D))}};return g.jsx(ms,{...b})}case te.PASSWORD:{const b={...T,bindValue:t.k,onChange:D=>{f==null||f(w(E,D))}};return g.jsx(Mr,{...b})}case te.RADIO:{const b={...T,bindValue:t.k,onChange:(D,N)=>{f==null||f(w(E,D,N))}};return g.jsx(Ss,{...b})}case te.SPOTLIGHT:{const b={...T,bindValue:t.k,onEnter:D=>{p==null||p(w(E,D))}};return g.jsx(gs,{...b})}case te.TEXT_FIELD:{const b={...T,bindValue:t.k,optionalDisplayValue:r,onChange:D=>{f==null||f(w(E,D))}};return g.jsx(we,{...b})}case te.TIME:{const b={...T,bindValue:lt.fromDataObj(t).getValue(),onChange:D=>{f==null||f(w(E,D))}};return g.jsx(Os,{...b})}default:{const b={...T,bindValue:t.k,optionalDisplayValue:r};return g.jsx(ys,{...b})}}},I={wrapper:`${Rs["smp-cell-wrapper"]}`};return g.jsx("span",{className:I.wrapper,onContextMenu:b=>{y&&l&&(b.preventDefault(),y(E,b.currentTarget))},children:M()})},Ds=({data:r,onClick:e,onEnter:t,onContextMenu:n})=>{var o,l;const[s,a]=R.useState(),i=R.useCallback(c=>{var u,p;if(!((u=c.rows)!=null&&u.length)||!((p=c.columns)!=null&&p.length))return{};const f=c.rows[0];return c.columns.filter(m=>m.visible).reduce((m,d)=>{const y=f.cells[d.name],S={...y,id:d.name,onChange:E=>{a(T=>T&&{...T,[d.name]:{...T[d.name],obj:{...T[d.name].obj,k:E.obj.k}}})},onClick:()=>{y.fun&&e&&e({...y})},onEnter:E=>{t&&t(E)},onContextMenu:(E,T)=>{n&&n(E,T)}};return{...m,[d.name]:S}},{})},[e,t,n]);return R.useEffect(()=>{r&&a(i(r))},[r,i]),!((o=r==null?void 0:r.rows)!=null&&o.length)||!((l=r.columns)!=null&&l.length)?null:s&&g.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(s).map(c=>g.jsx(Oe,{...c}))})})},js=r=>{var e;return(e=r.children)!=null&&e.length?r.children.map(t=>{var n,s;return{id:((n=t.obj)==null?void 0:n.k)??"",label:t.decode??t.value??((s=t.obj)==null?void 0:s.k)??"",fun:t.fun,icon:t.icon}}):[]},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,$s=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:l,onContextMenu:c})=>{var O,v;const[f,u]=R.useState(),[p,m]=R.useState(t??!0),d=R.useRef(null),y=s.trim()?s:"100vh",S=R.useCallback(j=>{var I,b;if(!((I=j==null?void 0:j.rows)!=null&&I.length)||!((b=j==null?void 0:j.columns)!=null&&b.length))return{};const M=j.rows[0];return j.columns.filter(D=>D.visible??!0).reduce((D,N)=>{const L=M.cells[N.name];if(!L||!p&&ce(n)&&L.shape!==te.BUTTON&&L.shape!==te.BUTTON_LIST)return D;const k={...L,id:N.name,onChange:Y=>{u(P=>{const V={...P};return V!=null&&V[N.name]&&(V[N.name].obj.k=Y.obj.k),V})},onClick:Y=>{Y.fun&&a&&a(Y)},onEnter:Y=>{i&&i(Y)},onContextMenu:(Y,P)=>{c&&c(Y,P)}};return l&&L.shape==te.BUTTON_LIST&&(k.onOptionsRequest=(Y,P)=>l(Y,P).then(V=>js(V))),!p&&ce(n)&&(k.data={...k.data,showText:!1,justify:"center",squared:!0}),{...D,[N.name]:k}},{})},[p,n,a,i,l,c]),E=R.useCallback(()=>{o==null||o()},[o]),T=()=>{ce(n)?m(j=>!j):(m(!1),o==null||o())};if(R.useEffect(()=>{u(S(r))},[r]),R.useEffect(()=>{if(!d.current)return;if(!ce(n)){u(S(r));return}const j=getComputedStyle(d.current).getPropertyValue("--smp-drawer-slide-transition");let M=Number(j);j.endsWith("ms")?M=parseFloat(j):j.endsWith("s")&&(M=parseFloat(j)*1e3),setTimeout(()=>{u(S(r))},M/2)},[p,n]),R.useEffect(()=>{t!==void 0&&!ce(n)&&m(t)},[n,t]),!((O=r==null?void 0:r.rows)!=null&&O.length)||!((v=r.columns)!=null&&v.length))return null;const w={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${p?"smp-drawer-open":""} ${!ce(n)&&!p?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${p?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${p?"smp-drawer-backdrop-open":""}`};return f&&g.jsxs(g.Fragment,{children:[!ce(n)&&g.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:w.backdrop,onClick:E}),g.jsx("aside",{ref:d,className:w.drawer,style:{height:y},"aria-label":"Drawer","smp-id":"drawer",children:g.jsxs("div",{className:w.container,children:[g.jsxs("div",{className:w.containerHeader,children:[e&&g.jsx("div",{className:w.containerLogo,children:g.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),g.jsx("div",{className:w.containerIcon,children:g.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!p,isInteractable:!0,onClick:T,width:20,height:20})})]}),g.jsx("div",{className:w.containerLayout,children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(f).map(j=>g.jsx(Oe,{...j}))})})]})})]})},Cs=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:l,IconColName:c,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:p,UmColName:m,UmColor:d="var(--smp-dashList-color-base)",ForceValue:y,ValueColName:S,ValueColor:E="var(--smp-dashList-color-base)",SelectLayout:T="1",onClick:w})=>{const O="N/A",v=(e==null?void 0:e.columns)||[],j=(e==null?void 0:e.rows)||[],M=j.length>0,I="--smp-dashList-color",b="smp-layout",D="descr",N="icon",L="um",k="value",Y=i||"1em",P="18px",V="--smp-dashList-columns",z="--smp-dashList-fontSize",J={dash:(G="1")=>{const Z=h(G),re=Z,ne=x(Z,D),fe=x(Z,N),ve=x(Z,L),me=x(Z,k);return{container:re,descr:ne,icon:fe,um:ve,value:me}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
50
+ ${ce(o)?"smp-dash-list-horizontal":""}`},{format:U}=je(),h=G=>`${b}-${G}`,x=(G,Z)=>`${G}__${Z}`,_=G=>`${I}-${G}`,C=G=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(G)){const ne=G.match(Z)||[];if((ne==null?void 0:ne.length)>3)return"rgb("+ne[1]+","+ne[2]+","+ne[3]+")"}return G},$=G=>{if(!u)return G;const[Z,re]=A(u).map($e=>parseInt($e||"0")),ne="0,0"+(re?"."+"0".repeat(re):""),fe=U(G,ne,"it");if(!Z)return fe;const[ve,me]=fe.split(",");return ve+(me?`,${me}`:"")},A=G=>G.includes(";")?G.split(";"):[G],W=G=>{const Z=ne=>{var fe;if(ne)return(fe=G==null?void 0:G.cells[ne])==null?void 0:fe.obj.k},re=ne=>{var fe,ve;if(!(v.length<=ne))return(ve=(fe=G==null?void 0:G.cells[v[ne].name])==null?void 0:fe.obj)==null?void 0:ve.k};return{descr:t||Z(n)||re(2)||"",icon:l||Z(c)||re(3)||"",um:p||Z(m)||re(1)||"",value:y||Z(S)||re(0)||""}},H=G=>{w==null||w(G)},B=(G,Z)=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),G.stopPropagation(),H(Z))},K=(G=>{const Z=J.dash(G);return{className:Z,descr:re=>g.jsx("div",{className:Z.descr,children:re},`${G}-${D}`),icon:re=>g.jsx("div",{className:Z.icon,children:g.jsx(oe,{color:f,height:P,icon:re,width:P})},`${G}-${N}`),um:re=>g.jsx("div",{className:Z.um,children:re},`${G}-${L}`),value:re=>g.jsx("div",{className:Z.value,children:re},`${G}-${k}`)}})(T),se=G=>{const{descr:Z,icon:re,um:ne,value:fe}=W(G),ve={[_(D)]:C(s),[_(L)]:C(d),[_(k)]:C(E)},me=[],$e=$(fe);switch(T){case"2":re&&me.push(K.icon(re)),me.push(K.descr(Z)),me.push(K.value(ne?$e+" "+ne:$e));break;default:case"1":me.push(K.descr(Z)),me.push(K.value(ne?$e+" "+ne:$e))}return g.jsx("div",{className:K.className.container,role:"button",style:ve,tabIndex:0,onClick:()=>H(G),onKeyDown:Vr=>B(Vr,G),children:me},G.rowId)},F={[V]:String(r),[z]:Y};return g.jsx("div",{className:J.dashList,style:F,children:M?j.map(G=>se(G)):O})},Qe={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},Is="_rowContent_20wit_2",Ls="_clickable_20wit_21",ks="_indent_20wit_26",Ps="_toggle_20wit_32",As="_cell_20wit_38",Ns="_leftSection_20wit_46",Ee={rowContent:Is,clickable:Ls,indent:ks,toggle:Ps,cell:As,leftSection:Ns};function et(r){return!!r&&"children"in r}function Ms(r){return!et(r)}function Fs(r){const e=JSON.stringify(r,Object.keys(r).sort());let t=0,n,s;if(e.length===0)return t.toString();for(n=0;n<e.length;n++)s=e.charCodeAt(n),t=(t<<5)-t+s,t|=0;return Math.abs(t).toString()}const Fr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var T;const[a,i]=R.useState(!1),o=et(r)&&!!((T=r.children)!=null&&T.length),l=r.cells&&Object.keys(r.cells).length>0,c=o,f=t*20,u=()=>{o&&i(!a)},p={content:`${Ee.rowContent} ${o?Ee.clickable:""}`,toggle:`${Ee.toggle}`,indent:`${Ee.indent}`,cell:`${Ee.cell}`},m=w=>g.jsx(Oe,{...w}),d=()=>g.jsx("span",{className:p.toggle,children:c&&g.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),y=()=>g.jsx("span",{className:p.indent,style:{width:`${f}px`},"aria-hidden":"true"}),S=()=>{const w=Ms(r)?"":r.decode||(l?"":"Untitled"),O=s??n*t;return g.jsxs("tr",{className:p.content,onClick:u,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${O}px)`},children:[et(r)&&g.jsxs("td",{className:Ee.leftSection,style:{height:`${n}px`},children:[y(),d(),g.jsx("span",{className:Ee.rowLabel,children:w})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([v,j])=>g.jsx("td",{className:p.cell,style:{width:e[v],minWidth:e[v],height:`${n}px`},children:m({...j,id:v})},Fs(j)||v))]})},E=()=>{var w;return a||!o?null:g.jsx(g.Fragment,{children:et(r)&&((w=r.children)==null?void 0:w.map((O,v)=>g.jsx(Fr,{row:O,level:t+1},`child-${v}`)))})};return g.jsxs(g.Fragment,{children:[S(),E()]})},Vs=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return g.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:g.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[g.jsx(oe,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),g.jsx(_e,{variant:"title",bindValue:r})]})})};function Ys(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function Us(r,e){return r.map(t=>{const n=e.find(s=>s.column===t.bindValue);return{column:t.bindValue,visible:(n==null?void 0:n.visible)??!0}})}function Ws(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(u,p,m){if(p>=e.length){f(u);return}const d=e[p].column,y=o(u,d);for(const[S,E]of y){const T=[...m,S],w=l(T,p),O=n.has(w);s.push(c(S,w,p,O)),a+=t,O&&i(E,p+1,T)}}function o(u,p){var d;const m=new Map;for(const y of u){const S=((d=y.cells[p])==null?void 0:d.decode)??"N/D";m.has(S)||m.set(S,[]),m.get(S).push(y)}return m}function l(u,p){return`group-${u.join("-")}-${p}`}function c(u,p,m,d){return{isGroup:!0,value:u,cells:{},rowId:p,level:m,isExpanded:d}}function f(u){for(const p of u)s.push(p),a+=t}}const Bs=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return g.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[g.jsx("td",{children:g.jsx(oe,{icon:"groups"})}),g.jsx("td",{children:g.jsx(It,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},Hs=({columns:r,columnWidths:e})=>g.jsx("tfoot",{children:g.jsx("tr",{children:r.map(t=>t.visible&&g.jsx("td",{className:Qe["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),Gs=({columns:r,rows:e,containerRef:t,sizingMode:n})=>{const[s,a]=R.useState({});return R.useEffect(()=>{var i,o;if(!(!r||r.length===0)){if(n==="fixed"){const c=Object.fromEntries(r.map(f=>[f.name,120]));a(c)}else if(n==="fit-grid"){const l=((i=t.current)==null?void 0:i.offsetWidth)||800,c=r.filter(p=>p.visible!==!1),f=l/c.length,u=Object.fromEntries(c.map(p=>[p.name,f]));a(u)}else if(n==="fit-content"){const l={};for(const c of r){if(!c.visible)continue;const f=((o=c.title)==null?void 0:o.length)||0,u=Math.max(...e.map(p=>{var m,d,y,S;return`${((d=(m=p.cells)==null?void 0:m[c.name])==null?void 0:d.decode)||((S=(y=p.cells)==null?void 0:y[c.name])==null?void 0:S.value)||""}`.length}),f);l[c.name]=u*8+24}a(l)}}},[r,e,t,n]),[s,a]},Ks=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var M;const[i,o]=R.useState(r??{columns:[],rows:[]}),[l,c]=R.useState(n||[]),[f,u]=R.useState(new Set),p=R.useRef(null),[m,d]=Gs({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:p,sizingMode:s});R.useEffect(()=>{if(l!=null&&l.length&&r.rows){const{flatRows:I}=Ws(r.rows,l,e,f);o({...r,rows:I})}else o(r)},[r,l,f,e]);const y=I=>{c(Us(I,l))},S=I=>{I.preventDefault();const b=I.dataTransfer.getData("text/plain");if(!b||l.some(L=>L.column===b))return;const N=[...l,{column:b,visible:!0}];c(N)},E=I=>{I.preventDefault()},{virtualItems:T,containerProps:w,innerProps:O}=$r({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),v=(I,b)=>{const D=I.clientX,N=m[b],L=Y=>{const P=Y.clientX-D,V=Math.max(50,N+P);d(z=>({...z,[b]:V}))},k=()=>{window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",k)};window.addEventListener("mousemove",L),window.addEventListener("mouseup",k)},j={smpTable:`${Qe["smp-table"]}`,headerCell:`${Qe["smp-headerCell"]}`,resizer:`${Qe["smp-resizer"]}`};return i&&g.jsx("div",{className:j.smpTable,...w,ref:p,children:g.jsxs("table",{children:[g.jsxs("thead",{children:[(n||a)&&g.jsx(Bs,{groups:l,onChange:y,onDrop:S,onDragOver:E}),g.jsx("tr",{children:i.columns&&((M=i.columns)==null?void 0:M.map(I=>I.visible&&g.jsxs("th",{className:j.headerCell,draggable:!0,onDragStart:b=>{b.dataTransfer.setData("text/plain",I.name)},style:{width:m[I.name],minWidth:m[I.name],maxWidth:m[I.name]},children:[g.jsx(_e,{variant:"title",bindValue:I.title}),g.jsx("div",{className:j.resizer,onMouseDown:b=>v(b,I.name),role:"region"})]},I.name)))})]}),g.jsx("tbody",{...O,children:T.map(({item:I,index:b,offsetTop:D})=>{const N=I.rowId||I.value||`${I.isGroup?"group":"row"}-${b}`;return I.isGroup?g.jsx(Vs,{label:I.value||"",rowHeight:e,offsetTop:D,level:I.level,onClick:()=>{const L=I.rowId;L&&u(k=>Ys(k,L))},isExpanded:I.isExpanded},`group-${N}`):g.jsx(Fr,{row:I,columnWidths:m,rowHeight:e,offsetTop:D,isGroup:!1},`row-${N}`)})}),g.jsx(Hs,{columns:i.columns,columnWidths:m})]})})},qs=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:l,onOptionsRequest:c})=>{const[f,u]=R.useState();R.useEffect(()=>{u(()=>{if(!r)return;const y={...r};return e&&(y.shape=e),y.shape==null&&(y.shape=te.TEXT_FIELD),s&&(y.obj=Sn(s)),y})},[r,s,e]);const m={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},d=()=>{ce(t)||o==null||o(f)};if(f)return g.jsxs("div",{className:m.container,children:[g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:g.jsx(Oe,{...f,id:"FLD",onChange:u,onOptionsRequest:c,fun:r==null?void 0:r.fun,onBlur:d,label:a,labelPosition:i})}),ce(t)&&g.jsx(Se,{optionalDisplayValue:"Confirm",onClick:()=>l==null?void 0:l(f),bindValue:"Confirm"})]})},zs=r=>(r==null?void 0:r.type)==="SmeupDataTree",Js=r=>(r==null?void 0:r.type)==="SmeupDataTable",Xs=r=>zs(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Js(r)?r.rows.map(e=>{const t=e.cells||e.cells,[n,s]=Object.keys(t);return{id:t[n].obj.k,label:t[s].value||t[s].obj.k}}):[],Zs=({data:r,id:e,readOnly:t=!1,hiddenSubmitButton:n=!1,updateOnClick:s=!1,decimalSeparator:a=".",optionsHandler:i,onSubmit:o,onCheck:l,onCheckObj:c,onContextMenu:f,onButtonClick:u})=>{var M,I;const[p,m]=R.useState({}),{translate:d}=je(),y=R.useId();R.useEffect(()=>{m(O(r))},[r]);const S=(b,D)=>{m(N=>({...N,[b]:{...N[b],obj:{...N[b].obj,k:D.obj.k},decode:D.decode,data:{...N[b].data,error:void 0},value:D.obj.k}})),s&&(D.shape==te.CHECKBOX||D.shape==te.SWITCH)&&E()},E=b=>{const D=v();o({value:D,cell:b})},T=(b,D)=>{u==null||u({cellId:b,currentState:{type:"SmeupDataTable",columns:r.columns,rows:[{cells:p}]},fun:D||""})},w=async b=>{var D,N;if(p[b].obj.k!=r.rows[0].cells[b].obj.k&&((D=p[b].inputSettings)!=null&&D.checkObject&&c&&((await c({obj:p[b].obj,fun:p[b].fun,cellId:b})).valid||m(k=>({...k,[b]:{...k[b],data:{...k[b].data,error:d(Te.CHECK_OBJECT_WRONG_VALIDATION)}}}))),(N=p[b].inputSettings)!=null&&N.checkValueOnExit)){const L=v();l==null||l({value:L,cell:b})}},O=b=>{var N,L,k;if(!((N=b.rows)!=null&&N.length)||!((L=b.columns)!=null&&L.length))return{};const D=(k=b.rows)==null?void 0:k[0];return b.columns.filter(Y=>Y.visible??!0).reduce((Y,P)=>{const V={...D.cells[P.name],id:P.name,label:P.title,data:{...D.cells[P.name].data,dSep:a}};return V.fun&&(V.onOptionsRequest=async(z,J)=>Xs(await i(z,J,r,P.name))),V.isEditable==null&&(V.isEditable=!0),t&&(V.isEditable=!1),V.isEditable&&V.shape==null&&(V.shape=te.TEXT_FIELD),{...Y,[P.name]:V}},{})},v=()=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(p))}]}}),j=((I=(M=r.setup)==null?void 0:M.commands)==null?void 0:I.map((b,D)=>R.createElement(Oe,{...b,decode:b.value,data:{label:b.value},id:`command-${D}`,key:`command-${D}`,shape:te.BUTTON,onClick:()=>E(b.obj.k)})))||[];return n||j.unshift(g.jsx(Oe,{decode:d(Te.CONFIRM_BUTTON),shape:te.BUTTON,id:"",obj:{t:"",p:"",k:""},data:{submit:!0,label:d(Te.CONFIRM_BUTTON)}},"submit-command")),p&&g.jsxs("form",{"data-component":"input-panel",id:e||y,onSubmit:b=>{b.preventDefault(),E()},children:[g.jsx("div",{style:{padding:"1em 0"},children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(p).map(b=>g.jsx(Oe,{...b,onChange:D=>S(b.id,D),onBlur:()=>w(b.id),onContextMenu:f,onClick:()=>{b.shape=="BTN"&&T(b.id,b.fun)},data:{...b.data,autocomplete:"off"}}))})}),j.length>0&&g.jsx(rt,{layout:{sections:[{id:"1",horizontal:!0,justify:"start",content:j.map(b=>({id:b.props.id}))}]},children:j})]})};exports.AppBar=Ds;exports.Autocomplete=Ct;exports.Button=Se;exports.ButtonList=kr;exports.Checkbox=Pr;exports.Combobox=Ar;exports.DashList=Cs;exports.DataTableComponent=Ks;exports.DatePicker=Nr;exports.Drawer=$s;exports.Field=qs;exports.Icon=oe;exports.InputPanel=Zs;exports.Password=Mr;exports.TabBar=Dr;exports.Textfield=we;exports.configurePaths=yn;