@sme.up/ketchup2 2.0.0-SNAPSHOT-20250616143804 → 2.0.0-SNAPSHOT-20250616144705
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/input-panel/assets/data.d.ts +1 -0
- package/dist/components/input-panel/assets/data.d.ts.map +1 -1
- package/dist/components/input-panel/input-panel-types.d.ts +5 -0
- package/dist/components/input-panel/input-panel-types.d.ts.map +1 -1
- package/dist/components/input-panel/input-panel.d.ts.map +1 -1
- package/dist/functional-components/layout/layout-types.d.ts +1 -1
- package/dist/functional-components/layout/layout-types.d.ts.map +1 -1
- package/dist/functional-components/layout/layout.d.ts.map +1 -1
- package/dist/ketchup2.cjs.js +10 -10
- package/dist/ketchup2.es.js +1158 -1147
- package/package.json +1 -1
package/dist/ketchup2.cjs.js
CHANGED
|
@@ -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 Ot;function _r(){return Ot||(Ot=1,process.env.NODE_ENV!=="production"&&function(){function r(
|
|
17
|
+
*/var Ot;function _r(){return Ot||(Ot=1,process.env.NODE_ENV!=="production"&&function(){function r(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===A?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case g:return"Fragment";case S:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case N:return"SuspenseList";case j: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 m:return"Portal";case O:return(h.displayName||"Context")+".Provider";case E:return(h._context.displayName||"Context")+".Consumer";case w:var y=h.render;return h=h.displayName,h||(h=y.displayName||y.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case $:return y=h.displayName||null,y!==null?y:r(h.type)||"Memo";case U:y=h._payload,h=h._init;try{return r(h(y))}catch{}}return null}function e(h){return""+h}function t(h){try{e(h);var y=!1}catch{y=!0}if(y){y=console;var T=y.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return T.call(y,"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===g)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===U)return"<...>";try{var y=r(h);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var h=D.A;return h===null?null:h.getOwner()}function a(){return Error("react-stack-top-frame")}function i(h){if(k.call(h,"key")){var y=Object.getOwnPropertyDescriptor(h,"key").get;if(y&&y.isReactWarning)return!1}return h.key!==void 0}function o(h,y){function T(){K||(K=!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)",y))}T.isReactWarning=!0,Object.defineProperty(h,"key",{get:T,configurable:!0})}function f(){var h=r(this.type);return q[h]||(q[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,y,T,C,R,L,F,V){return T=L.ref,h={$$typeof:p,type:h,key:y,props:L,_owner:R},(T!==void 0?T:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:f}):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:F}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function u(h,y,T,C,R,L,F,V){var M=y.children;if(M!==void 0)if(C)if(W(M)){for(C=0;C<M.length;C++)l(M[C]);Object.freeze&&Object.freeze(M)}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 l(M);if(k.call(y,"key")){M=r(h);var J=Object.keys(y).filter(function(se){return se!=="key"});C=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",_[M+C]||(J=0<J.length?"{"+J.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,M,J,M),_[M+C]=!0)}if(M=null,T!==void 0&&(t(T),M=""+T),i(y)&&(t(y.key),M=""+y.key),"key"in y){T={};for(var G in y)G!=="key"&&(T[G]=y[G])}else T=y;return M&&o(T,typeof
|
|
22
|
+
<%s key={someKey} {...props} />`,C,M,J,M),_[M+C]=!0)}if(M=null,T!==void 0&&(t(T),M=""+T),i(y)&&(t(y.key),M=""+y.key),"key"in y){T={};for(var G in y)G!=="key"&&(T[G]=y[G])}else T=y;return M&&o(T,typeof h=="function"?h.displayName||h.name||"Unknown":h),c(h,M,L,R,s(),T,F,V)}function l(h){typeof h=="object"&&h!==null&&h.$$typeof===p&&h._store&&(h._store.validated=1)}var d=P,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),O=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),D=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=Object.prototype.hasOwnProperty,W=Array.isArray,B=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(h){return h()}};var K,q={},X=d["react-stack-bottom-frame"].bind(d,a)(),H=B(n(a)),_={};Ce.Fragment=g,Ce.jsx=function(h,y,T,C,R){var L=1e4>D.recentlyCreatedOwnerStacks++;return u(h,y,T,!1,C,R,L?Error("react-stack-top-frame"):X,L?B(n(h)):H)},Ce.jsxs=function(h,y,T,C,R){var L=1e4>D.recentlyCreatedOwnerStacks++;return u(h,y,T,!0,C,R,L?Error("react-stack-top-frame"):X,L?B(n(h)):H)}}()),Ce}var Rt;function kr(){return Rt||(Rt=1,process.env.NODE_ENV==="production"?Ie.exports=Lr():Ie.exports=_r()),Ie.exports}var v=kr();const ne={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",PASSWORD:"PWD"},Ir=r=>r.t=="D8",Nr=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 Be{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Be(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 Mr(r,e){if(gt(r)){const u=new Date(r);if(!isNaN(u.getTime()))return u}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,f=0,c="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),Ne(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),f=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(f)):a===0&&(t.setMonth(f-1),t.setDate(o)),Ne(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),f=parseInt(n.substring(2,4)),Number(n.substring(4))>50?c="19"+n.substring(4):c="20"+n.substring(4);let u=0,l=0;return i===0?(u=f,l=o-1,t.setFullYear(parseInt(c),l,u)):a===0&&(u=o,l=f-1,t.setFullYear(parseInt(c),l,u)),ft(o,l,parseInt(c))&&Ne(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),f=parseInt(n.substring(2,4)),c=n.substring(4);let u=0,l=0;return i===0?(u=f,l=o-1,t.setFullYear(parseInt(c),l,u)):a===0&&(u=o,l=f-1,t.setFullYear(parseInt(c),l,u)),ft(u,l,parseInt(c))&&Ne(t)?t:r}}return r}function gt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function Ne(r){return r instanceof Date&&!isNaN(r.getTime())}function Fr(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 ft(n,t-1,e)}function ft(r,e,t){const n=[31,Vr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Vr(r){return r%4===0&&(r%100!==0||r%400===0)}function Yr(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 Ge{constructor(e,t){ve(this,"class");ve(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=jt.get(`${e.t}${e.p}`);if(t)return new Ge(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=jt.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 jt=new Map([["D8*YYMD",{legacyToIso(r){return Fr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return gt(r)&&r.replaceAll("-","")||r}}]]),ze=(r,e)=>{P.useEffect(()=>{const t=n=>{typeof r=="object"&&r!==null&&"current"in r&&r.current&&!r.current.contains(n.target)&&e()};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[r,e])};function yt({position:r="bottom",enabled:e=!0}){const t=P.useRef(null),n=P.useRef(null),[s,a]=P.useState(0),i=P.useCallback(()=>{const o=t.current,f=n.current;if(!o||!f)return;const{top:c,left:u,width:l,height:d}=o.getBoundingClientRect();a(l);const p=f.offsetHeight,m=f.offsetWidth;if(m===0||p===0){requestAnimationFrame(i);return}let g=c+window.scrollY,x=u+window.scrollX;switch(r){case"top":g-=p;break;case"bottom":g+=d;break;case"left":x-=m;break;case"right":x+=l;break}requestAnimationFrame(()=>{f.style.transform=`translate(${x}px, ${g}px)`})},[r]);return P.useLayoutEffect(()=>{e&&t.current&&n.current&&i();const o=new MutationObserver(()=>{n.current&&i()});return n.current&&o.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),o.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const qe=(r,e,t)=>{if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},fr=({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 v.jsx("label",{className:s.container,id:n,children:r})},je=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return v.jsx("label",{className:n.container,htmlFor:t,children:r})};function Ur(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 Ke(){return Ke=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},Ke.apply(null,arguments)}function dt(r,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},dt(r,e)}function Wr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,dt(r,e)}function tt(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 Me={};/*!
|
|
23
23
|
* content-type
|
|
24
24
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
25
25
|
* MIT Licensed
|
|
26
|
-
*/var Dt;function Hr(){if(Dt)return Me;Dt=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-]+$/;Me.format=i,Me.parse=o;function i(
|
|
26
|
+
*/var Dt;function Hr(){if(Dt)return Me;Dt=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-]+$/;Me.format=i,Me.parse=o;function i(l){if(!l||typeof l!="object")throw new TypeError("argument obj is required");var d=l.parameters,p=l.type;if(!p||!a.test(p))throw new TypeError("invalid type");var m=p;if(d&&typeof d=="object")for(var g,x=Object.keys(d).sort(),S=0;S<x.length;S++){if(g=x[S],!t.test(g))throw new TypeError("invalid parameter name");m+="; "+g+"="+c(d[g])}return m}function o(l){if(!l)throw new TypeError("argument string is required");var d=typeof l=="object"?f(l):l;if(typeof d!="string")throw new TypeError("argument string is required to be a string");var p=d.indexOf(";"),m=p!==-1?d.slice(0,p).trim():d.trim();if(!a.test(m))throw new TypeError("invalid media type");var g=new u(m.toLowerCase());if(p!==-1){var x,S,E;for(r.lastIndex=p;S=r.exec(d);){if(S.index!==p)throw new TypeError("invalid parameter format");p+=S[0].length,x=S[1].toLowerCase(),E=S[2],E.charCodeAt(0)===34&&(E=E.slice(1,-1),E.indexOf("\\")!==-1&&(E=E.replace(n,"$1"))),g.parameters[x]=E}if(p!==d.length)throw new TypeError("invalid parameter format")}return g}function f(l){var d;if(typeof l.getHeader=="function"?d=l.getHeader("content-type"):typeof l.headers=="object"&&(d=l.headers&&l.headers["content-type"]),typeof d!="string")throw new TypeError("content-type header is missing from object");return d}function c(l){var d=String(l);if(t.test(d))return d;if(d.length>0&&!e.test(d))throw new TypeError("invalid parameter value");return'"'+d.replace(s,"\\$1")+'"'}function u(l){this.parameters=Object.create(null),this.type=l}return Me}var Br=Hr(),Oe=new Map,dr=function(e){return e.cloneNode(!0)},Ct=function(){return window.location.protocol==="file:"},pr=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=Br.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(Ct()?"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||Ct()&&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()},ye={},$t=function(e,t){ye[e]=ye[e]||[],ye[e].push(t)},Gr=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(ye[e])){var f=Oe.get(e),c=ye[e][i];f instanceof SVGSVGElement&&c(null,dr(f)),f instanceof Error&&c(f),i===ye[e].length-1&&delete ye[e]}},0)},n=0,s=ye[e].length;n<s;n++)t(n)},zr=function(e,t,n){if(Oe.has(e)){var s=Oe.get(e);if(s===void 0){$t(e,n);return}if(s instanceof SVGSVGElement){n(null,dr(s));return}}Oe.set(e,void 0),$t(e,n),pr(e,t,function(a,i){var o;a?Oe.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Oe.set(e,i.responseXML.documentElement),Gr(e)})},qr=function(e,t,n){pr(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)})},Kr=0,Jr=function(){return++Kr},he=[],Pt={},Xr="http://www.w3.org/2000/svg",rt="http://www.w3.org/1999/xlink",At=function(e,t,n,s,a,i,o){var f=e.getAttribute("data-src")||e.getAttribute("src");if(!f){o(new Error("Invalid data-src or src attribute"));return}if(he.indexOf(e)!==-1){he.splice(he.indexOf(e),1),e=null;return}he.push(e),e.setAttribute("src","");var c=s?zr:qr;c(f,a,function(u,l){if(!l){he.splice(he.indexOf(e),1),e=null,o(u);return}var d=e.getAttribute("id");d&&l.setAttribute("id",d);var p=e.getAttribute("title");p&&l.setAttribute("title",p);var m=e.getAttribute("width");m&&l.setAttribute("width",m);var g=e.getAttribute("height");g&&l.setAttribute("height",g);var x=Array.from(new Set(tt(tt(tt([],(l.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();l.setAttribute("class",x);var S=e.getAttribute("style");S&&l.setAttribute("style",S),l.setAttribute("data-src",f);var E=[].filter.call(e.attributes,function(H){return/^data-\w[\w-]*$/.test(H.name)});if(Array.prototype.forEach.call(E,function(H){H.name&&H.value&&l.setAttribute(H.name,H.value)}),n){var O={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"]},w,b,N,$,U;Object.keys(O).forEach(function(H){w=H,N=O[H],b=l.querySelectorAll(w+"[id]");for(var _=function(C,R){$=b[C].id,U=$+"-"+Jr();var L;Array.prototype.forEach.call(N,function(Y){L=l.querySelectorAll("["+Y+'*="'+$+'"]');for(var Z=0,te=L.length;Z<te;Z++){var re=L[Z].getAttribute(Y);re&&!re.match(new RegExp('url\\("?#'+$+'"?\\)'))||L[Z].setAttribute(Y,"url(#"+U+")")}});for(var F=l.querySelectorAll("[*|href]"),V=[],M=0,J=F.length;M<J;M++){var G=F[M].getAttributeNS(rt,"href");G&&G.toString()==="#"+b[C].id&&V.push(F[M])}for(var se=0,I=V.length;se<I;se++)V[se].setAttributeNS(rt,"href","#"+U);b[C].id=U},h=0,y=b.length;h<y;h++)_(h)})}l.removeAttribute("xmlns:a");for(var j=l.querySelectorAll("script"),A=[],D,k,W=0,B=j.length;W<B;W++)k=j[W].getAttribute("type"),(!k||k==="application/ecmascript"||k==="application/javascript"||k==="text/javascript")&&(D=j[W].innerText||j[W].textContent,D&&A.push(D),l.removeChild(j[W]));if(A.length>0&&(t==="always"||t==="once"&&!Pt[f])){for(var K=0,q=A.length;K<q;K++)new Function(A[K])(window);Pt[f]=!0}var X=l.querySelectorAll("style");if(Array.prototype.forEach.call(X,function(H){H.textContent+=""}),l.setAttribute("xmlns",Xr),l.setAttribute("xmlns:xlink",rt),i(l),!e.parentNode){he.splice(he.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(l,e),he.splice(he.indexOf(e),1),e=null,o(null,l)})},Zr=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,f=n.beforeEach,c=f===void 0?function(){}:f,u=n.cacheRequests,l=u===void 0?!0:u,d=n.evalScripts,p=d===void 0?"never":d,m=n.httpRequestWithCredentials,g=m===void 0?!1:m,x=n.renumerateIRIElements,S=x===void 0?!0:x;if(e&&"length"in e)for(var E=0,O=0,w=e.length;O<w;O++)At(e[O],p,S,l,g,c,function(b,N){o(b,N),e&&"length"in e&&e.length===++E&&a(E)});else e?At(e,p,S,l,g,c,function(b,N){o(b,N),a(1),e=null}):a(0)},Fe={exports:{}},Ve={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 Lt;function Qr(){if(Lt)return Q;Lt=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,
|
|
33
|
+
*/var Lt;function Qr(){if(Lt)return Q;Lt=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,f=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,u=r?Symbol.for("react.forward_ref"):60112,l=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,p=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function O(b){if(typeof b=="object"&&b!==null){var N=b.$$typeof;switch(N){case e:switch(b=b.type,b){case f:case c:case n:case a:case s:case l:return b;default:switch(b=b&&b.$$typeof,b){case o:case u:case m:case p:case i:return b;default:return N}}case t:return N}}}function w(b){return O(b)===c}return Q.AsyncMode=f,Q.ConcurrentMode=c,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=u,Q.Fragment=n,Q.Lazy=m,Q.Memo=p,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=l,Q.isAsyncMode=function(b){return w(b)||O(b)===f},Q.isConcurrentMode=w,Q.isContextConsumer=function(b){return O(b)===o},Q.isContextProvider=function(b){return O(b)===i},Q.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Q.isForwardRef=function(b){return O(b)===u},Q.isFragment=function(b){return O(b)===n},Q.isLazy=function(b){return O(b)===m},Q.isMemo=function(b){return O(b)===p},Q.isPortal=function(b){return O(b)===t},Q.isProfiler=function(b){return O(b)===a},Q.isStrictMode=function(b){return O(b)===s},Q.isSuspense=function(b){return O(b)===l},Q.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===c||b===a||b===s||b===l||b===d||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===p||b.$$typeof===i||b.$$typeof===o||b.$$typeof===u||b.$$typeof===x||b.$$typeof===S||b.$$typeof===E||b.$$typeof===g)},Q.typeOf=O,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 _t;function en(){return _t||(_t=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,
|
|
40
|
+
*/var _t;function en(){return _t||(_t=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,f=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,u=r?Symbol.for("react.forward_ref"):60112,l=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,p=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function O(I){return typeof I=="string"||typeof I=="function"||I===n||I===c||I===a||I===s||I===l||I===d||typeof I=="object"&&I!==null&&(I.$$typeof===m||I.$$typeof===p||I.$$typeof===i||I.$$typeof===o||I.$$typeof===u||I.$$typeof===x||I.$$typeof===S||I.$$typeof===E||I.$$typeof===g)}function w(I){if(typeof I=="object"&&I!==null){var Y=I.$$typeof;switch(Y){case e:var Z=I.type;switch(Z){case f:case c:case n:case a:case s:case l:return Z;default:var te=Z&&Z.$$typeof;switch(te){case o:case u:case m:case p:case i:return te;default:return Y}}case t:return Y}}}var b=f,N=c,$=o,U=i,j=e,A=u,D=n,k=m,W=p,B=t,K=a,q=s,X=l,H=!1;function _(I){return H||(H=!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(I)||w(I)===f}function h(I){return w(I)===c}function y(I){return w(I)===o}function T(I){return w(I)===i}function C(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function R(I){return w(I)===u}function L(I){return w(I)===n}function F(I){return w(I)===m}function V(I){return w(I)===p}function M(I){return w(I)===t}function J(I){return w(I)===a}function G(I){return w(I)===s}function se(I){return w(I)===l}ee.AsyncMode=b,ee.ConcurrentMode=N,ee.ContextConsumer=$,ee.ContextProvider=U,ee.Element=j,ee.ForwardRef=A,ee.Fragment=D,ee.Lazy=k,ee.Memo=W,ee.Portal=B,ee.Profiler=K,ee.StrictMode=q,ee.Suspense=X,ee.isAsyncMode=_,ee.isConcurrentMode=h,ee.isContextConsumer=y,ee.isContextProvider=T,ee.isElement=C,ee.isForwardRef=R,ee.isFragment=L,ee.isLazy=F,ee.isMemo=V,ee.isPortal=M,ee.isProfiler=J,ee.isStrictMode=G,ee.isSuspense=se,ee.isValidElementType=O,ee.typeOf=w}()),ee}var kt;function hr(){return kt||(kt=1,process.env.NODE_ENV==="production"?Ve.exports=Qr():Ve.exports=en()),Ve.exports}/*
|
|
41
41
|
object-assign
|
|
42
42
|
(c) Sindre Sorhus
|
|
43
43
|
@license MIT
|
|
44
|
-
*/var nt,It;function tn(){if(It)return nt;It=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
|
|
45
|
-
Valid keys: `+JSON.stringify(Object.keys(p),null," "));var I=se(V,G,O,L,F+"."+G,t);if(I)return I}return null}return x(y)}function B(p){switch(typeof p){case"number":case"string":case"undefined":return!0;case"boolean":return!p;case"object":if(Array.isArray(p))return p.every(B);if(p===null||o(p))return!0;var y=f(p);if(y){var T=y.call(p),C;if(y!==p.entries){for(;!(C=T.next()).done;)if(!B(C.value))return!1}else for(;!(C=T.next()).done;){var O=C.value;if(O&&!B(O[1]))return!1}}else return!1;return!0;default:return!1}}function K(p,y){return p==="symbol"?!0:y?y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&y instanceof Symbol:!1}function z(p){var y=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":K(y,p)?"symbol":y}function X(p){if(typeof p>"u"||p===null)return""+p;var y=z(p);if(y==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return y}function H(p){var y=X(p);switch(y){case"array":case"object":return"an "+y;case"boolean":case"date":case"regexp":return"a "+y;default:return y}}function _(p){return!p.constructor||!p.constructor.name?d:p.constructor.name}return h.checkPropTypes=s,h.resetWarningCache=s.resetWarningCache,h.PropTypes=h,h},ot}var lt,Yt;function sn(){if(Yt)return lt;Yt=1;var r=vt();function e(){}function t(){}return t.resetWarningCache=e,lt=function(){function n(i,o,c,l,u,f){if(f!==r){var d=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 d.name="Invariant Violation",d}}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},lt}var Ut;function an(){if(Ut)return Fe.exports;if(Ut=1,process.env.NODE_ENV!=="production"){var r=hr(),e=!0;Fe.exports=nn()(r.isElement,e)}else Fe.exports=sn()();return Fe.exports}var ie=an(),on=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},ln=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},cn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ye="http://www.w3.org/2000/svg",Wt="http://www.w3.org/1999/xlink",Re=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}Wr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof on(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,c=a.httpRequestWithCredentials,l=a.renumerateIRIElements,u=a.src,f=a.title,d=a.useRequestCache,h=this.props.onError,m=this.props.beforeInjection,g=this.props.afterInjection,x=this.props.wrapper,w,E;x==="svg"?(w=document.createElementNS(Ye,x),w.setAttribute("xmlns",Ye),w.setAttribute("xmlns:xlink",Wt),E=document.createElementNS(Ye,x)):(w=document.createElement(x),E=document.createElement(x)),w.appendChild(E),E.dataset.src=u,this.nonReactWrapper=this.reactWrapper.appendChild(w);var R=function($){if(s.removeSVG(),!s._isMounted){h($);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){h($)})},S=function($,U){if($){R($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{g(U)}catch(j){R(j)}})},b=function($){if($.setAttribute("role","img"),i){var U=$.querySelector(":scope > desc");U&&$.removeChild(U);var j=document.createElement("desc");j.innerHTML=i,$.prepend(j)}if(f){var A=$.querySelector(":scope > title");A&&$.removeChild(A);var D=document.createElement("title");D.innerHTML=f,$.prepend(D)}try{m($)}catch(k){R(k)}};Zr(E,{afterEach:S,beforeEach:b,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:c,renumerateIRIElements:l})}},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;ln(Ke({},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,c=Ur(s,cn),l=o;return ke.createElement(l,Ke({},c,{ref:this.refCallback},o==="svg"?{xmlns:Ye,xmlnsXlink:Wt}:{}),this.state.isLoading&&i&&ke.createElement(i,null),this.state.hasError&&a&&ke.createElement(a,null))},e}(ke.Component);Re.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Re.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 pt={assets:"/"};const un=r=>{pt={...pt,...r}},Ht=r=>`${pt.assets}/${r}`.replace(/\/+/g,"/"),le=P.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:c,isInteractable:l=!1,spin:u=!1,title:f})=>{const[d,h]=P.useState(r),m=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),g=m&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),x=Ht(`assets/svg/${r}.svg`),w=Ht(`assets/svg/${n}.svg`),E={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${u?"smp-icon-spin":""}`},R=()=>{!a&&l&&c&&c()};return v.jsx(v.Fragment,{children:g?v.jsx(Re,{src:r,fallback:()=>v.jsx(Re,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:f,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:R}):m?v.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:f,onError:()=>h(w),onClick:R,className:E.img,title:f,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&R()}}):v.jsx(Re,{src:x,fallback:()=>v.jsx(Re,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:f,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:R})})}),we=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:c,state:l,variant:u,rotatedShapeIcon:f=!1,onShapeIconClick:d,ref:h,inputRef:m,onKeyDown:g,inputType:x="text",ariaLabel:w="input field",label:E,helperText:R=!1,error:S,appearance:b="base",fullWidth:N=!1,_dataComponent:$="textfield",width:U})=>{const j=P.useId(),A=`${j}-helper`,D=S?"danger":l,k=S||l=="danger"?"error":o,W=R||!!S,B=X=>{s==null||s(X.target.value)},K={wrapper:`smp-textfield-wrapper ${N?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${a?"smp-textfield-placeholder":""} ${c?`smp-textfield-${c}`:""} ${D?`smp-textfield-${D}`:""} ${b?`smp-textfield-${b}`:""} ${i?"":"smp-textfield-readOnly"}`,input:"smp-textfield-input "};u&&(u!="notSelectable"||i)&&(K.container+=`smp-textfield-variant-${u}`);const z=U?{"--smp-textField-width-base":U}:void 0;return v.jsxs("div",{className:K.wrapper,"data-component":$,children:[E&&v.jsx(je,{label:E,disabled:r,htmlFor:j}),v.jsxs("div",{className:K.container,ref:h,style:z,children:[t&&v.jsx(le,{icon:t,disabled:r}),v.jsx("input",{id:j,type:x,value:e,placeholder:a,onChange:B,onBlur:n,className:K.input,disabled:r,readOnly:!i,onKeyDown:g,"aria-label":w,ref:m,"aria-describedby":W?A:void 0}),k&&v.jsx(le,{icon:k,disabled:r,state:D,onClick:d,rotated:f,isInteractable:i})]}),W&&v.jsx(fr,{helperText:S,disabled:r,state:D,id:A})]})};function gr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=P.useState(0),i=P.useRef(null),o=r.length*e,c=Math.max(0,Math.floor(s/e)-n),l=Math.min(r.length-1,Math.floor((s+t)/e)+n),u=[];for(let h=c;h<=l;h++)u.push({item:r[h],index:h,offsetTop:h*e});const f=P.useCallback(h=>{const m=h.target.scrollTop;a(m)},[]),d=h=>{if(!i.current)return;const m=h*e,g=m+e,x=i.current,w=x.scrollTop,E=w+t;m<w?x.scrollTop=m:g>E&&(x.scrollTop=g-t)};return{virtualItems:u,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:f},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:c,endIndex:l},scrollToIndex:d}}const fn=10,yr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:c,onKeyDown:l})=>{var A;const[u,f]=P.useState(""),d=24,[h,m]=P.useState(a!==null?a:-1),g=s!==void 0?s:e.length>fn,x=u?e.filter(D=>D.label.toLowerCase().includes(u.toLowerCase())):e,w=D=>{f(D)},{virtualItems:E,containerProps:R,innerProps:S,scrollToIndex:b}=gr({items:x,itemHeight:d,containerHeight:200,overscan:5});P.useEffect(()=>{a!==null&&a!==h&&m(a)},[a]),P.useEffect(()=>{h>=0&&h<x.length&&b(h)},[h,x]);const N=D=>{if(D.key==="ArrowDown"||D.key==="ArrowUp"){D.preventDefault();let k=h;D.key==="ArrowDown"?k=h<x.length-1?h+1:0:D.key==="ArrowUp"&&(k=h>0?h-1:x.length-1),m(k)}else D.key==="Enter"?h>=0&&h<x.length&&(c==null||c(x[h])):D.key==="Escape"&&(D.preventDefault(),D.stopPropagation());l&&l(D)},$=D=>{N(D)},U=D=>{N(D)},j={wrapper:"smp-list",container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return v.jsxs("div",{id:r,ref:n,className:j.wrapper,"data-component":"list",style:{width:o},children:[g&&v.jsx(we,{bindValue:u,placeholder:"Search...",onChange:w,onKeyDown:$}),v.jsx("div",{...R,className:j.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:U,"aria-activedescendant":h>=0&&h<x.length?(A=x[h])==null?void 0:A.id:void 0,children:v.jsx("div",{...S,className:j.virtualScroll,children:E.map(({item:D,index:k,offsetTop:W})=>{const B=i.includes(D.id);return v.jsxs("li",{role:"option",id:D.id,"aria-selected":h===k?"true":"false",tabIndex:-1,className:`${j.listItem} ${h===k?"selected-item":""}`,"aria-label":D.id+"-"+D.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${W}px)`},onClick:()=>{c==null||c(D),m(k)},children:[ze(D.id,D.label,t),B&&v.jsx(le,{icon:"check",width:16})]},D.id)})})})]})},vr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=P.useState(ze(e,t,r));return P.useEffect(()=>{a(e)},[e]),P.useEffect(()=>{a(ze(e,t,r))},[t,r]),v.jsx(we,{...n,bindValue:s})},dn=r=>{const e=P.useRef(null);return P.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}},bt=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,placeholder:o,fun:c,_changeOnEnter:l=!1,onChange:u,onOptionsRequest:f,_multiActiveIndex:d,...h})=>{const[m,g]=P.useState(r),[x,w]=P.useState(e),[E,R]=P.useState(!1),[S,b]=P.useState(t||[]),[N,$]=P.useState(0),[U,j]=P.useState([r]),{anchorRef:A,targetRef:D,anchorWidth:k}=yt({position:"bottom",enabled:E});qe(D,()=>R(!1));const W=dn(400),B=H=>{H.length>=a?c&&f&&W(async()=>{const _=await f(c,H);b(_),$(_.length>0?0:-1),R(!0)}):R(!1),g(H),w(e),l||u==null||u(H,e)},K=H=>{l?(g(""),w("")):(g(H.id),w(H.label)),u==null||u(H.id,H.label);const _=S.findIndex(p=>p.id===H.id);$(_),j([H.id]),R(!1)},z=H=>{H.key==="Escape"&&(R(!1),$(-1))},X=H=>{if((H.key==="ArrowDown"||H.key==="ArrowUp")&&(H.preventDefault(),E)){const _=H.key==="ArrowDown"?(N+1)%S.length:(N-1+S.length)%S.length;$(_)}switch(H.key){case"Enter":N>=0&&N<S.length?K(S[N]):l&&(u==null||u(m,""),R(!1),g(""),w(""));break;case"Escape":R(!1),$(-1);break}};return v.jsxs("div",{"data-component":"autocomplete",children:[v.jsx(vr,{...h,bindValue:m,optionalDisplayValue:x,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:A,onChange:B,onKeyDown:X,"aria-autocomplete":"list"}),E&&v.jsx(yr,{options:S,displayMode:s,onClick:K,ref:D,selectedIndex:N,activeIndex:d||U,width:k,showFilter:!1,onKeyDown:z})]})},Bt=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Gt=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],xe=({label:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:c=!0,showText:l=!0,fullWidth:u=!1,loading:f=!1,justify:d="center",title:h,optionalDisplayValue:m})=>{const g={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${u?"smp-button-fullWidth":""} smp-justifyContent-${d}`};return v.jsx("button",{"data-component":"button",className:g.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":f,title:h||r||m,children:f?v.jsx(le,{icon:"spinner",state:Gt(i),spin:!0}):v.jsxs(v.Fragment,{children:[n&&c&&v.jsx(le,{icon:n,disabled:s,state:Gt(i),width:Bt(a),height:Bt(a)}),l&&m&&v.jsx("span",{children:m})]})})},br=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:u,justify:f,onClick:d,onOptionsRequest:h})=>{const[m,g]=P.useState(r);P.useEffect(()=>{!m&&h&&e&&h(e,void 0).then(E=>g(E)).catch(E=>{console.error("Errore nel caricamento delle opzioni per ButtonList",E)})},[m,e,h]);const x={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=m==null?void 0:m.map((E,R)=>{const S={bindValue:E.id,optionalDisplayValue:E.label,fun:E.fun,icon:E.icon,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:u,sizing:s,justify:f,onClick:()=>{d==null||d(E.id,E.fun)}};return v.jsx(xe,{...S},`button-${R}`)});return v.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:w})},xr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i})=>{const o=l=>{s&&a&&a(l.target.checked)},c={wrapper:"smp-checkbox-wrapper"};return v.jsxs("div",{className:c.wrapper,"data-component":e,children:[n&&v.jsx(je,{label:n,disabled:t}),v.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:o,onBlur:i})]})},pn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ae=({variant:r="body",bindValue:e,color:t,...n})=>{const s=pn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return v.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},xt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,c]=P.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},u=h=>{n==null||n(r.filter((m,g)=>g!==h))},f=h=>{c(h)},d=h=>{if(o===null||o===h)return;const m=[...r],[g]=m.splice(o,1);m.splice(h,0,g),n==null||n(m),c(null)};return v.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((h,m)=>{const g=ze(h.bindValue,h.optionalDisplayValue,t),x=v.jsxs("div",{className:l.element,role:"listitem",draggable:i,onDragStart:()=>f(m),onDragOver:E=>i&&E.preventDefault(),onDrop:()=>i&&d(m),style:{"--smp-chips-backgroundColor-base":a},children:[i&&v.jsx(le,{icon:"drag_indicator_horizontal",isInteractable:!0}),v.jsx(Ae,{variant:"label",bindValue:g,color:s}),e&&v.jsx(le,{icon:"close",isInteractable:!0,onClick:()=>u(m),color:s})]},`chip-${m}`),w=i&&m<r.length-1?v.jsx(le,{icon:"chevron-right",color:s},`separator-${m}`):null;return[x,w].filter(Boolean)})})};function Sr(r,e){const t=P.useRef(null);P.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(l=>!l.hasAttribute("disabled")&&l.offsetParent!==null):[];(()=>{const l=s();l.length>0&&requestAnimationFrame(()=>l[0].focus())})();const i=l=>{if(l.key==="Escape"||l.key!=="Tab")return;const u=s();if(u.length===0)return;const f=u[0],d=u[u.length-1];l.shiftKey&&document.activeElement===f?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),f.focus())},o=l=>{if(n&&!n.contains(l.target)){l.preventDefault();const u=s();u.length>0&&u[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=c,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const wr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:c,multiActiveIndex:l,...u})=>{const[f,d]=P.useState(!1),[h,m]=P.useState(t),[g,x]=P.useState(-1),[w,E]=P.useState([r]),R=P.useId(),{anchorRef:S,targetRef:b,anchorWidth:N}=yt({position:"bottom",enabled:f});qe(b,()=>d(!1)),Sr(f,b);const $=D=>{e==null||e(D.id,D.label);const k=h.findIndex(W=>W.id===D.id);x(k),E([D.id]),d(!1)},U=D=>{D.key==="Escape"&&(d(!1),x(-1))},j=D=>{(D.key==="ArrowDown"||D.key==="ArrowUp")&&(D.preventDefault(),A())},A=()=>{o&&c&&c(o,void 0).then(D=>{m(D),x(D.length>0?0:-1),d(!0)})};return v.jsxs("div",{role:"combobox","aria-expanded":f,"aria-controls":R,"aria-owns":R,"data-component":"combobox",children:[v.jsx(vr,{...u,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:A,onKeyDown:j,shapeIcon:"arrow_drop_down",rotatedShapeIcon:f,isEditable:s,ref:S,"aria-autocomplete":"list",variant:"notSelectable"}),f&&v.jsx(yr,{id:R,options:h,displayMode:i,ref:b,selectedIndex:g,activeIndex:l||w,width:N,onClick:$,onKeyDown:U})]})},q=r=>typeof r=="string",$e=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},qt=r=>r==null?"":""+r,hn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},mn=/###/g,zt=r=>r&&r.indexOf("###")>-1?r.replace(mn,"."):r,Kt=r=>!r||q(r),Pe=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(Kt(r))return{};const a=zt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return Kt(r)?{}:{obj:r,k:zt(n[s])}},Jt=(r,e,t)=>{const{obj:n,k:s}=Pe(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=Pe(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Pe(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},gn=(r,e,t,n)=>{const{obj:s,k:a}=Pe(r,e,Object);s[a]=s[a]||[],s[a].push(t)},Je=(r,e)=>{const{obj:t,k:n}=Pe(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},yn=(r,e,t)=>{const n=Je(r,t);return n!==void 0?n:Je(e,t)},Er=(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]):Er(r[n],e[n],t):r[n]=e[n]);return r},Te=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const bn=r=>q(r)?r.replace(/[&<>"'\/]/g,e=>vn[e]):r;class xn{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 Sn=[" ",",","?","!",";"],wn=new xn(20),En=(r,e,t)=>{e=e||"",t=t||"";const n=Sn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=wn.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},ht=(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 c=a;c<n.length;++c)if(c!==a&&(o+=t),o+=n[c],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&c<n.length-1)continue;a+=c-a+1;break}s=i}return s},Le=r=>r==null?void 0:r.replace("_","-"),Tn={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 Xe{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Tn,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 Xe(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Xe(this.logger,e)}}var me=new Xe;class Qe{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 Xt extends Qe{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 l,u;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 c=Je(this.data,o);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),c||!i||!q(n)?c:ht((u=(l=this.data)==null?void 0:l[e])==null?void 0:u[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),Jt(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 c=Je(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Er(c,n,a):c={...c,...n},Jt(this.data,o,c),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 Tr={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 Zt={},Qt=r=>!q(r)&&typeof r!="boolean"&&typeof r!="number";class Ze extends Qe{constructor(e,t={}){super(),hn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=me.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&&!En(e,n,s);if(i&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:q(a)?[a]:a};const l=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),e=l.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:c}=this.extractFromKey(e[e.length-1],s),l=c[c.length-1];let u=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const f=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return d?a?{res:`${l}${u}${o}`,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${u}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const h=this.resolve(e,s);let m=h==null?void 0:h.res;const g=(h==null?void 0:h.usedKey)||o,x=(h==null?void 0:h.exactUsedKey)||o,w=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,S=s.count!==void 0&&!q(s.count),b=Ze.hasDefaultValue(s),N=S?this.pluralResolver.getSuffix(f,s.count,s):"",$=s.ordinal&&S?this.pluralResolver.getSuffix(f,s.count,{ordinal:!1}):"",U=S&&!s.ordinal&&s.count===0,j=U&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${N}`]||s[`defaultValue${$}`]||s.defaultValue;let A=m;R&&!m&&b&&(A=j);const D=Qt(A),k=Object.prototype.toString.apply(A);if(R&&A&&D&&w.indexOf(k)<0&&!(q(E)&&Array.isArray(A))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,A,{...s,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(h.res=W,h.usedParams=this.getUsedParamsDetails(s),h):W}if(i){const W=Array.isArray(A),B=W?[]:{},K=W?x:g;for(const z in A)if(Object.prototype.hasOwnProperty.call(A,z)){const X=`${K}${i}${z}`;b&&!m?B[z]=this.translate(X,{...s,defaultValue:Qt(j)?j[z]:void 0,joinArrays:!1,ns:c}):B[z]=this.translate(X,{...s,joinArrays:!1,ns:c}),B[z]===X&&(B[z]=A[z])}m=B}}else if(R&&q(E)&&Array.isArray(m))m=m.join(E),m&&(m=this.extendTranslation(m,e,s,n));else{let W=!1,B=!1;!this.isValidLookup(m)&&b&&(W=!0,m=j),this.isValidLookup(m)||(B=!0,m=o);const z=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:m,X=b&&j!==m&&this.options.updateMissing;if(B||W||X){if(this.logger.log(X?"updateKey":"missingKey",f,l,o,X?j:m),i){const y=this.resolve(o,{...s,keySeparator:!1});y&&y.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 H=[];const _=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&_&&_[0])for(let y=0;y<_.length;y++)H.push(_[y]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(s.lng||this.language):H.push(s.lng||this.language);const p=(y,T,C)=>{var L;const O=b&&C!==m?C:z;this.options.missingKeyHandler?this.options.missingKeyHandler(y,l,T,O,X,s):(L=this.backendConnector)!=null&&L.saveMissing&&this.backendConnector.saveMissing(y,l,T,O,X,s),this.emit("missingKey",y,l,T,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?H.forEach(y=>{const T=this.pluralResolver.getSuffixes(y,s);U&&s[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach(C=>{p([y],o+C,s[`defaultValue${C}`]||j)})}):p(H,o,j))}m=this.extendTranslation(m,e,s,h,n),B&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${o}`),(B||W)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${o}`:o,W?m:void 0,s))}return a?(h.res=m,h.usedParams=this.getUsedParamsDetails(s),h):m}extendTranslation(e,t,n,s,a){var c,l;if((c=this.i18nFormat)!=null&&c.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 u=q(e)&&(((l=n==null?void 0:n.interpolation)==null?void 0:l.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const h=e.match(this.interpolator.nestingRegexp);f=h&&h.length}let d=n.replace&&!q(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),u){const h=e.match(this.interpolator.nestingRegexp),m=h&&h.length;f<m&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...h)=>(a==null?void 0:a[0])===h[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${t[0]}`),null):this.translate(...h,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=Tr.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(c=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(c,t),u=l.key;s=u;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const d=t.count!==void 0&&!q(t.count),h=d&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(x=>{var w,E;this.isValidLookup(n)||(o=x,!Zt[`${g[0]}-${x}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(Zt[`${g[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${g.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!!!")),g.forEach(R=>{var N;if(this.isValidLookup(n))return;i=R;const S=[u];if((N=this.i18nFormat)!=null&&N.addLookupKeys)this.i18nFormat.addLookupKeys(S,u,R,x,t);else{let $;d&&($=this.pluralResolver.getSuffix(R,t.count,t));const U=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(S.push(u+$),t.ordinal&&$.indexOf(j)===0&&S.push(u+$.replace(j,this.options.pluralSeparator)),h&&S.push(u+U)),m){const A=`${u}${this.options.contextSeparator}${t.context}`;S.push(A),d&&(S.push(A+$),t.ordinal&&$.indexOf(j)===0&&S.push(A+$.replace(j,this.options.pluralSeparator)),h&&S.push(A+U))}}let b;for(;b=S.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(R,x,b,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 er{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=me.create("languageUtils")}getScriptPartFromCode(e){if(e=Le(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=Le(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 tr={zero:0,one:1,two:2,few:3,many:4,other:5},rr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class On{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=me.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Le(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!"),rr;if(!e.match(/-|_/))return rr;const c=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(c,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)=>tr[s]-tr[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 nr=(r,e,t,n=".",s=!0)=>{let a=yn(r,e,t);return!a&&s&&q(t)&&(a=ht(r,t,n),a===void 0&&(a=ht(e,t,n))),a},ct=r=>r.replace(/\$/g,"$$$$");class Rn{constructor(e={}){var t;this.logger=me.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:c,formatSeparator:l,unescapeSuffix:u,unescapePrefix:f,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:g,nestingOptionsSeparator:x,maxReplaces:w,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:bn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Te(a):i||"{{",this.suffix=o?Te(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?Te(d):h||Te("$t("),this.nestingSuffix=m?Te(m):g||Te(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=w||1e3,this.alwaysFormat=E!==void 0?E:!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 h;let a,i,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=m=>{if(m.indexOf(this.formatSeparator)<0){const E=nr(t,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...s,...t,interpolationkey:m}):E}const g=m.split(this.formatSeparator),x=g.shift().trim(),w=g.join(this.formatSeparator).trim();return this.format(nr(t,c,x,this.options.keySeparator,this.options.ignoreJSONStructure),w,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const u=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((h=s==null?void 0:s.interpolation)==null?void 0:h.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>ct(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?ct(this.escape(m)):ct(m)}].forEach(m=>{for(o=0;a=m.regex.exec(e);){const g=a[1].trim();if(i=l(g),i===void 0)if(typeof u=="function"){const w=u(e,a,s);i=q(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))i="";else if(f){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=qt(i));const x=m.safeValue(i);if(e=e.replace(a[0],x),f?(m.regex.lastIndex+=i.length,m.regex.lastIndex-=a[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(c,l)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const f=c.split(new RegExp(`${u}[ ]*{`));let d=`{${f[1]}`;c=f[0],d=this.interpolate(d,i);const h=d.match(/'/g),m=d.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!m||m.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),l&&(i={...l,...i})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,g),`${c}${u}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];i={...n},i=i.replace&&!q(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const u=s[1].split(this.formatSeparator).map(f=>f.trim());s[1]=u.shift(),c=u,l=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=qt(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),l&&(a=c.reduce((u,f)=>this.format(u,f,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const jn=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,...c]=i.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),u=o.trim();t[u]||(t[u]=l),l==="false"&&(t[u]=!1),l==="true"&&(t[u]=!0),isNaN(l)||(t[u]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},sr=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(Le(n),s),e[i]=o),o(t)}},Dn=r=>(e,t,n)=>r(Le(t),n)(e);class Cn{constructor(e={}){this.logger=me.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?sr:Dn;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()]=sr(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(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,c)=>{var f;const{formatName:l,formatOptions:u}=jn(c);if(this.formats[l]){let d=o;try{const h=((f=s==null?void 0:s.formatParams)==null?void 0:f[s.interpolationkey])||{},m=h.locale||h.lng||s.locale||s.lng||n;d=this.formats[l](o,m,{...u,...s,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${l}`);return o},e)}}const $n=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Pn extends Qe{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=me.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={},c={};return e.forEach(l=>{let u=!0;t.forEach(f=>{const d=`${l}|${f}`;!n.reload&&this.store.hasResourceBundle(l,f)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?i[d]===void 0&&(i[d]=!0):(this.state[d]=1,u=!1,i[d]===void 0&&(i[d]=!0),a[d]===void 0&&(a[d]=!0),c[f]===void 0&&(c[f]=!0)))}),u||(o[l]=!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(c)}}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(c=>{gn(c.loaded,[a],i),$n(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{o[l]||(o[l]={});const u=c.loaded[l];u.length&&u.forEach(f=>{o[l][f]===void 0&&(o[l][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.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=(l,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&u&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(l,u)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,t);l&&typeof l.then=="function"?l.then(u=>o(null,u)).catch(o):o(null,l)}catch(l){o(l)}return}return c(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 c,l,u,f,d;if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((f=(u=this.services)==null?void 0:u.utils)!=null&&f.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((d=this.backend)!=null&&d.create){const h={...i,isUpdate:a},m=this.backend.create.bind(this.backend);if(m.length<6)try{let g;m.length===5?g=m(e,t,n,s,h):g=m(e,t,n,s),g&&typeof g.then=="function"?g.then(x=>o(null,x)).catch(o):o(null,g)}catch(g){o(g)}else m(e,t,n,s,o,h)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const ar=()=>({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}),ir=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},Ue=()=>{},An=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class _e extends Qe{constructor(e={},t){if(super(),this.options=ir(e),this.services={},this.logger=me,this.modules={external:[]},An(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=ar();this.options={...n,...this.options,...ir(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=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?me.init(s(this.modules.logger),this.options):me.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Cn;const u=new er(this.options);this.store=new Xt(this.options.resources,this.options);const f=this.services;f.logger=me,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new On(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(f.formatter=s(l),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Rn(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Pn(s(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(d,...h)=>{this.emit(d,...h)}),this.modules.languageDetector&&(f.languageDetector=s(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=s(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Ze(this.services,this.options),this.translator.on("*",(d,...h)=>{this.emit(d,...h)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ue),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[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(l=>{this[l]=(...u)=>this.store[l](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...u)=>(this.store[l](...u),this)});const o=$e(),c=()=>{const l=(u,f)=>{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(f),t(u,f)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),o}loadResources(e,t=Ue){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=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>c(u)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,l=>c(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,t,n){const s=$e();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=Ue),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"&&Tr.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=$e();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,c)=>{c?this.isLanguageChangingTo===e&&(s(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),t&&t(o,(...l)=>this.t(...l))},i=o=>{var u,f;!e&&!o&&this.services.languageDetector&&(o=[]);const c=q(o)?o:o&&o[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(f=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||f.call(u,l)),this.loadResources(l,d=>{a(d,l)})};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 c;typeof i!="object"?c=this.options.overloadTranslationOptionHandler([a,i].concat(o)):c={...i},c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||s.keyPrefix);const l=this.options.keySeparator||".";let u;return c.keyPrefix&&Array.isArray(a)?u=a.map(f=>`${c.keyPrefix}${l}${f}`):u=c.keyPrefix?`${c.keyPrefix}${l}${a}`:a,this.t(u,c)};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,c)=>{const l=this.services.backendConnector.state[`${o}|${c}`];return l===-1||l===0||l===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=$e();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=$e();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 er(ar());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new _e(e,t)}cloneInstance(e={},t=Ue){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new _e(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((c,l)=>(c[l]={...this.store.data[l]},c[l]=Object.keys(c[l]).reduce((u,f)=>(u[f]={...c[l][f]},u),c[l]),c),{});a.store=new Xt(o,s),a.services.resourceStore=a.store}return a.translator=new Ze(a.services,s),a.translator.on("*",(o,...c)=>{a.emit(o,...c)}),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=_e.createInstance();ae.createInstance=_e.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 Ln={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"},_n={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},kn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},In={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:Ln,Month:_n,Generic:kn},Nn={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"},Mn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Fn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},Vn={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:Nn,Month:Mn,Generic:Fn};function or(r,e){return new RegExp(Yn(r),e)}function Yn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Un(r,e,t,n){let s=e;const a=Wn(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=Hn(s);return new Intl.NumberFormat(n,i).format(a)}function Wn(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const c=o=="."?",":".";a=a.replace(or(c,"g"),""),a=a.replace(or(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function Hn(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 Un(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Vn},it:{translation:In}}});const Bn=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),Gn=(r,e)=>ae.t(r,e);function et(){const r=P.useCallback((n,s,a,i)=>Bn(n,s,a||void 0,i),[]),e=P.useCallback(()=>ae.languages[0],[]),t=P.useCallback((n,s)=>Gn(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var St=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(St||{}),oe=(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))(oe||{}),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||{}),mt=(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))(mt||{});function qn({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=et(),i=()=>{if(!n)return;const _=new Date(n);return isNaN(_.getTime())?void 0:_},[o]=P.useState(new Date),[c,l]=P.useState(r||i()||new Date),[u,f]=P.useState(c?c.getMonth():new Date().getMonth()),[d,h]=P.useState(c?c.getFullYear():new Date().getFullYear()),[m,g]=P.useState(c?c.getDate():null),x=P.useRef(null),w=P.useRef([]),E=[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)],R=[{value:a(oe.SUNDAY_SHORT),full:a(oe.SUNDAY)},{value:a(oe.MONDAY_SHORT),full:a(oe.MONDAY)},{value:a(oe.TUESDAY_SHORT),full:a(oe.TUESDAY)},{value:a(oe.WEDNESDAY_SHORT),full:a(oe.WEDNESDAY)},{value:a(oe.THURSDAY_SHORT),full:a(oe.THURSDAY)},{value:a(oe.FRIDAY_SHORT),full:a(oe.FRIDAY)},{value:a(oe.SATURDAY_SHORT),full:a(oe.SATURDAY)}],S=_=>t.some(p=>{const y=p.start.getTime(),T=p.end.getTime(),C=_.getTime();return C>=y&&C<=T}),b=_=>{S(_)||(l(_),g(_.getDate()),e&&e(Yr(_)))},N=()=>{u===0?(f(11),h(d-1)):f(u-1),g(1)},$=()=>{u===11?(f(0),h(d+1)):f(u+1),g(1)},U=(_,p)=>new Date(_,p+1,0).getDate(),j=(_,p)=>new Date(_,p,1).getDay(),A=_=>{var y;const p=B.findIndex(T=>T!==null&&T.getDate()===_);p!==-1&&w.current[p]&&((y=w.current[p])==null||y.focus(),g(_))},D=(_,p)=>{const y=B[p];if(!y)return;const T=U(d,u),C=y.getDate();switch(_.key){case"ArrowRight":_.preventDefault();{let O=C+1,L=new Date(d,u,O);if(O>T){const F=u===11?d+1:d,V=u===11?0:u+1;O=1,L=new Date(F,V,O),$(),setTimeout(()=>{k(1,"forward")},0);return}S(L)?k(O,"forward"):A(O)}break;case"Tab":break;case"ArrowLeft":_.preventDefault();{let O=C-1,L=new Date(d,u,O);if(O<1){const F=u===0?d-1:d,V=u===0?11:u-1,M=U(F,V);O=M,L=new Date(F,V,O),N(),setTimeout(()=>{k(M,"backward")},0);return}S(L)?k(O,"backward"):A(O)}break;case"ArrowUp":_.preventDefault();{let O=C-7,L=new Date(d,u,O);if(O<1){const F=u===0?d-1:d,V=u===0?11:u-1;O=U(F,V)+O,L=new Date(F,V,O),N(),setTimeout(()=>{k(O,"backward")},0);return}S(L)?k(O,"backward"):A(O)}break;case"ArrowDown":_.preventDefault();{let O=C+7,L=new Date(d,u,O);if(O>T){const F=u===11?d+1:d,V=u===11?0:u+1;O=O-T,L=new Date(F,V,O),$(),setTimeout(()=>{k(O,"forward")},0);return}S(L)?k(O,"forward"):A(O)}break;case"Home":_.preventDefault(),k(1,"forward");break;case"End":_.preventDefault(),k(T,"backward");break;case"PageUp":_.preventDefault(),N(),setTimeout(()=>{const O=U(u===0?d-1:d,u===0?11:u-1),L=Math.min(C,O);k(L,"forward")},0);break;case"PageDown":_.preventDefault(),$(),setTimeout(()=>{const O=U(u===11?d+1:d,u===11?0:u+1),L=Math.min(C,O);k(L,"forward")},0);break;case" ":case"Space":if(S(y))return;g(y.getDate()),l(y);break;case"Enter":_.preventDefault(),b(y);break}},k=(_,p)=>{const y=U(d,u);if(p==="forward"){for(let T=_;T<=y;T++){const C=new Date(d,u,T);if(!S(C)){A(T);return}}$(),setTimeout(()=>{k(1,"forward")},0)}else{for(let L=_;L>=1;L--){const F=new Date(d,u,L);if(!S(F)){A(L);return}}const T=u===0?d-1:d,C=u===0?11:u-1,O=U(T,C);N(),setTimeout(()=>{k(O,"backward")},0)}},B=(()=>{const _=U(d,u),p=j(d,u),y=[];for(let T=0;T<p;T++)y.push(null);for(let T=1;T<=_;T++){const C=new Date(d,u,T);y.push(C)}return y})(),K=[];let z=[];B.forEach((_,p)=>{if(z.push(_),z.length===7||p===B.length-1){for(;z.length<7;)z.push(null);K.push(z),z=[]}}),P.useEffect(()=>{var _;if(m!==null){const p=B.findIndex(y=>y!==null&&y.getDate()===m);p!==-1&&w.current[p]&&((_=w.current[p])==null||_.focus())}},[u,d,m,B]);const X={label:"smp-datepickercalendar-label",wrapper:"smp-datepickercalendar",calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(_,p,y,T)=>`smp-datepickercalendar-td
|
|
44
|
+
*/var nt,It;function tn(){if(It)return nt;It=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 f=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(f.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return nt=s()?Object.assign:function(a,i){for(var o,f=n(a),c,u=1;u<arguments.length;u++){o=Object(arguments[u]);for(var l in o)e.call(o,l)&&(f[l]=o[l]);if(r){c=r(o);for(var d=0;d<c.length;d++)t.call(o,c[d])&&(f[c[d]]=o[c[d]])}}return f},nt}var st,Nt;function vt(){if(Nt)return st;Nt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return st=r,st}var at,Mt;function mr(){return Mt||(Mt=1,at=Function.call.bind(Object.prototype.hasOwnProperty)),at}var it,Ft;function rn(){if(Ft)return it;Ft=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=vt(),t={},n=mr();r=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,f,c){if(process.env.NODE_ENV!=="production"){for(var u in a)if(n(a,u)){var l;try{if(typeof a[u]!="function"){var d=Error((f||"React class")+": "+o+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}l=a[u](i,u,f,o,null,e)}catch(m){l=m}if(l&&!(l instanceof Error)&&r((f||"React class")+": type specification of "+o+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof l+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),l instanceof Error&&!(l.message in t)){t[l.message]=!0;var p=c?c():"";r("Failed "+o+" type: "+l.message+(p??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},it=s,it}var ot,Vt;function nn(){if(Vt)return ot;Vt=1;var r=hr(),e=tn(),t=vt(),n=mr(),s=rn(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var f="Warning: "+o;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}});function i(){return null}return ot=function(o,f){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function l(h){var y=h&&(c&&h[c]||h[u]);if(typeof y=="function")return y}var d="<<anonymous>>",p={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:E(),arrayOf:O,element:w(),elementType:b(),instanceOf:N,node:A(),objectOf:U,oneOf:$,oneOfType:j,shape:k,exact:W};function m(h,y){return h===y?h!==0||1/h===1/y:h!==h&&y!==y}function g(h,y){this.message=h,this.data=y&&typeof y=="object"?y:{},this.stack=""}g.prototype=Error.prototype;function x(h){if(process.env.NODE_ENV!=="production")var y={},T=0;function C(L,F,V,M,J,G,se){if(M=M||d,G=G||V,se!==t){if(f){var I=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 I.name="Invariant Violation",I}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Y=M+":"+V;!y[Y]&&T<3&&(a("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+M+"`. 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."),y[Y]=!0,T++)}}return F[V]==null?L?F[V]===null?new g("The "+J+" `"+G+"` is marked as required "+("in `"+M+"`, but its value is `null`.")):new g("The "+J+" `"+G+"` is marked as required in "+("`"+M+"`, but its value is `undefined`.")):null:h(F,V,M,J,G)}var R=C.bind(null,!1);return R.isRequired=C.bind(null,!0),R}function S(h){function y(T,C,R,L,F,V){var M=T[C],J=q(M);if(J!==h){var G=X(M);return new g("Invalid "+L+" `"+F+"` of type "+("`"+G+"` supplied to `"+R+"`, expected ")+("`"+h+"`."),{expectedType:h})}return null}return x(y)}function E(){return x(i)}function O(h){function y(T,C,R,L,F){if(typeof h!="function")return new g("Property `"+F+"` of component `"+R+"` has invalid PropType notation inside arrayOf.");var V=T[C];if(!Array.isArray(V)){var M=q(V);return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+R+"`, expected an array."))}for(var J=0;J<V.length;J++){var G=h(V,J,R,L,F+"["+J+"]",t);if(G instanceof Error)return G}return null}return x(y)}function w(){function h(y,T,C,R,L){var F=y[T];if(!o(F)){var V=q(F);return new g("Invalid "+R+" `"+L+"` of type "+("`"+V+"` supplied to `"+C+"`, expected a single ReactElement."))}return null}return x(h)}function b(){function h(y,T,C,R,L){var F=y[T];if(!r.isValidElementType(F)){var V=q(F);return new g("Invalid "+R+" `"+L+"` of type "+("`"+V+"` supplied to `"+C+"`, expected a single ReactElement type."))}return null}return x(h)}function N(h){function y(T,C,R,L,F){if(!(T[C]instanceof h)){var V=h.name||d,M=_(T[C]);return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+R+"`, expected ")+("instance of `"+V+"`."))}return null}return x(y)}function $(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 y(T,C,R,L,F){for(var V=T[C],M=0;M<h.length;M++)if(m(V,h[M]))return null;var J=JSON.stringify(h,function(se,I){var Y=X(I);return Y==="symbol"?String(I):I});return new g("Invalid "+L+" `"+F+"` of value `"+String(V)+"` "+("supplied to `"+R+"`, expected one of "+J+"."))}return x(y)}function U(h){function y(T,C,R,L,F){if(typeof h!="function")return new g("Property `"+F+"` of component `"+R+"` has invalid PropType notation inside objectOf.");var V=T[C],M=q(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+R+"`, expected an object."));for(var J in V)if(n(V,J)){var G=h(V,J,R,L,F+"."+J,t);if(G instanceof Error)return G}return null}return x(y)}function j(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 y=0;y<h.length;y++){var T=h[y];if(typeof T!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+H(T)+" at index "+y+"."),i}function C(R,L,F,V,M){for(var J=[],G=0;G<h.length;G++){var se=h[G],I=se(R,L,F,V,M,t);if(I==null)return null;I.data&&n(I.data,"expectedType")&&J.push(I.data.expectedType)}var Y=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new g("Invalid "+V+" `"+M+"` supplied to "+("`"+F+"`"+Y+"."))}return x(C)}function A(){function h(y,T,C,R,L){return B(y[T])?null:new g("Invalid "+R+" `"+L+"` supplied to "+("`"+C+"`, expected a ReactNode."))}return x(h)}function D(h,y,T,C,R){return new g((h||"React class")+": "+y+" type `"+T+"."+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+R+"`.")}function k(h){function y(T,C,R,L,F){var V=T[C],M=q(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type `"+M+"` "+("supplied to `"+R+"`, expected `object`."));for(var J in h){var G=h[J];if(typeof G!="function")return D(R,L,F,J,X(G));var se=G(V,J,R,L,F+"."+J,t);if(se)return se}return null}return x(y)}function W(h){function y(T,C,R,L,F){var V=T[C],M=q(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type `"+M+"` "+("supplied to `"+R+"`, expected `object`."));var J=e({},T[C],h);for(var G in J){var se=h[G];if(n(h,G)&&typeof se!="function")return D(R,L,F,G,X(se));if(!se)return new g("Invalid "+L+" `"+F+"` key `"+G+"` supplied to `"+R+"`.\nBad object: "+JSON.stringify(T[C],null," ")+`
|
|
45
|
+
Valid keys: `+JSON.stringify(Object.keys(h),null," "));var I=se(V,G,R,L,F+"."+G,t);if(I)return I}return null}return x(y)}function B(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(B);if(h===null||o(h))return!0;var y=l(h);if(y){var T=y.call(h),C;if(y!==h.entries){for(;!(C=T.next()).done;)if(!B(C.value))return!1}else for(;!(C=T.next()).done;){var R=C.value;if(R&&!B(R[1]))return!1}}else return!1;return!0;default:return!1}}function K(h,y){return h==="symbol"?!0:y?y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&y instanceof Symbol:!1}function q(h){var y=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":K(y,h)?"symbol":y}function X(h){if(typeof h>"u"||h===null)return""+h;var y=q(h);if(y==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return y}function H(h){var y=X(h);switch(y){case"array":case"object":return"an "+y;case"boolean":case"date":case"regexp":return"a "+y;default:return y}}function _(h){return!h.constructor||!h.constructor.name?d:h.constructor.name}return p.checkPropTypes=s,p.resetWarningCache=s.resetWarningCache,p.PropTypes=p,p},ot}var lt,Yt;function sn(){if(Yt)return lt;Yt=1;var r=vt();function e(){}function t(){}return t.resetWarningCache=e,lt=function(){function n(i,o,f,c,u,l){if(l!==r){var d=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 d.name="Invariant Violation",d}}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},lt}var Ut;function an(){if(Ut)return Fe.exports;if(Ut=1,process.env.NODE_ENV!=="production"){var r=hr(),e=!0;Fe.exports=nn()(r.isElement,e)}else Fe.exports=sn()();return Fe.exports}var ie=an(),on=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},ln=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},cn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ye="http://www.w3.org/2000/svg",Wt="http://www.w3.org/1999/xlink",Re=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}Wr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof on(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,f=a.httpRequestWithCredentials,c=a.renumerateIRIElements,u=a.src,l=a.title,d=a.useRequestCache,p=this.props.onError,m=this.props.beforeInjection,g=this.props.afterInjection,x=this.props.wrapper,S,E;x==="svg"?(S=document.createElementNS(Ye,x),S.setAttribute("xmlns",Ye),S.setAttribute("xmlns:xlink",Wt),E=document.createElementNS(Ye,x)):(S=document.createElement(x),E=document.createElement(x)),S.appendChild(E),E.dataset.src=u,this.nonReactWrapper=this.reactWrapper.appendChild(S);var O=function($){if(s.removeSVG(),!s._isMounted){p($);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){p($)})},w=function($,U){if($){O($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{g(U)}catch(j){O(j)}})},b=function($){if($.setAttribute("role","img"),i){var U=$.querySelector(":scope > desc");U&&$.removeChild(U);var j=document.createElement("desc");j.innerHTML=i,$.prepend(j)}if(l){var A=$.querySelector(":scope > title");A&&$.removeChild(A);var D=document.createElement("title");D.innerHTML=l,$.prepend(D)}try{m($)}catch(k){O(k)}};Zr(E,{afterEach:w,beforeEach:b,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:f,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;ln(Ke({},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,f=Ur(s,cn),c=o;return ke.createElement(c,Ke({},f,{ref:this.refCallback},o==="svg"?{xmlns:Ye,xmlnsXlink:Wt}:{}),this.state.isLoading&&i&&ke.createElement(i,null),this.state.hasError&&a&&ke.createElement(a,null))},e}(ke.Component);Re.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Re.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 pt={assets:"/"};const un=r=>{pt={...pt,...r}},Ht=r=>`${pt.assets}/${r}`.replace(/\/+/g,"/"),le=P.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:f,isInteractable:c=!1,spin:u=!1,title:l})=>{const[d,p]=P.useState(r),m=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),g=m&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),x=Ht(`assets/svg/${r}.svg`),S=Ht(`assets/svg/${n}.svg`),E={img:`${c?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${c?"smp-icon-interactable":""} ${u?"smp-icon-spin":""}`},O=()=>{!a&&c&&f&&f()};return v.jsx(v.Fragment,{children:g?v.jsx(Re,{src:r,fallback:()=>v.jsx(Re,{src:S,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:l,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:O}):m?v.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:l,onError:()=>p(S),onClick:O,className:E.img,title:l,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&O()}}):v.jsx(Re,{src:x,fallback:()=>v.jsx(Re,{src:S,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:l,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:O})})}),we=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:f,state:c,variant:u,rotatedShapeIcon:l=!1,onShapeIconClick:d,ref:p,inputRef:m,onKeyDown:g,inputType:x="text",ariaLabel:S="input field",label:E,helperText:O=!1,error:w,appearance:b="base",fullWidth:N=!1,_dataComponent:$="textfield",width:U})=>{const j=P.useId(),A=`${j}-helper`,D=w?"danger":c,k=w||c=="danger"?"error":o,W=O||!!w,B=X=>{s==null||s(X.target.value)},K={wrapper:`smp-textfield-wrapper ${N?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${a?"smp-textfield-placeholder":""} ${f?`smp-textfield-${f}`:""} ${D?`smp-textfield-${D}`:""} ${b?`smp-textfield-${b}`:""} ${i?"":"smp-textfield-readOnly"}`,input:"smp-textfield-input "};u&&(u!="notSelectable"||i)&&(K.container+=`smp-textfield-variant-${u}`);const q=U?{"--smp-textField-width-base":U}:void 0;return v.jsxs("div",{className:K.wrapper,"data-component":$,children:[E&&v.jsx(je,{label:E,disabled:r,htmlFor:j}),v.jsxs("div",{className:K.container,ref:p,style:q,children:[t&&v.jsx(le,{icon:t,disabled:r}),v.jsx("input",{id:j,type:x,value:e,placeholder:a,onChange:B,onBlur:n,className:K.input,disabled:r,readOnly:!i,onKeyDown:g,"aria-label":S,ref:m,"aria-describedby":W?A:void 0}),k&&v.jsx(le,{icon:k,disabled:r,state:D,onClick:d,rotated:l,isInteractable:i})]}),W&&v.jsx(fr,{helperText:w,disabled:r,state:D,id:A})]})};function gr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=P.useState(0),i=P.useRef(null),o=r.length*e,f=Math.max(0,Math.floor(s/e)-n),c=Math.min(r.length-1,Math.floor((s+t)/e)+n),u=[];for(let p=f;p<=c;p++)u.push({item:r[p],index:p,offsetTop:p*e});const l=P.useCallback(p=>{const m=p.target.scrollTop;a(m)},[]),d=p=>{if(!i.current)return;const m=p*e,g=m+e,x=i.current,S=x.scrollTop,E=S+t;m<S?x.scrollTop=m:g>E&&(x.scrollTop=g-t)};return{virtualItems:u,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:l},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:f,endIndex:c},scrollToIndex:d}}const fn=10,yr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:f,onKeyDown:c})=>{var A;const[u,l]=P.useState(""),d=24,[p,m]=P.useState(a!==null?a:-1),g=s!==void 0?s:e.length>fn,x=u?e.filter(D=>D.label.toLowerCase().includes(u.toLowerCase())):e,S=D=>{l(D)},{virtualItems:E,containerProps:O,innerProps:w,scrollToIndex:b}=gr({items:x,itemHeight:d,containerHeight:200,overscan:5});P.useEffect(()=>{a!==null&&a!==p&&m(a)},[a]),P.useEffect(()=>{p>=0&&p<x.length&&b(p)},[p,x]);const N=D=>{if(D.key==="ArrowDown"||D.key==="ArrowUp"){D.preventDefault();let k=p;D.key==="ArrowDown"?k=p<x.length-1?p+1:0:D.key==="ArrowUp"&&(k=p>0?p-1:x.length-1),m(k)}else D.key==="Enter"?p>=0&&p<x.length&&(f==null||f(x[p])):D.key==="Escape"&&(D.preventDefault(),D.stopPropagation());c&&c(D)},$=D=>{N(D)},U=D=>{N(D)},j={wrapper:"smp-list",container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return v.jsxs("div",{id:r,ref:n,className:j.wrapper,"data-component":"list",style:{width:o},children:[g&&v.jsx(we,{bindValue:u,placeholder:"Search...",onChange:S,onKeyDown:$}),v.jsx("div",{...O,className:j.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:U,"aria-activedescendant":p>=0&&p<x.length?(A=x[p])==null?void 0:A.id:void 0,children:v.jsx("div",{...w,className:j.virtualScroll,children:E.map(({item:D,index:k,offsetTop:W})=>{const B=i.includes(D.id);return v.jsxs("li",{role:"option",id:D.id,"aria-selected":p===k?"true":"false",tabIndex:-1,className:`${j.listItem} ${p===k?"selected-item":""}`,"aria-label":D.id+"-"+D.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${W}px)`},onClick:()=>{f==null||f(D),m(k)},children:[qe(D.id,D.label,t),B&&v.jsx(le,{icon:"check",width:16})]},D.id)})})})]})},vr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=P.useState(qe(e,t,r));return P.useEffect(()=>{a(e)},[e]),P.useEffect(()=>{a(qe(e,t,r))},[t,r]),v.jsx(we,{...n,bindValue:s})},dn=r=>{const e=P.useRef(null);return P.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}},bt=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,placeholder:o,fun:f,_changeOnEnter:c=!1,onChange:u,onOptionsRequest:l,_multiActiveIndex:d,...p})=>{const[m,g]=P.useState(r),[x,S]=P.useState(e),[E,O]=P.useState(!1),[w,b]=P.useState(t||[]),[N,$]=P.useState(0),[U,j]=P.useState([r]),{anchorRef:A,targetRef:D,anchorWidth:k}=yt({position:"bottom",enabled:E});ze(D,()=>O(!1));const W=dn(400),B=H=>{H.length>=a?f&&l&&W(async()=>{const _=await l(f,H);b(_),$(_.length>0?0:-1),O(!0)}):O(!1),g(H),S(e),c||u==null||u(H,e)},K=H=>{c?(g(""),S("")):(g(H.id),S(H.label)),u==null||u(H.id,H.label);const _=w.findIndex(h=>h.id===H.id);$(_),j([H.id]),O(!1)},q=H=>{H.key==="Escape"&&(O(!1),$(-1))},X=H=>{if((H.key==="ArrowDown"||H.key==="ArrowUp")&&(H.preventDefault(),E)){const _=H.key==="ArrowDown"?(N+1)%w.length:(N-1+w.length)%w.length;$(_)}switch(H.key){case"Enter":N>=0&&N<w.length?K(w[N]):c&&(u==null||u(m,""),O(!1),g(""),S(""));break;case"Escape":O(!1),$(-1);break}};return v.jsxs("div",{"data-component":"autocomplete",children:[v.jsx(vr,{...p,bindValue:m,optionalDisplayValue:x,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:A,onChange:B,onKeyDown:X,"aria-autocomplete":"list"}),E&&v.jsx(yr,{options:w,displayMode:s,onClick:K,ref:D,selectedIndex:N,activeIndex:d||U,width:k,showFilter:!1,onKeyDown:q})]})},Bt=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Gt=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],xe=({label:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:f=!0,showText:c=!0,fullWidth:u=!1,loading:l=!1,justify:d="center",title:p,optionalDisplayValue:m})=>{const g={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${u?"smp-button-fullWidth":""} smp-justifyContent-${d}`};return v.jsx("button",{"data-component":"button",className:g.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":l,title:p||r||m,children:l?v.jsx(le,{icon:"spinner",state:Gt(i),spin:!0}):v.jsxs(v.Fragment,{children:[n&&f&&v.jsx(le,{icon:n,disabled:s,state:Gt(i),width:Bt(a),height:Bt(a)}),c&&m&&v.jsx("span",{children:m})]})})},br=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:f,fullWidth:c,disabled:u,justify:l,onClick:d,onOptionsRequest:p})=>{const[m,g]=P.useState(r);P.useEffect(()=>{!m&&p&&e&&p(e,void 0).then(E=>g(E)).catch(E=>{console.error("Errore nel caricamento delle opzioni per ButtonList",E)})},[m,e,p]);const x={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},S=m==null?void 0:m.map((E,O)=>{const w={bindValue:E.id,optionalDisplayValue:E.label,fun:E.fun,icon:E.icon,variant:a,appearance:i,showText:o,showIcon:f,fullWidth:c,disabled:u,sizing:s,justify:l,onClick:()=>{d==null||d(E.id,E.fun)}};return v.jsx(xe,{...w},`button-${O}`)});return v.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:S})},xr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i})=>{const o=c=>{s&&a&&a(c.target.checked)},f={wrapper:"smp-checkbox-wrapper"};return v.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&v.jsx(je,{label:n,disabled:t}),v.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:o,onBlur:i})]})},pn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ae=({variant:r="body",bindValue:e,color:t,...n})=>{const s=pn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return v.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},xt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,f]=P.useState(null),c={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},u=p=>{n==null||n(r.filter((m,g)=>g!==p))},l=p=>{f(p)},d=p=>{if(o===null||o===p)return;const m=[...r],[g]=m.splice(o,1);m.splice(p,0,g),n==null||n(m),f(null)};return v.jsx("div",{className:c.container,role:"list","data-component":"chip",children:r.flatMap((p,m)=>{const g=qe(p.bindValue,p.optionalDisplayValue,t),x=v.jsxs("div",{className:c.element,role:"listitem",draggable:i,onDragStart:()=>l(m),onDragOver:E=>i&&E.preventDefault(),onDrop:()=>i&&d(m),style:{"--smp-chips-backgroundColor-base":a},children:[i&&v.jsx(le,{icon:"drag_indicator_horizontal",isInteractable:!0}),v.jsx(Ae,{variant:"label",bindValue:g,color:s}),e&&v.jsx(le,{icon:"close",isInteractable:!0,onClick:()=>u(m),color:s})]},`chip-${m}`),S=i&&m<r.length-1?v.jsx(le,{icon:"chevron-right",color:s},`separator-${m}`):null;return[x,S].filter(Boolean)})})};function Sr(r,e){const t=P.useRef(null);P.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 u=s();if(u.length===0)return;const l=u[0],d=u[u.length-1];c.shiftKey&&document.activeElement===l?(c.preventDefault(),d.focus()):!c.shiftKey&&document.activeElement===d&&(c.preventDefault(),l.focus())},o=c=>{if(n&&!n.contains(c.target)){c.preventDefault();const u=s();u.length>0&&u[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=f,t.current&&requestAnimationFrame(()=>{var c;(c=t.current)==null||c.focus()})}},[r,e])}const wr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:f,multiActiveIndex:c,...u})=>{const[l,d]=P.useState(!1),[p,m]=P.useState(t),[g,x]=P.useState(-1),[S,E]=P.useState([r]),O=P.useId(),{anchorRef:w,targetRef:b,anchorWidth:N}=yt({position:"bottom",enabled:l});ze(b,()=>d(!1)),Sr(l,b);const $=D=>{e==null||e(D.id,D.label);const k=p.findIndex(W=>W.id===D.id);x(k),E([D.id]),d(!1)},U=D=>{D.key==="Escape"&&(d(!1),x(-1))},j=D=>{(D.key==="ArrowDown"||D.key==="ArrowUp")&&(D.preventDefault(),A())},A=()=>{o&&f&&f(o,void 0).then(D=>{m(D),x(D.length>0?0:-1),d(!0)})};return v.jsxs("div",{role:"combobox","aria-expanded":l,"aria-controls":O,"aria-owns":O,"data-component":"combobox",children:[v.jsx(vr,{...u,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:A,onKeyDown:j,shapeIcon:"arrow_drop_down",rotatedShapeIcon:l,isEditable:s,ref:w,"aria-autocomplete":"list",variant:"notSelectable"}),l&&v.jsx(yr,{id:O,options:p,displayMode:i,ref:b,selectedIndex:g,activeIndex:c||S,width:N,onClick:$,onKeyDown:U})]})},z=r=>typeof r=="string",$e=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},zt=r=>r==null?"":""+r,hn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},mn=/###/g,qt=r=>r&&r.indexOf("###")>-1?r.replace(mn,"."):r,Kt=r=>!r||z(r),Pe=(r,e,t)=>{const n=z(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(Kt(r))return{};const a=qt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return Kt(r)?{}:{obj:r,k:qt(n[s])}},Jt=(r,e,t)=>{const{obj:n,k:s}=Pe(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=Pe(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Pe(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},gn=(r,e,t,n)=>{const{obj:s,k:a}=Pe(r,e,Object);s[a]=s[a]||[],s[a].push(t)},Je=(r,e)=>{const{obj:t,k:n}=Pe(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},yn=(r,e,t)=>{const n=Je(r,t);return n!==void 0?n:Je(e,t)},Er=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?z(r[n])||r[n]instanceof String||z(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Er(r[n],e[n],t):r[n]=e[n]);return r},Te=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const bn=r=>z(r)?r.replace(/[&<>"'\/]/g,e=>vn[e]):r;class xn{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 Sn=[" ",",","?","!",";"],wn=new xn(20),En=(r,e,t)=>{e=e||"",t=t||"";const n=Sn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=wn.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},ht=(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 f=a;f<n.length;++f)if(f!==a&&(o+=t),o+=n[f],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&f<n.length-1)continue;a+=f-a+1;break}s=i}return s},Le=r=>r==null?void 0:r.replace("_","-"),Tn={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 Xe{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Tn,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:(z(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Xe(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Xe(this.logger,e)}}var me=new Xe;class Qe{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 Xt extends Qe{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,u;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):z(n)&&a?o.push(...n.split(a)):o.push(n)));const f=Je(this.data,o);return!f&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),f||!i||!z(n)?f:ht((u=(c=this.data)==null?void 0:c[e])==null?void 0:u[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),Jt(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)(z(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 f=Je(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Er(f,n,a):f={...f,...n},Jt(this.data,o,f),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 Tr={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 Zt={},Qt=r=>!z(r)&&typeof r!="boolean"&&typeof r!="number";class Ze extends Qe{constructor(e,t={}){super(),hn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=me.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&&!En(e,n,s);if(i&&!o){const f=e.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:e,namespaces:z(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:z(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:f}=this.extractFromKey(e[e.length-1],s),c=f[f.length-1];let u=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const l=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((l==null?void 0:l.toLowerCase())==="cimode")return d?a?{res:`${c}${u}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${u}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:o;const p=this.resolve(e,s);let m=p==null?void 0:p.res;const g=(p==null?void 0:p.usedKey)||o,x=(p==null?void 0:p.exactUsedKey)||o,S=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,w=s.count!==void 0&&!z(s.count),b=Ze.hasDefaultValue(s),N=w?this.pluralResolver.getSuffix(l,s.count,s):"",$=s.ordinal&&w?this.pluralResolver.getSuffix(l,s.count,{ordinal:!1}):"",U=w&&!s.ordinal&&s.count===0,j=U&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${N}`]||s[`defaultValue${$}`]||s.defaultValue;let A=m;O&&!m&&b&&(A=j);const D=Qt(A),k=Object.prototype.toString.apply(A);if(O&&A&&D&&S.indexOf(k)<0&&!(z(E)&&Array.isArray(A))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,A,{...s,ns:f}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(p.res=W,p.usedParams=this.getUsedParamsDetails(s),p):W}if(i){const W=Array.isArray(A),B=W?[]:{},K=W?x:g;for(const q in A)if(Object.prototype.hasOwnProperty.call(A,q)){const X=`${K}${i}${q}`;b&&!m?B[q]=this.translate(X,{...s,defaultValue:Qt(j)?j[q]:void 0,joinArrays:!1,ns:f}):B[q]=this.translate(X,{...s,joinArrays:!1,ns:f}),B[q]===X&&(B[q]=A[q])}m=B}}else if(O&&z(E)&&Array.isArray(m))m=m.join(E),m&&(m=this.extendTranslation(m,e,s,n));else{let W=!1,B=!1;!this.isValidLookup(m)&&b&&(W=!0,m=j),this.isValidLookup(m)||(B=!0,m=o);const q=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:m,X=b&&j!==m&&this.options.updateMissing;if(B||W||X){if(this.logger.log(X?"updateKey":"missingKey",l,c,o,X?j:m),i){const y=this.resolve(o,{...s,keySeparator:!1});y&&y.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 H=[];const _=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&_&&_[0])for(let y=0;y<_.length;y++)H.push(_[y]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(s.lng||this.language):H.push(s.lng||this.language);const h=(y,T,C)=>{var L;const R=b&&C!==m?C:q;this.options.missingKeyHandler?this.options.missingKeyHandler(y,c,T,R,X,s):(L=this.backendConnector)!=null&&L.saveMissing&&this.backendConnector.saveMissing(y,c,T,R,X,s),this.emit("missingKey",y,c,T,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?H.forEach(y=>{const T=this.pluralResolver.getSuffixes(y,s);U&&s[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach(C=>{h([y],o+C,s[`defaultValue${C}`]||j)})}):h(H,o,j))}m=this.extendTranslation(m,e,s,p,n),B&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${c}${u}${o}`),(B||W)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${o}`:o,W?m:void 0,s))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(s),p):m}extendTranslation(e,t,n,s,a){var f,c;if((f=this.i18nFormat)!=null&&f.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 u=z(e)&&(((c=n==null?void 0:n.interpolation)==null?void 0:c.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(u){const p=e.match(this.interpolator.nestingRegexp);l=p&&p.length}let d=n.replace&&!z(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),u){const p=e.match(this.interpolator.nestingRegexp),m=p&&p.length;l<m&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...p)=>(a==null?void 0:a[0])===p[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`),null):this.translate(...p,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=z(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Tr.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 z(e)&&(e=[e]),e.forEach(f=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(f,t),u=c.key;s=u;let l=c.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const d=t.count!==void 0&&!z(t.count),p=d&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(z(t.context)||typeof t.context=="number")&&t.context!=="",g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(x=>{var S,E;this.isValidLookup(n)||(o=x,!Zt[`${g[0]}-${x}`]&&((S=this.utils)!=null&&S.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(Zt[`${g[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${g.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!!!")),g.forEach(O=>{var N;if(this.isValidLookup(n))return;i=O;const w=[u];if((N=this.i18nFormat)!=null&&N.addLookupKeys)this.i18nFormat.addLookupKeys(w,u,O,x,t);else{let $;d&&($=this.pluralResolver.getSuffix(O,t.count,t));const U=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(w.push(u+$),t.ordinal&&$.indexOf(j)===0&&w.push(u+$.replace(j,this.options.pluralSeparator)),p&&w.push(u+U)),m){const A=`${u}${this.options.contextSeparator}${t.context}`;w.push(A),d&&(w.push(A+$),t.ordinal&&$.indexOf(j)===0&&w.push(A+$.replace(j,this.options.pluralSeparator)),p&&w.push(A+U))}}let b;for(;b=w.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(O,x,b,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&&!z(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 er{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=me.create("languageUtils")}getScriptPartFromCode(e){if(e=Le(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=Le(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(z(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)),z(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 z(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))):z(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const tr={zero:0,one:1,two:2,few:3,many:4,other:5},rr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class On{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=me.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Le(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!"),rr;if(!e.match(/-|_/))return rr;const f=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(f,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)=>tr[s]-tr[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 nr=(r,e,t,n=".",s=!0)=>{let a=yn(r,e,t);return!a&&s&&z(t)&&(a=ht(r,t,n),a===void 0&&(a=ht(e,t,n))),a},ct=r=>r.replace(/\$/g,"$$$$");class Rn{constructor(e={}){var t;this.logger=me.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:f,formatSeparator:c,unescapeSuffix:u,unescapePrefix:l,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:m,nestingSuffixEscaped:g,nestingOptionsSeparator:x,maxReplaces:S,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:bn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Te(a):i||"{{",this.suffix=o?Te(o):f||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?Te(d):p||Te("$t("),this.nestingSuffix=m?Te(m):g||Te(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=S||1e3,this.alwaysFormat=E!==void 0?E:!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 p;let a,i,o;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=m=>{if(m.indexOf(this.formatSeparator)<0){const E=nr(t,f,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...s,...t,interpolationkey:m}):E}const g=m.split(this.formatSeparator),x=g.shift().trim(),S=g.join(this.formatSeparator).trim();return this.format(nr(t,f,x,this.options.keySeparator,this.options.ignoreJSONStructure),S,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const u=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,l=((p=s==null?void 0:s.interpolation)==null?void 0:p.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>ct(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?ct(this.escape(m)):ct(m)}].forEach(m=>{for(o=0;a=m.regex.exec(e);){const g=a[1].trim();if(i=c(g),i===void 0)if(typeof u=="function"){const S=u(e,a,s);i=z(S)?S:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))i="";else if(l){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),i="";else!z(i)&&!this.useRawValueToEscape&&(i=zt(i));const x=m.safeValue(i);if(e=e.replace(a[0],x),l?(m.regex.lastIndex+=i.length,m.regex.lastIndex-=a[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(f,c)=>{const u=this.nestingOptionsSeparator;if(f.indexOf(u)<0)return f;const l=f.split(new RegExp(`${u}[ ]*{`));let d=`{${l[1]}`;f=l[0],d=this.interpolate(d,i);const p=d.match(/'/g),m=d.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!m||m.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),c&&(i={...c,...i})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,g),`${f}${u}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,f};for(;s=this.nestingRegexp.exec(e);){let f=[];i={...n},i=i.replace&&!z(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 u=s[1].split(this.formatSeparator).map(l=>l.trim());s[1]=u.shift(),f=u,c=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!z(a))return a;z(a)||(a=zt(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),c&&(a=f.reduce((u,l)=>this.format(u,l,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const jn=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,...f]=i.split(":"),c=f.join(":").trim().replace(/^'+|'+$/g,""),u=o.trim();t[u]||(t[u]=c),c==="false"&&(t[u]=!1),c==="true"&&(t[u]=!0),isNaN(c)||(t[u]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},sr=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(Le(n),s),e[i]=o),o(t)}},Dn=r=>(e,t,n)=>r(Le(t),n)(e);class Cn{constructor(e={}){this.logger=me.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?sr:Dn;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()]=sr(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(f=>f.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,f)=>{var l;const{formatName:c,formatOptions:u}=jn(f);if(this.formats[c]){let d=o;try{const p=((l=s==null?void 0:s.formatParams)==null?void 0:l[s.interpolationkey])||{},m=p.locale||p.lng||s.locale||s.lng||n;d=this.formats[c](o,m,{...u,...s,...p})}catch(p){this.logger.warn(p)}return d}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const $n=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Pn extends Qe{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=me.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={},f={};return e.forEach(c=>{let u=!0;t.forEach(l=>{const d=`${c}|${l}`;!n.reload&&this.store.hasResourceBundle(c,l)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?i[d]===void 0&&(i[d]=!0):(this.state[d]=1,u=!1,i[d]===void 0&&(i[d]=!0),a[d]===void 0&&(a[d]=!0),f[l]===void 0&&(f[l]=!0)))}),u||(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(f)}}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(f=>{gn(f.loaded,[a],i),$n(f,e),t&&f.errors.push(t),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(c=>{o[c]||(o[c]={});const u=f.loaded[c];u.length&&u.forEach(l=>{o[c][l]===void 0&&(o[c][l]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(f=>!f.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,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const l=this.waitingReads.shift();this.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}if(c&&u&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(c,u)},f=this.backend[n].bind(this.backend);if(f.length===2){try{const c=f(e,t);c&&typeof c.then=="function"?c.then(u=>o(null,u)).catch(o):o(null,c)}catch(c){o(c)}return}return f(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();z(e)&&(e=this.languageUtils.toResolveHierarchy(e)),z(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 f,c,u,l,d;if((c=(f=this.services)==null?void 0:f.utils)!=null&&c.hasLoadedNamespace&&!((l=(u=this.services)==null?void 0:u.utils)!=null&&l.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((d=this.backend)!=null&&d.create){const p={...i,isUpdate:a},m=this.backend.create.bind(this.backend);if(m.length<6)try{let g;m.length===5?g=m(e,t,n,s,p):g=m(e,t,n,s),g&&typeof g.then=="function"?g.then(x=>o(null,x)).catch(o):o(null,g)}catch(g){o(g)}else m(e,t,n,s,o,p)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const ar=()=>({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]),z(r[1])&&(e.defaultValue=r[1]),z(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}),ir=r=>{var e,t;return z(r.ns)&&(r.ns=[r.ns]),z(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),z(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},Ue=()=>{},An=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class _e extends Qe{constructor(e={},t){if(super(),this.options=ir(e),this.services={},this.logger=me,this.modules={external:[]},An(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&&(z(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=ar();this.options={...n,...this.options,...ir(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?me.init(s(this.modules.logger),this.options):me.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Cn;const u=new er(this.options);this.store=new Xt(this.options.resources,this.options);const l=this.services;l.logger=me,l.resourceStore=this.store,l.languageUtils=u,l.pluralResolver=new On(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(l.formatter=s(c),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new Rn(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Pn(s(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.languageDetector&&(l.languageDetector=s(this.modules.languageDetector),l.languageDetector.init&&l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=s(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new Ze(this.services,this.options),this.translator.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ue),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]=(...u)=>this.store[c](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...u)=>(this.store[c](...u),this)});const o=$e(),f=()=>{const c=(u,l)=>{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(l),t(u,l)};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?f():setTimeout(f,0),o}loadResources(e,t=Ue){var a,i;let n=t;const s=z(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=[],f=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(l=>{l!=="cimode"&&o.indexOf(l)<0&&o.push(l)})};s?f(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>f(u)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,c=>f(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=$e();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=Ue),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"&&Tr.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=$e();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,f)=>{f?this.isLanguageChangingTo===e&&(s(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),t&&t(o,(...c)=>this.t(...c))},i=o=>{var u,l;!e&&!o&&this.services.languageDetector&&(o=[]);const f=z(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(z(o)?[o]:o);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),(l=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||l.call(u,c)),this.loadResources(c,d=>{a(d,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 f;typeof i!="object"?f=this.options.overloadTranslationOptionHandler([a,i].concat(o)):f={...i},f.lng=f.lng||s.lng,f.lngs=f.lngs||s.lngs,f.ns=f.ns||s.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||n||s.keyPrefix);const c=this.options.keySeparator||".";let u;return f.keyPrefix&&Array.isArray(a)?u=a.map(l=>`${f.keyPrefix}${c}${l}`):u=f.keyPrefix?`${f.keyPrefix}${c}${a}`:a,this.t(u,f)};return z(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,f)=>{const c=this.services.backendConnector.state[`${o}|${f}`];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=$e();return this.options.ns?(z(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=$e();z(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 er(ar());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new _e(e,t)}cloneInstance(e={},t=Ue){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new _e(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((f,c)=>(f[c]={...this.store.data[c]},f[c]=Object.keys(f[c]).reduce((u,l)=>(u[l]={...f[c][l]},u),f[c]),f),{});a.store=new Xt(o,s),a.services.resourceStore=a.store}return a.translator=new Ze(a.services,s),a.translator.on("*",(o,...f)=>{a.emit(o,...f)}),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=_e.createInstance();ae.createInstance=_e.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 Ln={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"},_n={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},kn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},In={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:Ln,Month:_n,Generic:kn},Nn={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"},Mn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Fn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},Vn={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:Nn,Month:Mn,Generic:Fn};function or(r,e){return new RegExp(Yn(r),e)}function Yn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Un(r,e,t,n){let s=e;const a=Wn(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=Hn(s);return new Intl.NumberFormat(n,i).format(a)}function Wn(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const f=o=="."?",":".";a=a.replace(or(f,"g"),""),a=a.replace(or(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function Hn(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 Un(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Vn},it:{translation:In}}});const Bn=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),Gn=(r,e)=>ae.t(r,e);function et(){const r=P.useCallback((n,s,a,i)=>Bn(n,s,a||void 0,i),[]),e=P.useCallback(()=>ae.languages[0],[]),t=P.useCallback((n,s)=>Gn(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var St=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(St||{}),oe=(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))(oe||{}),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||{}),mt=(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))(mt||{});function zn({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=et(),i=()=>{if(!n)return;const _=new Date(n);return isNaN(_.getTime())?void 0:_},[o]=P.useState(new Date),[f,c]=P.useState(r||i()||new Date),[u,l]=P.useState(f?f.getMonth():new Date().getMonth()),[d,p]=P.useState(f?f.getFullYear():new Date().getFullYear()),[m,g]=P.useState(f?f.getDate():null),x=P.useRef(null),S=P.useRef([]),E=[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)],O=[{value:a(oe.SUNDAY_SHORT),full:a(oe.SUNDAY)},{value:a(oe.MONDAY_SHORT),full:a(oe.MONDAY)},{value:a(oe.TUESDAY_SHORT),full:a(oe.TUESDAY)},{value:a(oe.WEDNESDAY_SHORT),full:a(oe.WEDNESDAY)},{value:a(oe.THURSDAY_SHORT),full:a(oe.THURSDAY)},{value:a(oe.FRIDAY_SHORT),full:a(oe.FRIDAY)},{value:a(oe.SATURDAY_SHORT),full:a(oe.SATURDAY)}],w=_=>t.some(h=>{const y=h.start.getTime(),T=h.end.getTime(),C=_.getTime();return C>=y&&C<=T}),b=_=>{w(_)||(c(_),g(_.getDate()),e&&e(Yr(_)))},N=()=>{u===0?(l(11),p(d-1)):l(u-1),g(1)},$=()=>{u===11?(l(0),p(d+1)):l(u+1),g(1)},U=(_,h)=>new Date(_,h+1,0).getDate(),j=(_,h)=>new Date(_,h,1).getDay(),A=_=>{var y;const h=B.findIndex(T=>T!==null&&T.getDate()===_);h!==-1&&S.current[h]&&((y=S.current[h])==null||y.focus(),g(_))},D=(_,h)=>{const y=B[h];if(!y)return;const T=U(d,u),C=y.getDate();switch(_.key){case"ArrowRight":_.preventDefault();{let R=C+1,L=new Date(d,u,R);if(R>T){const F=u===11?d+1:d,V=u===11?0:u+1;R=1,L=new Date(F,V,R),$(),setTimeout(()=>{k(1,"forward")},0);return}w(L)?k(R,"forward"):A(R)}break;case"Tab":break;case"ArrowLeft":_.preventDefault();{let R=C-1,L=new Date(d,u,R);if(R<1){const F=u===0?d-1:d,V=u===0?11:u-1,M=U(F,V);R=M,L=new Date(F,V,R),N(),setTimeout(()=>{k(M,"backward")},0);return}w(L)?k(R,"backward"):A(R)}break;case"ArrowUp":_.preventDefault();{let R=C-7,L=new Date(d,u,R);if(R<1){const F=u===0?d-1:d,V=u===0?11:u-1;R=U(F,V)+R,L=new Date(F,V,R),N(),setTimeout(()=>{k(R,"backward")},0);return}w(L)?k(R,"backward"):A(R)}break;case"ArrowDown":_.preventDefault();{let R=C+7,L=new Date(d,u,R);if(R>T){const F=u===11?d+1:d,V=u===11?0:u+1;R=R-T,L=new Date(F,V,R),$(),setTimeout(()=>{k(R,"forward")},0);return}w(L)?k(R,"forward"):A(R)}break;case"Home":_.preventDefault(),k(1,"forward");break;case"End":_.preventDefault(),k(T,"backward");break;case"PageUp":_.preventDefault(),N(),setTimeout(()=>{const R=U(u===0?d-1:d,u===0?11:u-1),L=Math.min(C,R);k(L,"forward")},0);break;case"PageDown":_.preventDefault(),$(),setTimeout(()=>{const R=U(u===11?d+1:d,u===11?0:u+1),L=Math.min(C,R);k(L,"forward")},0);break;case" ":case"Space":if(w(y))return;g(y.getDate()),c(y);break;case"Enter":_.preventDefault(),b(y);break}},k=(_,h)=>{const y=U(d,u);if(h==="forward"){for(let T=_;T<=y;T++){const C=new Date(d,u,T);if(!w(C)){A(T);return}}$(),setTimeout(()=>{k(1,"forward")},0)}else{for(let L=_;L>=1;L--){const F=new Date(d,u,L);if(!w(F)){A(L);return}}const T=u===0?d-1:d,C=u===0?11:u-1,R=U(T,C);N(),setTimeout(()=>{k(R,"backward")},0)}},B=(()=>{const _=U(d,u),h=j(d,u),y=[];for(let T=0;T<h;T++)y.push(null);for(let T=1;T<=_;T++){const C=new Date(d,u,T);y.push(C)}return y})(),K=[];let q=[];B.forEach((_,h)=>{if(q.push(_),q.length===7||h===B.length-1){for(;q.length<7;)q.push(null);K.push(q),q=[]}}),P.useEffect(()=>{var _;if(m!==null){const h=B.findIndex(y=>y!==null&&y.getDate()===m);h!==-1&&S.current[h]&&((_=S.current[h])==null||_.focus())}},[u,d,m,B]);const X={label:"smp-datepickercalendar-label",wrapper:"smp-datepickercalendar",calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(_,h,y,T)=>`smp-datepickercalendar-td
|
|
46
46
|
${_?"smp-datepickercalendar-td-today":""}
|
|
47
|
-
${
|
|
47
|
+
${h?"smp-datepickercalendar-td-selected":""}
|
|
48
48
|
${y?"smp-datepickercalendar-td-focused":""}
|
|
49
|
-
${T?"smp-datepickercalendar-td-disabled":""}`},H=()=>`${E[u]} ${d.toString()}`;return v.jsxs("div",{className:X.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[v.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[v.jsx(xe,{onClick:N,ariaLabel:a(mt.PREVIOUS_MONTH),bindValue:"<",appearance:"ghost",variant:"base"}),v.jsx("div",{"aria-label":H(),className:X.label,children:H()}),v.jsx(xe,{onClick:$,ariaLabel:a(mt.NEXT_MONTH),bindValue:">",appearance:"ghost",variant:"base"})]}),v.jsxs("table",{ref:x,role:"grid","aria-label":`${a(St.CALENDAR_FOR)} ${E[u]} ${d}`,className:X.table,children:[v.jsx("thead",{children:v.jsx("tr",{children:R.map(_=>v.jsx("th",{scope:"col",abbr:_.full,className:X.th,children:_.value},_.value))})}),v.jsx("tbody",{children:K.map((_,p)=>v.jsx("tr",{children:_.map((y,T)=>{const C=p*7+T;if(y===null)return v.jsx("td",{className:X.td(!1,!1,!1,!0)},`empty-${T}`);const O=y.getDate()===o.getDate()&&y.getMonth()===o.getMonth()&&y.getFullYear()===o.getFullYear(),L=c&&y.getDate()===c.getDate()&&y.getMonth()===c.getMonth()&&y.getFullYear()===c.getFullYear(),F=m===y.getDate(),V=S(y);return v.jsx("td",{role:"gridcell","aria-selected":L,tabIndex:F?0:-1,onClick:()=>b(y),onKeyDown:M=>D(M,C),"aria-label":`${y.getDate()} ${E[y.getMonth()]} ${y.getFullYear()}`,"data-selected":L,"aria-disabled":V,ref:M=>{w.current[C]=M},className:X.td(O,L,F,V),children:y.getDate()},`day-${T}`)})},`week-${p}`))})]})]})}const Or=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const[i,o]=P.useState(!1),[c,l]=P.useState(r||""),[u,f]=P.useState(""),{anchorRef:d,targetRef:h}=yt({position:"bottom",enabled:i});qe(h,()=>{o(!1)}),qe(d,()=>{if(typeof d=="object"&&d!==null&&"current"in d){const $=d.current.querySelector("input");$&&$===document.activeElement&&E()}}),Sr(i,h);const{format:m,getCurrentLanguage:g}=et(),x=P.useCallback($=>{const U=$.length>5&&Mr($,g())||$,j=m(U,void 0,void 0,{type:"date"}),A=typeof U!="string",D=A&&U.toISOString().substring(0,10)||"";return{isValid:A,formattedDate:j,isoDate:D,normalizedDate:U}},[g,m]);P.useEffect(()=>{const{formattedDate:$,isoDate:U,isValid:j}=x(r);l(j&&U||r),f(j&&$||r)},[r,m,x]);const w=()=>o($=>!$),E=()=>{S(u)},R=$=>{S($),o(!1)},S=$=>{const{isoDate:U,isValid:j}=x($);t&&t(j&&U||$)},b=$=>{f($)},N=$=>{$.key==="Enter"&&($.preventDefault(),S(u))};return v.jsxs("div",{"data-component":"date-picker",children:[v.jsx(we,{bindValue:u,placeholder:e,onBlur:E,onChange:b,onKeyDown:N,shapeIcon:"calendar",onShapeIconClick:w,ref:d,isEditable:s,...a}),i&&v.jsx(qn,{disabledDateRanges:n,onDateChange:R,initialValue:gt(c)&&c||"",targetRef:h})]})},zn=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:c,onOptionsRequest:l,onChange:u})=>{const f=r.map(m=>m.bindValue),d=(m,g)=>{const x=[...r];if(m=="")x.pop();else{const w=x.findIndex(E=>E.bindValue===m&&E.optionalDisplayValue===g);w>=0?x.splice(w,1):x.push({bindValue:m,optionalDisplayValue:g})}u==null||u(x)},h={container:"smp-multipleAutocomplete-container"};return v.jsxs("div",{className:h.container,"data-component":"multiple-autocomplete",children:[i&&v.jsx(je,{label:i,disabled:o}),v.jsx(xt,{elements:r,displayMode:e,isEditable:s,onChange:m=>{u==null||u(m)}}),v.jsx(bt,{bindValue:"",fun:c,isEditable:s,onChange:d,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:l,_multiActiveIndex:f})]})},Rr=({...r})=>{const[e,t]=P.useState(!1),n=e?"visibility-off":"visibility";return v.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},Kn=({...r})=>{const[e,t]=P.useState(r.bindValue),{translate:n}=et(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return v.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(St.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},Jn=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?v.jsxs("div",{className:n.wrapper,children:[v.jsx(je,{label:t}),v.jsx(Ae,{variant:"body",bindValue:e||r})]}):v.jsx(Ae,{variant:"body",bindValue:e||r})};class Se{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Se(e,e.k.split(";"))}static fromString(e){return new Se({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const We=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),lr=r=>{const e=Se.fromDataObj(r.obj),t=r.decode?Se.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},Xn=(r,e)=>{const t=new Se(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Se(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return We(r,t,n)},Zn=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:c,helperText:l,error:u,onBlur:f,onKeyDown:d})=>{const h=P.useId(),m=`${h}-helper`,g=u?"danger":s,x=l||!!u,w=R=>{t==null||t(R.target.value)},E={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${g?`smp-textarea-${g}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return v.jsxs("div",{className:E.wrapper,"data-component":"textarea",children:[o&&v.jsx(je,{htmlFor:h,label:o,disabled:r}),v.jsx("textarea",{id:h,value:e,placeholder:n,onChange:w,onBlur:f,className:E.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:c,"aria-labelledby":o?h:void 0,"aria-describedby":x?m:void 0}),x&&v.jsx(fr,{id:m,helperText:u,disabled:r,state:g})]})},wt=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:c,onChange:l,onClick:u,onEnter:f,onBlur:d,onOptionsRequest:h,isEditable:m})=>{const g={obj:t,shape:e,decode:r,icon:s,fun:a},x={onBlur:d,onOptionsRequest:h,fun:a,icon:s,label:o,isEditable:m,...n},w=(S,b,N)=>Ir(t)?We(S,new Ge(t,b).getLegacyValue()):We(S,b,N),E=S=>We(g,new Be(t,S).getLegacyValue()),R=S=>Xn(g,S);switch(e){case ne.AUTOCOMPLETE:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,N)=>{l==null||l(w(g,b,N))}};return v.jsx(bt,{...S})}case ne.BUTTON:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{u==null||u(w(g,t.k))}};return v.jsx(xe,{...S})}case ne.BUTTON_LIST:{const S={...x,options:c,onClick:(b,N)=>{const $={...g,fun:N};u==null||u(w($,b))}};return v.jsx(br,{...S})}case ne.COMBOBOX:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,N)=>{l==null||l(w(g,b,N))}};return v.jsx(wr,{...S})}case ne.SWITCH:case ne.CHECKBOX:{const S={...x,bindValue:Be.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:b=>{l==null||l(E(b))}};return v.jsx(xr,{...S})}case ne.CHIP:{const S={...x,elements:lr(g)};return v.jsx(xt,{...S})}case ne.DATE:{const S={...x,bindValue:Ge.fromDataObj(t).getValue(),onChange:b=>{l==null||l(w(g,b))}};return v.jsx(Or,{...S})}case ne.ICON:case ne.IMAGE:{const S={...x,icon:s,placeholderIcon:i,isInteractable:!!x.fun,onClick:()=>{u==null||u(w(g,t.k))}};return v.jsx(le,{...S})}case ne.MULTI_AUTOCOMPLETE:{const S={...x,elements:lr(g),onChange:b=>{l==null||l(R(b))}};return v.jsx(zn,{...S})}case ne.MEMO:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{l==null||l(w(g,b))}};return v.jsx(Zn,{...S})}case ne.PASSWORD:{const S={...x,bindValue:t.k,onChange:b=>{l==null||l(w(g,b))}};return v.jsx(Rr,{...S})}case ne.SPOTLIGHT:{const S={...x,bindValue:t.k,onEnter:b=>{f==null||f(w(g,b))}};return v.jsx(Kn,{...S})}case ne.TEXT_FIELD:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{l==null||l(w(g,b))}};return v.jsx(we,{...S})}default:{const S={...x,bindValue:t.k,optionalDisplayValue:r};return v.jsx(Jn,{...S})}}},Qn=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},jr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:jr(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=Qn(t.content.filter(c=>!!e[c.id]),+t.columns).map((c,l)=>({...t,id:`${t.id}-${l}`,content:c,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),cr=(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}},ur=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),de={"smp-layout":"_smp-layout_xrjwg_1","smp-layout-horizontal":"_smp-layout-horizontal_xrjwg_9","smp-layout-vertical":"_smp-layout-vertical_xrjwg_13","smp-layout-section-grid":"_smp-layout-section-grid_xrjwg_18","smp-layout-section-vertical":"_smp-layout-section-vertical_xrjwg_20","smp-layout-section-horizontal":"_smp-layout-section-horizontal_xrjwg_24","smp-layout-section-flex":"_smp-layout-section-flex_xrjwg_29","smp-layout-cell-container":"_smp-layout-cell-container_xrjwg_34","smp-grid-template-cols":"_smp-grid-template-cols_xrjwg_44","smp-grid-template-rows":"_smp-grid-template-rows_xrjwg_48","smp-layout-section-with-title":"_smp-layout-section-with-title_xrjwg_52","smp-layout-section-title":"_smp-layout-section-title_xrjwg_58"},Et=({layout:r,cells:e})=>{var f;if(!((f=r.sections)!=null&&f.length))return v.jsx(v.Fragment,{});const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=jr(r.sections,e),a=d=>d==null?void 0:d.reduce((h,m)=>{var R,S;let g="",x={},w={},E="";return(R=m.sections)!=null&&R.length?(g=de["smp-layout-section-grid"],x=a(m.sections),m.gridCols==null&&(E=`${de[m.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(m.horizontal||ur(m.sections))&&(w=cr(m.sections,m.horizontal?t:n)))):(S=m.content)!=null&&S.length&&(m.gridCols!==void 0&&m.gridCols>0?(g=de["smp-layout-section-grid"],E=`${de["smp-grid-template-cols"]}`,w={[t]:`repeat(${m.gridCols}, 1fr)`}):g=de["smp-layout-section-flex"]),{...h,...x,[m.id]:{classes:`${g} ${de[m.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${E} ${m.justify?`smp-justifyContent-${m.justify}`:""} ${m.align?`smp-alignItems-${m.align}`:""}`,styles:w}}},{}),i=a(s),o={container:`${de["smp-layout"]} ${r.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:i},c=r.horizontal||ur(r.sections)?cr(s,r.horizontal?t:n):{},l=d=>{var m;const h=v.jsx("div",{"smp-id":"section-"+d.id,className:o.sections[d.id].classes,style:o.sections[d.id].styles,children:(m=d.sections)!=null&&m.length?d.sections.map(g=>l(g)):d.content.map(g=>u(g,e[g.id],d.justify,d.align))},"section-"+d.id);return d.title?v.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[v.jsx("span",{className:`${de["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:v.jsx(je,{label:d.title})}),h]}):h},u=(d,h,m,g)=>{const x=d.colSpan!==void 0?d.colSpan>0?d.colSpan:d.colStart!==void 0&&d.colStart<1?1:null:null,w=x!==null?`span ${x}`:d.colStart,E=d.colEnd!==void 0&&d.colEnd>0?d.colEnd:"",R={gridColumnStart:w,gridColumnEnd:E},S=`${de["smp-layout-cell-container"]} ${m?`smp-justifyContent-${m}`:""} ${g?`smp-alignItems-${g}`:""}`;return h?v.jsx("div",{className:S,style:{...R},"smp-id":d.id,children:v.jsx(wt,{...h})},d.id):v.jsx(v.Fragment,{})};return v.jsx("div",{className:o.container,style:c,"smp-id":"layout",children:s==null?void 0:s.map(d=>l(d))})},es=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=P.useState(),a=P.useCallback(c=>{var u,f;if(!((u=c.rows)!=null&&u.length)||!((f=c.columns)!=null&&f.length))return{};const l=c.rows[0];return c.columns.filter(d=>d.visible).reduce((d,h)=>{const m=l.cells[h.name],g={...m,onChange:x=>{s(w=>w&&{...w,[h.name]:{...w[h.name],obj:{...w[h.name].obj,k:x.obj.k}}})},onClick:()=>{m.fun&&e&&e({...m})},onEnter:x=>{t&&t(x)}};return{...d,[h.name]:g}},{})},[e,t]);return P.useEffect(()=>{r&&s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&v.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:v.jsx(Et,{layout:r.rows[0].layout,cells:n})})},ts=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,rs=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:c})=>{var R,S;const[l,u]=P.useState(),[f,d]=P.useState(t??!0),h=P.useRef(null),m=s.trim()?s:"100vh",g=P.useCallback(b=>{var $,U;if(!(($=b==null?void 0:b.rows)!=null&&$.length)||!((U=b==null?void 0:b.columns)!=null&&U.length))return{};const N=b.rows[0];return b.columns.filter(j=>j.visible??!0).reduce((j,A)=>{const D=N.cells[A.name];if(!D||!f&&ce(n)&&D.shape!==ne.BUTTON&&D.shape!==ne.BUTTON_LIST)return j;const k={...D,onChange:W=>{u(B=>{const K={...B};return K!=null&&K[A.name]&&(K[A.name].obj.k=W.obj.k),K})},onClick:W=>{W.fun&&a&&a(W)},onEnter:W=>{i&&i(W)}};return c&&D.shape==ne.BUTTON_LIST&&(k.onOptionsRequest=(W,B)=>c(W,B).then(K=>ts(K))),!f&&ce(n)&&(k.data={...k.data,showText:!1,justify:"center"}),{...j,[A.name]:k}},{})},[f,n,a,i,c]),x=P.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?d(b=>!b):(d(!1),o==null||o())};if(P.useEffect(()=>{u(g(r))},[r]),P.useEffect(()=>{if(!h.current)return;if(!ce(n)){u(g(r));return}const b=getComputedStyle(h.current).getPropertyValue("--smp-drawer-slide-transition");let N=Number(b);b.endsWith("ms")?N=parseFloat(b):b.endsWith("s")&&(N=parseFloat(b)*1e3),setTimeout(()=>{u(g(r))},N/2)},[f,n]),P.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!((R=r==null?void 0:r.rows)!=null&&R.length)||!((S=r.columns)!=null&&S.length))return null;const E={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${f?"smp-drawer-open":""} ${!ce(n)&&!f?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${f?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${f?"smp-drawer-backdrop-open":""}`};return l&&v.jsxs(v.Fragment,{children:[!ce(n)&&v.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:E.backdrop,onClick:x}),v.jsx("aside",{ref:h,className:E.drawer,style:{height:m},"aria-label":"Drawer","smp-id":"drawer",children:v.jsxs("div",{className:E.container,children:[v.jsxs("div",{className:E.containerHeader,children:[e&&v.jsx("div",{className:E.containerLogo,children:v.jsx(le,{icon:e,title:"drawer_logo",width:"100%",height:24})}),v.jsx("div",{className:E.containerIcon,children:v.jsx(le,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!f,isInteractable:!0,onClick:w,width:20,height:20})})]}),v.jsx("div",{className:E.containerLayout,children:v.jsx(Et,{layout:r.rows[0].layout,cells:l})})]})})]})},ns=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:c,IconColName:l,IconColor:u="var(--smp-dashList-color-base)",NumberFormat:f,ForceUM:d,UmColName:h,UmColor:m="var(--smp-dashList-color-base)",ForceValue:g,ValueColName:x,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:R})=>{const S="N/A",b=(e==null?void 0:e.columns)||[],N=(e==null?void 0:e.rows)||[],$=N.length>0,U="--smp-dashList-color",j="smp-layout",A="descr",D="icon",k="um",W="value",B=i||"1em",K="18px",z="--smp-dashList-columns",X="--smp-dashList-fontSize",H={dash:(Y="1")=>{const Z=p(Y),te=Z,re=y(Z,A),fe=y(Z,D),ge=y(Z,k),pe=y(Z,W);return{container:te,descr:re,icon:fe,um:ge,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
-
${ce(o)?"smp-dash-list-horizontal":""}`},{format:_}=et(),p=Y=>`${j}-${Y}`,y=(Y,Z)=>`${Y}__${Z}`,T=Y=>`${U}-${Y}`,C=Y=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(Y)){const re=Y.match(Z)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return Y},O=Y=>{if(!f)return Y;const[Z,te]=L(f).map(Ee=>parseInt(Ee||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=_(Y,re,"it");if(!Z)return fe;const[ge,pe]=fe.split(",");return ge+(pe?`,${pe}`:"")},L=Y=>Y.includes(";")?Y.split(";"):[Y],F=Y=>{const Z=re=>{var fe;if(re)return(fe=Y==null?void 0:Y.cells[re])==null?void 0:fe.obj.k},te=re=>{var fe,ge;if(!(b.length<=re))return(ge=(fe=Y==null?void 0:Y.cells[b[re].name])==null?void 0:fe.obj)==null?void 0:ge.k};return{descr:t||Z(n)||te(2)||"",icon:c||Z(l)||te(3)||"",um:d||Z(h)||te(1)||"",value:g||Z(x)||te(0)||""}},V=Y=>{R==null||R(Y)},M=(Y,Z)=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),Y.stopPropagation(),V(Z))},G=(Y=>{const Z=H.dash(Y);return{className:Z,descr:te=>v.jsx("div",{className:Z.descr,children:te},`${Y}-${A}`),icon:te=>v.jsx("div",{className:Z.icon,children:v.jsx(le,{color:u,height:K,icon:te,width:K})},`${Y}-${D}`),um:te=>v.jsx("div",{className:Z.um,children:te},`${Y}-${k}`),value:te=>v.jsx("div",{className:Z.value,children:te},`${Y}-${W}`)}})(E),se=Y=>{const{descr:Z,icon:te,um:re,value:fe}=F(Y),ge={[T(A)]:C(s),[T(k)]:C(m),[T(W)]:C(w)},pe=[],Ee=O(fe);switch(E){case"2":te&&pe.push(G.icon(te)),pe.push(G.descr(Z)),pe.push(G.value(re?Ee+" "+re:Ee));break;default:case"1":pe.push(G.descr(Z)),pe.push(G.value(re?Ee+" "+re:Ee))}return v.jsx("div",{className:G.className.container,role:"button",style:ge,tabIndex:0,onClick:()=>V(Y),onKeyDown:Cr=>M(Cr,Y),children:pe},Y.rowId)},I={[z]:String(r),[X]:B};return v.jsx("div",{className:H.dashList,style:I,children:$?N.map(Y=>se(Y)):S})},ut={"smp-table":"_smp-table_8dmh0_1","smp-headerCell":"_smp-headerCell_8dmh0_35","smp-resizer":"_smp-resizer_8dmh0_44"},ss="_rowContent_gazwe_13",as="_clickable_gazwe_42",is="_indent_gazwe_47",os="_toggle_gazwe_53",ls="_rowLabel_gazwe_69",cs="_cell_gazwe_78",us="_leftSection_gazwe_86",be={rowContent:ss,clickable:as,indent:is,toggle:os,rowLabel:ls,cell:cs,leftSection:us};function He(r){return!!r&&"children"in r}function fs(r){return!He(r)}function ds(r){return JSON.stringify(r).split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0).toString()}const Dr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var E;const[a,i]=P.useState(!1),o=He(r)&&!!((E=r.children)!=null&&E.length),c=r.cells&&Object.keys(r.cells).length>0,l=o,u=t*20,f=()=>{o&&i(!a)},d={content:`${be.rowContent} ${o?be.clickable:""}`,toggle:`${be.toggle}`,indent:`${be.indent}`,cell:`${be.cell}`},h=R=>v.jsx(wt,{...R}),m=()=>v.jsx("span",{className:d.toggle,children:l?a?"▶":"▼":" "}),g=()=>v.jsx("span",{className:d.indent,style:{width:`${u}px`},"aria-hidden":"true"}),x=()=>{const R=fs(r)?"":r.decode||(c?"":"Untitled"),S=s??n*t;return v.jsxs("tr",{className:d.content,onClick:f,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${S}px)`},children:[He(r)&&v.jsxs("td",{className:be.leftSection,style:{height:`${n}px`},children:[g(),m(),v.jsx("span",{className:be.rowLabel,children:R})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([b,N])=>v.jsx("td",{className:d.cell,style:{width:e[b],minWidth:e[b],height:`${n}px`},children:h(N)},ds(N)||b))]})},w=()=>{var R;return a||!o?null:v.jsx(v.Fragment,{children:He(r)&&((R=r.children)==null?void 0:R.map((S,b)=>v.jsx(Dr,{row:S,level:t+1},`child-${b}`)))})};return v.jsxs(v.Fragment,{children:[x(),w()]})},ps=({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 v.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:v.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[v.jsx(le,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),v.jsx(Ae,{variant:"title",bindValue:r})]})})};function hs(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function ms(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 gs(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(f,d,h){if(d>=e.length){u(f);return}const m=e[d].column,g=o(f,m);for(const[x,w]of g){const E=[...h,x],R=c(E,d),S=n.has(R);s.push(l(x,R,d,S)),a+=t,S&&i(w,d+1,E)}}function o(f,d){var m;const h=new Map;for(const g of f){const x=((m=g.cells[d])==null?void 0:m.decode)??"N/D";h.has(x)||h.set(x,[]),h.get(x).push(g)}return h}function c(f,d){return`group-${f.join("-")}-${d}`}function l(f,d,h,m){return{isGroup:!0,value:f,cells:{},rowId:d,level:h,isExpanded:m}}function u(f){for(const d of f)s.push(d),a+=t}}const ys=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return v.jsxs("div",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[v.jsx(le,{icon:"groups"}),v.jsx(xt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})]})},vs=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var U;const[i,o]=P.useState(r),[c,l]=P.useState(n||[]),[u,f]=P.useState(new Set),d=i&&i.columns?Object.fromEntries(i.columns.map(j=>[j.name,120])):{},[h,m]=P.useState(d),g=P.useRef(null);P.useEffect(()=>{var D;if(!i||!i.columns||i.columns.length)return;const j=((D=g.current)==null?void 0:D.clientWidth)??1e3;let A={};switch(s){case"fixed":A=Object.fromEntries(i.columns.map(k=>[k.name,120]));break;case"fit-grid":{const k=i.columns.filter(B=>B.visible),W=Math.floor(j/k.length);A=Object.fromEntries(k.map(B=>[B.name,W]));break}case"fit-content":A=Object.fromEntries(i.columns.map(k=>{const W=Math.max(...r.rows.map(H=>{var y;const _=(y=H==null?void 0:H.cells)==null?void 0:y[k.name],p=(_==null?void 0:_.decode)||(_==null?void 0:_.value);return p?String(p).length:0}),0),B=k.title?k.title.length:0,K=Math.max(W,B);return[k.name,Math.max(50,K*8+16)]}));break}m(A)},[s,r,i]),P.useEffect(()=>{if(c!=null&&c.length&&r.rows){const{flatRows:j}=gs(r.rows,c,e,u);o({...r,rows:j})}else o(r)},[r,c,u,e]);const x=j=>{l(ms(j,c))},w=j=>{j.preventDefault();const A=j.dataTransfer.getData("text/plain");if(!A||c.some(W=>W.column===A))return;const k=[...c,{column:A,visible:!0}];l(k)},E=j=>{j.preventDefault()},{virtualItems:R,containerProps:S,innerProps:b}=gr({items:(i==null?void 0:i.rows)||[],itemHeight:e,containerHeight:t,overscan:5}),N=(j,A)=>{const D=j.clientX,k=h[A],W=K=>{const z=K.clientX-D,X=Math.max(50,k+z);m(H=>({...H,[A]:X}))},B=()=>{window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",B)};window.addEventListener("mousemove",W),window.addEventListener("mouseup",B)},$={smpTable:`${ut["smp-table"]}`,headerCell:`${ut["smp-headerCell"]}`,resizer:`${ut["smp-resizer"]}`};return i&&v.jsx("div",{className:$.smpTable,...S,ref:g,children:v.jsxs("table",{children:[v.jsxs("thead",{children:[(n||a)&&v.jsx(ys,{groups:c,onChange:x,onDrop:w,onDragOver:E}),v.jsx("tr",{children:i.columns&&((U=i.columns)==null?void 0:U.map(j=>j.visible&&v.jsxs("th",{className:$.headerCell,draggable:!0,onDragStart:A=>{A.dataTransfer.setData("text/plain",j.name)},style:{width:h[j.name],minWidth:h[j.name],maxWidth:h[j.name]},children:[v.jsx(Ae,{variant:"title",bindValue:j.title}),v.jsx("div",{className:$.resizer,onMouseDown:A=>N(A,j.name),role:"region"})]},j.name)))})]}),v.jsx("tbody",{...b,children:R.map(({item:j,index:A,offsetTop:D})=>j.isGroup?v.jsx(ps,{label:j.value||"",rowHeight:e,offsetTop:D,level:j.level,onClick:()=>{const k=j.rowId;k&&f(W=>hs(W,k))},isExpanded:j.isExpanded},j.rowId||`group-${A}`):v.jsx(Dr,{row:j,columnWidths:h,rowHeight:e,offsetTop:D,isGroup:!1},j.rowId||`row-${A}`))}),v.jsx("tfoot",{children:v.jsx("span",{children:"Tfooter here"})})]})})},bs=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:c,onOptionsRequest:l})=>{const[u,f]=P.useState();P.useEffect(()=>{f(()=>{if(!r)return;const g={...r};return e&&(g.shape=e),g.shape==null&&(g.shape=ne.TEXT_FIELD),s&&(g.obj=Nr(s)),g})},[r,s,e]);const h={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},m=()=>{ce(t)||o==null||o(u)};if(u)return v.jsxs("div",{className:h.container,children:[v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:v.jsx(wt,{...u,onChange:f,onOptionsRequest:l,fun:r==null?void 0:r.fun,onBlur:m,label:a,labelPosition:i})}),ce(t)&&v.jsx(xe,{optionalDisplayValue:"Confirm",onClick:()=>c==null?void 0:c(u),bindValue:"Confirm"})]})},xs=({data:r,readOnly:e=!1,optionsHandler:t,onSubmit:n})=>{const[s,a]=P.useState({});P.useEffect(()=>{a(o(r))},[r]);const i=()=>{const l=c();n({value:l})},o=l=>{var f,d,h;if(!((f=l.rows)!=null&&f.length)||!((d=l.columns)!=null&&d.length))return{};const u=(h=l.rows)==null?void 0:h[0];return l.columns.filter(m=>m.visible??!0).reduce((m,g)=>{const x={...u.cells[g.name],label:g.title,onChange:w=>{a(E=>({...E,[g.name]:{...E[g.name],obj:{...E[g.name].obj,k:w.obj.k},decode:w.decode}}))}};return x.fun&&(x.shape==ne.AUTOCOMPLETE||x.shape==ne.MULTI_AUTOCOMPLETE||x.shape==ne.COMBOBOX)&&(x.onOptionsRequest=(w,E)=>t(w,E,r,g.name)),x.isEditable==null&&(x.isEditable=!0),e&&(x.isEditable=!1),x.isEditable&&x.shape==null&&(x.shape=ne.TEXT_FIELD),{...m,[g.name]:x}},{})},c=()=>{const l={columns:[...r.columns],rows:[{cells:{}}]};return Object.entries(s).forEach(([u,f])=>{l.rows[0].cells[u]={obj:{...f.obj},decode:f.decode,shape:f.shape}}),{before:r,after:l}};return s&&v.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[v.jsx(Et,{layout:r.rows[0].layout,cells:s}),v.jsx(xe,{onClick:i,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=es;exports.Autocomplete=bt;exports.Button=xe;exports.ButtonList=br;exports.Checkbox=xr;exports.Combobox=wr;exports.DashList=ns;exports.DataTableComponent=vs;exports.DatePicker=Or;exports.Drawer=rs;exports.Field=bs;exports.Icon=le;exports.InputPanel=xs;exports.Password=Rr;exports.Textfield=we;exports.configurePaths=un;
|
|
49
|
+
${T?"smp-datepickercalendar-td-disabled":""}`},H=()=>`${E[u]} ${d.toString()}`;return v.jsxs("div",{className:X.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[v.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[v.jsx(xe,{onClick:N,ariaLabel:a(mt.PREVIOUS_MONTH),bindValue:"<",appearance:"ghost",variant:"base"}),v.jsx("div",{"aria-label":H(),className:X.label,children:H()}),v.jsx(xe,{onClick:$,ariaLabel:a(mt.NEXT_MONTH),bindValue:">",appearance:"ghost",variant:"base"})]}),v.jsxs("table",{ref:x,role:"grid","aria-label":`${a(St.CALENDAR_FOR)} ${E[u]} ${d}`,className:X.table,children:[v.jsx("thead",{children:v.jsx("tr",{children:O.map(_=>v.jsx("th",{scope:"col",abbr:_.full,className:X.th,children:_.value},_.value))})}),v.jsx("tbody",{children:K.map((_,h)=>v.jsx("tr",{children:_.map((y,T)=>{const C=h*7+T;if(y===null)return v.jsx("td",{className:X.td(!1,!1,!1,!0)},`empty-${T}`);const R=y.getDate()===o.getDate()&&y.getMonth()===o.getMonth()&&y.getFullYear()===o.getFullYear(),L=f&&y.getDate()===f.getDate()&&y.getMonth()===f.getMonth()&&y.getFullYear()===f.getFullYear(),F=m===y.getDate(),V=w(y);return v.jsx("td",{role:"gridcell","aria-selected":L,tabIndex:F?0:-1,onClick:()=>b(y),onKeyDown:M=>D(M,C),"aria-label":`${y.getDate()} ${E[y.getMonth()]} ${y.getFullYear()}`,"data-selected":L,"aria-disabled":V,ref:M=>{S.current[C]=M},className:X.td(R,L,F,V),children:y.getDate()},`day-${T}`)})},`week-${h}`))})]})]})}const Or=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const[i,o]=P.useState(!1),[f,c]=P.useState(r||""),[u,l]=P.useState(""),{anchorRef:d,targetRef:p}=yt({position:"bottom",enabled:i});ze(p,()=>{o(!1)}),ze(d,()=>{if(typeof d=="object"&&d!==null&&"current"in d){const $=d.current.querySelector("input");$&&$===document.activeElement&&E()}}),Sr(i,p);const{format:m,getCurrentLanguage:g}=et(),x=P.useCallback($=>{const U=$.length>5&&Mr($,g())||$,j=m(U,void 0,void 0,{type:"date"}),A=typeof U!="string",D=A&&U.toISOString().substring(0,10)||"";return{isValid:A,formattedDate:j,isoDate:D,normalizedDate:U}},[g,m]);P.useEffect(()=>{const{formattedDate:$,isoDate:U,isValid:j}=x(r);c(j&&U||r),l(j&&$||r)},[r,m,x]);const S=()=>o($=>!$),E=()=>{w(u)},O=$=>{w($),o(!1)},w=$=>{const{isoDate:U,isValid:j}=x($);t&&t(j&&U||$)},b=$=>{l($)},N=$=>{$.key==="Enter"&&($.preventDefault(),w(u))};return v.jsxs("div",{"data-component":"date-picker",children:[v.jsx(we,{bindValue:u,placeholder:e,onBlur:E,onChange:b,onKeyDown:N,shapeIcon:"calendar",onShapeIconClick:S,ref:d,isEditable:s,...a}),i&&v.jsx(zn,{disabledDateRanges:n,onDateChange:O,initialValue:gt(f)&&f||"",targetRef:p})]})},qn=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:f,onOptionsRequest:c,onChange:u})=>{const l=r.map(m=>m.bindValue),d=(m,g)=>{const x=[...r];if(m=="")x.pop();else{const S=x.findIndex(E=>E.bindValue===m&&E.optionalDisplayValue===g);S>=0?x.splice(S,1):x.push({bindValue:m,optionalDisplayValue:g})}u==null||u(x)},p={container:"smp-multipleAutocomplete-container"};return v.jsxs("div",{className:p.container,"data-component":"multiple-autocomplete",children:[i&&v.jsx(je,{label:i,disabled:o}),v.jsx(xt,{elements:r,displayMode:e,isEditable:s,onChange:m=>{u==null||u(m)}}),v.jsx(bt,{bindValue:"",fun:f,isEditable:s,onChange:d,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:c,_multiActiveIndex:l})]})},Rr=({...r})=>{const[e,t]=P.useState(!1),n=e?"visibility-off":"visibility";return v.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},Kn=({...r})=>{const[e,t]=P.useState(r.bindValue),{translate:n}=et(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return v.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(St.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},Jn=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?v.jsxs("div",{className:n.wrapper,children:[v.jsx(je,{label:t}),v.jsx(Ae,{variant:"body",bindValue:e||r})]}):v.jsx(Ae,{variant:"body",bindValue:e||r})};class Se{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Se(e,e.k.split(";"))}static fromString(e){return new Se({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const We=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),lr=r=>{const e=Se.fromDataObj(r.obj),t=r.decode?Se.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},Xn=(r,e)=>{const t=new Se(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Se(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return We(r,t,n)},Zn=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:f,helperText:c,error:u,onBlur:l,onKeyDown:d})=>{const p=P.useId(),m=`${p}-helper`,g=u?"danger":s,x=c||!!u,S=O=>{t==null||t(O.target.value)},E={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${g?`smp-textarea-${g}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return v.jsxs("div",{className:E.wrapper,"data-component":"textarea",children:[o&&v.jsx(je,{htmlFor:p,label:o,disabled:r}),v.jsx("textarea",{id:p,value:e,placeholder:n,onChange:S,onBlur:l,className:E.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:f,"aria-labelledby":o?p:void 0,"aria-describedby":x?m:void 0}),x&&v.jsx(fr,{id:m,helperText:u,disabled:r,state:g})]})},wt=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:f,onChange:c,onClick:u,onEnter:l,onBlur:d,onOptionsRequest:p,isEditable:m})=>{const g={obj:t,shape:e,decode:r,icon:s,fun:a},x={onBlur:d,onOptionsRequest:p,fun:a,icon:s,label:o,isEditable:m,...n},S=(w,b,N)=>Ir(t)?We(w,new Ge(t,b).getLegacyValue()):We(w,b,N),E=w=>We(g,new Be(t,w).getLegacyValue()),O=w=>Xn(g,w);switch(e){case ne.AUTOCOMPLETE:{const w={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,N)=>{c==null||c(S(g,b,N))}};return v.jsx(bt,{...w})}case ne.BUTTON:{const w={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{u==null||u(S(g,t.k))}};return v.jsx(xe,{...w})}case ne.BUTTON_LIST:{const w={...x,options:f,onClick:(b,N)=>{const $={...g,fun:N};u==null||u(S($,b))}};return v.jsx(br,{...w})}case ne.COMBOBOX:{const w={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,N)=>{c==null||c(S(g,b,N))}};return v.jsx(wr,{...w})}case ne.SWITCH:case ne.CHECKBOX:{const w={...x,bindValue:Be.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:b=>{c==null||c(E(b))}};return v.jsx(xr,{...w})}case ne.CHIP:{const w={...x,elements:lr(g)};return v.jsx(xt,{...w})}case ne.DATE:{const w={...x,bindValue:Ge.fromDataObj(t).getValue(),onChange:b=>{c==null||c(S(g,b))}};return v.jsx(Or,{...w})}case ne.ICON:case ne.IMAGE:{const w={...x,icon:s,placeholderIcon:i,isInteractable:!!x.fun,onClick:()=>{u==null||u(S(g,t.k))}};return v.jsx(le,{...w})}case ne.MULTI_AUTOCOMPLETE:{const w={...x,elements:lr(g),onChange:b=>{c==null||c(O(b))}};return v.jsx(qn,{...w})}case ne.MEMO:{const w={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{c==null||c(S(g,b))}};return v.jsx(Zn,{...w})}case ne.PASSWORD:{const w={...x,bindValue:t.k,onChange:b=>{c==null||c(S(g,b))}};return v.jsx(Rr,{...w})}case ne.SPOTLIGHT:{const w={...x,bindValue:t.k,onEnter:b=>{l==null||l(S(g,b))}};return v.jsx(Kn,{...w})}case ne.TEXT_FIELD:{const w={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{c==null||c(S(g,b))}};return v.jsx(we,{...w})}default:{const w={...x,bindValue:t.k,optionalDisplayValue:r};return v.jsx(Jn,{...w})}}},Qn=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},jr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:jr(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=Qn(t.content.filter(f=>!!e[f.id]),+t.columns).map((f,c)=>({...t,id:`${t.id}-${c}`,content:f,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),cr=(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}},ur=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),de={"smp-layout":"_smp-layout_xrjwg_1","smp-layout-horizontal":"_smp-layout-horizontal_xrjwg_9","smp-layout-vertical":"_smp-layout-vertical_xrjwg_13","smp-layout-section-grid":"_smp-layout-section-grid_xrjwg_18","smp-layout-section-vertical":"_smp-layout-section-vertical_xrjwg_20","smp-layout-section-horizontal":"_smp-layout-section-horizontal_xrjwg_24","smp-layout-section-flex":"_smp-layout-section-flex_xrjwg_29","smp-layout-cell-container":"_smp-layout-cell-container_xrjwg_34","smp-grid-template-cols":"_smp-grid-template-cols_xrjwg_44","smp-grid-template-rows":"_smp-grid-template-rows_xrjwg_48","smp-layout-section-with-title":"_smp-layout-section-with-title_xrjwg_52","smp-layout-section-title":"_smp-layout-section-title_xrjwg_58"},Et=({cells:r,layout:e={horizontal:!1,sections:[{id:"1",content:Object.keys(r).map(t=>({id:t}))}]}})=>{const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=jr(e.sections||[],r),a=l=>l==null?void 0:l.reduce((d,p)=>{var E,O;let m="",g={},x={},S="";return(E=p.sections)!=null&&E.length?(m=de["smp-layout-section-grid"],g=a(p.sections),p.gridCols==null&&(S=`${de[p.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(p.horizontal||ur(p.sections))&&(x=cr(p.sections,p.horizontal?t:n)))):(O=p.content)!=null&&O.length&&(p.gridCols!==void 0&&p.gridCols>0?(m=de["smp-layout-section-grid"],S=`${de["smp-grid-template-cols"]}`,x={[t]:`repeat(${p.gridCols}, 1fr)`}):m=de["smp-layout-section-flex"]),{...d,...g,[p.id]:{classes:`${m} ${de[p.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${S} ${p.justify?`smp-justifyContent-${p.justify}`:""} ${p.align?`smp-alignItems-${p.align}`:""}`,styles:x}}},{}),i=a(s),o={container:`${de["smp-layout"]} ${e.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:i},f=e.horizontal||ur(e.sections||[])?cr(s,e.horizontal?t:n):{},c=l=>{var p;const d=v.jsx("div",{"smp-id":"section-"+l.id,className:o.sections[l.id].classes,style:o.sections[l.id].styles,children:(p=l.sections)!=null&&p.length?l.sections.map(m=>c(m)):l.content.map(m=>u(m,r[m.id],l.justify,l.align))},"section-"+l.id);return l.title?v.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[v.jsx("span",{className:`${de["smp-layout-section-title"]} ${l.justify?`smp-justifyContent-${l.justify}`:""} ${l.align?`smp-alignItems-${l.align}`:""}`,children:v.jsx(je,{label:l.title})}),d]}):d},u=(l,d,p,m)=>{const g=l.colSpan!==void 0?l.colSpan>0?l.colSpan:l.colStart!==void 0&&l.colStart<1?1:null:null,x=g!==null?`span ${g}`:l.colStart,S=l.colEnd!==void 0&&l.colEnd>0?l.colEnd:"",E={gridColumnStart:x,gridColumnEnd:S},O=`${de["smp-layout-cell-container"]} ${p?`smp-justifyContent-${p}`:""} ${m?`smp-alignItems-${m}`:""}`;return d?v.jsx("div",{className:O,style:{...E},"smp-id":l.id,children:v.jsx(wt,{...d})},l.id):v.jsx(v.Fragment,{})};return v.jsx("div",{className:o.container,style:f,"smp-id":"layout",children:s==null?void 0:s.map(l=>c(l))})},es=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=P.useState(),a=P.useCallback(f=>{var u,l;if(!((u=f.rows)!=null&&u.length)||!((l=f.columns)!=null&&l.length))return{};const c=f.rows[0];return f.columns.filter(d=>d.visible).reduce((d,p)=>{const m=c.cells[p.name],g={...m,onChange:x=>{s(S=>S&&{...S,[p.name]:{...S[p.name],obj:{...S[p.name].obj,k:x.obj.k}}})},onClick:()=>{m.fun&&e&&e({...m})},onEnter:x=>{t&&t(x)}};return{...d,[p.name]:g}},{})},[e,t]);return P.useEffect(()=>{r&&s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&v.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:v.jsx(Et,{layout:r.rows[0].layout,cells:n})})},ts=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,rs=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:f})=>{var O,w;const[c,u]=P.useState(),[l,d]=P.useState(t??!0),p=P.useRef(null),m=s.trim()?s:"100vh",g=P.useCallback(b=>{var $,U;if(!(($=b==null?void 0:b.rows)!=null&&$.length)||!((U=b==null?void 0:b.columns)!=null&&U.length))return{};const N=b.rows[0];return b.columns.filter(j=>j.visible??!0).reduce((j,A)=>{const D=N.cells[A.name];if(!D||!l&&ce(n)&&D.shape!==ne.BUTTON&&D.shape!==ne.BUTTON_LIST)return j;const k={...D,onChange:W=>{u(B=>{const K={...B};return K!=null&&K[A.name]&&(K[A.name].obj.k=W.obj.k),K})},onClick:W=>{W.fun&&a&&a(W)},onEnter:W=>{i&&i(W)}};return f&&D.shape==ne.BUTTON_LIST&&(k.onOptionsRequest=(W,B)=>f(W,B).then(K=>ts(K))),!l&&ce(n)&&(k.data={...k.data,showText:!1,justify:"center"}),{...j,[A.name]:k}},{})},[l,n,a,i,f]),x=P.useCallback(()=>{o==null||o()},[o]),S=()=>{ce(n)?d(b=>!b):(d(!1),o==null||o())};if(P.useEffect(()=>{u(g(r))},[r]),P.useEffect(()=>{if(!p.current)return;if(!ce(n)){u(g(r));return}const b=getComputedStyle(p.current).getPropertyValue("--smp-drawer-slide-transition");let N=Number(b);b.endsWith("ms")?N=parseFloat(b):b.endsWith("s")&&(N=parseFloat(b)*1e3),setTimeout(()=>{u(g(r))},N/2)},[l,n]),P.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!((O=r==null?void 0:r.rows)!=null&&O.length)||!((w=r.columns)!=null&&w.length))return null;const E={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${l?"smp-drawer-open":""} ${!ce(n)&&!l?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${l?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${l?"smp-drawer-backdrop-open":""}`};return c&&v.jsxs(v.Fragment,{children:[!ce(n)&&v.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:E.backdrop,onClick:x}),v.jsx("aside",{ref:p,className:E.drawer,style:{height:m},"aria-label":"Drawer","smp-id":"drawer",children:v.jsxs("div",{className:E.container,children:[v.jsxs("div",{className:E.containerHeader,children:[e&&v.jsx("div",{className:E.containerLogo,children:v.jsx(le,{icon:e,title:"drawer_logo",width:"100%",height:24})}),v.jsx("div",{className:E.containerIcon,children:v.jsx(le,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!l,isInteractable:!0,onClick:S,width:20,height:20})})]}),v.jsx("div",{className:E.containerLayout,children:v.jsx(Et,{layout:r.rows[0].layout,cells:c})})]})})]})},ns=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:f,IconColName:c,IconColor:u="var(--smp-dashList-color-base)",NumberFormat:l,ForceUM:d,UmColName:p,UmColor:m="var(--smp-dashList-color-base)",ForceValue:g,ValueColName:x,ValueColor:S="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:O})=>{const w="N/A",b=(e==null?void 0:e.columns)||[],N=(e==null?void 0:e.rows)||[],$=N.length>0,U="--smp-dashList-color",j="smp-layout",A="descr",D="icon",k="um",W="value",B=i||"1em",K="18px",q="--smp-dashList-columns",X="--smp-dashList-fontSize",H={dash:(Y="1")=>{const Z=h(Y),te=Z,re=y(Z,A),fe=y(Z,D),ge=y(Z,k),pe=y(Z,W);return{container:te,descr:re,icon:fe,um:ge,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
+
${ce(o)?"smp-dash-list-horizontal":""}`},{format:_}=et(),h=Y=>`${j}-${Y}`,y=(Y,Z)=>`${Y}__${Z}`,T=Y=>`${U}-${Y}`,C=Y=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(Y)){const re=Y.match(Z)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return Y},R=Y=>{if(!l)return Y;const[Z,te]=L(l).map(Ee=>parseInt(Ee||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=_(Y,re,"it");if(!Z)return fe;const[ge,pe]=fe.split(",");return ge+(pe?`,${pe}`:"")},L=Y=>Y.includes(";")?Y.split(";"):[Y],F=Y=>{const Z=re=>{var fe;if(re)return(fe=Y==null?void 0:Y.cells[re])==null?void 0:fe.obj.k},te=re=>{var fe,ge;if(!(b.length<=re))return(ge=(fe=Y==null?void 0:Y.cells[b[re].name])==null?void 0:fe.obj)==null?void 0:ge.k};return{descr:t||Z(n)||te(2)||"",icon:f||Z(c)||te(3)||"",um:d||Z(p)||te(1)||"",value:g||Z(x)||te(0)||""}},V=Y=>{O==null||O(Y)},M=(Y,Z)=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),Y.stopPropagation(),V(Z))},G=(Y=>{const Z=H.dash(Y);return{className:Z,descr:te=>v.jsx("div",{className:Z.descr,children:te},`${Y}-${A}`),icon:te=>v.jsx("div",{className:Z.icon,children:v.jsx(le,{color:u,height:K,icon:te,width:K})},`${Y}-${D}`),um:te=>v.jsx("div",{className:Z.um,children:te},`${Y}-${k}`),value:te=>v.jsx("div",{className:Z.value,children:te},`${Y}-${W}`)}})(E),se=Y=>{const{descr:Z,icon:te,um:re,value:fe}=F(Y),ge={[T(A)]:C(s),[T(k)]:C(m),[T(W)]:C(S)},pe=[],Ee=R(fe);switch(E){case"2":te&&pe.push(G.icon(te)),pe.push(G.descr(Z)),pe.push(G.value(re?Ee+" "+re:Ee));break;default:case"1":pe.push(G.descr(Z)),pe.push(G.value(re?Ee+" "+re:Ee))}return v.jsx("div",{className:G.className.container,role:"button",style:ge,tabIndex:0,onClick:()=>V(Y),onKeyDown:Cr=>M(Cr,Y),children:pe},Y.rowId)},I={[q]:String(r),[X]:B};return v.jsx("div",{className:H.dashList,style:I,children:$?N.map(Y=>se(Y)):w})},ut={"smp-table":"_smp-table_8dmh0_1","smp-headerCell":"_smp-headerCell_8dmh0_35","smp-resizer":"_smp-resizer_8dmh0_44"},ss="_rowContent_gazwe_13",as="_clickable_gazwe_42",is="_indent_gazwe_47",os="_toggle_gazwe_53",ls="_rowLabel_gazwe_69",cs="_cell_gazwe_78",us="_leftSection_gazwe_86",be={rowContent:ss,clickable:as,indent:is,toggle:os,rowLabel:ls,cell:cs,leftSection:us};function He(r){return!!r&&"children"in r}function fs(r){return!He(r)}function ds(r){return JSON.stringify(r).split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0).toString()}const Dr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var E;const[a,i]=P.useState(!1),o=He(r)&&!!((E=r.children)!=null&&E.length),f=r.cells&&Object.keys(r.cells).length>0,c=o,u=t*20,l=()=>{o&&i(!a)},d={content:`${be.rowContent} ${o?be.clickable:""}`,toggle:`${be.toggle}`,indent:`${be.indent}`,cell:`${be.cell}`},p=O=>v.jsx(wt,{...O}),m=()=>v.jsx("span",{className:d.toggle,children:c?a?"▶":"▼":" "}),g=()=>v.jsx("span",{className:d.indent,style:{width:`${u}px`},"aria-hidden":"true"}),x=()=>{const O=fs(r)?"":r.decode||(f?"":"Untitled"),w=s??n*t;return v.jsxs("tr",{className:d.content,onClick:l,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${w}px)`},children:[He(r)&&v.jsxs("td",{className:be.leftSection,style:{height:`${n}px`},children:[g(),m(),v.jsx("span",{className:be.rowLabel,children:O})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([b,N])=>v.jsx("td",{className:d.cell,style:{width:e[b],minWidth:e[b],height:`${n}px`},children:p(N)},ds(N)||b))]})},S=()=>{var O;return a||!o?null:v.jsx(v.Fragment,{children:He(r)&&((O=r.children)==null?void 0:O.map((w,b)=>v.jsx(Dr,{row:w,level:t+1},`child-${b}`)))})};return v.jsxs(v.Fragment,{children:[x(),S()]})},ps=({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 v.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:v.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[v.jsx(le,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),v.jsx(Ae,{variant:"title",bindValue:r})]})})};function hs(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function ms(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 gs(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(l,d,p){if(d>=e.length){u(l);return}const m=e[d].column,g=o(l,m);for(const[x,S]of g){const E=[...p,x],O=f(E,d),w=n.has(O);s.push(c(x,O,d,w)),a+=t,w&&i(S,d+1,E)}}function o(l,d){var m;const p=new Map;for(const g of l){const x=((m=g.cells[d])==null?void 0:m.decode)??"N/D";p.has(x)||p.set(x,[]),p.get(x).push(g)}return p}function f(l,d){return`group-${l.join("-")}-${d}`}function c(l,d,p,m){return{isGroup:!0,value:l,cells:{},rowId:d,level:p,isExpanded:m}}function u(l){for(const d of l)s.push(d),a+=t}}const ys=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return v.jsxs("div",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[v.jsx(le,{icon:"groups"}),v.jsx(xt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})]})},vs=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var U;const[i,o]=P.useState(r),[f,c]=P.useState(n||[]),[u,l]=P.useState(new Set),d=i&&i.columns?Object.fromEntries(i.columns.map(j=>[j.name,120])):{},[p,m]=P.useState(d),g=P.useRef(null);P.useEffect(()=>{var D;if(!i||!i.columns||i.columns.length)return;const j=((D=g.current)==null?void 0:D.clientWidth)??1e3;let A={};switch(s){case"fixed":A=Object.fromEntries(i.columns.map(k=>[k.name,120]));break;case"fit-grid":{const k=i.columns.filter(B=>B.visible),W=Math.floor(j/k.length);A=Object.fromEntries(k.map(B=>[B.name,W]));break}case"fit-content":A=Object.fromEntries(i.columns.map(k=>{const W=Math.max(...r.rows.map(H=>{var y;const _=(y=H==null?void 0:H.cells)==null?void 0:y[k.name],h=(_==null?void 0:_.decode)||(_==null?void 0:_.value);return h?String(h).length:0}),0),B=k.title?k.title.length:0,K=Math.max(W,B);return[k.name,Math.max(50,K*8+16)]}));break}m(A)},[s,r,i]),P.useEffect(()=>{if(f!=null&&f.length&&r.rows){const{flatRows:j}=gs(r.rows,f,e,u);o({...r,rows:j})}else o(r)},[r,f,u,e]);const x=j=>{c(ms(j,f))},S=j=>{j.preventDefault();const A=j.dataTransfer.getData("text/plain");if(!A||f.some(W=>W.column===A))return;const k=[...f,{column:A,visible:!0}];c(k)},E=j=>{j.preventDefault()},{virtualItems:O,containerProps:w,innerProps:b}=gr({items:(i==null?void 0:i.rows)||[],itemHeight:e,containerHeight:t,overscan:5}),N=(j,A)=>{const D=j.clientX,k=p[A],W=K=>{const q=K.clientX-D,X=Math.max(50,k+q);m(H=>({...H,[A]:X}))},B=()=>{window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",B)};window.addEventListener("mousemove",W),window.addEventListener("mouseup",B)},$={smpTable:`${ut["smp-table"]}`,headerCell:`${ut["smp-headerCell"]}`,resizer:`${ut["smp-resizer"]}`};return i&&v.jsx("div",{className:$.smpTable,...w,ref:g,children:v.jsxs("table",{children:[v.jsxs("thead",{children:[(n||a)&&v.jsx(ys,{groups:f,onChange:x,onDrop:S,onDragOver:E}),v.jsx("tr",{children:i.columns&&((U=i.columns)==null?void 0:U.map(j=>j.visible&&v.jsxs("th",{className:$.headerCell,draggable:!0,onDragStart:A=>{A.dataTransfer.setData("text/plain",j.name)},style:{width:p[j.name],minWidth:p[j.name],maxWidth:p[j.name]},children:[v.jsx(Ae,{variant:"title",bindValue:j.title}),v.jsx("div",{className:$.resizer,onMouseDown:A=>N(A,j.name),role:"region"})]},j.name)))})]}),v.jsx("tbody",{...b,children:O.map(({item:j,index:A,offsetTop:D})=>j.isGroup?v.jsx(ps,{label:j.value||"",rowHeight:e,offsetTop:D,level:j.level,onClick:()=>{const k=j.rowId;k&&l(W=>hs(W,k))},isExpanded:j.isExpanded},j.rowId||`group-${A}`):v.jsx(Dr,{row:j,columnWidths:p,rowHeight:e,offsetTop:D,isGroup:!1},j.rowId||`row-${A}`))}),v.jsx("tfoot",{children:v.jsx("span",{children:"Tfooter here"})})]})})},bs=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:f,onOptionsRequest:c})=>{const[u,l]=P.useState();P.useEffect(()=>{l(()=>{if(!r)return;const g={...r};return e&&(g.shape=e),g.shape==null&&(g.shape=ne.TEXT_FIELD),s&&(g.obj=Nr(s)),g})},[r,s,e]);const p={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},m=()=>{ce(t)||o==null||o(u)};if(u)return v.jsxs("div",{className:p.container,children:[v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:v.jsx(wt,{...u,onChange:l,onOptionsRequest:c,fun:r==null?void 0:r.fun,onBlur:m,label:a,labelPosition:i})}),ce(t)&&v.jsx(xe,{optionalDisplayValue:"Confirm",onClick:()=>f==null?void 0:f(u),bindValue:"Confirm"})]})},xs=({data:r,readOnly:e=!1,hiddenSubmitButton:t=!1,optionsHandler:n,onSubmit:s})=>{const[a,i]=P.useState({});P.useEffect(()=>{i(f(r))},[r]);const o=()=>{const u=c();s({value:u})},f=u=>{var d,p,m;if(!((d=u.rows)!=null&&d.length)||!((p=u.columns)!=null&&p.length))return{};const l=(m=u.rows)==null?void 0:m[0];return u.columns.filter(g=>g.visible??!0).reduce((g,x)=>{const S={...l.cells[x.name],label:x.title,onChange:E=>{i(O=>({...O,[x.name]:{...O[x.name],obj:{...O[x.name].obj,k:E.obj.k},decode:E.decode}}))}};return S.fun&&(S.shape==ne.AUTOCOMPLETE||S.shape==ne.MULTI_AUTOCOMPLETE||S.shape==ne.COMBOBOX)&&(S.onOptionsRequest=(E,O)=>n(E,O,r,x.name)),S.isEditable==null&&(S.isEditable=!0),e&&(S.isEditable=!1),S.isEditable&&S.shape==null&&(S.shape=ne.TEXT_FIELD),{...g,[x.name]:S}},{})},c=()=>{const u={columns:[...r.columns],rows:[{cells:{}}]};return Object.entries(a).forEach(([l,d])=>{u.rows[0].cells[l]={obj:{...d.obj},decode:d.decode,shape:d.shape}}),{before:r,after:u}};return a&&v.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[v.jsx(Et,{layout:r.rows[0].layout,cells:a}),!t&&v.jsx(xe,{onClick:o,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=es;exports.Autocomplete=bt;exports.Button=xe;exports.ButtonList=br;exports.Checkbox=xr;exports.Combobox=wr;exports.DashList=ns;exports.DataTableComponent=vs;exports.DatePicker=Or;exports.Drawer=rs;exports.Field=bs;exports.Icon=le;exports.InputPanel=xs;exports.Password=Rr;exports.Textfield=we;exports.configurePaths=un;
|