@memori.ai/memori-webcomponent 4.4.0 → 4.4.1
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/CHANGELOG.md +7 -0
- package/dist/memori-webcomponent.js +2 -2
- package/package.json +2 -2
|
@@ -232,7 +232,7 @@ to {
|
|
|
232
232
|
pointer-events: auto;
|
|
233
233
|
}
|
|
234
234
|
`,Pa=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:s})=>{let{toasts:a,handlers:l}=Gs(n);return Ta.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...o},className:s,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map((n=>{let o=n.position||t,s=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Ps()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}})(o,l.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return Ta.createElement(Ia,{id:n.id,key:n.id,onHeightUpdate:l.updateHeight,className:n.visible?Ra:"",style:s},"custom"===n.type?Is(n.message,n):i?i(n):Ta.createElement(_a,{toast:n,position:o}))})))},ka=js;c=o("85Hg2");var Oa=({className:e,title:n,loading:r=!0})=>(0,s.jsx)("svg",{...n?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:t(vs)(e,{"memori-loading-icon":r}),"aria-label":n,children:(0,s.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});var Na=({primary:e=!1,outlined:n=!1,ghost:r=!1,padded:i=!0,shape:o="rounded",danger:a=!1,loading:l=!1,disabled:c=!1,block:u=!1,icon:d,className:p,title:h,id:f,htmlType:m,onClick:g,onMouseDown:v,onMouseUp:y,onMouseLeave:b,onTouchStart:S,onTouchEnd:x,children:w})=>(0,s.jsxs)("button",{id:f,type:m,onClick:g,onMouseDown:v,onMouseUp:y,onMouseLeave:b,onTouchStart:S,onTouchEnd:x,title:h,disabled:l||c,className:t(vs)("memori-button",{"memori-button--primary":e,"memori-button--outlined":n,"memori-button--ghost":r,"memori-button--square":"square"===o,"memori-button--rounded":"rounded"===o,"memori-button--circle":"circle"===o,"memori-button--padded":i,"memori-button--block":u,"memori-button--with-icon":(d||l)&&w,"memori-button--icon-only":(d||l)&&!w,"memori-button--danger":a,"memori-button--loading":l},p),children:[d&&!l&&(0,s.jsx)("span",{className:"memori-button--icon",children:d}),l&&(0,s.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,s.jsx)(Oa,{loading:!0})}),w]});c=o("85Hg2"),c=o("85Hg2");function La(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,La),r}c=o("85Hg2");var Da,Ba=((Da=Ba||{})[Da.None=0]="None",Da[Da.RenderStrategy=1]="RenderStrategy",Da[Da.Static=2]="Static",Da),za=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(za||{});function Fa({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:s}){let a=ja(t,e);if(o)return Ua(a,n,r,s);let l=null!=i?i:0;if(2&l){let{static:e=!1,...t}=a;if(e)return Ua(t,n,r,s)}if(1&l){let{unmount:e=!0,...t}=a;return La(e?0:1,{0:()=>null,1:()=>Ua({...t,hidden:!0,style:{display:"none"}},n,r,s)})}return Ua(a,n,r,s)}function Ua(e,t={},n,r){let{as:i=n,children:o,refName:s="ref",...a}=Ga(e,["unmount","static"]),l=void 0!==e.ref?{[s]:e.ref}:{},u="function"==typeof o?o(t):o;a.className&&"function"==typeof a.className&&(a.className=a.className(t));let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&n.push(r);e&&(d["data-headlessui-state"]=n.join(" "))}if(i===c.Fragment&&Object.keys(Va(a)).length>0){if(!(0,c.isValidElement)(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(a).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"));return(0,c.cloneElement)(u,Object.assign({},ja(u.props,Va(Ga(a,["ref"]))),d,l,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(u.ref,l.ref)))}return(0,c.createElement)(i,Object.assign({},Ga(a,["ref"]),i!==c.Fragment&&l,i!==c.Fragment&&d),u)}function ja(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function Ha(e){var t;return Object.assign((0,c.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function Va(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function Ga(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");const Wa="undefined"==typeof window||"undefined"==typeof document;let qa=Wa?c.useEffect:c.useLayoutEffect;function Ka(e){let t=(0,c.useRef)(e);return qa((()=>{t.current=e}),[e]),t}let Ja=function(e){let n=Ka(e);return t(c).useCallback(((...e)=>n.current(...e)),[n])},Qa=Symbol();function Ya(e,t=!0){return Object.assign(e,{[Qa]:t})}function Xa(...e){let t=(0,c.useRef)(e);(0,c.useEffect)((()=>{t.current=e}),[e]);let n=Ja((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[Qa])))?void 0:n}var $a,Za=(($a=Za||{}).Space=" ",$a.Enter="Enter",$a.Escape="Escape",$a.Backspace="Backspace",$a.Delete="Delete",$a.ArrowLeft="ArrowLeft",$a.ArrowUp="ArrowUp",$a.ArrowRight="ArrowRight",$a.ArrowDown="ArrowDown",$a.Home="Home",$a.End="End",$a.PageUp="PageUp",$a.PageDown="PageDown",$a.Tab="Tab",$a);function el(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}c=o("85Hg2"),c=o("85Hg2");let tl={serverHandoffComplete:!1};function nl(){let[e,t]=(0,c.useState)(tl.serverHandoffComplete);return(0,c.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,c.useEffect)((()=>{!1===tl.serverHandoffComplete&&(tl.serverHandoffComplete=!0)}),[]),e}var rl;let il=0;function ol(){return++il}let sl=null!=(rl=t(c).useId)?rl:function(){let e=nl(),[n,r]=t(c).useState(e?ol:null);return qa((()=>{null===n&&r(ol())}),[n]),null!=n?""+n:void 0};c=o("85Hg2");var al=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(al||{});let ll=Ha((function(e,t){let{features:n=1,...r}=e;return Fa({ourProps:{ref:t,"aria-hidden":2==(2&n)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&n)&&2!=(2&n)&&{display:"none"}}},theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}));function cl(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}function ul(){let e=[],t=[],n={enqueue(e){t.push(e)},addEventListener:(e,t,r,i)=>(e.addEventListener(t,r,i),n.add((()=>e.removeEventListener(t,r,i)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return n.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>n.requestAnimationFrame((()=>n.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return n.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return cl((()=>{t.current&&e[0]()})),n.add((()=>{t.current=!1}))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0){let[t]=e.splice(n,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function dl(e){return Wa?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let pl=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var hl,fl,ml=((fl=ml||{})[fl.First=1]="First",fl[fl.Previous=2]="Previous",fl[fl.Next=4]="Next",fl[fl.Last=8]="Last",fl[fl.WrapAround=16]="WrapAround",fl[fl.NoScroll=32]="NoScroll",fl),gl=((hl=gl||{})[hl.Error=0]="Error",hl[hl.Overflow=1]="Overflow",hl[hl.Success=2]="Success",hl[hl.Underflow=3]="Underflow",hl),vl=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(vl||{});function yl(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(pl))}var bl=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(bl||{});function Sl(e,t=0){var n;return e!==(null==(n=dl(e))?void 0:n.body)&&La(t,{0:()=>e.matches(pl),1(){let t=e;for(;null!==t;){if(t.matches(pl))return!0;t=t.parentElement}return!1}})}function xl(e){let t=dl(e);ul().nextFrame((()=>{t&&!Sl(t.activeElement,0)&&wl(e)}))}function wl(e){null==e||e.focus({preventScroll:!0})}let Cl=["textarea","input"].join(",");function Al(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),i=t(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function El(e,t){return Ml(yl(),t,!0,e)}function Ml(e,t,n=!0,r=null){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?Al(e):e:yl(e);r=null!=r?r:i.activeElement;let s,a=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,o.indexOf(r))-1;if(4&t)return Math.max(0,o.indexOf(r))+1;if(8&t)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},u=0,d=o.length;do{if(u>=d||u+d<=0)return 0;let e=l+u;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}s=o[e],null==s||s.focus(c),u+=a}while(s!==i.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,Cl))&&n}(s)&&s.select(),s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),2}c=o("85Hg2"),c=o("85Hg2");function _l(e,t,n){let r=Ka(t);(0,c.useEffect)((()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)}),[e,n])}var Tl=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Tl||{});function Il(){let e=(0,c.useRef)(0);return _l("keydown",(t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)}),!0),e}c=o("85Hg2");function Rl(){let e=(0,c.useRef)(!1);return qa((()=>(e.current=!0,()=>{e.current=!1})),[]),e}c=o("85Hg2");function Pl(...e){return(0,c.useMemo)((()=>dl(...e)),[...e])}c=o("85Hg2");function kl(e,t,n,r){let i=Ka(n);(0,c.useEffect)((()=>{function n(e){i.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}),[e,t,r])}c=o("85Hg2");function Ol(e,t){let n=(0,c.useRef)([]),r=Ja(e);(0,c.useEffect)((()=>{let e=[...n.current];for(let[i,o]of t.entries())if(n.current[i]!==o){let i=r(t,e);return n.current=t,i}}),[r,...t])}var Nl=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Nl||{});let Ll=Object.assign(Ha((function(e,n){let r=(0,c.useRef)(null),i=Xa(r,n),{initialFocus:o,containers:s,features:a=30,...l}=e;nl()||(a=1);let u=Pl(r);!function({ownerDocument:e},t){let n=(0,c.useRef)(null);kl(null==e?void 0:e.defaultView,"focusout",(e=>{!t||n.current||(n.current=e.target)}),!0),Ol((()=>{t||((null==e?void 0:e.activeElement)===(null==e?void 0:e.body)&&wl(n.current),n.current=null)}),[t]);let r=(0,c.useRef)(!1);(0,c.useEffect)((()=>(r.current=!1,()=>{r.current=!0,cl((()=>{!r.current||(wl(n.current),n.current=null)}))})),[])}({ownerDocument:u},Boolean(16&a));let d=function({ownerDocument:e,container:t,initialFocus:n},r){let i=(0,c.useRef)(null),o=Rl();return Ol((()=>{if(!r)return;let s=t.current;!s||cl((()=>{if(!o.current)return;let t=null==e?void 0:e.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===t)return void(i.current=t)}else if(s.contains(t))return void(i.current=t);null!=n&&n.current?wl(n.current):Ml(s,ml.First)===gl.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==e?void 0:e.activeElement}))}),[r]),i}({ownerDocument:u,container:r,initialFocus:o},Boolean(2&a));!function({ownerDocument:e,container:t,containers:n,previousActiveElement:r},i){let o=Rl();kl(null==e?void 0:e.defaultView,"focus",(e=>{if(!i||!o.current)return;let s=new Set(null==n?void 0:n.current);s.add(t);let a=r.current;if(!a)return;let l=e.target;l&&l instanceof HTMLElement?function(e,t){var n;for(let r of e)if(null!=(n=r.current)&&n.contains(t))return!0;return!1}(s,l)?(r.current=l,wl(l)):(e.preventDefault(),e.stopPropagation(),wl(a)):wl(r.current)}),!0)}({ownerDocument:u,container:r,containers:s,previousActiveElement:d},Boolean(8&a));let p=Il(),h=Ja((()=>{let e=r.current;!e||La(p.current,{[Tl.Forwards]:()=>Ml(e,ml.First),[Tl.Backwards]:()=>Ml(e,ml.Last)})})),f={ref:i};return t(c).createElement(t(c).Fragment,null,Boolean(4&a)&&t(c).createElement(ll,{as:"button",type:"button",onFocus:h,features:al.Focusable}),Fa({ourProps:f,theirProps:l,defaultTag:"div",name:"FocusTrap"}),Boolean(4&a)&&t(c).createElement(ll,{as:"button",type:"button",onFocus:h,features:al.Focusable}))})),{features:Nl});let Dl=new Set,Bl=new Map;function zl(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Fl(e){let t=Bl.get(e);!t||(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function Ul(e,t=!0){qa((()=>{if(!t||!e.current)return;let n=e.current,r=dl(n);if(r){Dl.add(n);for(let e of Bl.keys())e.contains(n)&&(Fl(e),Bl.delete(e));return r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement){for(let t of Dl)if(e.contains(t))return;1===Dl.size&&(Bl.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),zl(e))}})),()=>{if(Dl.delete(n),Dl.size>0)r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement&&!Bl.has(e)){for(let t of Dl)if(e.contains(t))return;Bl.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),zl(e)}}));else for(let e of Bl.keys())Fl(e),Bl.delete(e)}}}),[t])}c=o("85Hg2");let jl=(0,(c=o("85Hg2")).createContext)(!1);function Hl(e){return t(c).createElement(jl.Provider,{value:e.force},e.children)}function Vl(e){let t=(0,c.useContext)(jl),n=(0,c.useContext)(Kl),r=Pl(e),[i,o]=(0,c.useState)((()=>{if(!t&&null!==n||Wa)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let i=r.createElement("div");return i.setAttribute("id","headlessui-portal-root"),r.body.appendChild(i)}));return(0,c.useEffect)((()=>{null!==i&&(null!=r&&r.body.contains(i)||null==r||r.body.appendChild(i))}),[i,r]),(0,c.useEffect)((()=>{t||null!==n&&o(n.current)}),[n,o,t]),i}let Gl=c.Fragment,Wl=Ha((function(e,t){let n=e,r=(0,c.useRef)(null),i=Xa(Ya((e=>{r.current=e})),t),o=Pl(r),s=Vl(r),[l]=(0,c.useState)((()=>{var e;return Wa?null:null!=(e=null==o?void 0:o.createElement("div"))?e:null})),u=nl(),d=(0,c.useRef)(!1);return qa((()=>{if(d.current=!1,s&&l)return s.contains(l)||(l.setAttribute("data-headlessui-portal",""),s.appendChild(l)),()=>{d.current=!0,cl((()=>{var e;!d.current||!s||!l||(s.removeChild(l),s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s)))}))}}),[s,l]),u&&s&&l?(0,a.createPortal)(Fa({ourProps:{ref:i},theirProps:n,defaultTag:Gl,name:"Portal"}),l):null})),ql=c.Fragment,Kl=(0,c.createContext)(null),Jl=Ha((function(e,n){let{target:r,...i}=e,o={ref:Xa(n)};return t(c).createElement(Kl.Provider,{value:r},Fa({ourProps:o,theirProps:i,defaultTag:ql,name:"Popover.Group"}))})),Ql=Object.assign(Wl,{Group:Jl});let Yl=(0,(c=o("85Hg2")).createContext)(null);function Xl(){let e=(0,c.useContext)(Yl);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Xl),e}return e}function $l(){let[e,n]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Ja((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t(c).createElement(Yl.Provider,{value:i},e.children)}),[n])]}let Zl=Ha((function(e,t){let n=Xl(),r=`headlessui-description-${sl()}`,i=Xa(t);qa((()=>n.register(r)),[r,n.register]);let o=e;return Fa({ourProps:{ref:i,...n.props,id:r},theirProps:o,slot:n.slot||{},defaultTag:"p",name:n.name||"Description"})}));let ec=(0,(c=o("85Hg2")).createContext)(null);ec.displayName="OpenClosedContext";var tc=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(tc||{});function nc(){return(0,c.useContext)(ec)}function rc({value:e,children:n}){return t(c).createElement(ec.Provider,{value:e},n)}let ic=(0,(c=o("85Hg2")).createContext)((()=>{}));ic.displayName="StackContext";var oc=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(oc||{});function sc({children:e,onUpdate:n,type:r,element:i,enabled:o}){let s=(0,c.useContext)(ic),a=Ja(((...e)=>{null==n||n(...e),s(...e)}));return qa((()=>{let e=void 0===o||!0===o;return e&&a(0,r,i),()=>{e&&a(1,r,i)}}),[a,r,i,o]),t(c).createElement(ic.Provider,{value:a},e)}c=o("85Hg2"),c=o("85Hg2");function ac(e,t,n){let r=Ka(t);(0,c.useEffect)((()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}function lc(e,t,n=!0){let r=(0,c.useRef)(!1);function i(n,i){if(!r.current||n.defaultPrevented)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e),s=i(n);if(null!==s&&s.getRootNode().contains(s)){for(let e of o){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(s))return}return!Sl(s,bl.Loose)&&-1!==s.tabIndex&&n.preventDefault(),t(n,s)}}(0,c.useEffect)((()=>{requestAnimationFrame((()=>{r.current=n}))}),[n]);let o=(0,c.useRef)(null);ac("mousedown",(e=>{var t,n;r.current&&(o.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),ac("click",(e=>{!o.current||(i(e,(()=>o.current)),o.current=null)}),!0),ac("blur",(e=>i(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}var cc=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(cc||{}),uc=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(uc||{});let dc={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},pc=(0,c.createContext)(null);function hc(e){let t=(0,c.useContext)(pc);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,hc),t}return t}function fc(e,t){(0,c.useEffect)((()=>{var n;if(!t||!e)return;let r=ul();function i(e,t,n){let i=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),r.add((()=>{Object.assign(e.style,{[t]:i})}))}let o=e.documentElement,s=(null!=(n=e.defaultView)?n:window).innerWidth-o.clientWidth;if(i(o,"overflow","hidden"),s>0){i(o,"paddingRight",`${s-(o.clientWidth-o.offsetWidth)}px`)}if(/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0){let e=window.pageYOffset;i(o,"position","fixed"),i(o,"marginTop",`-${e}px`),i(o,"width","100%"),r.add((()=>window.scrollTo(0,e)))}return r.dispose}),[e,t])}function mc(e,t){return La(t.type,dc,e,t)}pc.displayName="DialogContext";let gc=Ba.RenderStrategy|Ba.Static,vc=Ha((function(e,n){let{open:r,onClose:i,initialFocus:o,__demoMode:s=!1,...a}=e,[l,u]=(0,c.useState)(0),d=nc();void 0===r&&null!==d&&(r=La(d,{[tc.Open]:!0,[tc.Closed]:!1}));let p=(0,c.useRef)(new Set),h=(0,c.useRef)(null),f=Xa(h,n),m=(0,c.useRef)(null),g=Pl(h),v=e.hasOwnProperty("open")||null!==d,y=e.hasOwnProperty("onClose");if(!v&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!y)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof r)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${r}`);if("function"!=typeof i)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${i}`);let b=r?0:1,[S,x]=(0,c.useReducer)(mc,{titleId:null,descriptionId:null,panelRef:(0,c.createRef)()}),w=Ja((()=>i(!1))),C=Ja((e=>x({type:0,id:e}))),A=!!nl()&&(!s&&0===b),E=l>1,M=null!==(0,c.useContext)(pc),_=E?"parent":"leaf";Ul(h,!!E&&A),lc((()=>{var e,t;return[...Array.from(null!=(e=null==g?void 0:g.querySelectorAll("body > *, [data-headlessui-portal]"))?e:[]).filter((e=>!(!(e instanceof HTMLElement)||e.contains(m.current)||S.panelRef.current&&e.contains(S.panelRef.current)))),null!=(t=S.panelRef.current)?t:h.current]}),w,A&&!E),kl(null==g?void 0:g.defaultView,"keydown",(e=>{e.defaultPrevented||e.key===Za.Escape&&0===b&&(E||(e.preventDefault(),e.stopPropagation(),w()))})),fc(g,0===b&&!M),(0,c.useEffect)((()=>{if(0!==b||!h.current)return;let e=new IntersectionObserver((e=>{for(let t of e)0===t.boundingClientRect.x&&0===t.boundingClientRect.y&&0===t.boundingClientRect.width&&0===t.boundingClientRect.height&&w()}));return e.observe(h.current),()=>e.disconnect()}),[b,h,w]);let[T,I]=$l(),R=`headlessui-dialog-${sl()}`,P=(0,c.useMemo)((()=>[{dialogState:b,close:w,setTitleId:C},S]),[b,S,w,C]),k=(0,c.useMemo)((()=>({open:0===b})),[b]),O={ref:f,id:R,role:"dialog","aria-modal":0===b||void 0,"aria-labelledby":S.titleId,"aria-describedby":T};return t(c).createElement(sc,{type:"Dialog",enabled:0===b,element:h,onUpdate:Ja(((e,t,n)=>{"Dialog"===t&&La(e,{[oc.Add](){p.current.add(n),u((e=>e+1))},[oc.Remove](){p.current.add(n),u((e=>e-1))}})}))},t(c).createElement(Hl,{force:!0},t(c).createElement(Ql,null,t(c).createElement(pc.Provider,{value:P},t(c).createElement(Ql.Group,{target:h},t(c).createElement(Hl,{force:!1},t(c).createElement(I,{slot:k,name:"Dialog.Description"},t(c).createElement(Ll,{initialFocus:o,containers:p,features:A?La(_,{parent:Ll.features.RestoreFocus,leaf:Ll.features.All&~Ll.features.FocusLock}):Ll.features.None},Fa({ourProps:O,theirProps:a,slot:k,defaultTag:"div",features:gc,visible:0===b,name:"Dialog"})))))))),t(c).createElement(ll,{features:al.Hidden,ref:m}))})),yc=Ha((function(e,t){let[{dialogState:n,close:r}]=hc("Dialog.Overlay");return Fa({ourProps:{ref:Xa(t),id:`headlessui-dialog-overlay-${sl()}`,"aria-hidden":!0,onClick:Ja((e=>{if(e.target===e.currentTarget){if(el(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),r()}}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n})),[n]),defaultTag:"div",name:"Dialog.Overlay"})})),bc=Ha((function(e,n){let[{dialogState:r},i]=hc("Dialog.Backdrop"),o=Xa(n),s=`headlessui-dialog-backdrop-${sl()}`;(0,c.useEffect)((()=>{if(null===i.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")}),[i.panelRef]);let a=(0,c.useMemo)((()=>({open:0===r})),[r]);return t(c).createElement(Hl,{force:!0},t(c).createElement(Ql,null,Fa({ourProps:{ref:o,id:s,"aria-hidden":!0},theirProps:e,slot:a,defaultTag:"div",name:"Dialog.Backdrop"})))})),Sc=Ha((function(e,t){let[{dialogState:n},r]=hc("Dialog.Panel"),i=Xa(t,r.panelRef),o=`headlessui-dialog-panel-${sl()}`,s=(0,c.useMemo)((()=>({open:0===n})),[n]);return Fa({ourProps:{ref:i,id:o,onClick:Ja((e=>{e.stopPropagation()}))},theirProps:e,slot:s,defaultTag:"div",name:"Dialog.Panel"})})),xc=Ha((function(e,t){let[{dialogState:n,setTitleId:r}]=hc("Dialog.Title"),i=`headlessui-dialog-title-${sl()}`,o=Xa(t);(0,c.useEffect)((()=>(r(i),()=>r(null))),[i,r]);let s=(0,c.useMemo)((()=>({open:0===n})),[n]);return Fa({ourProps:{ref:o,id:i},theirProps:e,slot:s,defaultTag:"h2",name:"Dialog.Title"})})),wc=Object.assign(vc,{Backdrop:bc,Panel:Sc,Overlay:yc,Title:xc,Description:Zl});c=o("85Hg2");function Cc(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Ac(e,...t){e&&t.length>0&&e.classList.add(...t)}function Ec(e,...t){e&&t.length>0&&e.classList.remove(...t)}var Mc=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(Mc||{});function _c(e,t,n,r){let i=n?"enter":"leave",o=ul(),s=void 0!==r?Cc(r):()=>{};"enter"===i&&(e.removeAttribute("hidden"),e.style.display="");let a=La(i,{enter:()=>t.enter,leave:()=>t.leave}),l=La(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=La(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Ec(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Ac(e,...a,...c),o.nextFrame((()=>{Ec(e,...c),Ac(e,...l),function(e,t){let n=ul();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,s]=[r,i].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));if(o+s!==0){let r=[];r.push(n.addEventListener(e,"transitionrun",(i=>{i.target===i.currentTarget&&(r.splice(0).forEach((e=>e())),r.push(n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t("ended"),r.splice(0).forEach((e=>e())))})),n.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(t("cancelled"),r.splice(0).forEach((e=>e())))}))))})))}else t("ended");n.add((()=>t("cancelled"))),n.dispose}(e,(n=>("ended"===n&&(Ec(e,...a),Ac(e,...t.entered)),s(n))))})),o.dispose}function Tc(){let[e]=(0,c.useState)(ul);return(0,c.useEffect)((()=>()=>e.dispose()),[e]),e}function Ic({container:e,direction:t,classes:n,onStart:r,onStop:i}){let o=Rl(),s=Tc(),a=Ka(t);qa((()=>{let t=ul();s.add(t.dispose);let l=e.current;if(l&&"idle"!==a.current&&o.current)return t.dispose(),r.current(a.current),t.add(_c(l,n.current,"enter"===a.current,(e=>{t.dispose(),La(e,{[Mc.Ended](){i.current(a.current)},[Mc.Cancelled]:()=>{}})}))),t.dispose}),[t])}function Rc(e=""){return e.split(" ").filter((e=>e.trim().length>1))}let Pc=(0,(c=o("85Hg2")).createContext)(null);Pc.displayName="TransitionContext";var kc,Oc=((kc=Oc||{}).Visible="visible",kc.Hidden="hidden",kc);let Nc=(0,c.createContext)(null);function Lc(e){return"children"in e?Lc(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function Dc(e,t){let n=Ka(e),r=(0,c.useRef)([]),i=Rl(),o=Tc(),s=Ja(((e,t=za.Hidden)=>{let s=r.current.findIndex((({el:t})=>t===e));-1!==s&&(La(t,{[za.Unmount](){r.current.splice(s,1)},[za.Hidden](){r.current[s].state="hidden"}}),o.microTask((()=>{var e;!Lc(r)&&i.current&&(null==(e=n.current)||e.call(n))})))})),a=Ja((e=>{let t=r.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>s(e,za.Unmount)})),l=(0,c.useRef)([]),u=(0,c.useRef)(Promise.resolve()),d=(0,c.useRef)({enter:[],leave:[],idle:[]}),p=Ja(((e,n,r)=>{l.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{l.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(d.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?u.current=u.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),h=Ja(((e,t,n)=>{Promise.all(d.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=l.current.shift())||e()})).then((()=>n(t)))}));return(0,c.useMemo)((()=>({children:r,register:a,unregister:s,onStart:p,onStop:h,wait:u,chains:d})),[a,s,r,p,h,d,u])}function Bc(){}Nc.displayName="NestingContext";let zc=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Fc(e){var t;let n={};for(let r of zc)n[r]=null!=(t=e[r])?t:Bc;return n}let Uc=Ba.RenderStrategy,jc=Ha((function(e,n){let{beforeEnter:r,afterEnter:i,beforeLeave:o,afterLeave:s,enter:a,enterFrom:l,enterTo:u,entered:d,leave:p,leaveFrom:h,leaveTo:f,...m}=e,g=(0,c.useRef)(null),v=Xa(g,n),y=m.unmount?za.Unmount:za.Hidden,{show:b,appear:S,initial:x}=function(){let e=(0,c.useContext)(Pc);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[w,C]=(0,c.useState)(b?"visible":"hidden"),A=function(){let e=(0,c.useContext)(Nc);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:E,unregister:M}=A,_=(0,c.useRef)(null);(0,c.useEffect)((()=>E(g)),[E,g]),(0,c.useEffect)((()=>{if(y===za.Hidden&&g.current)return b&&"visible"!==w?void C("visible"):La(w,{hidden:()=>M(g),visible:()=>E(g)})}),[w,g,E,M,b,y]);let T=Ka({enter:Rc(a),enterFrom:Rc(l),enterTo:Rc(u),entered:Rc(d),leave:Rc(p),leaveFrom:Rc(h),leaveTo:Rc(f)}),I=function(e){let t=(0,c.useRef)(Fc(e));return(0,c.useEffect)((()=>{t.current=Fc(e)}),[e]),t}({beforeEnter:r,afterEnter:i,beforeLeave:o,afterLeave:s}),R=nl();(0,c.useEffect)((()=>{if(R&&"visible"===w&&null===g.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[g,w,R]);let P=x&&!S,k=!R||P||_.current===b?"idle":b?"enter":"leave",O=Ja((e=>La(e,{enter:()=>I.current.beforeEnter(),leave:()=>I.current.beforeLeave(),idle:()=>{}}))),N=Ja((e=>La(e,{enter:()=>I.current.afterEnter(),leave:()=>I.current.afterLeave(),idle:()=>{}}))),L=Dc((()=>{C("hidden"),M(g)}),A);Ic({container:g,classes:T,direction:k,onStart:Ka((e=>{L.onStart(g,e,O)})),onStop:Ka((e=>{L.onStop(g,e,N),"leave"===e&&!Lc(L)&&(C("hidden"),M(g))}))}),(0,c.useEffect)((()=>{!P||(y===za.Hidden?_.current=null:_.current=b)}),[b,P,w]);let D=m,B={ref:v};return t(c).createElement(Nc.Provider,{value:L},t(c).createElement(rc,{value:La(w,{visible:tc.Open,hidden:tc.Closed})},Fa({ourProps:B,theirProps:D,defaultTag:"div",features:Uc,visible:"visible"===w,name:"Transition.Child"})))})),Hc=Ha((function(e,n){let{show:r,appear:i=!1,unmount:o,...s}=e,a=(0,c.useRef)(null),l=Xa(a,n);nl();let u=nc();if(void 0===r&&null!==u&&(r=La(u,{[tc.Open]:!0,[tc.Closed]:!1})),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,p]=(0,c.useState)(r?"visible":"hidden"),h=Dc((()=>{p("hidden")})),[f,m]=(0,c.useState)(!0),g=(0,c.useRef)([r]);qa((()=>{!1!==f&&g.current[g.current.length-1]!==r&&(g.current.push(r),m(!1))}),[g,r]);let v=(0,c.useMemo)((()=>({show:r,appear:i,initial:f})),[r,i,f]);(0,c.useEffect)((()=>{if(r)p("visible");else if(Lc(h)){let e=a.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&p("hidden")}else p("hidden")}),[r,h]);let y={unmount:o};return t(c).createElement(Nc.Provider,{value:h},t(c).createElement(Pc.Provider,{value:v},Fa({ourProps:{...y,as:c.Fragment,children:t(c).createElement(jc,{ref:l,...y,...s})},theirProps:{},defaultTag:c.Fragment,features:Uc,visible:"visible"===d,name:"Transition"})))})),Vc=Ha((function(e,n){let r=null!==(0,c.useContext)(Pc),i=null!==nc();return t(c).createElement(t(c).Fragment,null,!r&&i?t(c).createElement(Hc,{ref:n,...e}):t(c).createElement(jc,{ref:n,...e}))})),Gc=Object.assign(Hc,{Child:Vc,Root:Hc});var Wc=({spinning:e=!1,primary:n=!1,className:r,children:i})=>(0,s.jsxs)("div",{className:t(vs)("memori-spin",r,{"memori-spin--spinning":e,"memori-spin--primary":n}),children:[i,(0,s.jsx)("div",{className:"memori-spin--spinner",children:(0,s.jsx)(Oa,{loading:!0})})]});var qc=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"})});var Kc=({open:e=!1,onClose:n,className:r,title:i,description:o,children:a,footer:l,loading:u=!1,closable:d=!0,width:p="100%",widthMd:h="100%"})=>{const{t:f}=ge();return(0,s.jsx)(Gc,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(wc,{open:e,onClose:n,className:t(vs)("memori-modal",r),children:[(0,s.jsx)(Gc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"memori-modal--backdrop"})}),(0,s.jsx)("div",{className:"memori-modal--container",children:(0,s.jsx)("div",{className:"memori-modal--container-scrollable",children:(0,s.jsx)(Gc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsxs)(wc.Panel,{className:"memori-modal--panel",children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-modal--panel {\n --memori-modal--width: ${p};\n --memori-modal--width-md: ${h};\n }\n `}}),d&&(0,s.jsx)("div",{className:"memori-modal--close",children:(0,s.jsx)(Na,{ghost:!0,padded:!0,shape:"circle",icon:(0,s.jsx)(qc,{}),title:f("close")||"Close",onClick:()=>n(!1)})}),(0,s.jsxs)(Wc,{spinning:u,children:[i&&(0,s.jsx)(wc.Title,{className:"memori-modal--title",children:i}),o&&(0,s.jsx)(wc.Description,{className:"memori-modal--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-modal--footer",children:l})]})]})})})})]})})},Jc=(c=o("85Hg2"),e=>"checkbox"===e.type),Qc=e=>e instanceof Date,Yc=e=>null==e;const Xc=e=>"object"==typeof e;var $c=e=>!Yc(e)&&!Array.isArray(e)&&Xc(e)&&!Qc(e),Zc=e=>$c(e)&&e.target?Jc(e.target)?e.target.checked:e.target.value:e,eu=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),tu=e=>Array.isArray(e)?e.filter(Boolean):[],nu=e=>void 0===e,ru=(e,t,n)=>{if(!t||!$c(e))return n;const r=tu(t.split(/[,[\].]+?/)).reduce(((e,t)=>Yc(e)?e:e[t]),e);return nu(r)||r===e?nu(e[t])?n:e[t]:r};const iu="blur",ou="focusout",su="onBlur",au="onChange",lu="onSubmit",cu="onTouched",uu="all",du="max",pu="min",hu="maxLength",fu="minLength",mu="pattern",gu="required",vu="validate";t(c).createContext(null);var yu=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return t._proxyFormState[i]!==uu&&(t._proxyFormState[i]=!r||uu),n&&(n[i]=!0),e[i]}});return i},bu=e=>$c(e)&&!Object.keys(e).length,Su=(e,t,n)=>{const{name:r,...i}=e;return bu(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find((e=>t[e]===(!n||uu)))},xu=e=>Array.isArray(e)?e:[e];function wu(e){const n=t(c).useRef(e);n.current=e,t(c).useEffect((()=>{const t=!e.disabled&&n.current.subject.subscribe({next:n.current.callback});return()=>{t&&t.unsubscribe()}}),[e.disabled])}var Cu=e=>"string"==typeof e,Au=(e,t,n,r)=>Cu(e)?(r&&t.watch.add(e),ru(n,e)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),ru(n,e)))):(t.watchAll=!!r,n),Eu="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Mu(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(Eu&&(e instanceof Blob||e instanceof FileList)||!n&&!$c(e))return e;if(t=n?[]:{},Array.isArray(e)||(e=>{const t=e.constructor&&e.constructor.prototype;return $c(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)t[n]=Mu(e[n]);else t=e}return t}var _u=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Tu=e=>/^\w*$/.test(e),Iu=e=>tu(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Ru(e,t,n){let r=-1;const i=Tu(t)?[t]:Iu(t),o=i.length,s=o-1;for(;++r<o;){const t=i[r];let o=n;if(r!==s){const n=e[t];o=$c(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}e[t]=o,e=e[t]}return e}const Pu=(e,t,n)=>{for(const r of n||Object.keys(e)){const n=ru(e,r);if(n){const{_f:e,...r}=n;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else $c(r)&&Pu(r,t)}}};var ku=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),Ou=(e,t,n)=>{const r=tu(ru(e,n));return Ru(r,"root",t[n]),Ru(e,n,r),e},Nu=e=>"boolean"==typeof e,Lu=e=>"file"===e.type,Du=e=>"function"==typeof e,Bu=e=>Cu(e)||t(c).isValidElement(e),zu=e=>"radio"===e.type,Fu=e=>e instanceof RegExp;const Uu={value:!1,isValid:!1},ju={value:!0,isValid:!0};var Hu=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!nu(e[0].attributes.value)?nu(e[0].value)||""===e[0].value?ju:{value:e[0].value,isValid:!0}:ju:Uu}return Uu};const Vu={isValid:!1,value:null};var Gu=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),Vu):Vu;function Wu(e,t,n="validate"){if(Bu(e)||Array.isArray(e)&&e.every(Bu)||Nu(e)&&!e)return{type:n,message:Bu(e)?e:"",ref:t}}var qu=e=>$c(e)&&!Fu(e)?e:{value:e,message:""},Ku=async(e,t,n,r,i)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:c,min:u,max:d,pattern:p,validate:h,name:f,valueAsNumber:m,mount:g,disabled:v}=e._f;if(!g||v)return{};const y=s?s[0]:o,b=e=>{r&&y.reportValidity&&(y.setCustomValidity(Nu(e)?"":e||""),y.reportValidity())},S={},x=zu(o),w=Jc(o),C=x||w,A=(m||Lu(o))&&!o.value||""===t||Array.isArray(t)&&!t.length,E=_u.bind(null,f,n,S),M=(e,t,n,r=hu,i=fu)=>{const s=e?t:n;S[f]={type:e?r:i,message:s,ref:o,...E(e?r:i,s)}};if(i?!Array.isArray(t)||!t.length:a&&(!C&&(A||Yc(t))||Nu(t)&&!t||w&&!Hu(s).isValid||x&&!Gu(s).isValid)){const{value:e,message:t}=Bu(a)?{value:!!a,message:a}:qu(a);if(e&&(S[f]={type:gu,message:t,ref:y,...E(gu,t)},!n))return b(t),S}if(!(A||Yc(u)&&Yc(d))){let e,r;const i=qu(d),s=qu(u);if(Yc(t)||isNaN(t)){const n=o.valueAsDate||new Date(t),a=e=>new Date((new Date).toDateString()+" "+e),l="time"==o.type,c="week"==o.type;Cu(i.value)&&t&&(e=l?a(t)>a(i.value):c?t>i.value:n>new Date(i.value)),Cu(s.value)&&t&&(r=l?a(t)<a(s.value):c?t<s.value:n<new Date(s.value))}else{const n=o.valueAsNumber||(t?+t:t);Yc(i.value)||(e=n>i.value),Yc(s.value)||(r=n<s.value)}if((e||r)&&(M(!!e,i.message,s.message,du,pu),!n))return b(S[f].message),S}if((l||c)&&!A&&(Cu(t)||i&&Array.isArray(t))){const e=qu(l),r=qu(c),i=!Yc(e.value)&&t.length>e.value,o=!Yc(r.value)&&t.length<r.value;if((i||o)&&(M(i,e.message,r.message),!n))return b(S[f].message),S}if(p&&!A&&Cu(t)){const{value:e,message:r}=qu(p);if(Fu(e)&&!t.match(e)&&(S[f]={type:mu,message:r,ref:o,...E(mu,r)},!n))return b(r),S}if(h)if(Du(h)){const e=Wu(await h(t),y);if(e&&(S[f]={...e,...E(vu,e.message)},!n))return b(e.message),S}else if($c(h)){let e={};for(const r in h){if(!bu(e)&&!n)break;const i=Wu(await h[r](t),y,r);i&&(e={...i,...E(r,i.message)},b(i.message),n&&(S[f]=e))}if(!bu(e)&&(S[f]={ref:y,...e},!n))return S}return b(!0),S};var Ju=e=>({isOnSubmit:!e||e===lu,isOnBlur:e===su,isOnChange:e===au,isOnAll:e===uu,isOnTouch:e===cu});function Qu(e){for(const t in e)if(!nu(e[t]))return!1;return!0}function Yu(e,t){const n=Tu(t)?[t]:Iu(t),r=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=nu(e)?r++:e[t[r++]];return e}(e,n),i=n[n.length-1];let o;r&&delete r[i];for(let t=0;t<n.slice(0,-1).length;t++){let r,i=-1;const s=n.slice(0,-(t+1)),a=s.length-1;for(t>0&&(o=e);++i<s.length;){const t=s[i];r=r?r[t]:e[t],a===i&&($c(r)&&bu(r)||Array.isArray(r)&&Qu(r))&&(o?delete o[t]:delete e[t]),o=r}}return e}function Xu(){let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var $u=e=>Yc(e)||!Xc(e);function Zu(e,t){if($u(e)||$u(t))return e===t;if(Qc(e)&&Qc(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const n=e[i];if(!r.includes(i))return!1;if("ref"!==i){const e=t[i];if(Qc(n)&&Qc(e)||$c(n)&&$c(e)||Array.isArray(n)&&Array.isArray(e)?!Zu(n,e):n!==e)return!1}}return!0}var ed=e=>{const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},td=e=>"select-multiple"===e.type,nd=e=>ed(e)&&e.isConnected,rd=e=>{for(const t in e)if(Du(e[t]))return!0;return!1};function id(e,t={}){const n=Array.isArray(e);if($c(e)||n)for(const n in e)Array.isArray(e[n])||$c(e[n])&&!rd(e[n])?(t[n]=Array.isArray(e[n])?[]:{},id(e[n],t[n])):Yc(e[n])||(t[n]=!0);return t}function od(e,t,n){const r=Array.isArray(e);if($c(e)||r)for(const r in e)Array.isArray(e[r])||$c(e[r])&&!rd(e[r])?nu(t)||$u(n[r])?n[r]=Array.isArray(e[r])?id(e[r],[]):{...id(e[r])}:od(e[r],Yc(t)?{}:t[r],n[r]):Zu(e[r],t[r])?delete n[r]:n[r]=!0;return n}var sd=(e,t)=>od(e,t,id(t)),ad=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>nu(e)?e:t?""===e?NaN:e?+e:e:n&&Cu(e)?new Date(e):r?r(e):e;function ld(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return Lu(t)?t.files:zu(t)?Gu(e.refs).value:td(t)?[...t.selectedOptions].map((({value:e})=>e)):Jc(t)?Hu(e.refs).value:ad(nu(t.value)?e.ref.value:t.value,e)}var cd=e=>nu(e)?e:Fu(e)?e.source:$c(e)?Fu(e.value)?e.value.source:e.value:e;function ud(e,t,n){const r=ru(e,n);if(r||Tu(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const r=i.join("."),o=ru(t,r),s=ru(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(s&&s.type)return{name:r,error:s};i.pop()}return{name:n}}const dd={mode:lu,reValidateMode:au,shouldFocusError:!0};function pd(e={}){let t,n={...dd,...e},r={submitCount:0,isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},o=Mu(n.defaultValues)||{},s=n.shouldUnregister?{}:Mu(o),a={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c=0,u={};const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={watch:Xu(),array:Xu(),state:Xu()},h=Ju(n.mode),f=Ju(n.reValidateMode),m=n.criteriaMode===uu,g=async()=>{let e=!1;return d.isValid&&(e=n.resolver?bu((await S()).errors):await x(i,!0),e!==r.isValid&&(r.isValid=e,p.state.next({isValid:e}))),e},v=(e,t,n,r)=>{const l=ru(i,e);if(l){const i=ru(s,e,nu(n)?ru(o,e):n);nu(i)||r&&r.defaultChecked||t?Ru(s,e,t?i:ld(l._f)):A(e,i),a.mount&&g()}},y=(e,t,n,i,s)=>{let a=!1,l=!1;const c={name:e};if(d.isDirty&&(l=r.isDirty,r.isDirty=c.isDirty=w(),a=l!==c.isDirty),d.dirtyFields&&(!n||i)){l=ru(r.dirtyFields,e);const n=Zu(ru(o,e),t);n?Yu(r.dirtyFields,e):Ru(r.dirtyFields,e,!0),c.dirtyFields=r.dirtyFields,a=a||l!==!n}if(n){const t=ru(r.touchedFields,e);t||(Ru(r.touchedFields,e,n),c.touchedFields=r.touchedFields,a=a||d.touchedFields&&t!==n)}return a&&s&&p.state.next(c),a?c:{}},b=(n,i,o,s)=>{const a=ru(r.errors,n),l=d.isValid&&Nu(i)&&r.isValid!==i;var h;if(e.delayError&&o?(h=()=>((e,t)=>{Ru(r.errors,e,t),p.state.next({errors:r.errors})})(n,o),t=e=>{clearTimeout(c),c=window.setTimeout(h,e)},t(e.delayError)):(clearTimeout(c),t=null,o?Ru(r.errors,n,o):Yu(r.errors,n)),(o?!Zu(a,o):a)||!bu(s)||l){const e={...s,...l&&Nu(i)?{isValid:i}:{},errors:r.errors,name:n};r={...r,...e},p.state.next(e)}u[n]--,d.isValidating&&!Object.values(u).some((e=>e))&&(p.state.next({isValidating:!1}),u={})},S=async e=>n.resolver?await n.resolver({...s},n.context,((e,t,n,r)=>{const i={};for(const n of e){const e=ru(t,n);e&&Ru(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}})(e||l.mount,i,n.criteriaMode,n.shouldUseNativeValidation)):{},x=async(e,t,i={valid:!0})=>{for(const o in e){const a=e[o];if(a){const{_f:e,...o}=a;if(e){const o=l.array.has(e.name),c=await Ku(a,ru(s,e.name),m,n.shouldUseNativeValidation,o);if(c[e.name]&&(i.valid=!1,t))break;!t&&(ru(c,e.name)?o?Ou(r.errors,c,e.name):Ru(r.errors,e.name,c[e.name]):Yu(r.errors,e.name))}o&&await x(o,t,i)}}return i.valid},w=(e,t)=>(e&&t&&Ru(s,e,t),!Zu(I(),o)),C=(e,t,n)=>Au(e,l,{...a.mount?s:nu(t)?o:Cu(e)?{[e]:t}:t},n),A=(e,t,n={})=>{const r=ru(i,e);let o=t;if(r){const n=r._f;n&&(!n.disabled&&Ru(s,e,ad(t,n)),o=Eu&&ed(n.ref)&&Yc(t)?"":t,td(n.ref)?[...n.ref.options].forEach((e=>e.selected=o.includes(e.value))):n.refs?Jc(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find((t=>t===e.value)):o===e.value))):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach((e=>e.checked=e.value===o)):Lu(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||p.watch.next({name:e})))}(n.shouldDirty||n.shouldTouch)&&y(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&T(e)},E=(e,t,n)=>{for(const r in t){const o=t[r],s=`${e}.${r}`,a=ru(i,s);!l.array.has(e)&&$u(o)&&(!a||a._f)||Qc(o)?A(s,o,n):E(s,o,n)}},M=(e,t,n={})=>{const a=ru(i,e),c=l.array.has(e),u=Mu(t);Ru(s,e,u),c?(p.array.next({name:e,values:s}),(d.isDirty||d.dirtyFields)&&n.shouldDirty&&(r.dirtyFields=sd(o,s),p.state.next({name:e,dirtyFields:r.dirtyFields,isDirty:w(e,u)}))):!a||a._f||Yc(u)?A(e,u,n):E(e,u,n),ku(e,l)&&p.state.next({}),p.watch.next({name:e})},_=async e=>{const o=e.target;let a=o.name;const c=ru(i,a);if(c){let x,w;const C=o.type?ld(c._f):Zc(e),A=e.type===iu||e.type===ou,E=!((v=c._f).mount&&(v.required||v.min||v.max||v.maxLength||v.minLength||v.pattern||v.validate)||n.resolver||ru(r.errors,a)||c._f.deps)||((e,t,n,r,i)=>!i.isOnAll&&(!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e))(A,ru(r.touchedFields,a),r.isSubmitted,f,h),M=ku(a,l,A);Ru(s,a,C),A?(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const _=y(a,C,A,!1),I=!bu(_)||M;if(!A&&p.watch.next({name:a,type:e.type}),E)return d.isValid&&g(),I&&p.state.next({name:a,...M?{}:_});if(!A&&M&&p.state.next({}),u[a]=u[a]?u[a]+1:1,p.state.next({isValidating:!0}),n.resolver){const{errors:e}=await S([a]),t=ud(r.errors,i,a),n=ud(e,i,t.name||a);x=n.error,a=n.name,w=bu(e)}else x=(await Ku(c,ru(s,a),m,n.shouldUseNativeValidation))[a],g();c._f.deps&&T(c._f.deps),b(a,w,x,_)}var v},T=async(e,t={})=>{let o,s;const a=xu(e);if(p.state.next({isValidating:!0}),n.resolver){const t=await(async e=>{const{errors:t}=await S();if(e)for(const n of e){const e=ru(t,n);e?Ru(r.errors,n,e):Yu(r.errors,n)}else r.errors=t;return t})(nu(e)?e:a);o=bu(t),s=e?!a.some((e=>ru(t,e))):o}else e?(s=(await Promise.all(a.map((async e=>{const t=ru(i,e);return await x(t&&t._f?{[e]:t}:t)})))).every(Boolean),(s||r.isValid)&&g()):s=o=await x(i);return p.state.next({...!Cu(e)||d.isValid&&o!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:o}:{},errors:r.errors,isValidating:!1}),t.shouldFocus&&!s&&Pu(i,(e=>e&&ru(r.errors,e)),e?a:l.mount),s},I=e=>{const t={...o,...a.mount?s:{}};return nu(e)?t:Cu(e)?ru(t,e):e.map((e=>ru(t,e)))},R=(e,t)=>({invalid:!!ru((t||r).errors,e),isDirty:!!ru((t||r).dirtyFields,e),isTouched:!!ru((t||r).touchedFields,e),error:ru((t||r).errors,e)}),P=(e,t={})=>{for(const a of e?xu(e):l.mount)l.mount.delete(a),l.array.delete(a),ru(i,a)&&(t.keepValue||(Yu(i,a),Yu(s,a)),!t.keepError&&Yu(r.errors,a),!t.keepDirty&&Yu(r.dirtyFields,a),!t.keepTouched&&Yu(r.touchedFields,a),!n.shouldUnregister&&!t.keepDefaultValue&&Yu(o,a));p.watch.next({}),p.state.next({...r,...t.keepDirty?{isDirty:w()}:{}}),!t.keepIsValid&&g()},k=(e,t={})=>{let r=ru(i,e);const c=Nu(t.disabled);return Ru(i,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?c&&Ru(s,e,t.disabled?void 0:ru(s,e,ld(r._f))):v(e,!0,t.value),{...c?{disabled:t.disabled}:{},...n.shouldUseNativeValidation?{required:!!t.required,min:cd(t.min),max:cd(t.max),minLength:cd(t.minLength),maxLength:cd(t.maxLength),pattern:cd(t.pattern)}:{},name:e,onChange:_,onBlur:_,ref:s=>{if(s){k(e,t),r=ru(i,e);const n=nu(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,a=(e=>zu(e)||Jc(e))(n),l=r._f.refs||[];if(a?l.find((e=>e===n)):n===r._f.ref)return;Ru(i,e,{_f:{...r._f,...a?{refs:[...l.filter(nd),n,...Array.isArray(ru(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),v(e,!1,void 0,n)}else r=ru(i,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!eu(l.array,e)||!a.action)&&l.unMount.add(e)}}},O=()=>n.shouldFocusError&&Pu(i,(e=>e&&ru(r.errors,e)),l.mount);return{control:{register:k,unregister:P,getFieldState:R,_executeSchema:S,_focusError:O,_getWatch:C,_getDirty:w,_updateValid:g,_removeUnmounted:()=>{for(const e of l.unMount){const t=ru(i,e);t&&(t._f.refs?t._f.refs.every((e=>!nd(e))):!nd(t._f.ref))&&P(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],n,l,c=!0,u=!0)=>{if(l&&n){if(a.action=!0,u&&Array.isArray(ru(i,e))){const t=n(ru(i,e),l.argA,l.argB);c&&Ru(i,e,t)}if(u&&Array.isArray(ru(r.errors,e))){const t=n(ru(r.errors,e),l.argA,l.argB);c&&Ru(r.errors,e,t),((e,t)=>{!tu(ru(e,t)).length&&Yu(e,t)})(r.errors,e)}if(d.touchedFields&&u&&Array.isArray(ru(r.touchedFields,e))){const t=n(ru(r.touchedFields,e),l.argA,l.argB);c&&Ru(r.touchedFields,e,t)}d.dirtyFields&&(r.dirtyFields=sd(o,s)),p.state.next({isDirty:w(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ru(s,e,t)},_getFieldArray:t=>tu(ru(a.mount?s:o,t,e.shouldUnregister?ru(o,t,[]):[])),_subjects:p,_proxyFormState:d,get _fields(){return i},get _formValues(){return s},get _stateFlags(){return a},set _stateFlags(e){a=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:T,register:k,handleSubmit:(e,t)=>async o=>{o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let a=!0,l=Mu(s);p.state.next({isSubmitting:!0});try{if(n.resolver){const{errors:e,values:t}=await S();r.errors=e,l=t}else await x(i);bu(r.errors)?(p.state.next({errors:{},isSubmitting:!0}),await e(l,o)):(t&&await t({...r.errors},o),O())}catch(e){throw a=!1,e}finally{r.isSubmitted=!0,p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:bu(r.errors)&&a,submitCount:r.submitCount+1,errors:r.errors})}},watch:(e,t)=>Du(e)?p.watch.subscribe({next:n=>e(C(void 0,t),n)}):C(e,t,!0),setValue:M,getValues:I,reset:(t,n)=>((t,n={})=>{const c=t||o,u=Mu(c),h=t&&!bu(t)?u:o;if(n.keepDefaultValues||(o=c),!n.keepValues){if(n.keepDirtyValues)for(const e of l.mount)ru(r.dirtyFields,e)?Ru(h,e,ru(s,e)):M(e,ru(h,e));else{if(Eu&&nu(t))for(const e of l.mount){const t=ru(i,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(ed(e)){const t=e.closest("form");if(t){t.reset();break}}}}i={}}s=e.shouldUnregister?n.keepDefaultValues?Mu(o):{}:u,p.array.next({values:h}),p.watch.next({values:h})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!n.keepIsValid,a.watch=!!e.shouldUnregister,p.state.next({submitCount:n.keepSubmitCount?r.submitCount:0,isDirty:n.keepDirty||n.keepDirtyValues?r.isDirty:!(!n.keepDefaultValues||Zu(t,o)),isSubmitted:!!n.keepIsSubmitted&&r.isSubmitted,dirtyFields:n.keepDirty||n.keepDirtyValues?r.dirtyFields:n.keepDefaultValues&&t?sd(o,t):{},touchedFields:n.keepTouched?r.touchedFields:{},errors:n.keepErrors?r.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(Du(t)?t(s):t,n),resetField:(e,t={})=>{ru(i,e)&&(nu(t.defaultValue)?M(e,ru(o,e)):(M(e,t.defaultValue),Ru(o,e,t.defaultValue)),t.keepTouched||Yu(r.touchedFields,e),t.keepDirty||(Yu(r.dirtyFields,e),r.isDirty=t.defaultValue?w(e,ru(o,e)):w()),t.keepError||(Yu(r.errors,e),d.isValid&&g()),p.state.next({...r}))},clearErrors:e=>{e?xu(e).forEach((e=>Yu(r.errors,e))):r.errors={},p.state.next({errors:r.errors})},unregister:P,setError:(e,t,n)=>{const o=(ru(i,e,{_f:{}})._f||{}).ref;Ru(r.errors,e,{...t,ref:o}),p.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&o&&o.focus&&o.focus()},setFocus:(e,t={})=>{const n=ru(i,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:R}}function hd(e={}){const n=t(c).useRef(),[r,i]=t(c).useState({isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:e.defaultValues});n.current||(n.current={...pd(e),formState:r});const o=n.current.control;return o._options=e,wu({subject:o._subjects.state,callback:t(c).useCallback((e=>{Su(e,o._proxyFormState,!0)&&(o._formState={...o._formState,...e},i({...o._formState}))}),[o])}),t(c).useEffect((()=>{o._stateFlags.mount||(o._proxyFormState.isValid&&o._updateValid(),o._stateFlags.mount=!0),o._stateFlags.watch&&(o._stateFlags.watch=!1,o._subjects.state.next({})),o._removeUnmounted()})),t(c).useEffect((()=>{r.submitCount&&o._focusError()}),[o,r.submitCount]),n.current.formState=yu(r,o),n.current}var fd=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),(0,s.jsx)("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"})]});var md=({pwdOrTokens:e,setPwdOrTokens:t,onFinish:n,minimumNumberOfRecoveryTokens:r=1,showTokens:i=!0,openModal:o=!1,withModal:a=!1})=>{var l;const{t:u}=ge(),{register:d,handleSubmit:p,formState:{errors:h},setError:f}=hd(),[m,g]=(0,c.useState)(1),[v,y]=(0,c.useState)(!!e),b=(0,s.jsxs)("form",{name:"memoriAuth",onSubmit:p((t=>{var i,o,s;"password"===e&&!(null===(i=t.password)||void 0===i?void 0:i.length)||"tokens"===e&&(((null===(o=null==t?void 0:t.tokens)||void 0===o?void 0:o.length)||0)<r||!(null===(s=null==t?void 0:t.tokens)||void 0===s?void 0:s.every((e=>e.length))))?f("tokens",{type:"minLength",message:"Tokens"}):n&&n(t).then((()=>{y(!1)}))})),className:"memori-auth-widget--form",children:[("password"===e||!i)&&(0,s.jsxs)("fieldset",{className:"memori-auth-widget--password-fieldset",children:[(0,s.jsxs)("label",{children:["Password:"," ",(0,s.jsx)("input",{className:"memori-auth-widget--input",required:!0,type:"password",placeholder:"Password",...d("password",{required:!0})})]}),i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{}),(0,s.jsx)(Na,{outlined:!0,onClick:()=>t("tokens"),children:u("auth.useRecoveryTokens")||"Recovery tokens"})]})]}),"tokens"===e&&i&&(0,s.jsxs)("fieldset",{className:"memori-auth-widget--tokens-fieldset",name:"tokens",children:[(0,s.jsxs)("legend",{children:[u("auth.tokens"),": "]}),(S=m,Array.from({length:S},((e,t)=>t))).map((e=>(0,s.jsx)("label",{className:"memori-auth-widget--token",children:(0,s.jsx)("input",{type:"password",className:"memori-auth-widget--input",placeholder:"Recovery token",required:!0,autoComplete:"off",...d(`tokens.${e}`,{required:!0})})},e))),(0,s.jsx)(Na,{onClick:()=>g((e=>e+1)),className:"memori-auth-widget--token-add",icon:(0,s.jsx)(fd,{}),children:u("auth.addToken")||"Add token"}),(0,s.jsx)("hr",{}),(0,s.jsx)(Na,{outlined:!0,onClick:()=>t("password"),children:u("auth.usePassword")||"Password"})]}),"minLength"===(null===(l=h.tokens)||void 0===l?void 0:l.type)&&(0,s.jsxs)("div",{className:"memori-auth-widget--error",children:[u("auth.atLeast")||"At least"," ",r]}),(0,s.jsx)(Na,{htmlType:"submit",primary:!0,className:"memori-auth-widget--submit",children:u("confirm")||"Submit"})]});var S;return a?(0,s.jsx)(Kc,{open:o||v,title:u("auth.title")||"Authentication",onClose:()=>t(null),closable:!1,children:b}):b};c=o("85Hg2"),c=o("85Hg2");const gd=()=>{let e=!1;if("maxTouchPoints"in navigator)e=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)e=navigator.msMaxTouchPoints>0;else{const n=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(n&&"(pointer:coarse)"===n.media)e=!!n.matches;else if("orientation"in window)e=!0;else{var t=null===navigator||void 0===navigator?void 0:navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(t)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(t)}}return e},vd=()=>{var e;let t=(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.platform)||(null===navigator||void 0===navigator?void 0:navigator.platform)||"unknown",n=(null===navigator||void 0===navigator?void 0:navigator.userAgent)||"unknown";return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(t)||n.includes("Mac")&&"ontouchend"in document};const yd=e=>e.slice(0,e.length/2).trim().toLowerCase()===e.slice(e.length/2+1).trim().toLowerCase()?e.slice(0,e.length/2):e,bd=e=>e.replaceAll(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu,"").trim();function Sd(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const xd=({type:e,resourceURI:t,sessionID:n,baseURL:r="",apiURL:i=""})=>{let o="cover"===e?`${r}/images/memoriCover.png`:`${r}/images/memoriAvatar.png?v=20231208`;try{return t&&0!==t.length?t.includes("memoriai/memory")&&!t.includes("memori-ai-session-id")&&n?`${t}?memori-ai-session-id=${n}`:(t.startsWith("https://")||t.startsWith("http://"))&&(new URL(t).hostname.includes("memori.ai")||new URL(t).hostname.includes("aclambda.online"))?`${t}${t.endsWith("/")||!n?"":"/"}${n||""}`:t.startsWith("cloud://")?`${(null==i?void 0:i.replace(/v2/,"v1"))||""}/CloudAsset/${t.replace("cloud://","")}`:t.startsWith("guid://")?`${(null==i?void 0:i.replace(/v2/,"v1"))||""}/GuidAsset/${t.replace("guid://","")}`:t||o:o}catch(e){return t||o}};var wd=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"})});var Cd=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",className:e,"aria-label":t,children:(0,s.jsxs)("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[(0,s.jsx)("path",{fillRule:"evenodd",d:"M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z",clipRule:"evenodd"}),(0,s.jsx)("path",{fillRule:"evenodd",d:"M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z",clipRule:"evenodd"}),(0,s.jsx)("path",{fillRule:"evenodd",d:"M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z",clipRule:"evenodd"})]})});var Ad=({content:e,className:n,align:r="right",disabled:i=!1,visible:o=!1,children:a})=>(0,s.jsxs)("div",{className:t(vs)("memori-tooltip",`memori-tooltip--align-${r}`,n,{"memori-tooltip--disabled":i,"memori-tooltip--visible":o}),children:[(0,s.jsx)("div",{className:"memori-tooltip--content",children:e}),(0,s.jsx)("div",{className:"memori-tooltip--trigger",children:a})]});c=o("85Hg2"),c=o("85Hg2");var Ed=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Ed||{});function Md(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==i&&r.length-n-1>=i)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=i)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}c=o("85Hg2");function _d({container:e,accept:t,walk:n,enabled:r=!0}){let i=(0,c.useRef)(t),o=(0,c.useRef)(n);(0,c.useEffect)((()=>{i.current=t,o.current=n}),[t,n]),qa((()=>{if(!e||!r)return;let t=dl(e);if(!t)return;let n=i.current,s=o.current,a=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,a,!1);for(;l.nextNode();)s(l.currentNode)}),[e,r,i,o])}c=o("85Hg2");function Td(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function Id(e,t){let[n,r]=(0,c.useState)((()=>Td(e)));return qa((()=>{r(Td(e))}),[e.type,e.as]),qa((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")}),[n,t]),n}var Rd=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Rd||{}),Pd=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Pd||{}),kd=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(kd||{});function Od(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=Al(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{items:r,activeItemIndex:i}}let Nd={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Od(e),i=Md(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=i?e.items.indexOf(i):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Od(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Od(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Ld=(0,c.createContext)(null);function Dd(e){let t=(0,c.useContext)(Ld);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Dd),t}return t}function Bd(e,t){return La(t.type,Nd,e,t)}Ld.displayName="MenuContext";let zd=c.Fragment,Fd=Ha((function(e,n){let r=(0,c.useReducer)(Bd,{menuState:1,buttonRef:(0,c.createRef)(),itemsRef:(0,c.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:o,buttonRef:s},a]=r,l=Xa(n);lc([s,o],((e,t)=>{var n;a({type:1}),Sl(t,bl.Loose)||(e.preventDefault(),null==(n=s.current)||n.focus())}),0===i);let u=Ja((()=>{a({type:1})})),d=(0,c.useMemo)((()=>({open:0===i,close:u})),[i,u]),p=e,h={ref:l};return t(c).createElement(Ld.Provider,{value:r},t(c).createElement(rc,{value:La(i,{0:tc.Open,1:tc.Closed})},Fa({ourProps:h,theirProps:p,slot:d,defaultTag:zd,name:"Menu"})))})),Ud=Ha((function(e,t){var n;let[r,i]=Dd("Menu.Button"),o=Xa(r.buttonRef,t),s=`headlessui-menu-button-${sl()}`,a=Tc(),l=Ja((e=>{switch(e.key){case Za.Space:case Za.Enter:case Za.ArrowDown:e.preventDefault(),e.stopPropagation(),i({type:0}),a.nextFrame((()=>i({type:2,focus:Ed.First})));break;case Za.ArrowUp:e.preventDefault(),e.stopPropagation(),i({type:0}),a.nextFrame((()=>i({type:2,focus:Ed.Last})))}})),u=Ja((e=>{if(e.key===Za.Space)e.preventDefault()})),d=Ja((t=>{if(el(t.currentTarget))return t.preventDefault();e.disabled||(0===r.menuState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),i({type:0})))})),p=(0,c.useMemo)((()=>({open:0===r.menuState})),[r]),h=e;return Fa({ourProps:{ref:o,id:s,type:Id(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===r.menuState,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:h,slot:p,defaultTag:"button",name:"Menu.Button"})})),jd=Ba.RenderStrategy|Ba.Static,Hd=Ha((function(e,t){var n,r;let[i,o]=Dd("Menu.Items"),s=Xa(i.itemsRef,t),a=Pl(i.itemsRef),l=`headlessui-menu-items-${sl()}`,u=Tc(),d=nc(),p=null!==d?d===tc.Open:0===i.menuState;(0,c.useEffect)((()=>{let e=i.itemsRef.current;!e||0===i.menuState&&e!==(null==a?void 0:a.activeElement)&&e.focus({preventScroll:!0})}),[i.menuState,i.itemsRef,a]),_d({container:i.itemsRef.current,enabled:0===i.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let h=Ja((e=>{var t,n;switch(u.dispose(),e.key){case Za.Space:if(""!==i.searchQuery)return e.preventDefault(),e.stopPropagation(),o({type:3,value:e.key});case Za.Enter:if(e.preventDefault(),e.stopPropagation(),o({type:1}),null!==i.activeItemIndex){let{dataRef:e}=i.items[i.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}xl(i.buttonRef.current);break;case Za.ArrowDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Ed.Next});case Za.ArrowUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Ed.Previous});case Za.Home:case Za.PageUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Ed.First});case Za.End:case Za.PageDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Ed.Last});case Za.Escape:e.preventDefault(),e.stopPropagation(),o({type:1}),ul().nextFrame((()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case Za.Tab:e.preventDefault(),e.stopPropagation(),o({type:1}),ul().nextFrame((()=>{El(i.buttonRef.current,e.shiftKey?ml.Previous:ml.Next)}));break;default:1===e.key.length&&(o({type:3,value:e.key}),u.setTimeout((()=>o({type:4})),350))}})),f=Ja((e=>{if(e.key===Za.Space)e.preventDefault()})),m=(0,c.useMemo)((()=>({open:0===i.menuState})),[i]),g=e;return Fa({ourProps:{"aria-activedescendant":null===i.activeItemIndex||null==(n=i.items[i.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=i.buttonRef.current)?void 0:r.id,id:l,onKeyDown:h,onKeyUp:f,role:"menu",tabIndex:0,ref:s},theirProps:g,slot:m,defaultTag:"div",features:jd,visible:p,name:"Menu.Items"})})),Vd=c.Fragment,Gd=Ha((function(e,t){let{disabled:n=!1,...r}=e,[i,o]=Dd("Menu.Item"),s=`headlessui-menu-item-${sl()}`,a=null!==i.activeItemIndex&&i.items[i.activeItemIndex].id===s,l=(0,c.useRef)(null),u=Xa(t,l);qa((()=>{if(0!==i.menuState||!a||0===i.activationTrigger)return;let e=ul();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=l.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[l,a,i.menuState,i.activationTrigger,i.activeItemIndex]);let d=(0,c.useRef)({disabled:n,domRef:l});qa((()=>{d.current.disabled=n}),[d,n]),qa((()=>{var e,t;d.current.textValue=null==(t=null==(e=l.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,l]),qa((()=>(o({type:5,id:s,dataRef:d}),()=>o({type:6,id:s}))),[d,s]);let p=Ja((()=>{o({type:1})})),h=Ja((e=>{if(n)return e.preventDefault();o({type:1}),xl(i.buttonRef.current)})),f=Ja((()=>{if(n)return o({type:2,focus:Ed.Nothing});o({type:2,focus:Ed.Specific,id:s})})),m=Ja((()=>{n||a||o({type:2,focus:Ed.Specific,id:s,trigger:0})})),g=Ja((()=>{n||!a||o({type:2,focus:Ed.Nothing})})),v=(0,c.useMemo)((()=>({active:a,disabled:n,close:p})),[a,n,p]);return Fa({ourProps:{id:s,ref:u,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:h,onFocus:f,onPointerMove:m,onMouseMove:m,onPointerLeave:g,onMouseLeave:g},theirProps:r,slot:v,defaultTag:Vd,name:"Menu.Item"})})),Wd=Object.assign(Fd,{Button:Ud,Items:Hd,Item:Gd});var qd=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,"aria-label":t,children:[(0,s.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,s.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"})]});const Kd={"it-IT":"Non è quello che ti ho chiesto","fr-FR":"Ce n'est pas ce que je t'ai demandé","en-GB":"It's not what I asked"},Jd={"it-IT":"La risposta non era corretta","fr-FR":"La réponse n'était pas correcte","en-GB":"The answer was not correct"},Qd={"it-IT":"Non mi è piaciuta la risposta","fr-FR":"Je n'ai pas aimé la réponse","en-GB":"I didn't like the answer"};var Yd=({memori:e,className:n,onNegativeClick:r,toggle:i=!1,dropdown:o=!1})=>{const[a,l]=(0,c.useState)(),u="it-IT"===e.culture?"it-IT":"fr-FR"===e.culture?"fr-FR":"en-GB",d=Kd[u],p=Jd[u],h=Qd[u];return(0,s.jsx)("div",{className:"memori-chat--feedback"+(n?` ${n}`:""),children:o?(0,s.jsxs)(Wd,{as:"div",className:"memori-chat--feedback-menu",children:[(0,s.jsx)(Wd.Button,{as:t(c).Fragment,children:(0,s.jsx)(Na,{ghost:!0,shape:"circle",title:"Feedback",className:"memori-chat--feedback-menu-button",disabled:!!a,icon:(0,s.jsx)(qd,{className:a?"memori-chat--feedback-clicked":void 0})})}),(0,s.jsx)(Gc,{as:t(c).Fragment,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,s.jsx)(Wd.Items,{className:"memori-chat--feedback-menu-items",children:(0,s.jsxs)("div",{className:"memori-chat--feedback-menu-items-container",children:[(0,s.jsx)(Wd.Item,{children:({active:e})=>(0,s.jsx)("button",{className:"memori-chat--feedback-menu-item"+(e?" memori-chat--feedback-menu-item-active":""),onClick:()=>{l("up"===a&&i?void 0:"up")},children:h})},"ok"),(0,s.jsx)(Wd.Item,{children:({active:e})=>(0,s.jsx)("button",{className:"memori-chat--feedback-menu-item"+(e?" memori-chat--feedback-menu-item-active":""),onClick:()=>{l("down"===a&&i?void 0:"down"),r(d)},children:p})},"no")]})})})]}):(0,s.jsx)(Ad,{align:"left",content:"Feedback",children:(0,s.jsx)(Na,{title:"Feedback",onClick:()=>{l("down"===a&&i?void 0:"down"),r(d)},ghost:!0,shape:"circle",icon:(0,s.jsx)(qd,{className:a?"memori-chat--feedback-clicked":void 0})})})})},Xd={};!function(e){"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults=t();const r=/[&<>"']/,i=new RegExp(r.source,"g"),o=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,s=new RegExp(o.source,"g"),a={"&":"&","<":"<",">":">",'"':""","'":"'"},l=e=>a[e];function c(e,t){if(t){if(r.test(e))return e.replace(i,l)}else if(o.test(e))return e.replace(s,l);return e}const u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(u,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const p=/(^|[^\[])\^/g;function h(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(p,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function f(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const m={exec:()=>null};function g(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function v(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.slice(0,r-i)}function y(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function b(e,t,n,r){const i=t.href,o=t.title?c(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:o,text:c(s)}}function S(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}class x{options;rules;lexer;constructor(t){this.options=t||e.defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:v(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=S(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=v(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=v(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s="",a="",l=!1;for(;e;){let n=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;s=t[0],e=e.substring(s.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(c)&&(s+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(c=l,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(c))break;if(o.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=u||!c.trim())a+="\n"+c.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(i.test(r))break;if(o.test(r))break;if(n.test(r))break;a+="\n"+c}d||c.trim()||(d=!0),s+=l+"\n",e=e.substring(l.length+1),r=c.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(s)&&(l=!0));let p,h=null;this.options.gfm&&(h=/^\[[ xX]\] /.exec(a),h&&(p="[ ] "!==h[0],a=a.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!h,checked:p,loose:!1,text:a,tokens:[]}),i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=a.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=g(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(const e of n)o.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of i)o.rows.push(g(e,o.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:c(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=v(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=y(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),b(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return b(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let i,o,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){s+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+a);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=c(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=c(t[1]),n="mailto:"+e):(e=c(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=c(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=c(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:c(t[0]),{type:"text",raw:t[0],text:e}}}}const w=/^(?: *(?:\n|$))+/,C=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,A=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,E=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,M=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_=/(?:[*+-]|\d{1,9}[.)])/,T=h(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,_).getRegex(),I=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,R=/^[^\n]+/,P=/(?!\s*\])(?:\\.|[^\[\]\\])+/,k=h(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",P).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),O=h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_).getRegex(),N="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",L=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,D=h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",L).replace("tag",N).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),B=h(I).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),z={blockquote:h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",B).getRegex(),code:C,def:k,fences:A,heading:M,hr:E,html:D,lheading:T,list:O,newline:w,paragraph:B,table:m,text:R},F=h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),U={...z,table:F,paragraph:h(I).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",F).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex()},j={...z,html:h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",L).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:m,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:h(I).replace("hr",E).replace("heading"," *#{1,6} *[^\n]").replace("lheading",T).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},H=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,V=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,G=/^( {2,}|\\)\n(?!\s*$)/,W=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,q="\\p{P}$+<=>`^|~",K=h(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,q).getRegex(),J=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Q=h(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,q).getRegex(),Y=h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,q).getRegex(),X=h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,q).getRegex(),$=h(/\\([punct])/,"gu").replace(/punct/g,q).getRegex(),Z=h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ee=h(L).replace("(?:--\x3e|$)","--\x3e").getRegex(),te=h("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ee).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ne=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,re=h(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ne).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ie=h(/^!?\[(label)\]\[(ref)\]/).replace("label",ne).replace("ref",P).getRegex(),oe=h(/^!?\[(ref)\](?:\[\])?/).replace("ref",P).getRegex(),se=h("reflink|nolink(?!\\()","g").replace("reflink",ie).replace("nolink",oe).getRegex(),ae={_backpedal:m,anyPunctuation:$,autolink:Z,blockSkip:J,br:G,code:V,del:m,emStrongLDelim:Q,emStrongRDelimAst:Y,emStrongRDelimUnd:X,escape:H,link:re,nolink:oe,punctuation:K,reflink:ie,reflinkSearch:se,tag:te,text:W,url:m},le={...ae,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",ne).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne).getRegex()},ce={...ae,escape:h(H).replace("])","~|])").getRegex(),url:h(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ue={...ce,br:h(G).replace("{2,}","*").getRegex(),text:h(ce.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},de={normal:z,gfm:U,pedantic:j},pe={normal:ae,gfm:ce,breaks:ue,pedantic:le};class he{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new x,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:de.normal,inline:pe.normal};this.options.pedantic?(n.block=de.pedantic,n.inline=pe.pedantic):this.options.gfm&&(n.block=de.gfm,this.options.breaks?n.inline=pe.breaks:n.inline=pe.gfm),this.tokenizer.rules=n}static get rules(){return{block:de,inline:pe}}static lex(e,t){return new he(t).lex(e)}static lexInline(e,t){return new he(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],o&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),o=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,o,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class fe{options;constructor(t){this.options=t||e.defaults}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+c(r)+'">'+(n?e:c(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:c(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=f(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>",i}image(e,t,n){const r=f(e);if(null===r)return n;let i=`<img src="${e=r}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class me{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ge{options;renderer;textRenderer;constructor(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new fe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new me}static parse(e,t){return new ge(t).parse(e)}static parseInline(e,t){return new ge(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(i.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=i;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,d(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=i;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=i;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let o="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});o+=this.renderer.tablerow(r)}n+=this.renderer.table(t,o);continue}case"blockquote":{const e=i,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=i,t=e.ordered,r=e.start,o=e.loose;let s="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,i=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);o?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,o),s+=this.renderer.listitem(a,i,!!r)}n+=this.renderer.list(s,t,r);continue}case"html":{const e=i;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=i;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=i,s=o.tokens?this.parseInline(o.tokens):o.text;for(;r+1<e.length&&"text"===e[r+1].type;)o=e[++r],s+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);n+=t?this.renderer.paragraph(s):s;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}switch(i.type){case"escape":{const e=i;n+=t.text(e.text);break}case"html":{const e=i;n+=t.html(e.text);break}case"link":{const e=i;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=i;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=i;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=i;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=i;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=i;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=i;n+=t.text(e.text);break}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class ve{options;constructor(t){this.options=t||e.defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class ye{defaults=t();options=this.setOptions;parse=this.#e(he.lex,ge.parse);parseInline=this.#e(he.lexInline,ge.parseInline);Parser=ge;Renderer=fe;TextRenderer=me;Lexer=he;Tokenizer=x;Hooks=ve;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{n=n.concat(this.walkTokens(e[r],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new fe(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.renderer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new x(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=e.tokenizer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new ve;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.hooks[r],o=t[r];ve.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>o.call(t,e)));const n=i.call(t,e);return o.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return he.lex(e,t??this.defaults)}parser(e,t){return ge.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const i={...r},o={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const s=this.#t(!!o.silent,!!o.async);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then((t=>e(t,o))).then((e=>o.hooks?o.hooks.processAllTokens(e):e)).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(s);try{o.hooks&&(n=o.hooks.preprocess(n));let r=e(n,o);o.hooks&&(r=o.hooks.processAllTokens(r)),o.walkTokens&&this.walkTokens(r,o.walkTokens);let i=t(r,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e){return s(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+c(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const be=new ye;function Se(e,t){return be.parse(e,t)}Se.options=Se.setOptions=function(e){return be.setOptions(e),Se.defaults=be.defaults,n(Se.defaults),Se},Se.getDefaults=t,Se.defaults=e.defaults,Se.use=function(...e){return be.use(...e),Se.defaults=be.defaults,n(Se.defaults),Se},Se.walkTokens=function(e,t){return be.walkTokens(e,t)},Se.parseInline=be.parseInline,Se.Parser=ge,Se.parser=ge.parse,Se.Renderer=fe,Se.TextRenderer=me,Se.Lexer=he,Se.lexer=he.lex,Se.Tokenizer=x,Se.Hooks=ve,Se.parse=Se;const xe=Se.options,we=Se.setOptions,Ce=Se.use,Ae=Se.walkTokens,Ee=Se.parseInline,Me=Se,_e=ge.parse,Te=he.lex;e.Hooks=ve,e.Lexer=he,e.Marked=ye,e.Parser=ge,e.Renderer=fe,e.TextRenderer=me,e.Tokenizer=x,e.getDefaults=t,e.lexer=Te,e.marked=Se,e.options=xe,e.parse=Me,e.parseInline=Ee,e.parser=_e,e.setOptions=we,e.use=Ce,e.walkTokens=Ae}(Xd);var $d={};
|
|
235
|
-
/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */$d=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:s,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),s||(s=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=x(Array.prototype.forEach),d=x(Array.prototype.pop),p=x(Array.prototype.push),h=x(String.prototype.toLowerCase),f=x(String.prototype.toString),m=x(String.prototype.match),g=x(String.prototype.replace),v=x(String.prototype.indexOf),y=x(String.prototype.trim),b=x(RegExp.prototype.test),S=w(TypeError);function x(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return l(e,t,r)}}function w(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function C(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=i(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function A(t){const n=a(null);for(const[r,o]of e(t))void 0!==i(t,r)&&(n[r]=o);return n}function E(e,t){for(;null!==e;){const n=i(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=r(e)}function n(e){return console.warn("fallback value for",e),null}return n}const M=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),_=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),T=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k=o(["#text"]),O=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),D=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),F=s(/\${[\w\W]*}/gm),U=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),H=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=s(/^(?:\w+script|data):/i),G=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=s(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:B,ERB_EXPR:z,TMPLIT_EXPR:F,DATA_ATTR:U,ARIA_ATTR:j,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:G,DOCTYPE_NAME:W});const K=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=e=>Q(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const i=r,s=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:x,Element:w,NodeFilter:B,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:F,DOMParser:U,trustedTypes:j}=t,V=w.prototype,G=E(V,"cloneNode"),Y=E(V,"nextSibling"),X=E(V,"childNodes"),$=E(V,"parentNode");if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Z,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:ie}=r,{importNode:oe}=i;let se={};n.isSupported="function"==typeof e&&"function"==typeof $&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ae,ERB_EXPR:le,TMPLIT_EXPR:ce,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:he}=q;let{IS_ALLOWED_URI:fe}=q,me=null;const ge=C({},[...M,..._,...T,...R,...k]);let ve=null;const ye=C({},[...O,...N,...L,...D]);let be=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,xe=null,we=!0,Ce=!0,Ae=!1,Ee=!0,Me=!1,_e=!1,Te=!1,Ie=!1,Re=!1,Pe=!1,ke=!1,Oe=!0,Ne=!1;const Le="user-content-";let De=!0,Be=!1,ze={},Fe=null;const Ue=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let je=null;const He=C({},["audio","video","img","source","image","track"]);let Ve=null;const Ge=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Je=Ke,Qe=!1,Ye=null;const Xe=C({},[We,qe,Ke],f);let $e=null;const Ze=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=A(e),$e=$e=-1===Ze.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===$e?f:h,me="ALLOWED_TAGS"in e?C({},e.ALLOWED_TAGS,tt):ge,ve="ALLOWED_ATTR"in e?C({},e.ALLOWED_ATTR,tt):ye,Ye="ALLOWED_NAMESPACES"in e?C({},e.ALLOWED_NAMESPACES,f):Xe,Ve="ADD_URI_SAFE_ATTR"in e?C(A(Ge),e.ADD_URI_SAFE_ATTR,tt):Ge,je="ADD_DATA_URI_TAGS"in e?C(A(He),e.ADD_DATA_URI_TAGS,tt):He,Fe="FORBID_CONTENTS"in e?C({},e.FORBID_CONTENTS,tt):Ue,Se="FORBID_TAGS"in e?C({},e.FORBID_TAGS,tt):{},xe="FORBID_ATTR"in e?C({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,we=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Me=e.SAFE_FOR_TEMPLATES||!1,_e=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Oe=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,De=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,fe=e.ALLOWED_URI_REGEXP||H,Je=e.NAMESPACE||Ke,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(Ce=!1),Pe&&(Re=!0),ze&&(me=C({},[...k]),ve=[],!0===ze.html&&(C(me,M),C(ve,O)),!0===ze.svg&&(C(me,_),C(ve,N),C(ve,D)),!0===ze.svgFilters&&(C(me,T),C(ve,N),C(ve,D)),!0===ze.mathMl&&(C(me,R),C(ve,L),C(ve,D))),e.ADD_TAGS&&(me===ge&&(me=A(me)),C(me,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ve===ye&&(ve=A(ve)),C(ve,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&C(Ve,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Fe===Ue&&(Fe=A(Fe)),C(Fe,e.FORBID_CONTENTS,tt)),De&&(me["#text"]=!0),_e&&C(me,["html","head","body"]),me.table&&(C(me,["tbody"]),delete Se.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=e.TRUSTED_TYPES_POLICY,ee=Z.createHTML("")}else void 0===Z&&(Z=J(j,s)),null!==Z&&"string"==typeof ee&&(ee=Z.createHTML(""));o&&o(e),nt=e}},st=C({},["mi","mo","mn","ms","mtext"]),at=C({},["foreignobject","desc","title","annotation-xml"]),lt=C({},["title","style","font","a","script"]),ct=C({},_);C(ct,T),C(ct,I);const ut=C({},R);C(ut,P);const dt=function(e){let t=$(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=h(e.tagName),r=h(t.tagName);return!!Ye[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Ke?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(ct[n]):e.namespaceURI===We?t.namespaceURI===Ke?"math"===n:t.namespaceURI===qe?"math"===n&&at[r]:Boolean(ut[n]):e.namespaceURI===Ke?!(t.namespaceURI===qe&&!at[r])&&!(t.namespaceURI===We&&!st[r])&&!ut[n]&&(lt[n]||!ct[n]):!("application/xhtml+xml"!==$e||!Ye[e.namespaceURI]))},pt=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ht=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(Re||Pe)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ft=function(e){let t=null,n=null;if(Ie)e="<remove></remove>"+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===$e&&Je===Ke&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=Z?Z.createHTML(e):e;if(Je===Ke)try{t=(new U).parseFromString(i,$e)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Qe?ee:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Je===Ke?ie.call(t,_e?"html":"body")[0]:_e?t.documentElement:o},mt=function(e){return ne.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null)},gt=function(e){return e instanceof F&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof x&&e instanceof x},yt=function(e,t,r){se[e]&&u(se[e],(e=>{e.call(n,t,r,nt)}))},bt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),gt(e))return pt(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:me}),e.hasChildNodes()&&!vt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return pt(e),!0;if(!me[r]||Se[r]){if(!Se[r]&&xt(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(De&&!Fe[r]){const t=$(e)||e.parentNode,n=X(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(G(n[r],!0),Y(e))}return pt(e),!0}return e instanceof w&&!dt(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&3===e.nodeType&&(t=e.textContent,u([ae,le,ce],(e=>{t=g(t,e," ")})),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(pt(e),!0)},St=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(Ce&&!xe[t]&&b(ue,t));else if(we&&b(de,t));else if(!ve[t]||xe[t]){if(!(xt(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(Ve[t]);else if(b(fe,g(n,he,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!je[e])if(Ae&&!b(pe,g(n,he,"")));else if(n)return!1;return!0},xt=function(e){return e.indexOf("-")>0},wt=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let i=t.length;for(;i--;){const o=t[i],{name:s,namespaceURI:a,value:l}=o,c=tt(s);let p="value"===s?l:y(l);if(r.attrName=c,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),p=r.attrValue,r.forceKeepAttr)continue;if(ht(s,e),!r.keepAttr)continue;if(!Ee&&b(/\/>/i,p)){ht(s,e);continue}Me&&u([ae,le,ce],(e=>{p=g(p,e," ")}));const h=tt(e.nodeName);if(St(h,c,p)){if(!Ne||"id"!==c&&"name"!==c||(ht(s,e),p=Le+p),Z&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(h,c)){case"TrustedHTML":p=Z.createHTML(p);break;case"TrustedScriptURL":p=Z.createScriptURL(p)}try{a?e.setAttributeNS(a,s,p):e.setAttribute(s,p),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},Ct=function e(t){let n=null;const r=mt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof l&&e(n.content),wt(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,a=null;if(Qe=!e,Qe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Te||ot(t),n.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){const t=tt(e.nodeName);if(!me[t]||Se[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof x)r=ft("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!Re&&!Me&&!_e&&-1===e.indexOf("<"))return Z&&ke?Z.createHTML(e):e;if(r=ft(e),!r)return Re?null:ke?ee:""}r&&Ie&&pt(r.firstChild);const c=mt(Be?e:r);for(;s=c.nextNode();)bt(s)||(s.content instanceof l&&Ct(s.content),wt(s));if(Be)return e;if(Re){if(Pe)for(a=re.call(r.ownerDocument);r.firstChild;)a.appendChild(r.firstChild);else a=r;return(ve.shadowroot||ve.shadowrootmode)&&(a=oe.call(i,a,!0)),a}let d=_e?r.outerHTML:r.innerHTML;return _e&&me["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(W,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Me&&u([ae,le,ce],(e=>{d=g(d,e," ")})),Z&&ke?Z.createHTML(d):d},n.setConfig=function(){ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Te=!0},n.clearConfig=function(){nt=null,Te=!1},n.isValidAttribute=function(e,t,n){nt||ot({});const r=tt(e),i=tt(t);return St(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],p(se[e],t))},n.removeHook=function(e){if(se[e])return d(se[e])},n.removeHooks=function(e){se[e]&&(se[e]=[])},n.removeAllHooks=function(){se={}},n}return Q()}(),Xd.marked.use({async:!1,gfm:!0,pedantic:!0,renderer:{link(e,t,n){const r=Sd(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=' target="_blank" rel="noopener noreferrer">'+n+"</a>",i}}});var Zd=({message:e,memori:n,tenant:r,baseUrl:i,apiUrl:o,showFeedback:a,simulateUserPrompt:l,showAIicon:c=!0,isFirst:u=!1,user:d,userAvatar:p,experts:h})=>{var f,m,g,v,y,b,S;const{t:x}=ge(),w=(0,$d.sanitize)(Xd.marked.parse(null!==(f=e.translatedText)&&void 0!==f?f:e.text),{ADD_ATTR:["target"]});return(0,s.jsxs)(s.Fragment,{children:[(e.initial||u)&&(0,s.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,s.jsxs)(Gc,{show:!0,appear:!0,as:"div",className:t(vs)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&c||a&&l}),children:[!e.fromUser&&(0,s.jsx)(Gc.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),title:(null===(m=e.emitter)||void 0===m?void 0:m.length)&&n.enableBoardOfExperts?e.emitter:n.name,children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:(null===(g=e.emitter)||void 0===g?void 0:g.length)&&n.enableBoardOfExperts?e.emitter:n.name,src:(null===(v=e.emitter)||void 0===v?void 0:v.length)&&n.enableBoardOfExperts&&(null==h?void 0:h.find((t=>t.name===e.emitter)))?`${o}/api/v1/memoriai/memori/avatar/${null===(y=h.find((t=>t.name===e.emitter)))||void 0===y?void 0:y.expertMemoriID}`:n.avatarURL&&n.avatarURL.length>0?xd({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i,apiURL:o}):xd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i||"https://app.twincreator.com",apiURL:o}),onError:e=>{e.currentTarget.src=n.avatarURL&&n.avatarURL.length>0?xd({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i}):xd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i}),e.currentTarget.onerror=null}})}),(0,s.jsxs)(Gc.Child,{as:"div",className:t(vs)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&c||a&&l,"memori-chat--ai-generated":e.generatedByAI&&c,"memori-chat--with-feedback":a}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),children:[(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:w}}),(e.generatedByAI&&c||a&&l)&&(0,s.jsxs)("div",{className:"memori-chat--bubble-addon",children:[a&&!!l&&(0,s.jsx)(Yd,{memori:n,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:e=>{e&&l(e)}}),e.generatedByAI&&c&&(0,s.jsx)(Ad,{align:"left",content:x("generatedByAI"),className:"memori-chat--bubble-ai-icon",children:(0,s.jsx)("span",{children:(0,s.jsx)(Cd,{title:x("generatedByAI")||void 0})})})]})]}),e.fromUser&&(0,s.jsx)(s.Fragment,{children:p&&"string"==typeof p||!p&&(null===(b=null==d?void 0:d.avatarURL)||void 0===b?void 0:b.length)?(0,s.jsx)(Gc.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:null!==(S=null==d?void 0:d.userName)&&void 0!==S?S:"User",src:null!=p?p:null==d?void 0:d.avatarURL})}):p?(0,s.jsx)(Gc.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:p}):(0,s.jsx)(Gc.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)(wd,{})})})]})]})};c=o("85Hg2"),c=o("85Hg2");var ep,tp=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})}),np={};ep=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function n(e,n){var r=e.el,i=e.elStyle,o=e.elHeight,s=e.rowsLimit,a=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(a===s+1)return t({},e);var d=c,p=a,h=o;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(i.height)>parseFloat(o)&&(p++,h=i.height,p===s+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:h,rowsWrapped:p})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:h,rowsWrapped:p}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},a=t({},s,o),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var p=d.innerHTML.split(a.delimiter);d.innerHTML="";var h=window.getComputedStyle(d);p.reduce(n,{el:d,buffer:d.innerHTML,elStyle:h,elHeight:0,rowsLimit:i,rowsWrapped:0,options:a})}if(a.responsive){var f=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,i,t({},o,{responsive:!1}))}},v=function(){clearTimeout(f),f=setTimeout(g,a.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],ep):ep(np);var rp=({loading:e=!1,className:n,title:r,description:i,cover:o,hoverable:a=!1,children:l})=>(0,s.jsx)("div",{className:t(vs)("memori-card",n,{"memori-card--loading":e,"memori-card--with-cover":o,"memori-card--hoverable":a}),children:(0,s.jsxs)(Wc,{spinning:e,children:[o&&(0,s.jsx)("div",{className:"memori-card--cover",children:o}),(0,s.jsxs)("div",{className:"memori-card--content",children:[r&&(0,s.jsx)("h3",{className:"memori-card--title",children:r}),i&&(0,s.jsx)("p",{className:"memori-card--description",children:i}),(0,s.jsx)("div",{className:"memori-card--children",children:l})]})]})});const ip=({isChild:e=!1,item:n,baseUrl:r,onLinkPreviewInfo:i,descriptionOneLine:o=!1})=>{var a,l,u,d;const[p,h]=(0,c.useState)(null),f=(null===(a=n.url)||void 0===a?void 0:a.startsWith("http"))||!n.url||0===(null===(l=n.url)||void 0===l?void 0:l.length)?n.url:`https://${n.url}`;(0,c.useEffect)((()=>{var e,t;let o=(null===(e=n.url)||void 0===e?void 0:e.startsWith("http"))||!n.url||0===(null===(t=n.url)||void 0===t?void 0:t.length)?n.url:`https://${n.url}`;o&&o!==(null==p?void 0:p.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://app.twincreator.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(o,r).then((e=>{h(e?{...e,urlKey:o}:null),i&&e&&i(e)}))}),[null==n?void 0:n.url,r,i]);const m=n.title&&n.title.length>0?n.title:null==p?void 0:p.title,g=null==p?void 0:p.description,v=null==p?void 0:p.video,y=null!==(u=null==p?void 0:p.image)&&void 0!==u?u:null===(d=null==p?void 0:p.images)||void 0===d?void 0:d[0];return(0,c.useEffect)((()=>{setTimeout((()=>{(0,np.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[g,n.mediumID]),(0,s.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:t(vs)("memori-link-item--link",{"memori-link-item--link--child":e}),onClick:t=>{e||(t.preventDefault(),t.stopPropagation(),window.open(f,"_blank",`toolbar=yes,top=${.1*window.innerHeight},left=${.1*window.innerWidth},width=${.8*window.innerWidth},height=${.8*window.innerHeight}`))},children:(0,s.jsx)(rp,{hoverable:!0,className:t(vs)("memori-link-item--card",{"memori-link-item--card-description-oneline":o,"memori-link-item--card-has-image":y,"memori-link-item--card-has-video":v}),cover:v?(0,s.jsx)("iframe",{width:"100%",height:"100%",src:v,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):y?(0,s.jsx)("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",srcSet:y.includes("data:image")?void 0:y,alt:n.title}):(0,s.jsx)("div",{className:"memori-link-item--card-cover-icon",children:(0,s.jsx)(tp,{className:"memori-link-item--icon"})}),title:m,description:g})})};var op=({items:e,baseUrl:t,descriptionOneLine:n=!1,onLinkPreviewInfo:r})=>(0,s.jsx)(Gc,{appear:!0,show:!0,as:"div",className:"memori-link-items",children:(0,s.jsx)("div",{className:"memori-link-items--grid",children:e.map(((e,i)=>(0,s.jsx)(Gc.Child,{as:"div",className:"memori-link-item",enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(ip,{item:e,baseUrl:t,descriptionOneLine:n,onLinkPreviewInfo:r})},e.mediumID)))})});c=o("85Hg2");const sp=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],ap=async(e,t,n,r)=>{var i;const o=sp.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),s=await fetch(`${r||"https://app.twincreator.com"}/api/translate?text=${encodeURIComponent(e)}&target_lang=${t.toUpperCase()}${o?`&source_lang=${o}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),a=await s.json();return null===(i=null==a?void 0:a.translations)||void 0===i?void 0:i[0]},lp=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"}],cp="👤",up=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],dp={it:[{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]};c=o("85Hg2");var pp=({src:e,poster:t,alt:n=""})=>((0,c.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,s.jsx)("div",{className:"model-viewer",children:(0,s.jsx)("model-viewer",{src:e,"ios-src":"",poster:t,alt:n,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));var hp=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})}),fp={};function mp(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}(fp=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){mp(o,r,i,s,a,"next",e)}function a(e){mp(o,r,i,s,a,"throw",e)}s(void 0)}))}}).__esModule=!0,fp.default=fp;var gp={};function vp(){return gp=vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gp.__esModule=!0,gp.default=gp,vp.apply(this,arguments)}(gp=vp).__esModule=!0,gp.default=gp;Q=o("ffgrs"),Y=o("22y1y");var yp={},bp={};function Sp(e,t){return bp=Sp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bp.__esModule=!0,bp.default=bp,Sp(e,t)}(bp=Sp).__esModule=!0,bp.default=bp,(yp=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bp(e,t)}).__esModule=!0,yp.default=yp;var xp={},wp=o("lEJSL").default,Cp={};(Cp=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,Cp.default=Cp,(xp=function(e,t){if(t&&("object"===wp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Cp(e)}).__esModule=!0,xp.default=xp;var Ap={};function Ep(e){return Ap=Ep=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ap.__esModule=!0,Ap.default=Ap,Ep(e)}(Ap=Ep).__esModule=!0,Ap.default=Ap;var Mp,_p=o("7qcgS")();Mp=_p;try{regeneratorRuntime=_p}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=_p:Function("r","regeneratorRuntime = r")(_p)}c=o("85Hg2");var Tp={},Ip={};(Ip=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}).__esModule=!0,Ip.default=Ip,(Tp=function(e,t){if(null==e)return{};var n,r,i=Ip(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}).__esModule=!0,Tp.default=Tp;var Rp={},Pp={},kp=o("e3mvX");(Pp=function(e){if(Array.isArray(e))return kp(e)}).__esModule=!0,Pp.default=Pp;var Op={};(Op=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,Op.default=Op;var Np=o("8xD61"),Lp={};(Lp=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,Lp.default=Lp,(Rp=function(e){return Pp(e)||Op(e)||Np(e)||Lp()}).__esModule=!0,Rp.default=Rp;c=o("85Hg2"),c=o("85Hg2");function Dp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bp(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Dp(Object(r),!0).forEach((function(n){t(K)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var zp={};function Fp(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return zp[r]||(zp[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),zp[r]}function Up(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),i=Fp(r);return i.reduce((function(e,t){return Bp(Bp({},e),n[t])}),t)}function jp(e){return e.join(" ")}function Hp(e){var n=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,s=e.useInlineStyles,a=e.key,l=n.properties,u=n.type,d=n.tagName,p=n.value;if("text"===u)return p;if(d){var h,f=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,i){return Hp({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})}))}}(r,s);if(s){var m=Object.keys(r).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));h=Bp(Bp({},l),{},{className:jp(v)||void 0,style:Up(l.className,Object.assign({},l.style,o),r)})}else h=Bp(Bp({},l),{},{className:jp(l.className)});var y=f(n.children);return t(c).createElement(d,t(gp)({key:a},h),y)}}var Vp=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Gp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wp(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Gp(Object(r),!0).forEach((function(n){t(K)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qp=/\n/g;function Kp(e){var n=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,s=e.numberStyle,a=void 0===s?{}:s,l=e.startingLineNumber;return t(c).createElement("code",{style:Object.assign({},r,o)},function(e){var n=e.lines,r=e.startingLineNumber,i=e.style;return n.map((function(e,n){var o=n+r;return t(c).createElement("span",{key:"line-".concat(n),className:"react-syntax-highlighter-line-number",style:"function"==typeof i?i(o):i},"".concat(o,"\n"))}))}({lines:n.replace(/\n$/,"").split("\n"),style:a,startingLineNumber:l}))}function Jp(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Qp(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return Wp(Wp({},i),o)}function Yp(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,s=e.lineProps,a=void 0===s?{}:s,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,p="function"==typeof a?a(n):a;if(p.className=c,n&&o){var h=Qp(r,n,i);t.unshift(Jp(n,h))}return d&u&&(p.style=Wp(Wp({},p.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:p,children:t}}function Xp(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0;i<e.length;i++){var o=e[i];if("text"===o.type)r.push(Yp({children:[o],className:t(Rp)(new Set(n))}));else if(o.children){var s=n.concat(o.properties.className);Xp(o.children,s).forEach((function(e){return r.push(e)}))}}return r}function $p(e,t,n,r,i,o,s,a,l){var c,u=Xp(e.value),d=[],p=-1,h=0;function f(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Yp({children:e,lineNumber:t,lineNumberStyle:a,largestLineNumber:s,showInlineLineNumbers:i,lineProps:n,className:o,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&i){var n=Qp(a,t,s);e.unshift(Jp(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?f(e,n,r):m(e,n)}for(var v=function(){var e=u[h],t=e.children[0].value;if(t.match(qp)){var n=t.split("\n");n.forEach((function(t,i){var s=r&&d.length+o,a={type:"text",value:"".concat(t,"\n")};if(0===i){var l=g(u.slice(p+1,h).concat(Yp({children:[a],className:e.properties.className})),s);d.push(l)}else if(i===n.length-1){var c=u[h+1]&&u[h+1].children&&u[h+1].children[0],f={type:"text",value:"".concat(t)};if(c){var m=Yp({children:[f],className:e.properties.className});u.splice(h+1,0,m)}else{var v=g([f],s,e.properties.className);d.push(v)}}else{var y=g([a],s,e.properties.className);d.push(y)}})),p=h}h++};h<u.length;)v();if(p!==u.length-1){var y=u.slice(p+1,u.length);if(y&&y.length){var b=g(y,r&&d.length+o);d.push(b)}}return t?d:(c=[]).concat.apply(c,d)}function Zp(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return Hp({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function eh(e){return e&&void 0!==e.highlightAuto}function th(e,n){return function(r){var i=r.language,o=r.children,s=r.style,a=void 0===s?n:s,l=r.customStyle,u=void 0===l?{}:l,d=r.codeTagProps,p=void 0===d?{className:i?"language-".concat(i):void 0,style:Wp(Wp({},a['code[class*="language-"]']),a['code[class*="language-'.concat(i,'"]')])}:d,h=r.useInlineStyles,f=void 0===h||h,m=r.showLineNumbers,g=void 0!==m&&m,v=r.showInlineLineNumbers,y=void 0===v||v,b=r.startingLineNumber,S=void 0===b?1:b,x=r.lineNumberContainerStyle,w=r.lineNumberStyle,C=void 0===w?{}:w,A=r.wrapLines,E=r.wrapLongLines,M=void 0!==E&&E,_=r.lineProps,T=void 0===_?{}:_,I=r.renderer,R=r.PreTag,P=void 0===R?"pre":R,k=r.CodeTag,O=void 0===k?"code":k,N=r.code,L=void 0===N?(Array.isArray(o)?o[0]:o)||"":N,D=r.astGenerator,B=t(Tp)(r,Vp);D=D||e;var z=g?t(c).createElement(Kp,{containerStyle:x,codeStyle:p.style||{},numberStyle:C,startingLineNumber:S,codeString:L}):null,F=a.hljs||a['pre[class*="language-"]']||{backgroundColor:"#fff"},U=eh(D)?"hljs":"prismjs",j=f?Object.assign({},B,{style:Object.assign({},F,u)}):Object.assign({},B,{className:B.className?"".concat(U," ").concat(B.className):U,style:Object.assign({},u)});if(p.style=Wp(Wp({},p.style),{},M?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!D)return t(c).createElement(P,j,z,t(c).createElement(O,p,L));(void 0===A&&I||M)&&(A=!0),I=I||Zp;var H=[{type:"text",value:L}],V=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(eh(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(e){return{value:i}}}({astGenerator:D,language:i,code:L,defaultCodeValue:H});null===V.language&&(V.value=H);var G=$p(V,A,T,g,y,S,V.value.length+S,C,M);return t(c).createElement(P,j,t(c).createElement(O,p,!y&&z,I({rows:G,stylesheet:a,useInlineStyles:f})))}}function nh(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=t(Ap)(e);if(n){var o=t(Ap)(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return t(xp)(this,r)}}var rh,ih,oh,sh,ah,lh,ch,uh=function(e,n){return function(){var r=t(fp)(t(Mp).mark((function r(i){var o;return t(Mp).wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:o=t.sent,i(e,o.default||o);case 4:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},dh={abap:uh("abap",(function(){return o("bwHpE")})),abnf:uh("abnf",(function(){return o("daD87")})),actionscript:uh("actionscript",(function(){return o("lpEgO")})),ada:uh("ada",(function(){return o("1sGW9")})),agda:uh("agda",(function(){return o("e9VyR")})),al:uh("al",(function(){return o("kMFSe")})),antlr4:uh("antlr4",(function(){return o("8HlsP")})),apacheconf:uh("apacheconf",(function(){return o("isFCh")})),apex:uh("apex",(function(){return o("gUXVM")})),apl:uh("apl",(function(){return o("2L15v")})),applescript:uh("applescript",(function(){return o("8XyFT")})),aql:uh("aql",(function(){return o("gFWTI")})),arduino:uh("arduino",(function(){return o("jI3VB")})),arff:uh("arff",(function(){return o("6uYTH")})),asciidoc:uh("asciidoc",(function(){return o("gdYKH")})),asm6502:uh("asm6502",(function(){return o("ahFLg")})),asmatmel:uh("asmatmel",(function(){return o("4irIu")})),aspnet:uh("aspnet",(function(){return o("yDC6n")})),autohotkey:uh("autohotkey",(function(){return o("a4xpy")})),autoit:uh("autoit",(function(){return o("iNSix")})),avisynth:uh("avisynth",(function(){return o("kEBnk")})),avroIdl:uh("avroIdl",(function(){return o("lzthi")})),bash:uh("bash",(function(){return Promise.resolve(o("3aDLI"))})),basic:uh("basic",(function(){return o("cxDu6")})),batch:uh("batch",(function(){return o("6zDll")})),bbcode:uh("bbcode",(function(){return o("bPS87")})),bicep:uh("bicep",(function(){return o("8dy5f")})),birb:uh("birb",(function(){return o("3vHrY")})),bison:uh("bison",(function(){return o("bCjBS")})),bnf:uh("bnf",(function(){return o("4NqDW")})),brainfuck:uh("brainfuck",(function(){return o("4s0KX")})),brightscript:uh("brightscript",(function(){return o("jTsQ4")})),bro:uh("bro",(function(){return o("5lMc2")})),bsl:uh("bsl",(function(){return o("jBYxC")})),c:uh("c",(function(){return Promise.resolve(o("lyZgY"))})),cfscript:uh("cfscript",(function(){return o("coZDy")})),chaiscript:uh("chaiscript",(function(){return o("e1zEN")})),cil:uh("cil",(function(){return o("crKoM")})),clike:uh("clike",(function(){return o("4kO9t")})),clojure:uh("clojure",(function(){return o("01SpB")})),cmake:uh("cmake",(function(){return o("9yG4p")})),cobol:uh("cobol",(function(){return o("967Hn")})),coffeescript:uh("coffeescript",(function(){return o("7Yi6H")})),concurnas:uh("concurnas",(function(){return o("5tXmX")})),coq:uh("coq",(function(){return o("ektdr")})),cpp:uh("cpp",(function(){return Promise.resolve(o("lR39A"))})),crystal:uh("crystal",(function(){return o("8gt4L")})),csharp:uh("csharp",(function(){return o("7K6eJ")})),cshtml:uh("cshtml",(function(){return o("cVu4i")})),csp:uh("csp",(function(){return o("ecKo1")})),cssExtras:uh("cssExtras",(function(){return o("gnpv8")})),css:uh("css",(function(){return o("jx0H8")})),csv:uh("csv",(function(){return o("f9kmW")})),cypher:uh("cypher",(function(){return o("lojor")})),d:uh("d",(function(){return o("6Qa0U")})),dart:uh("dart",(function(){return o("74K1B")})),dataweave:uh("dataweave",(function(){return o("93H6c")})),dax:uh("dax",(function(){return o("cf9Y9")})),dhall:uh("dhall",(function(){return o("f6UWv")})),diff:uh("diff",(function(){return o("klPVo")})),django:uh("django",(function(){return o("jfxe9")})),dnsZoneFile:uh("dnsZoneFile",(function(){return o("5aMz5")})),docker:uh("docker",(function(){return o("kOauC")})),dot:uh("dot",(function(){return o("btE6k")})),ebnf:uh("ebnf",(function(){return o("aT88c")})),editorconfig:uh("editorconfig",(function(){return o("jWOl8")})),eiffel:uh("eiffel",(function(){return o("kHJaX")})),ejs:uh("ejs",(function(){return o("frfnA")})),elixir:uh("elixir",(function(){return o("hcrJ2")})),elm:uh("elm",(function(){return o("jd271")})),erb:uh("erb",(function(){return o("gczXL")})),erlang:uh("erlang",(function(){return o("FsabW")})),etlua:uh("etlua",(function(){return o("9DI9l")})),excelFormula:uh("excelFormula",(function(){return o("3QVue")})),factor:uh("factor",(function(){return o("ltNCT")})),falselang:uh("falselang",(function(){return o("g0Q6p")})),firestoreSecurityRules:uh("firestoreSecurityRules",(function(){return o("ukA2V")})),flow:uh("flow",(function(){return o("e5prn")})),fortran:uh("fortran",(function(){return o("gIEL6")})),fsharp:uh("fsharp",(function(){return o("3wQkt")})),ftl:uh("ftl",(function(){return o("7ZVWs")})),gap:uh("gap",(function(){return o("hOFj6")})),gcode:uh("gcode",(function(){return o("95BzQ")})),gdscript:uh("gdscript",(function(){return o("iul6t")})),gedcom:uh("gedcom",(function(){return o("e0qJM")})),gherkin:uh("gherkin",(function(){return o("2SHak")})),git:uh("git",(function(){return o("l6VFH")})),glsl:uh("glsl",(function(){return o("cEMfJ")})),gml:uh("gml",(function(){return o("8UVTr")})),gn:uh("gn",(function(){return o("kvibD")})),goModule:uh("goModule",(function(){return o("icqjF")})),go:uh("go",(function(){return o("jLkg8")})),graphql:uh("graphql",(function(){return o("aYGNi")})),groovy:uh("groovy",(function(){return o("4bTmH")})),haml:uh("haml",(function(){return o("h2A6V")})),handlebars:uh("handlebars",(function(){return o("79YVJ")})),haskell:uh("haskell",(function(){return o("bsiLW")})),haxe:uh("haxe",(function(){return o("94Kdj")})),hcl:uh("hcl",(function(){return o("9CheR")})),hlsl:uh("hlsl",(function(){return o("h3dqW")})),hoon:uh("hoon",(function(){return o("9WbsW")})),hpkp:uh("hpkp",(function(){return o("GiPN3")})),hsts:uh("hsts",(function(){return o("eaSn9")})),http:uh("http",(function(){return o("1uj7b")})),ichigojam:uh("ichigojam",(function(){return o("ge562")})),icon:uh("icon",(function(){return o("lVHUf")})),icuMessageFormat:uh("icuMessageFormat",(function(){return o("aYoUL")})),idris:uh("idris",(function(){return o("1RVAE")})),iecst:uh("iecst",(function(){return o("bi7Dr")})),ignore:uh("ignore",(function(){return o("cq0Pi")})),inform7:uh("inform7",(function(){return o("31K4E")})),ini:uh("ini",(function(){return o("l05OZ")})),io:uh("io",(function(){return o("6bY1b")})),j:uh("j",(function(){return o("1ebDS")})),java:uh("java",(function(){return o("iEZZI")})),javadoc:uh("javadoc",(function(){return o("aHy5a")})),javadoclike:uh("javadoclike",(function(){return o("5f3rE")})),javascript:uh("javascript",(function(){return o("7JDFI")})),javastacktrace:uh("javastacktrace",(function(){return o("gdCGE")})),jexl:uh("jexl",(function(){return o("cqMb9")})),jolie:uh("jolie",(function(){return o("cEDX4")})),jq:uh("jq",(function(){return o("kEWsh")})),jsExtras:uh("jsExtras",(function(){return o("74PI8")})),jsTemplates:uh("jsTemplates",(function(){return o("30TPr")})),jsdoc:uh("jsdoc",(function(){return o("9DH5c")})),json:uh("json",(function(){return Promise.resolve(o("l1Rj1"))})),json5:uh("json5",(function(){return o("920rv")})),jsonp:uh("jsonp",(function(){return o("9AwS1")})),jsstacktrace:uh("jsstacktrace",(function(){return o("bYXMr")})),jsx:uh("jsx",(function(){return Promise.resolve(o("6ho3O"))})),julia:uh("julia",(function(){return o("g0ibH")})),keepalived:uh("keepalived",(function(){return o("2hdnH")})),keyman:uh("keyman",(function(){return o("cIufI")})),kotlin:uh("kotlin",(function(){return o("c26dU")})),kumir:uh("kumir",(function(){return o("iYAha")})),kusto:uh("kusto",(function(){return o("9z1oX")})),latex:uh("latex",(function(){return o("lCPLU")})),latte:uh("latte",(function(){return o("c9oN0")})),less:uh("less",(function(){return o("hA3V9")})),lilypond:uh("lilypond",(function(){return o("hpHTA")})),liquid:uh("liquid",(function(){return o("kpZTm")})),lisp:uh("lisp",(function(){return o("chgK5")})),livescript:uh("livescript",(function(){return o("2gdiv")})),llvm:uh("llvm",(function(){return o("jUeFO")})),log:uh("log",(function(){return o("3BFSQ")})),lolcode:uh("lolcode",(function(){return o("lG9br")})),lua:uh("lua",(function(){return o("cVGpd")})),magma:uh("magma",(function(){return o("4LVzY")})),makefile:uh("makefile",(function(){return o("2NviD")})),markdown:uh("markdown",(function(){return o("jUFCF")})),markupTemplating:uh("markupTemplating",(function(){return Promise.resolve(o("t3W0d"))})),markup:uh("markup",(function(){return o("5hIXu")})),matlab:uh("matlab",(function(){return o("kPAC0")})),maxscript:uh("maxscript",(function(){return o("gHOJy")})),mel:uh("mel",(function(){return o("9mj6e")})),mermaid:uh("mermaid",(function(){return o("kozw5")})),mizar:uh("mizar",(function(){return o("2bN6W")})),mongodb:uh("mongodb",(function(){return o("eHKWX")})),monkey:uh("monkey",(function(){return o("7Fh0C")})),moonscript:uh("moonscript",(function(){return o("hDXwC")})),n1ql:uh("n1ql",(function(){return o("j9bkC")})),n4js:uh("n4js",(function(){return o("eTmBF")})),nand2tetrisHdl:uh("nand2tetrisHdl",(function(){return o("ezjCf")})),naniscript:uh("naniscript",(function(){return o("VxHk1")})),nasm:uh("nasm",(function(){return o("ly95T")})),neon:uh("neon",(function(){return o("7Fk34")})),nevod:uh("nevod",(function(){return o("3U8Qv")})),nginx:uh("nginx",(function(){return o("c6qVk")})),nim:uh("nim",(function(){return o("1JdCk")})),nix:uh("nix",(function(){return o("jcstS")})),nsis:uh("nsis",(function(){return o("kEJqW")})),objectivec:uh("objectivec",(function(){return o("lUP8A")})),ocaml:uh("ocaml",(function(){return o("lhTAD")})),opencl:uh("opencl",(function(){return o("8rxKO")})),openqasm:uh("openqasm",(function(){return o("ib0uL")})),oz:uh("oz",(function(){return o("csCUS")})),parigp:uh("parigp",(function(){return o("2DkHE")})),parser:uh("parser",(function(){return o("2cp75")})),pascal:uh("pascal",(function(){return o("fViVl")})),pascaligo:uh("pascaligo",(function(){return o("9Uuxa")})),pcaxis:uh("pcaxis",(function(){return o("jUdnN")})),peoplecode:uh("peoplecode",(function(){return o("l8w4e")})),perl:uh("perl",(function(){return o("aX7dM")})),phpExtras:uh("phpExtras",(function(){return o("3cMZl")})),php:uh("php",(function(){return Promise.resolve(o("5li5P"))})),phpdoc:uh("phpdoc",(function(){return o("bDyJN")})),plsql:uh("plsql",(function(){return o("cPuMN")})),powerquery:uh("powerquery",(function(){return o("jE1gU")})),powershell:uh("powershell",(function(){return o("k7t0j")})),processing:uh("processing",(function(){return o("jr8hV")})),prolog:uh("prolog",(function(){return o("hpuat")})),promql:uh("promql",(function(){return o("ckXC5")})),properties:uh("properties",(function(){return o("fAh6P")})),protobuf:uh("protobuf",(function(){return o("R6WqB")})),psl:uh("psl",(function(){return o("Al65w")})),pug:uh("pug",(function(){return o("dxbNS")})),puppet:uh("puppet",(function(){return o("lrSuh")})),pure:uh("pure",(function(){return o("6DKQK")})),purebasic:uh("purebasic",(function(){return o("7ZkSb")})),purescript:uh("purescript",(function(){return o("dBTYx")})),python:uh("python",(function(){return Promise.resolve(o("kiy5M"))})),q:uh("q",(function(){return o("4FXyy")})),qml:uh("qml",(function(){return o("2zZFj")})),qore:uh("qore",(function(){return o("iCK1Y")})),qsharp:uh("qsharp",(function(){return o("dvH9H")})),r:uh("r",(function(){return o("lQqRt")})),racket:uh("racket",(function(){return o("eHKmq")})),reason:uh("reason",(function(){return o("kkeLT")})),regex:uh("regex",(function(){return o("llX50")})),rego:uh("rego",(function(){return o("9hKdZ")})),renpy:uh("renpy",(function(){return o("cJgw5")})),rest:uh("rest",(function(){return o("867DK")})),rip:uh("rip",(function(){return o("3Odjx")})),roboconf:uh("roboconf",(function(){return o("gQ0Us")})),robotframework:uh("robotframework",(function(){return o("bLCgx")})),ruby:uh("ruby",(function(){return Promise.resolve(o("ch1PX"))})),rust:uh("rust",(function(){return o("cInT8")})),sas:uh("sas",(function(){return o("iz7eP")})),sass:uh("sass",(function(){return o("hrDC3")})),scala:uh("scala",(function(){return o("ub8Bf")})),scheme:uh("scheme",(function(){return o("7NAAt")})),scss:uh("scss",(function(){return Promise.resolve(o("fU6a0"))})),shellSession:uh("shellSession",(function(){return o("7kKCv")})),smali:uh("smali",(function(){return o("2lkCb")})),smalltalk:uh("smalltalk",(function(){return o("4280y")})),smarty:uh("smarty",(function(){return o("4hXYK")})),sml:uh("sml",(function(){return o("jh2E8")})),solidity:uh("solidity",(function(){return o("dTdF2")})),solutionFile:uh("solutionFile",(function(){return o("iI5tm")})),soy:uh("soy",(function(){return o("aoU5C")})),sparql:uh("sparql",(function(){return o("ggrvb")})),splunkSpl:uh("splunkSpl",(function(){return o("8LhCX")})),sqf:uh("sqf",(function(){return o("3tDsu")})),sql:uh("sql",(function(){return Promise.resolve(o("bnDV9"))})),squirrel:uh("squirrel",(function(){return o("bxaUV")})),stan:uh("stan",(function(){return o("dBqrq")})),stylus:uh("stylus",(function(){return o("JlHVK")})),swift:uh("swift",(function(){return o("c7NBs")})),systemd:uh("systemd",(function(){return o("jprZl")})),t4Cs:uh("t4Cs",(function(){return o("edsMI")})),t4Templating:uh("t4Templating",(function(){return o("bS9Wa")})),t4Vb:uh("t4Vb",(function(){return o("gYk20")})),tap:uh("tap",(function(){return o("byv7d")})),tcl:uh("tcl",(function(){return o("lUAIZ")})),textile:uh("textile",(function(){return o("7J2LO")})),toml:uh("toml",(function(){return o("eXtdM")})),tremor:uh("tremor",(function(){return o("vyajH")})),tsx:uh("tsx",(function(){return Promise.resolve(o("7cTnl"))})),tt2:uh("tt2",(function(){return o("8XOOm")})),turtle:uh("turtle",(function(){return o("1XvLQ")})),twig:uh("twig",(function(){return o("i9Fpp")})),typescript:uh("typescript",(function(){return Promise.resolve(o("fzL8k"))})),typoscript:uh("typoscript",(function(){return o("kKk69")})),unrealscript:uh("unrealscript",(function(){return o("jgq8Y")})),uorazor:uh("uorazor",(function(){return o("dsZ00")})),uri:uh("uri",(function(){return o("fqJRp")})),v:uh("v",(function(){return o("bgfyB")})),vala:uh("vala",(function(){return o("68x4q")})),vbnet:uh("vbnet",(function(){return o("eUhQs")})),velocity:uh("velocity",(function(){return o("fPNdV")})),verilog:uh("verilog",(function(){return o("2fM1V")})),vhdl:uh("vhdl",(function(){return o("hNF6q")})),vim:uh("vim",(function(){return o("75TCr")})),visualBasic:uh("visualBasic",(function(){return o("fc93z")})),warpscript:uh("warpscript",(function(){return o("jgHlG")})),wasm:uh("wasm",(function(){return o("dVZkI")})),webIdl:uh("webIdl",(function(){return o("9Jnxv")})),wiki:uh("wiki",(function(){return o("1Gimo")})),wolfram:uh("wolfram",(function(){return o("4SyRT")})),wren:uh("wren",(function(){return o("gaIVs")})),xeora:uh("xeora",(function(){return o("lagad")})),xmlDoc:uh("xmlDoc",(function(){return o("9DNYE")})),xojo:uh("xojo",(function(){return o("ksF4f")})),xquery:uh("xquery",(function(){return o("gXxHJ")})),yaml:uh("yaml",(function(){return o("6rk3j")})),yang:uh("yang",(function(){return o("kTyrQ")})),zig:uh("zig",(function(){return o("d3mFC")}))},ph=(ih=(rh={loader:function(){return o("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:dh,registerLanguage:function(e,t,n){return e.register(n)}}).loader,oh=rh.isLanguageRegistered,sh=rh.registerLanguage,ah=rh.languageLoaders,lh=rh.noAsyncLoadingLanguages,ch=function(e){t(yp)(i,e);var n,r=nh(i);function i(){return t(Q)(this,i),r.apply(this,arguments)}return t(Y)(i,[{key:"componentDidUpdate",value:function(){!i.isRegistered(this.props.language)&&ah&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;i.astGeneratorPromise||i.loadAstGenerator(),i.astGenerator||i.astGeneratorPromise.then((function(){e.forceUpdate()})),!i.isRegistered(this.props.language)&&ah&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&i.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return i.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return t(c).createElement(i.highlightInstance,t(gp)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:i.astGenerator}))}}],[{key:"preload",value:function(){return i.loadAstGenerator()}},{key:"loadLanguage",value:(n=t(fp)(t(Mp).mark((function e(n){var r;return t(Mp).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(r=ah[n])){e.next=5;break}return e.abrupt("return",r(i.registerLanguage));case 5:throw new Error("Language ".concat(n," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return i.isRegistered(e)||"function"==typeof ah[e]}},{key:"loadAstGenerator",value:function(){return i.astGeneratorPromise=ih().then((function(e){i.astGenerator=e,sh&&i.languages.forEach((function(t,n){return sh(e,n,t)}))})),i.astGeneratorPromise}}]),i}(t(c).PureComponent),t(K)(ch,"astGenerator",null),t(K)(ch,"highlightInstance",th(null,{})),t(K)(ch,"astGeneratorPromise",null),t(K)(ch,"languages",new Map),t(K)(ch,"supportedLanguages",rh.supportedLanguages||Object.keys(ah||{})),t(K)(ch,"isRegistered",(function(e){if(lh)return!0;if(!sh)throw new Error("Current syntax highlighter doesn't support registration of languages");return ch.astGenerator?oh(ch.astGenerator,e):ch.languages.has(e)})),t(K)(ch,"registerLanguage",(function(e,t){if(!sh)throw new Error("Current syntax highlighter doesn't support registration of languages");if(ch.astGenerator)return sh(ch.astGenerator,e,t);ch.languages.set(e,t)})),ch),hh={},fh={};(fh=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,fh.default=fh,Object.defineProperty(hh,"__esModule",{value:!0}),Object.defineProperty(hh,"a11yDark",{enumerable:!0,get:function(){return Ch.default}}),Object.defineProperty(hh,"atomDark",{enumerable:!0,get:function(){return Ah.default}}),Object.defineProperty(hh,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return Eh.default}}),Object.defineProperty(hh,"cb",{enumerable:!0,get:function(){return Mh.default}}),Object.defineProperty(hh,"coldarkCold",{enumerable:!0,get:function(){return _h.default}}),Object.defineProperty(hh,"coldarkDark",{enumerable:!0,get:function(){return Th.default}}),Object.defineProperty(hh,"coy",{enumerable:!0,get:function(){return mh.default}}),Object.defineProperty(hh,"coyWithoutShadows",{enumerable:!0,get:function(){return Ih.default}}),Object.defineProperty(hh,"darcula",{enumerable:!0,get:function(){return Rh.default}}),Object.defineProperty(hh,"dark",{enumerable:!0,get:function(){return gh.default}}),Object.defineProperty(hh,"dracula",{enumerable:!0,get:function(){return Ph.default}}),Object.defineProperty(hh,"duotoneDark",{enumerable:!0,get:function(){return kh.default}}),Object.defineProperty(hh,"duotoneEarth",{enumerable:!0,get:function(){return Oh.default}}),Object.defineProperty(hh,"duotoneForest",{enumerable:!0,get:function(){return Nh.default}}),Object.defineProperty(hh,"duotoneLight",{enumerable:!0,get:function(){return Lh.default}}),Object.defineProperty(hh,"duotoneSea",{enumerable:!0,get:function(){return Dh.default}}),Object.defineProperty(hh,"duotoneSpace",{enumerable:!0,get:function(){return Bh.default}}),Object.defineProperty(hh,"funky",{enumerable:!0,get:function(){return vh.default}}),Object.defineProperty(hh,"ghcolors",{enumerable:!0,get:function(){return zh.default}}),Object.defineProperty(hh,"gruvboxDark",{enumerable:!0,get:function(){return Fh.default}}),Object.defineProperty(hh,"gruvboxLight",{enumerable:!0,get:function(){return Uh.default}}),Object.defineProperty(hh,"holiTheme",{enumerable:!0,get:function(){return jh.default}}),Object.defineProperty(hh,"hopscotch",{enumerable:!0,get:function(){return Hh.default}}),Object.defineProperty(hh,"lucario",{enumerable:!0,get:function(){return Vh.default}}),Object.defineProperty(hh,"materialDark",{enumerable:!0,get:function(){return Gh.default}}),Object.defineProperty(hh,"materialLight",{enumerable:!0,get:function(){return Wh.default}}),Object.defineProperty(hh,"materialOceanic",{enumerable:!0,get:function(){return qh.default}}),Object.defineProperty(hh,"nightOwl",{enumerable:!0,get:function(){return Kh.default}}),Object.defineProperty(hh,"nord",{enumerable:!0,get:function(){return Jh.default}}),Object.defineProperty(hh,"okaidia",{enumerable:!0,get:function(){return yh.default}}),Object.defineProperty(hh,"oneDark",{enumerable:!0,get:function(){return Qh.default}}),Object.defineProperty(hh,"oneLight",{enumerable:!0,get:function(){return Yh.default}}),Object.defineProperty(hh,"pojoaque",{enumerable:!0,get:function(){return Xh.default}}),Object.defineProperty(hh,"prism",{enumerable:!0,get:function(){return wh.default}}),Object.defineProperty(hh,"shadesOfPurple",{enumerable:!0,get:function(){return $h.default}}),Object.defineProperty(hh,"solarizedDarkAtom",{enumerable:!0,get:function(){return Zh.default}}),Object.defineProperty(hh,"solarizedlight",{enumerable:!0,get:function(){return bh.default}}),Object.defineProperty(hh,"synthwave84",{enumerable:!0,get:function(){return ef.default}}),Object.defineProperty(hh,"tomorrow",{enumerable:!0,get:function(){return Sh.default}}),Object.defineProperty(hh,"twilight",{enumerable:!0,get:function(){return xh.default}}),Object.defineProperty(hh,"vs",{enumerable:!0,get:function(){return tf.default}}),Object.defineProperty(hh,"vscDarkPlus",{enumerable:!0,get:function(){return nf.default}}),Object.defineProperty(hh,"xonokai",{enumerable:!0,get:function(){return rf.default}}),Object.defineProperty(hh,"zTouch",{enumerable:!0,get:function(){return of.default}});var mh=fh(o("jcF8U")),gh=fh(o("3Tppx")),vh=fh(o("dBuK7")),yh=fh(o("eEjWK")),bh=fh(o("awG2g")),Sh=fh(o("2oFzQ")),xh=fh(o("4Au6Q")),wh=fh(o("dAPqs")),Ch=fh(o("8eAql")),Ah=fh(o("cv2QE")),Eh=fh(o("h5I9g")),Mh=fh(o("i4C5w")),_h=fh(o("3kFKo")),Th=fh(o("17zK0")),Ih=fh(o("5Avqr")),Rh=fh(o("1jHMv")),Ph=fh(o("7Q8CE")),kh=fh(o("jKUos")),Oh=fh(o("Uzm4J")),Nh=fh(o("7yfkN")),Lh=fh(o("lT2l1")),Dh=fh(o("fZ9um")),Bh=fh(o("1MoQL")),zh=fh(o("4uys7")),Fh=fh(o("kaYsk")),Uh=fh(o("kN6Vu")),jh=fh(o("2Z6pG")),Hh=fh(o("4jQJK")),Vh=fh(o("bpXw0")),Gh=fh(o("i4S8s")),Wh=fh(o("5bNr4")),qh=fh(o("5ZYWT")),Kh=fh(o("ihJCU")),Jh=fh(o("8iIbg")),Qh=fh(o("424u7")),Yh=fh(o("jPiNI")),Xh=fh(o("OHVOA")),$h=fh(o("2OKTL")),Zh=fh(o("2Mg8H")),ef=fh(o("9Kud0")),tf=fh(o("eCrmR")),nf=fh(o("8UhcQ")),rf=fh(o("dtU9z")),of=fh(o("4xtLO")),sf={};Object.defineProperty(sf,"__esModule",{value:!0}),sf.default=void 0;var af=fh(o("7cTnl")).default;sf.default=af;var lf={};Object.defineProperty(lf,"__esModule",{value:!0}),lf.default=void 0;var cf=fh(o("l1Rj1")).default;lf.default=cf;var uf={};Object.defineProperty(uf,"__esModule",{value:!0}),uf.default=void 0;var df=fh(o("fU6a0")).default;uf.default=df;var pf={};Object.defineProperty(pf,"__esModule",{value:!0}),pf.default=void 0;var hf=fh(o("3aDLI")).default;pf.default=hf;var ff={};Object.defineProperty(ff,"__esModule",{value:!0}),ff.default=void 0;var mf=fh(o("kiy5M")).default;ff.default=mf;var gf={};Object.defineProperty(gf,"__esModule",{value:!0}),gf.default=void 0;var vf=fh(o("lR39A")).default;gf.default=vf;var yf={};Object.defineProperty(yf,"__esModule",{value:!0}),yf.default=void 0;var bf=fh(o("5li5P")).default;yf.default=bf;var Sf={};Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.default=void 0;var xf=fh(o("ch1PX")).default;Sf.default=xf;var wf={};Object.defineProperty(wf,"__esModule",{value:!0}),wf.default=void 0;var Cf=fh(o("bnDV9")).default;wf.default=Cf,ph.registerLanguage("tsx",t(sf)),ph.registerLanguage("json",t(lf)),ph.registerLanguage("scss",t(uf)),ph.registerLanguage("bash",t(pf)),ph.registerLanguage("python",t(ff)),ph.registerLanguage("cpp",t(gf)),ph.registerLanguage("php",t(yf)),ph.registerLanguage("ruby",t(Sf)),ph.registerLanguage("sql",t(wf));var Af=({medium:e,className:t,preview:n=!1})=>{var r,i,o,a;const{t:l}=ge();return(0,s.jsxs)("div",{className:"memori-snippet",children:[(0,s.jsxs)("div",{className:"memori-snippet--content",children:[(0,s.jsx)(ph,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:hh.atomDark,showLineNumbers:!0,language:null!==(i=null===(r=up.find((t=>e.mimeType===t.mimeType)))||void 0===r?void 0:r.lang)&&void 0!==i?i:"text",children:(null===(o=e.content)||void 0===o?void 0:o.length)&&e.content.length>200&&n?`${e.content.slice(0,200)}\n...`:`${e.content}`}),(0,s.jsx)(Na,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:l("copy")||"Copy",icon:(0,s.jsx)(hp,{}),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})]}),!!(null===(a=e.title)||void 0===a?void 0:a.length)&&(0,s.jsx)("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption",children:e.title})]})};var Ef=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var Mf=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var _f=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"})});var Tf=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"})});const If=({isChild:e=!1,item:t,sessionID:n,tenantID:r,preview:i=!1,baseURL:o,apiURL:a,onClick:l,customMediaRenderer:c})=>{const u=xd({resourceURI:t.url,sessionID:n,tenantID:r,baseURL:o,apiURL:a}),d=null==c?void 0:c(t.mimeType);if(d)return d;switch(t.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,s.jsxs)("picture",{className:"memori-media-item--figure",children:[!i&&(0,s.jsx)("source",{srcSet:[u,t.url,t.content].join(", "),type:t.mimeType}),(0,s.jsx)("img",{alt:t.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),t.title&&(0,s.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:t.title})]})})});case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)(Tf,{className:"memori-media-item--icon"}),title:t.title})});case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)(_f,{className:"memori-media-item--icon"}),title:t.title})});case"application/pdf":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)(Mf,{className:"memori-media-item--icon"}),title:t.title})});case"video/mp4":case"video/avi":case"video/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)("video",{style:{width:"100%",height:"100%"},controls:!0,src:u,title:t.title}),title:t.title})});case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)("audio",{style:{width:"100%",height:"100%"},controls:!0,src:u}),title:t.title})});case"model/gltf-binary":return(0,s.jsx)(pp,{src:u,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)(Ef,{className:"memori-media-item--icon"}),title:t.title})})}};var Rf=(0,c.memo)((({items:e,sessionID:t,tenantID:n,translateTo:r,baseURL:i,apiURL:o,customMediaRenderer:a})=>{const[l,u]=(0,c.useState)(e),[d,p]=(0,c.useState)(),h=(0,c.useCallback)((async()=>{if(!r)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await ap(e.title,r);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));u(t)}),[r,e]);return(0,c.useEffect)((()=>{r&&h()}),[r,h]),(0,s.jsxs)(Gc,{appear:!0,show:!0,as:"div",className:"memori-media-items",children:[(0,s.jsx)("div",{className:"memori-media-items--grid",children:l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!up.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)).map(((e,r)=>(0,s.jsx)(Gc.Child,{as:"div",className:"memori-media-item",enter:"ease-out duration-500 delay-"+100*r,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(If,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,onClick:e=>{p(l.find((t=>t.mediumID===e)))},item:{...e,title:e.title,url:e.url,content:e.content},customMediaRenderer:a})},e.url+"&index="+r)))}),l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&up.map((e=>e.mimeType)).includes(e.mimeType)})).map((e=>(0,s.jsx)(Gc.Child,{as:"div",className:"memori-media-item--snippet",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Af,{medium:e},e.mediumID)},e.mediumID))),l.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).map((e=>(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:e.content||""}},e.mediumID))),(null==d?void 0:d.mediumID)&&(0,s.jsx)(Kc,{width:"100%",widthMd:"100%",className:"memori-media-item--modal",open:!!d,onClose:()=>p(void 0),footer:null,children:(0,s.jsx)(If,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,item:{...d,title:d.title,url:d.url,content:d.content},customMediaRenderer:a})})]})}));var Pf=(0,c.memo)((({hints:e=[],links:n=[],media:r=[],simulateUserPrompt:i=(()=>{}),sessionID:o,baseUrl:a,apiUrl:l,translateTo:u,customMediaRenderer:d})=>{const{t:p}=ge(),[h,f]=(0,c.useState)(!0),[m,g]=(0,c.useState)(6);return(0,c.useEffect)((()=>{f(!0)}),[e]),(0,s.jsxs)("div",{className:"memori-media-widget",children:[(null==r?void 0:r.length)>0&&(0,s.jsx)(Rf,{items:r,sessionID:o,translateTo:u,baseURL:a,apiURL:l,customMediaRenderer:d}),(null==n?void 0:n.length)>0&&(0,s.jsx)(op,{items:n,baseUrl:a}),(null==e?void 0:e.length)>0&&h&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Gc,{appear:!0,show:!0,as:"ul",className:"memori-media--hints",children:e.slice(0,m).map(((e,n)=>(0,s.jsx)(Gc.Child,{as:"li",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Na,{className:t(vs)("memori-media--hint"),primary:!0,onClick:()=>{i(e.originalText,e.text),f(!1)},onTouchEnd:()=>{i(e.originalText,e.text),f(!1)},children:e.text},e.text+n)},e.text+n)))}),e.length>m&&(0,s.jsx)("div",{className:"memori-hints--show-more",children:(0,s.jsx)(Na,{className:"memori-hints--show-more-button",id:"showMoreHints",onClick:()=>g(m+6),children:p("expand")||"Expand"})})]})]})}));c=o("85Hg2"),c=o("85Hg2");function kf(e=0){let[t,n]=(0,c.useState)(e),r=(0,c.useCallback)((e=>n((t=>t|e))),[t]),i=(0,c.useCallback)((e=>Boolean(t&e)),[t]),o=(0,c.useCallback)((e=>n((t=>t&~e))),[n]),s=(0,c.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:s}}let Of=(0,(c=o("85Hg2")).createContext)(null);function Nf(){let e=(0,c.useContext)(Of);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Nf),e}return e}function Lf(){let[e,n]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Ja((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t(c).createElement(Of.Provider,{value:i},e.children)}),[n])]}let Df=Ha((function(e,t){let{passive:n=!1,...r}=e,i=Nf(),o=`headlessui-label-${sl()}`,s=Xa(t);qa((()=>i.register(o)),[o,i.register]);let a={ref:s,...i.props,id:o};return n&&("onClick"in a&&delete a.onClick,"onClick"in r&&delete r.onClick),Fa({ourProps:a,theirProps:r,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})}));function Bf(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))Ff(n,zf(t,r),i);return n}function zf(e,t){return e?e+"["+t+"]":t}function Ff(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())Ff(e,zf(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):Bf(n,t,e)}function Uf(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}c=o("85Hg2");function jf(e,t,n){let[r,i]=(0,c.useState)(n),o=void 0!==e,s=(0,c.useRef)(o),a=(0,c.useRef)(!1),l=(0,c.useRef)(!1);return!o||s.current||a.current?!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[o?e:r,Ja((e=>(o||i(e),null==t?void 0:t(e))))]}var Hf,Vf=((Hf=Vf||{})[Hf.RegisterOption=0]="RegisterOption",Hf[Hf.UnregisterOption=1]="UnregisterOption",Hf);let Gf={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Al(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},Wf=(0,c.createContext)(null);function qf(e){let t=(0,c.useContext)(Wf);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,qf),t}return t}function Kf(e,t){return La(t.type,Gf,e,t)}Wf.displayName="RadioGroupContext";let Jf=Ha((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,...u}=e,d=Ja("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a),[p,h]=(0,c.useReducer)(Kf,{options:[]}),f=p.options,[m,g]=Lf(),[v,y]=$l(),b=`headlessui-radiogroup-${sl()}`,S=(0,c.useRef)(null),x=Xa(S,n),[w,C]=jf(r,s,i),A=(0,c.useMemo)((()=>f.find((e=>!e.propsRef.current.disabled))),[f]),E=(0,c.useMemo)((()=>f.some((e=>d(e.propsRef.current.value,w)))),[f,w]),M=Ja((e=>{var t;if(l||d(e,w))return!1;let n=null==(t=f.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==C||C(e),!0)}));_d({container:S.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let _=Ja((e=>{let t=S.current;if(!t)return;let n=dl(t),r=f.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case Za.Enter:Uf(e.currentTarget);break;case Za.ArrowLeft:case Za.ArrowUp:if(e.preventDefault(),e.stopPropagation(),Ml(r,ml.Previous|ml.WrapAround)===gl.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&M(e.propsRef.current.value)}break;case Za.ArrowRight:case Za.ArrowDown:if(e.preventDefault(),e.stopPropagation(),Ml(r,ml.Next|ml.WrapAround)===gl.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&M(e.propsRef.current.value)}break;case Za.Space:{e.preventDefault(),e.stopPropagation();let t=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&M(t.propsRef.current.value)}}})),T=Ja((e=>(h({type:0,...e}),()=>h({type:1,id:e.id})))),I=(0,c.useMemo)((()=>({registerOption:T,firstOption:A,containsCheckedOption:E,change:M,disabled:l,value:w,compare:d})),[T,A,E,M,l,w,d]),R={ref:x,id:b,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:_},P=(0,c.useMemo)((()=>({value:w})),[w]);return t(c).createElement(y,{name:"RadioGroup.Description"},t(c).createElement(g,{name:"RadioGroup.Label"},t(c).createElement(Wf.Provider,{value:I},null!=o&&null!=w&&Bf({[o]:w}).map((([e,n])=>t(c).createElement(ll,{features:al.Hidden,...Va({key:e,as:"input",type:"radio",checked:null!=n,hidden:!0,readOnly:!0,name:e,value:n})}))),Fa({ourProps:R,theirProps:u,slot:P,defaultTag:"div",name:"RadioGroup"}))))}));var Qf=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(Qf||{});let Yf=Ha((function(e,n){let r=(0,c.useRef)(null),i=Xa(r,n),o=`headlessui-radiogroup-option-${sl()}`,[s,a]=Lf(),[l,u]=$l(),{addFlag:d,removeFlag:p,hasFlag:h}=kf(1),{value:f,disabled:m=!1,...g}=e,v=(0,c.useRef)({value:f,disabled:m});qa((()=>{v.current.value=f}),[f,v]),qa((()=>{v.current.disabled=m}),[m,v]);let{registerOption:y,disabled:b,change:S,firstOption:x,containsCheckedOption:w,value:C,compare:A}=qf("RadioGroup.Option");qa((()=>y({id:o,element:r,propsRef:v})),[o,y,r,e]);let E=Ja((e=>{var t;if(el(e.currentTarget))return e.preventDefault();!S(f)||(d(2),null==(t=r.current)||t.focus())})),M=Ja((e=>{if(el(e.currentTarget))return e.preventDefault();d(2)})),_=Ja((()=>p(2))),T=(null==x?void 0:x.id)===o,I=b||m,R=A(C,f),P={ref:i,id:o,role:"radio","aria-checked":R?"true":"false","aria-labelledby":s,"aria-describedby":l,"aria-disabled":!!I||void 0,tabIndex:I?-1:R||!w&&T?0:-1,onClick:I?void 0:E,onFocus:I?void 0:M,onBlur:I?void 0:_},k=(0,c.useMemo)((()=>({checked:R,disabled:I,active:h(2)})),[R,I,h]);return t(c).createElement(u,{name:"RadioGroup.Description"},t(c).createElement(a,{name:"RadioGroup.Label"},Fa({ourProps:P,theirProps:g,slot:k,defaultTag:"div",name:"RadioGroup.Option"})))})),Xf=Object.assign(Jf,{Option:Yf,Label:Df,Description:Zl});var $f=({sendOnEnter:e,setSendOnEnter:n})=>{const{t:r}=ge();return(0,s.jsxs)(Wd,{as:"div",className:"memori-send-on-enter-menu",children:[(0,s.jsx)(Wd.Button,{className:t(vs)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)("span",{style:{display:"block",width:"1rem",height:"1rem"},children:"…"})})}),(0,s.jsx)(Wd.Items,{className:"memori-menu--overlay",children:(0,s.jsxs)(Xf,{value:e,onChange:n,children:[(0,s.jsx)(Xf.Option,{value:"keypress",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(Wd.Item,{children:(0,s.jsx)(Na,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnKeypress")})})}),(0,s.jsx)(Xf.Option,{value:"click",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(Wd.Item,{children:(0,s.jsx)(Na,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnClick")})})})]})})]})};c=o("85Hg2");var Zf=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});var em=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});var tm=({disabled:e=!1,value:n,onChange:r,onPressEnter:i,onFocus:o,onBlur:a})=>{const{t:l}=ge(),[u,d]=(0,c.useState)(!1);return(0,s.jsx)("div",{"data-testid":"chat-textarea",className:t(vs)("memori-chat-textarea",{"memori-chat-textarea--expanded":u,"memori-chat-textarea--disabled":e}),children:(0,s.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,s.jsx)("textarea",{className:"memori-chat-textarea--input",disabled:e,value:n,onChange:e=>{r(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&i&&i(e)},onFocus:o,onBlur:a}),(0,s.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,s.jsx)(Na,{className:t(vs)("memori-chat-textarea--expand-button"),onClick:()=>d(!u),padded:!1,ghost:!0,title:u?l("collapse")||"Collapse":l("expand")||"Expand",icon:u?(0,s.jsx)(em,{}):(0,s.jsx)(Zf,{})})})]})})};var nm=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});c=o("85Hg2");var rm=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});var im=({listening:e,stopAudio:n,startListening:r,stopListening:i})=>{const{t:o}=ge(),[a,l]=(0,c.useState)(),u=(0,c.useRef)(null),d=e=>{e.preventDefault(),l(o("write_and_speak.holdToSpeak")||"Hold to record"),u.current||(u.current=setTimeout((()=>{n(),l(o("write_and_speak.releaseToEndListening")||"Release to end listening"),r()}),300))},p=()=>{u.current&&(clearTimeout(u.current),u.current=null),i(),l(void 0)};return(0,c.useEffect)((()=>()=>p()),[]),(0,s.jsx)(Ad,{visible:!!a,content:(0,s.jsx)("span",{children:a||o("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,s.jsx)(Na,{primary:!0,className:t(vs)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":e}),title:e?o("write_and_speak.micButtonPopoverListening")||"Listening":o("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:d,onTouchStart:d,onMouseUp:p,onMouseLeave:p,onTouchEnd:p,shape:"circle",icon:(0,s.jsx)(rm,{})})})};var om=({dialogState:e,sendOnEnter:n="click",setSendOnEnter:r,userMessage:i="",onChangeUserMessage:o,sendMessage:a,onTextareaFocus:l,onTextareaBlur:c,onTextareaPressEnter:u,showMicrophone:d=!1,microphoneMode:p="HOLD_TO_TALK",listening:h=!1,stopAudio:f,startListening:m,stopListening:g})=>{const{t:v}=ge();return(0,s.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state),children:[(0,s.jsx)($f,{sendOnEnter:n,setSendOnEnter:r}),(0,s.jsx)(tm,{value:i,onChange:o,onPressEnter:u,onFocus:l,onBlur:c,disabled:["R2","R3","R4","R5","G3","X3"].includes((null==e?void 0:e.state)||"")}),(0,s.jsx)(Na,{shape:"circle",primary:!!(null==i?void 0:i.length),disabled:!i||0===i.length,className:"memori-chat-inputs--send",onClick:()=>{a(i),f(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:v("send")||"Send",icon:(0,s.jsx)(nm,{})}),d&&"HOLD_TO_TALK"===p&&(0,s.jsx)(im,{listening:h,startListening:m,stopListening:()=>{g(),(null==i?void 0:i.length)&&a(i)},stopAudio:f}),d&&"CONTINUOUS"===p&&(0,s.jsx)(Na,{primary:!0,className:t(vs)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":h}),title:h?v("write_and_speak.micButtonPopoverListening")||"Listening":v("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{h?g():(f(),m())},shape:"circle",icon:(0,s.jsx)(rm,{})})]})};c=o("85Hg2");const sm={en:[{delayAfter:3,text:"Generating an accurate and fancy response..."},{delayAfter:3,text:"Generating a response that will blow your mind..."},{delayAfter:3,text:"Generating a response that will make you smile..."},{delayAfter:3,text:"Thinking of a response..."},{delayAfter:3,text:"Thinking of a response that will make you smile..."},{delayAfter:3,text:"Gathering my thoughts..."},{delayAfter:3,text:"Gathering my thoughts to give you a response..."}],it:[{delayAfter:3,text:"Sto generando una risposta accurata e fantasiosa..."},{delayAfter:3,text:"Sto generando una risposta che ti farà impazzire..."},{delayAfter:3,text:"Sto generando una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto pensando ad una risposta..."},{delayAfter:3,text:"Sto pensando ad una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri per darti una risposta..."}]},am=(e=3)=>new Array(20*e).fill(" ").join("");var lm=({useDefaultSentences:e=!1,lang:t="en",sentence:n,sentences:r})=>{var i;const[o,a]=(0,c.useState)(0),[l,u]=(0,c.useState)((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)?`${r[t][0].text.endsWith("...")?r[t][0].text:`${r[t][0].text}...`}${am(r[t][0].delayAfter)}`:n?`${n.endsWith("...")?n:`${n}...`}${am()}`:""),[d,p]=(0,c.useState)("");return(0,c.useEffect)((()=>{const i=setInterval((()=>{var i;const s=l[d.length];if(void 0!==s&&l.length>0)p((e=>e+s));else if((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)&&o<r[t].length-1){const e=o+1,n=r[t][e];u(`${n.text.endsWith("...")?n.text:`${n.text}...`}${am(n.delayAfter)}`),p(""),a(e)}else if(!r&&!n&&e){const e=sm[t][Math.floor(Math.random()*sm[t].length)];u(`${e.text}${am(e.delayAfter)}`),p("")}}),50);return()=>clearInterval(i)})),(0,s.jsx)("div",{className:"memori-chat--bubble",children:(0,s.jsxs)("div",{className:"memori-chat--bubble-typing",children:[(0,s.jsxs)("div",{id:"wave",children:[(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"})]}),l.length>0&&(0,s.jsx)("p",{children:d})]})})};var cm=(0,c.memo)((({memori:e,tenant:n,sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,memoriTyping:l,typingText:u,showTypingText:d=!1,history:p=[],authToken:h,dialogState:f,simulateUserPrompt:m,showDates:g=!1,showContextPerLine:v=!1,showAIicon:y=!0,selectReceiverTag:b,preview:S=!1,instruct:x=!1,showInputs:w=!0,showMicrophone:C=!1,microphoneMode:A="HOLD_TO_TALK",sendOnEnter:E,setSendOnEnter:M,attachmentsMenuOpen:_,setAttachmentsMenuOpen:T,userMessage:I="",onChangeUserMessage:R,sendMessage:P,listening:k,isPlayingAudio:O,stopAudio:N,startListening:L,stopListening:D,resetTranscript:B,customMediaRenderer:z,user:F,userAvatar:U,experts:j})=>{var H,V,G,W,q,K,J,Q;const Y=()=>{setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),200)};(0,c.useEffect)((()=>{!S&&Y()}),[p,S]);return(0,s.jsxs)("div",{className:t(vs)("memori-chat--wrapper",{"memori-chat-wrapper--translate":a}),id:"chat-wrapper",lang:null==a?void 0:a.toUpperCase(),"data-memori-lang":null!==(W=null===(G=null===(V=null===(H=e.culture)||void 0===H?void 0:H.split("-"))||void 0===V?void 0:V[0])||void 0===G?void 0:G.toUpperCase())&&void 0!==W?W:"EN",children:[(0,s.jsx)("div",{className:t(vs)("memori-chat--history",{"memori-chat--history-touch":gd()}),children:(0,s.jsxs)("div",{className:t(vs)("memori-chat--content",{"memori-chat--content-touch":gd()}),children:[(0,s.jsx)("div",{className:t(vs)("memori-chat--cover"),style:{backgroundImage:`url("${xd({type:"cover",tenantID:null==n?void 0:n.id,resourceURI:e.coverURL,baseURL:i,apiURL:o})}"), url("${xd({type:"cover",tenantID:null==n?void 0:n.id,baseURL:i||"https://app.twincreator.com",apiURL:o})}")`}}),p.map(((l,u)=>{var d,h,b,S;return(0,s.jsxs)(t(c).Fragment,{children:[(0,s.jsx)(Zd,{isFirst:0===u,message:l,memori:e,tenant:n,baseUrl:i,apiUrl:o,simulateUserPrompt:m,showAIicon:y,showFeedback:u===p.length-1&&!l.fromUser&&(null==f?void 0:f.acceptsFeedback),user:F,userAvatar:U,experts:j}),g&&!!l.timestamp&&(0,s.jsx)("small",{className:"memori-chat--timestamp "+(l.fromUser?"text-right":"text-left"),children:new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(l.timestamp.endsWith("Z")?l.timestamp:`${l.timestamp}Z`))}),v&&!!Object.keys(null!==(d=l.contextVars)&&void 0!==d?d:{}).length&&(0,s.jsx)("div",{className:"memori-chat--context-vars",children:Object.keys(null!==(h=l.contextVars)&&void 0!==h?h:{}).map((e=>{var t,n,r;return"-"===(null===(t=l.contextVars)||void 0===t?void 0:t[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):"✔️"===(null===(n=l.contextVars)||void 0===n?void 0:n[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsxs)("span",{className:"memori-chat--context-tag-text",children:[e,": ",null===(r=l.contextVars)||void 0===r?void 0:r[e]]})},e)}))}),(0,s.jsx)(Pf,{simulateUserPrompt:m,media:null===(b=null==l?void 0:l.media)||void 0===b?void 0:b.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(S=null==l?void 0:l.media)||void 0===S?void 0:S.filter((e=>"text/html"===e.mimeType)),sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,customMediaRenderer:z})]},u)})),(null==f?void 0:f.hints)&&f.hints.length>0&&(0,s.jsx)(Pf,{simulateUserPrompt:m,hints:f.translatedHints?f.translatedHints:f.hints.map((e=>({text:e,originalText:e})))}),!!l&&(0,s.jsx)(lm,{useDefaultSentences:d,lang:a?"it"===a.toLowerCase()?"it":"en":"it"===(null===(J=null===(K=null===(q=e.culture)||void 0===q?void 0:q.split("-"))||void 0===K?void 0:K[0])||void 0===J?void 0:J.toLowerCase())?"it":"en",sentence:u,sentences:e.enableBoardOfExperts?dp:void 0},u),(0,s.jsx)("div",{id:"end-messages-ref"})]})}),"X3"===(null==f?void 0:f.state)&&r&&(0,s.jsx)("div",{className:"memori-chat--known-tags",children:Object.keys(null!==(Q=f.knownTags)&&void 0!==Q?Q:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return(0,s.jsx)(Na,{icon:(0,s.jsx)("span",{className:"memori-chat--known-tag-icon",children:e}),className:"memori-chat--known-tag",onClick:()=>b(e),children:null===(t=f.knownTags)||void 0===t?void 0:t[e]},e)}))}),w&&(0,s.jsx)(om,{userMessage:I,onChangeUserMessage:R,dialogState:f,instruct:x,authToken:h,sendMessage:P,microphoneMode:A,sendOnEnter:E,setSendOnEnter:M,attachmentsMenuOpen:_,setAttachmentsMenuOpen:T,onTextareaPressEnter:()=>{"keypress"===E&&(null==I?void 0:I.length)>0&&(D(),P(I),R(""),B())},onTextareaFocus:()=>{var e,t,n,r;D(),gd()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),null===(r=null===(n=document.querySelector(".memori.memori-widget"))||void 0===n?void 0:n.classList)||void 0===r||r.add("chat-focused"),setTimeout((()=>{Y()}),300))},onTextareaBlur:()=>{var e,t,n,r,i;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),null===(i=null===(r=document.querySelector(".memori.memori-widget"))||void 0===r?void 0:r.classList)||void 0===i||i.remove("chat-focused"),Y())},startListening:L,stopListening:D,stopAudio:N,listening:k,isPlayingAudio:O,showMicrophone:C})]})}));c=o("85Hg2");var um=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),(0,s.jsx)("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"})]});var dm=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"})});var pm=({memoriName:e,blockedUntil:t,showGiverInfo:n=!1,showTitle:r=!1,marginLeft:i=!1})=>{const{t:o}=ge(),a=new Date(t);return a>new Date?(0,s.jsx)(Ad,{className:"blocked-memori-badge--tooltip",content:(0,s.jsxs)(s.Fragment,{children:[!n&&o("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&o("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&` ${o("memoriBlockedReasonExceedChats")}`,n&&(0,s.jsx)("br",{}),n&&`\n${o("memoriBlockedGiverHelper")}`]}),children:(0,s.jsxs)("div",{className:"blocked-memori-badge--wrapper",children:[(0,s.jsx)("div",{className:"blocked-memori-badge "+(i?" margin-left":""),children:(0,s.jsx)(dm,{className:"blocked-memori-badge--icon"})}),r&&(0,s.jsx)("span",{className:"blocked-memori-badge--title",children:o("memoriBlockedTitle")})]})}):null};var hm=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",width:"20",height:"16",viewBox:"0 0 640 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M211.2 96a64 64 0 10-128 0 64 64 0 10128 0zM32 256c0 17.7 14.3 32 32 32h85.6c10.1-39.4 38.6-71.5 75.8-86.6-9.7-6-21.2-9.4-33.4-9.4H96c-35.3 0-64 28.7-64 64zm461.6 32H576c17.7 0 32-14.3 32-32 0-35.3-28.7-64-64-64h-96c-11.7 0-22.7 3.1-32.1 8.6 38.1 14.8 67.4 47.3 77.7 87.4zm-102.4-61.6c-6.9-1.6-14.2-2.4-21.6-2.4h-96c-8.5 0-16.7 1.1-24.5 3.1-30.8 8.1-55.6 31.1-66.1 60.9-3.5 10-5.5 20.8-5.5 32 0 17.7 14.3 32 32 32h224c17.7 0 32-14.3 32-32 0-11.2-1.9-22-5.5-32-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 10-128 0 64 64 0 10128 0zm-241.6 96a80 80 0 100-160 80 80 0 100 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32h576c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"})});var fm=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",width:"20",height:"20",viewBox:"0 0 48 48",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M30.106 48v-2.745a2.213 2.213 0 012.213-2.212h6.11a2.392 2.392 0 002.326-2.466v-3.223a1.834 1.834 0 01.459-1.145 2.912 2.912 0 00.712-1.926l-.007-.667a1.016 1.016 0 01.651-.952h1.067a1.363 1.363 0 001.051-.456 1.304 1.304 0 00.19-1.395 67.032 67.032 0 01-3.037-7.51 4.767 4.767 0 01-.217-1.507l-.002-4.994a14.513 14.513 0 00-.552-3.963l-.006-.022a13.959 13.959 0 00-3.137-5.702q-.479-.516-1.006-1.003a17.67 17.67 0 00-.677-.623A18.303 18.303 0 0024.194 1a19.617 19.617 0 00-12.539 4.489 17.555 17.555 0 00-3.945 21.69C9.945 31.507 11.694 38.622 12.14 46v2",strokeMiterlimit:10}),(0,s.jsx)("path",{d:"M27.917 12L31.417 12"}),(0,s.jsx)("path",{d:"M27.917 26L31.417 26"}),(0,s.jsx)("path",{d:"M29.667 12L29.667 26"}),(0,s.jsx)("path",{d:"M23.992 26L19.904 12 19.226 12 15.159 26"}),(0,s.jsx)("path",{d:"M16.854 21.133L22.276 21.133"})]});c=o("85Hg2");var mm=({forceStatus:e,provider:t})=>{var n;const{t:r}=ge(),[i,o]=(0,c.useState)(null!=e?e:"none"),a=(e=>{switch(e){case"DEFAULT":case"OpenAI":return{getStatus:async()=>{var e;const t=await fetch("https://status.openai.com/api/v2/summary.json");return null!==(e=(await t.json()).status.indicator)&&void 0!==e?e:"none"},statusPage:"https://status.openai.com/"};default:return{getStatus:async()=>"none",statusPage:""}}})(t);return(0,c.useEffect)((()=>{e||a.getStatus().then((e=>o(e)))}),[e,t]),"none"!==i?(0,s.jsx)(Ad,{className:"memori--completion-provider-status--tooltip",align:"topLeft",content:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:r("completionProviderDown",{provider:null!=t?t:r("completionProviderFallbackName")})}),!!(null===(n=a.statusPage)||void 0===n?void 0:n.length)&&(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:a.statusPage,rel:"noopener noreferrer",target:"_blank",children:r("completionProviderCheckStatusPage")})})]}),children:(0,s.jsx)(dm,{className:"memori--completion-provider-status--icon"})}):null};var gm=({memori:e,tenant:t,gamificationLevel:n,language:r,userLang:i,setUserLang:o,baseUrl:a,apiUrl:l,position:u,openPositionDrawer:d,integrationConfig:p,instruct:h=!1,clickedStart:f,onClickStart:m,initializeTTS:g,_TEST_forceProviderStatus:v,isUserLoggedIn:y=!1})=>{var b,S;const{t:x,i18n:w}=ge(),[C,A]=(0,c.useState)(e.description),[E,M]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{var t,n,i,o,s,l;(null!==(n=null===(t=w.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(i=null==r?void 0:r.toUpperCase())&&void 0!==i?i:"IT")&&(null===(o=e.description)||void 0===o?void 0:o.length)&&ap(e.description,null!==(l=null===(s=w.language)||void 0===s?void 0:s.toUpperCase())&&void 0!==l?l:"IT",r,a).then((e=>{A(e.text)})).catch(console.error)}),[w.language,r,e.description,a]),(0,s.jsxs)("div",{className:"memori--start-panel",children:[(0,s.jsxs)("div",{className:"memori--cover",style:{backgroundImage:`url("${xd({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:a,apiURL:l})}"), url("${xd({type:"cover",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})}")`},children:[!!(null===(b=null==n?void 0:n.badge)||void 0===b?void 0:b.length)&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--gamification-badge",children:(0,s.jsx)(Ad,{align:"left",content:`${x("gamification.level")} ${n.badge}, ${n.points} ${x("gamification.points")}`,children:(0,s.jsx)("span",{"aria-label":`${x("gamification.level")} ${n.badge}, ${n.points} ${x("gamification.points")}`,children:n.badge})})}),!!e.enableCompletions&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--completions-enabled",children:(0,s.jsx)(Ad,{align:"left",content:x("completionsEnabled"),children:(0,s.jsx)("span",{"aria-label":x("completionsEnabled")||"Completions",children:(0,s.jsx)(Cd,{})})})}),!!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--board-of-experts",children:(0,s.jsx)(Ad,{align:"left",content:x("boardOfExperts"),children:(0,s.jsx)("span",{"aria-label":x("boardOfExperts")||"Board of Experts",children:(0,s.jsx)(hm,{})})})}),!!e.nsfw&&(0,s.jsx)("div",{className:"memori--nsfw",children:(0,s.jsx)(Ad,{align:"left",content:x("nsfw"),children:(0,s.jsx)("span",{title:x("nsfw")||"NSFW",children:"🔞"})})})]}),(0,s.jsxs)("picture",{className:"memori--avatar",children:[(0,s.jsx)("source",{src:null!==(S=e.avatarURL)&&void 0!==S?S:xd({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l})}),(0,s.jsx)("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?xd({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l}):xd({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})})]}),(0,s.jsx)("h2",{className:"memori--title",children:e.name}),e.needsPosition&&!u&&(0,s.jsxs)("div",{className:"memori--needsPosition",children:[(0,s.jsx)("p",{children:x("write_and_speak.requirePosition")}),(0,s.jsx)(Na,{primary:!0,onClick:()=>d(),className:"memori--start-button",children:x("widget.position")})]}),(e.needsPosition&&u||!e.needsPosition)&&(0,s.jsxs)("div",{className:"memori--description",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"memori--description-text",children:C&&E?C:e.description}),C!==e.description&&(0,s.jsx)(Na,{ghost:!0,className:"memori--translation-toggle",icon:(0,s.jsx)(um,{}),onClick:()=>{M((e=>!e))},children:x(E?"showOriginalText":"showTranslatedText")})]}),(null==p?void 0:p.multilanguage)&&!h&&(0,s.jsxs)("div",{className:"memori--language-chooser",children:[(0,s.jsx)("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref",children:x("write_and_speak.iWantToTalkToIn",{name:e.name})}),(0,s.jsx)("select",{id:"user-lang-pref",className:"memori-select--button",value:(null!=i?i:w.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{o(e.target.value)},children:lp.map((e=>(0,s.jsx)("option",{value:e.value,"aria-label":e.label,children:e.label},e.value)))})]}),(0,s.jsx)(Na,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver,loading:f,onClick:e=>{try{window.speechSynthesis.speak(new SpeechSynthesisUtterance(""))}catch(e){console.error(e)}g&&g(),m&&m()},className:"memori--start-button",children:x("write_and_speak."+(h?"instructButton":"tryMeButton"))}),(0,s.jsx)(mm,{provider:e.completionProvider,forceStatus:v}),(0,s.jsx)("p",{className:"memori--start-description",children:x(h?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")}),!!e.blockedUntil&&(0,s.jsx)(pm,{memoriName:e.name,blockedUntil:e.blockedUntil,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0}),!!e.enableDeepThought&&!h&&!!y&&(0,s.jsxs)("div",{className:"memori--deep-thought-disclaimer",children:[(0,s.jsx)(Ad,{align:"left",content:x("deepThoughtHelper"),children:(0,s.jsx)(fm,{})}),(0,s.jsx)("h2",{children:x("deepThoughtDisclaimerTitle")}),(0,s.jsx)("p",{children:x("deepThoughtDisclaimer")}),(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:"https://app.twincreator.com/en/privacy_and_cookie",target:"_blank",rel:"noopener noreferrer",children:"Privacy policy"})})]})]})]})},vm=(c=o("85Hg2"),c=o("85Hg2"),q=o("hcaHr"),c=o("85Hg2"),["forwardedRef"]);function ym(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bm(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?ym(Object(r),!0).forEach((function(n){t(K)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ym(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class Sm extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,s.jsxs)("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"},children:[(0,s.jsx)("h2",{children:this.props.t("error.generic")}),(0,s.jsx)(Na,{primary:!0,onClick:()=>this.setState({hasError:!1}),children:this.props.t("error.tryAgain")||"Try again"})]}):this.props.children}}var xm=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,s=t(Tp)(i,vm),a=ge(e,bm(bm({},s),{},{keyPrefix:n.keyPrefix})),l=t(q)(a,3),u=l[0],d=l[1],p=l[2],h=bm(bm({},s),{},{t:u,i18n:d,tReady:p});return n.withRef&&o?h.ref=o:!n.withRef&&o&&(h.forwardedRef=o),(0,c.createElement)(r,h)}i.displayName="withI18nextTranslation(".concat(pe(r),")"),i.WrappedComponent=r;return n.withRef?(0,c.forwardRef)((function(e,t){return(0,c.createElement)(i,Object.assign({},e,{forwardedRef:t}))})):i}}(["common"])(Sm),wm=(c=o("85Hg2"),c=o("85Hg2"),{});e(wm,"REVISION",(()=>Cm)),e(wm,"MOUSE",(()=>Am)),e(wm,"TOUCH",(()=>Em)),e(wm,"CullFaceNone",(()=>Mm)),e(wm,"CullFaceBack",(()=>_m)),e(wm,"CullFaceFront",(()=>Tm)),e(wm,"CullFaceFrontBack",(()=>Im)),e(wm,"BasicShadowMap",(()=>Rm)),e(wm,"PCFShadowMap",(()=>Pm)),e(wm,"PCFSoftShadowMap",(()=>km)),e(wm,"VSMShadowMap",(()=>Om)),e(wm,"FrontSide",(()=>Nm)),e(wm,"BackSide",(()=>Lm)),e(wm,"DoubleSide",(()=>Dm)),e(wm,"NoBlending",(()=>Bm)),e(wm,"NormalBlending",(()=>zm)),e(wm,"AdditiveBlending",(()=>Fm)),e(wm,"SubtractiveBlending",(()=>Um)),e(wm,"MultiplyBlending",(()=>jm)),e(wm,"CustomBlending",(()=>Hm)),e(wm,"AddEquation",(()=>Vm)),e(wm,"SubtractEquation",(()=>Gm)),e(wm,"ReverseSubtractEquation",(()=>Wm)),e(wm,"MinEquation",(()=>qm)),e(wm,"MaxEquation",(()=>Km)),e(wm,"ZeroFactor",(()=>Jm)),e(wm,"OneFactor",(()=>Qm)),e(wm,"SrcColorFactor",(()=>Ym)),e(wm,"OneMinusSrcColorFactor",(()=>Xm)),e(wm,"SrcAlphaFactor",(()=>$m)),e(wm,"OneMinusSrcAlphaFactor",(()=>Zm)),e(wm,"DstAlphaFactor",(()=>eg)),e(wm,"OneMinusDstAlphaFactor",(()=>tg)),e(wm,"DstColorFactor",(()=>ng)),e(wm,"OneMinusDstColorFactor",(()=>rg)),e(wm,"SrcAlphaSaturateFactor",(()=>ig)),e(wm,"NeverDepth",(()=>og)),e(wm,"AlwaysDepth",(()=>sg)),e(wm,"LessDepth",(()=>ag)),e(wm,"LessEqualDepth",(()=>lg)),e(wm,"EqualDepth",(()=>cg)),e(wm,"GreaterEqualDepth",(()=>ug)),e(wm,"GreaterDepth",(()=>dg)),e(wm,"NotEqualDepth",(()=>pg)),e(wm,"MultiplyOperation",(()=>hg)),e(wm,"MixOperation",(()=>fg)),e(wm,"AddOperation",(()=>mg)),e(wm,"NoToneMapping",(()=>gg)),e(wm,"LinearToneMapping",(()=>vg)),e(wm,"ReinhardToneMapping",(()=>yg)),e(wm,"CineonToneMapping",(()=>bg)),e(wm,"ACESFilmicToneMapping",(()=>Sg)),e(wm,"CustomToneMapping",(()=>xg)),e(wm,"UVMapping",(()=>wg)),e(wm,"CubeReflectionMapping",(()=>Cg)),e(wm,"CubeRefractionMapping",(()=>Ag)),e(wm,"EquirectangularReflectionMapping",(()=>Eg)),e(wm,"EquirectangularRefractionMapping",(()=>Mg)),e(wm,"CubeUVReflectionMapping",(()=>_g)),e(wm,"RepeatWrapping",(()=>Tg)),e(wm,"ClampToEdgeWrapping",(()=>Ig)),e(wm,"MirroredRepeatWrapping",(()=>Rg)),e(wm,"NearestFilter",(()=>Pg)),e(wm,"NearestMipmapNearestFilter",(()=>kg)),e(wm,"NearestMipMapNearestFilter",(()=>Og)),e(wm,"NearestMipmapLinearFilter",(()=>Ng)),e(wm,"NearestMipMapLinearFilter",(()=>Lg)),e(wm,"LinearFilter",(()=>Dg)),e(wm,"LinearMipmapNearestFilter",(()=>Bg)),e(wm,"LinearMipMapNearestFilter",(()=>zg)),e(wm,"LinearMipmapLinearFilter",(()=>Fg)),e(wm,"LinearMipMapLinearFilter",(()=>Ug)),e(wm,"UnsignedByteType",(()=>jg)),e(wm,"ByteType",(()=>Hg)),e(wm,"ShortType",(()=>Vg)),e(wm,"UnsignedShortType",(()=>Gg)),e(wm,"IntType",(()=>Wg)),e(wm,"UnsignedIntType",(()=>qg)),e(wm,"FloatType",(()=>Kg)),e(wm,"HalfFloatType",(()=>Jg)),e(wm,"UnsignedShort4444Type",(()=>Qg)),e(wm,"UnsignedShort5551Type",(()=>Yg)),e(wm,"UnsignedInt248Type",(()=>Xg)),e(wm,"AlphaFormat",(()=>$g)),e(wm,"RGBFormat",(()=>Zg)),e(wm,"RGBAFormat",(()=>ev)),e(wm,"LuminanceFormat",(()=>tv)),e(wm,"LuminanceAlphaFormat",(()=>nv)),e(wm,"DepthFormat",(()=>rv)),e(wm,"DepthStencilFormat",(()=>iv)),e(wm,"RedFormat",(()=>ov)),e(wm,"RedIntegerFormat",(()=>sv)),e(wm,"RGFormat",(()=>av)),e(wm,"RGIntegerFormat",(()=>lv)),e(wm,"RGBAIntegerFormat",(()=>cv)),e(wm,"RGB_S3TC_DXT1_Format",(()=>uv)),e(wm,"RGBA_S3TC_DXT1_Format",(()=>dv)),e(wm,"RGBA_S3TC_DXT3_Format",(()=>pv)),e(wm,"RGBA_S3TC_DXT5_Format",(()=>hv)),e(wm,"RGB_PVRTC_4BPPV1_Format",(()=>fv)),e(wm,"RGB_PVRTC_2BPPV1_Format",(()=>mv)),e(wm,"RGBA_PVRTC_4BPPV1_Format",(()=>gv)),e(wm,"RGBA_PVRTC_2BPPV1_Format",(()=>vv)),e(wm,"RGB_ETC1_Format",(()=>yv)),e(wm,"RGB_ETC2_Format",(()=>bv)),e(wm,"RGBA_ETC2_EAC_Format",(()=>Sv)),e(wm,"RGBA_ASTC_4x4_Format",(()=>xv)),e(wm,"RGBA_ASTC_5x4_Format",(()=>wv)),e(wm,"RGBA_ASTC_5x5_Format",(()=>Cv)),e(wm,"RGBA_ASTC_6x5_Format",(()=>Av)),e(wm,"RGBA_ASTC_6x6_Format",(()=>Ev)),e(wm,"RGBA_ASTC_8x5_Format",(()=>Mv)),e(wm,"RGBA_ASTC_8x6_Format",(()=>_v)),e(wm,"RGBA_ASTC_8x8_Format",(()=>Tv)),e(wm,"RGBA_ASTC_10x5_Format",(()=>Iv)),e(wm,"RGBA_ASTC_10x6_Format",(()=>Rv)),e(wm,"RGBA_ASTC_10x8_Format",(()=>Pv)),e(wm,"RGBA_ASTC_10x10_Format",(()=>kv)),e(wm,"RGBA_ASTC_12x10_Format",(()=>Ov)),e(wm,"RGBA_ASTC_12x12_Format",(()=>Nv)),e(wm,"RGBA_BPTC_Format",(()=>Lv)),e(wm,"LoopOnce",(()=>Dv)),e(wm,"LoopRepeat",(()=>Bv)),e(wm,"LoopPingPong",(()=>zv)),e(wm,"InterpolateDiscrete",(()=>Fv)),e(wm,"InterpolateLinear",(()=>Uv)),e(wm,"InterpolateSmooth",(()=>jv)),e(wm,"ZeroCurvatureEnding",(()=>Hv)),e(wm,"ZeroSlopeEnding",(()=>Vv)),e(wm,"WrapAroundEnding",(()=>Gv)),e(wm,"NormalAnimationBlendMode",(()=>Wv)),e(wm,"AdditiveAnimationBlendMode",(()=>qv)),e(wm,"TrianglesDrawMode",(()=>Kv)),e(wm,"TriangleStripDrawMode",(()=>Jv)),e(wm,"TriangleFanDrawMode",(()=>Qv)),e(wm,"LinearEncoding",(()=>Yv)),e(wm,"sRGBEncoding",(()=>Xv)),e(wm,"BasicDepthPacking",(()=>$v)),e(wm,"RGBADepthPacking",(()=>Zv)),e(wm,"TangentSpaceNormalMap",(()=>ey)),e(wm,"ObjectSpaceNormalMap",(()=>ty)),e(wm,"NoColorSpace",(()=>ny)),e(wm,"SRGBColorSpace",(()=>ry)),e(wm,"LinearSRGBColorSpace",(()=>iy)),e(wm,"ZeroStencilOp",(()=>oy)),e(wm,"KeepStencilOp",(()=>sy)),e(wm,"ReplaceStencilOp",(()=>ay)),e(wm,"IncrementStencilOp",(()=>ly)),e(wm,"DecrementStencilOp",(()=>cy)),e(wm,"IncrementWrapStencilOp",(()=>uy)),e(wm,"DecrementWrapStencilOp",(()=>dy)),e(wm,"InvertStencilOp",(()=>py)),e(wm,"NeverStencilFunc",(()=>hy)),e(wm,"LessStencilFunc",(()=>fy)),e(wm,"EqualStencilFunc",(()=>my)),e(wm,"LessEqualStencilFunc",(()=>gy)),e(wm,"GreaterStencilFunc",(()=>vy)),e(wm,"NotEqualStencilFunc",(()=>yy)),e(wm,"GreaterEqualStencilFunc",(()=>by)),e(wm,"AlwaysStencilFunc",(()=>Sy)),e(wm,"StaticDrawUsage",(()=>xy)),e(wm,"DynamicDrawUsage",(()=>wy)),e(wm,"StreamDrawUsage",(()=>Cy)),e(wm,"StaticReadUsage",(()=>Ay)),e(wm,"DynamicReadUsage",(()=>Ey)),e(wm,"StreamReadUsage",(()=>My)),e(wm,"StaticCopyUsage",(()=>_y)),e(wm,"DynamicCopyUsage",(()=>Ty)),e(wm,"StreamCopyUsage",(()=>Iy)),e(wm,"GLSL1",(()=>Ry)),e(wm,"GLSL3",(()=>Py)),e(wm,"_SRGBAFormat",(()=>ky)),e(wm,"EventDispatcher",(()=>Oy)),e(wm,"MathUtils",(()=>Ky)),e(wm,"Vector2",(()=>Jy)),e(wm,"Matrix3",(()=>Qy)),e(wm,"ColorManagement",(()=>rb)),e(wm,"Color",(()=>ub)),e(wm,"ImageUtils",(()=>pb)),e(wm,"Source",(()=>hb)),e(wm,"Texture",(()=>gb)),e(wm,"Vector4",(()=>vb)),e(wm,"WebGLRenderTarget",(()=>yb)),e(wm,"DataArrayTexture",(()=>bb)),e(wm,"WebGLArrayRenderTarget",(()=>Sb)),e(wm,"Data3DTexture",(()=>xb)),e(wm,"WebGL3DRenderTarget",(()=>wb)),e(wm,"WebGLMultipleRenderTargets",(()=>Cb)),e(wm,"Quaternion",(()=>Ab)),e(wm,"Vector3",(()=>Eb)),e(wm,"Box3",(()=>Tb)),e(wm,"Sphere",(()=>Kb)),e(wm,"Ray",(()=>tS)),e(wm,"Matrix4",(()=>nS)),e(wm,"Euler",(()=>pS)),e(wm,"Layers",(()=>hS)),e(wm,"Object3D",(()=>_S)),e(wm,"Triangle",(()=>zS)),e(wm,"Material",(()=>US)),e(wm,"MeshBasicMaterial",(()=>jS)),e(wm,"BufferAttribute",(()=>GS)),e(wm,"Int8BufferAttribute",(()=>WS)),e(wm,"Uint8BufferAttribute",(()=>qS)),e(wm,"Uint8ClampedBufferAttribute",(()=>KS)),e(wm,"Int16BufferAttribute",(()=>JS)),e(wm,"Uint16BufferAttribute",(()=>QS)),e(wm,"Int32BufferAttribute",(()=>YS)),e(wm,"Uint32BufferAttribute",(()=>XS)),e(wm,"Float16BufferAttribute",(()=>$S)),e(wm,"Float32BufferAttribute",(()=>ZS)),e(wm,"Float64BufferAttribute",(()=>ex)),e(wm,"BufferGeometry",(()=>lx)),e(wm,"Mesh",(()=>Mx)),e(wm,"BoxGeometry",(()=>Tx)),e(wm,"UniformsUtils",(()=>Px)),e(wm,"ShaderMaterial",(()=>kx)),e(wm,"Camera",(()=>Ox)),e(wm,"PerspectiveCamera",(()=>Nx)),e(wm,"CubeCamera",(()=>Dx)),e(wm,"CubeTexture",(()=>Bx)),e(wm,"WebGLCubeRenderTarget",(()=>zx)),e(wm,"Plane",(()=>Hx)),e(wm,"Frustum",(()=>Wx)),e(wm,"PlaneGeometry",(()=>Jx)),e(wm,"ShaderChunk",(()=>Qx)),e(wm,"UniformsLib",(()=>Yx)),e(wm,"ShaderLib",(()=>Xx)),e(wm,"OrthographicCamera",(()=>iw)),e(wm,"PMREMGenerator",(()=>hw)),e(wm,"MeshDepthMaterial",(()=>cA)),e(wm,"MeshDistanceMaterial",(()=>uA)),e(wm,"WebGLUtils",(()=>fA)),e(wm,"ArrayCamera",(()=>mA)),e(wm,"Group",(()=>gA)),e(wm,"DepthTexture",(()=>bA)),e(wm,"WebGLRenderer",(()=>CA)),e(wm,"WebGL1Renderer",(()=>AA)),e(wm,"FogExp2",(()=>EA)),e(wm,"Fog",(()=>MA)),e(wm,"Scene",(()=>_A)),e(wm,"InterleavedBuffer",(()=>TA)),e(wm,"InterleavedBufferAttribute",(()=>RA)),e(wm,"SpriteMaterial",(()=>PA)),e(wm,"Sprite",(()=>WA)),e(wm,"LOD",(()=>QA)),e(wm,"SkinnedMesh",(()=>tE)),e(wm,"Bone",(()=>nE)),e(wm,"DataTexture",(()=>rE)),e(wm,"Skeleton",(()=>sE)),e(wm,"InstancedBufferAttribute",(()=>aE)),e(wm,"InstancedMesh",(()=>pE)),e(wm,"LineBasicMaterial",(()=>hE)),e(wm,"Line",(()=>bE)),e(wm,"LineSegments",(()=>wE)),e(wm,"LineLoop",(()=>CE)),e(wm,"PointsMaterial",(()=>AE)),e(wm,"Points",(()=>IE)),e(wm,"VideoTexture",(()=>PE)),e(wm,"FramebufferTexture",(()=>kE)),e(wm,"CompressedTexture",(()=>OE)),e(wm,"CanvasTexture",(()=>NE)),e(wm,"Curve",(()=>LE)),e(wm,"EllipseCurve",(()=>DE)),e(wm,"ArcCurve",(()=>BE)),e(wm,"CatmullRomCurve3",(()=>VE)),e(wm,"CubicBezierCurve",(()=>KE)),e(wm,"CubicBezierCurve3",(()=>JE)),e(wm,"LineCurve",(()=>QE)),e(wm,"LineCurve3",(()=>YE)),e(wm,"QuadraticBezierCurve",(()=>XE)),e(wm,"QuadraticBezierCurve3",(()=>$E)),e(wm,"SplineCurve",(()=>ZE)),e(wm,"CurvePath",(()=>tM)),e(wm,"Path",(()=>nM)),e(wm,"LatheGeometry",(()=>rM)),e(wm,"CapsuleGeometry",(()=>iM)),e(wm,"CircleGeometry",(()=>oM)),e(wm,"CylinderGeometry",(()=>sM)),e(wm,"ConeGeometry",(()=>aM)),e(wm,"PolyhedronGeometry",(()=>lM)),e(wm,"DodecahedronGeometry",(()=>cM)),e(wm,"EdgesGeometry",(()=>fM)),e(wm,"Shape",(()=>mM)),e(wm,"ShapeUtils",(()=>jM)),e(wm,"ExtrudeGeometry",(()=>GM)),e(wm,"IcosahedronGeometry",(()=>qM)),e(wm,"OctahedronGeometry",(()=>KM)),e(wm,"RingGeometry",(()=>JM)),e(wm,"ShapeGeometry",(()=>QM)),e(wm,"SphereGeometry",(()=>YM)),e(wm,"TetrahedronGeometry",(()=>XM)),e(wm,"TorusGeometry",(()=>$M)),e(wm,"TorusKnotGeometry",(()=>ZM)),e(wm,"TubeGeometry",(()=>e_)),e(wm,"WireframeGeometry",(()=>t_)),e(wm,"ShadowMaterial",(()=>i_)),e(wm,"RawShaderMaterial",(()=>o_)),e(wm,"MeshStandardMaterial",(()=>s_)),e(wm,"MeshPhysicalMaterial",(()=>a_)),e(wm,"MeshPhongMaterial",(()=>l_)),e(wm,"MeshToonMaterial",(()=>c_)),e(wm,"MeshNormalMaterial",(()=>u_)),e(wm,"MeshLambertMaterial",(()=>d_)),e(wm,"MeshMatcapMaterial",(()=>p_)),e(wm,"LineDashedMaterial",(()=>h_)),e(wm,"AnimationUtils",(()=>S_)),e(wm,"Interpolant",(()=>x_)),e(wm,"CubicInterpolant",(()=>w_)),e(wm,"LinearInterpolant",(()=>C_)),e(wm,"DiscreteInterpolant",(()=>A_)),e(wm,"KeyframeTrack",(()=>E_)),e(wm,"BooleanKeyframeTrack",(()=>M_)),e(wm,"ColorKeyframeTrack",(()=>__)),e(wm,"NumberKeyframeTrack",(()=>T_)),e(wm,"QuaternionLinearInterpolant",(()=>I_)),e(wm,"QuaternionKeyframeTrack",(()=>R_)),e(wm,"StringKeyframeTrack",(()=>P_)),e(wm,"VectorKeyframeTrack",(()=>k_)),e(wm,"AnimationClip",(()=>O_)),e(wm,"Cache",(()=>L_)),e(wm,"LoadingManager",(()=>D_)),e(wm,"DefaultLoadingManager",(()=>B_)),e(wm,"Loader",(()=>z_)),e(wm,"FileLoader",(()=>j_)),e(wm,"AnimationLoader",(()=>H_)),e(wm,"CompressedTextureLoader",(()=>V_)),e(wm,"ImageLoader",(()=>G_)),e(wm,"CubeTextureLoader",(()=>W_)),e(wm,"DataTextureLoader",(()=>q_)),e(wm,"TextureLoader",(()=>K_)),e(wm,"Light",(()=>J_)),e(wm,"HemisphereLight",(()=>Q_)),e(wm,"SpotLight",(()=>tT)),e(wm,"PointLight",(()=>sT)),e(wm,"DirectionalLight",(()=>lT)),e(wm,"AmbientLight",(()=>cT)),e(wm,"RectAreaLight",(()=>uT)),e(wm,"SphericalHarmonics3",(()=>dT)),e(wm,"LightProbe",(()=>pT)),e(wm,"MaterialLoader",(()=>hT)),e(wm,"LoaderUtils",(()=>fT)),e(wm,"InstancedBufferGeometry",(()=>mT)),e(wm,"BufferGeometryLoader",(()=>gT)),e(wm,"ObjectLoader",(()=>vT)),e(wm,"ImageBitmapLoader",(()=>xT)),e(wm,"AudioContext",(()=>CT)),e(wm,"AudioLoader",(()=>AT)),e(wm,"HemisphereLightProbe",(()=>ET)),e(wm,"AmbientLightProbe",(()=>MT)),e(wm,"StereoCamera",(()=>RT)),e(wm,"Clock",(()=>PT)),e(wm,"AudioListener",(()=>BT)),e(wm,"Audio",(()=>zT)),e(wm,"PositionalAudio",(()=>VT)),e(wm,"AudioAnalyser",(()=>GT)),e(wm,"PropertyMixer",(()=>WT)),e(wm,"PropertyBinding",(()=>$T)),e(wm,"AnimationObjectGroup",(()=>ZT)),e(wm,"AnimationMixer",(()=>nI)),e(wm,"Uniform",(()=>rI)),e(wm,"UniformsGroup",(()=>oI)),e(wm,"InstancedInterleavedBuffer",(()=>sI)),e(wm,"GLBufferAttribute",(()=>aI)),e(wm,"Raycaster",(()=>lI)),e(wm,"Spherical",(()=>dI)),e(wm,"Cylindrical",(()=>pI)),e(wm,"Box2",(()=>fI)),e(wm,"Line3",(()=>vI)),e(wm,"SpotLightHelper",(()=>bI)),e(wm,"SkeletonHelper",(()=>CI)),e(wm,"PointLightHelper",(()=>EI)),e(wm,"HemisphereLightHelper",(()=>II)),e(wm,"GridHelper",(()=>RI)),e(wm,"PolarGridHelper",(()=>PI)),e(wm,"DirectionalLightHelper",(()=>LI)),e(wm,"CameraHelper",(()=>zI)),e(wm,"BoxHelper",(()=>jI)),e(wm,"Box3Helper",(()=>HI)),e(wm,"PlaneHelper",(()=>VI)),e(wm,"ArrowHelper",(()=>KI)),e(wm,"AxesHelper",(()=>JI)),e(wm,"ShapePath",(()=>QI)),e(wm,"DataUtils",(()=>$I)),e(wm,"ImmediateRenderObject",(()=>ZI)),e(wm,"WebGLMultisampleRenderTarget",(()=>eR)),e(wm,"DataTexture2DArray",(()=>tR)),e(wm,"DataTexture3D",(()=>nR)),e(wm,"BoxBufferGeometry",(()=>rR)),e(wm,"CapsuleBufferGeometry",(()=>iR)),e(wm,"CircleBufferGeometry",(()=>oR)),e(wm,"ConeBufferGeometry",(()=>sR)),e(wm,"CylinderBufferGeometry",(()=>aR)),e(wm,"DodecahedronBufferGeometry",(()=>lR)),e(wm,"ExtrudeBufferGeometry",(()=>cR)),e(wm,"IcosahedronBufferGeometry",(()=>uR)),e(wm,"LatheBufferGeometry",(()=>dR)),e(wm,"OctahedronBufferGeometry",(()=>pR)),e(wm,"PlaneBufferGeometry",(()=>hR)),e(wm,"PolyhedronBufferGeometry",(()=>fR)),e(wm,"RingBufferGeometry",(()=>mR)),e(wm,"ShapeBufferGeometry",(()=>gR)),e(wm,"SphereBufferGeometry",(()=>vR)),e(wm,"TetrahedronBufferGeometry",(()=>yR)),e(wm,"TorusBufferGeometry",(()=>bR)),e(wm,"TorusKnotBufferGeometry",(()=>SR)),e(wm,"TubeBufferGeometry",(()=>xR));
|
|
235
|
+
/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */$d=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:s,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),s||(s=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=x(Array.prototype.forEach),d=x(Array.prototype.pop),p=x(Array.prototype.push),h=x(String.prototype.toLowerCase),f=x(String.prototype.toString),m=x(String.prototype.match),g=x(String.prototype.replace),v=x(String.prototype.indexOf),y=x(String.prototype.trim),b=x(RegExp.prototype.test),S=w(TypeError);function x(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return l(e,t,r)}}function w(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function C(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=i(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function A(t){const n=a(null);for(const[r,o]of e(t))void 0!==i(t,r)&&(n[r]=o);return n}function E(e,t){for(;null!==e;){const n=i(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=r(e)}function n(e){return console.warn("fallback value for",e),null}return n}const M=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),_=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),T=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k=o(["#text"]),O=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),D=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),F=s(/\${[\w\W]*}/gm),U=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),H=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=s(/^(?:\w+script|data):/i),G=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=s(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:B,ERB_EXPR:z,TMPLIT_EXPR:F,DATA_ATTR:U,ARIA_ATTR:j,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:G,DOCTYPE_NAME:W});const K=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=e=>Q(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const i=r,s=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:x,Element:w,NodeFilter:B,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:F,DOMParser:U,trustedTypes:j}=t,V=w.prototype,G=E(V,"cloneNode"),Y=E(V,"nextSibling"),X=E(V,"childNodes"),$=E(V,"parentNode");if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Z,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:ie}=r,{importNode:oe}=i;let se={};n.isSupported="function"==typeof e&&"function"==typeof $&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ae,ERB_EXPR:le,TMPLIT_EXPR:ce,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:he}=q;let{IS_ALLOWED_URI:fe}=q,me=null;const ge=C({},[...M,..._,...T,...R,...k]);let ve=null;const ye=C({},[...O,...N,...L,...D]);let be=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,xe=null,we=!0,Ce=!0,Ae=!1,Ee=!0,Me=!1,_e=!1,Te=!1,Ie=!1,Re=!1,Pe=!1,ke=!1,Oe=!0,Ne=!1;const Le="user-content-";let De=!0,Be=!1,ze={},Fe=null;const Ue=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let je=null;const He=C({},["audio","video","img","source","image","track"]);let Ve=null;const Ge=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Je=Ke,Qe=!1,Ye=null;const Xe=C({},[We,qe,Ke],f);let $e=null;const Ze=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=A(e),$e=$e=-1===Ze.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===$e?f:h,me="ALLOWED_TAGS"in e?C({},e.ALLOWED_TAGS,tt):ge,ve="ALLOWED_ATTR"in e?C({},e.ALLOWED_ATTR,tt):ye,Ye="ALLOWED_NAMESPACES"in e?C({},e.ALLOWED_NAMESPACES,f):Xe,Ve="ADD_URI_SAFE_ATTR"in e?C(A(Ge),e.ADD_URI_SAFE_ATTR,tt):Ge,je="ADD_DATA_URI_TAGS"in e?C(A(He),e.ADD_DATA_URI_TAGS,tt):He,Fe="FORBID_CONTENTS"in e?C({},e.FORBID_CONTENTS,tt):Ue,Se="FORBID_TAGS"in e?C({},e.FORBID_TAGS,tt):{},xe="FORBID_ATTR"in e?C({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,we=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Me=e.SAFE_FOR_TEMPLATES||!1,_e=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Oe=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,De=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,fe=e.ALLOWED_URI_REGEXP||H,Je=e.NAMESPACE||Ke,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(Ce=!1),Pe&&(Re=!0),ze&&(me=C({},[...k]),ve=[],!0===ze.html&&(C(me,M),C(ve,O)),!0===ze.svg&&(C(me,_),C(ve,N),C(ve,D)),!0===ze.svgFilters&&(C(me,T),C(ve,N),C(ve,D)),!0===ze.mathMl&&(C(me,R),C(ve,L),C(ve,D))),e.ADD_TAGS&&(me===ge&&(me=A(me)),C(me,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ve===ye&&(ve=A(ve)),C(ve,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&C(Ve,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Fe===Ue&&(Fe=A(Fe)),C(Fe,e.FORBID_CONTENTS,tt)),De&&(me["#text"]=!0),_e&&C(me,["html","head","body"]),me.table&&(C(me,["tbody"]),delete Se.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=e.TRUSTED_TYPES_POLICY,ee=Z.createHTML("")}else void 0===Z&&(Z=J(j,s)),null!==Z&&"string"==typeof ee&&(ee=Z.createHTML(""));o&&o(e),nt=e}},st=C({},["mi","mo","mn","ms","mtext"]),at=C({},["foreignobject","desc","title","annotation-xml"]),lt=C({},["title","style","font","a","script"]),ct=C({},_);C(ct,T),C(ct,I);const ut=C({},R);C(ut,P);const dt=function(e){let t=$(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=h(e.tagName),r=h(t.tagName);return!!Ye[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Ke?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(ct[n]):e.namespaceURI===We?t.namespaceURI===Ke?"math"===n:t.namespaceURI===qe?"math"===n&&at[r]:Boolean(ut[n]):e.namespaceURI===Ke?!(t.namespaceURI===qe&&!at[r])&&!(t.namespaceURI===We&&!st[r])&&!ut[n]&&(lt[n]||!ct[n]):!("application/xhtml+xml"!==$e||!Ye[e.namespaceURI]))},pt=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ht=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(Re||Pe)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ft=function(e){let t=null,n=null;if(Ie)e="<remove></remove>"+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===$e&&Je===Ke&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=Z?Z.createHTML(e):e;if(Je===Ke)try{t=(new U).parseFromString(i,$e)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Qe?ee:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Je===Ke?ie.call(t,_e?"html":"body")[0]:_e?t.documentElement:o},mt=function(e){return ne.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null)},gt=function(e){return e instanceof F&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof x&&e instanceof x},yt=function(e,t,r){se[e]&&u(se[e],(e=>{e.call(n,t,r,nt)}))},bt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),gt(e))return pt(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:me}),e.hasChildNodes()&&!vt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return pt(e),!0;if(!me[r]||Se[r]){if(!Se[r]&&xt(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(De&&!Fe[r]){const t=$(e)||e.parentNode,n=X(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(G(n[r],!0),Y(e))}return pt(e),!0}return e instanceof w&&!dt(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&3===e.nodeType&&(t=e.textContent,u([ae,le,ce],(e=>{t=g(t,e," ")})),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(pt(e),!0)},St=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(Ce&&!xe[t]&&b(ue,t));else if(we&&b(de,t));else if(!ve[t]||xe[t]){if(!(xt(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(Ve[t]);else if(b(fe,g(n,he,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!je[e])if(Ae&&!b(pe,g(n,he,"")));else if(n)return!1;return!0},xt=function(e){return e.indexOf("-")>0},wt=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let i=t.length;for(;i--;){const o=t[i],{name:s,namespaceURI:a,value:l}=o,c=tt(s);let p="value"===s?l:y(l);if(r.attrName=c,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),p=r.attrValue,r.forceKeepAttr)continue;if(ht(s,e),!r.keepAttr)continue;if(!Ee&&b(/\/>/i,p)){ht(s,e);continue}Me&&u([ae,le,ce],(e=>{p=g(p,e," ")}));const h=tt(e.nodeName);if(St(h,c,p)){if(!Ne||"id"!==c&&"name"!==c||(ht(s,e),p=Le+p),Z&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(h,c)){case"TrustedHTML":p=Z.createHTML(p);break;case"TrustedScriptURL":p=Z.createScriptURL(p)}try{a?e.setAttributeNS(a,s,p):e.setAttribute(s,p),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},Ct=function e(t){let n=null;const r=mt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof l&&e(n.content),wt(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,a=null;if(Qe=!e,Qe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Te||ot(t),n.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){const t=tt(e.nodeName);if(!me[t]||Se[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof x)r=ft("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!Re&&!Me&&!_e&&-1===e.indexOf("<"))return Z&&ke?Z.createHTML(e):e;if(r=ft(e),!r)return Re?null:ke?ee:""}r&&Ie&&pt(r.firstChild);const c=mt(Be?e:r);for(;s=c.nextNode();)bt(s)||(s.content instanceof l&&Ct(s.content),wt(s));if(Be)return e;if(Re){if(Pe)for(a=re.call(r.ownerDocument);r.firstChild;)a.appendChild(r.firstChild);else a=r;return(ve.shadowroot||ve.shadowrootmode)&&(a=oe.call(i,a,!0)),a}let d=_e?r.outerHTML:r.innerHTML;return _e&&me["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(W,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Me&&u([ae,le,ce],(e=>{d=g(d,e," ")})),Z&&ke?Z.createHTML(d):d},n.setConfig=function(){ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Te=!0},n.clearConfig=function(){nt=null,Te=!1},n.isValidAttribute=function(e,t,n){nt||ot({});const r=tt(e),i=tt(t);return St(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],p(se[e],t))},n.removeHook=function(e){if(se[e])return d(se[e])},n.removeHooks=function(e){se[e]&&(se[e]=[])},n.removeAllHooks=function(){se={}},n}return Q()}(),Xd.marked.use({async:!1,gfm:!0,pedantic:!0,renderer:{link(e,t,n){const r=Sd(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=' target="_blank" rel="noopener noreferrer">'+n+"</a>",i}}});var Zd=({message:e,memori:n,tenant:r,baseUrl:i,apiUrl:o,showFeedback:a,simulateUserPrompt:l,showAIicon:c=!0,isFirst:u=!1,user:d,userAvatar:p,experts:h})=>{var f,m,g,v,y,b,S;const{t:x}=ge(),w=(0,$d.sanitize)(Xd.marked.parse(null!==(f=e.translatedText)&&void 0!==f?f:e.text),{ADD_ATTR:["target"]});return(0,s.jsxs)(s.Fragment,{children:[(e.initial||u)&&(0,s.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,s.jsxs)(Gc,{show:!0,appear:!0,as:"div",className:t(vs)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&c||a&&l}),children:[!e.fromUser&&(0,s.jsx)(Gc.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),title:(null===(m=e.emitter)||void 0===m?void 0:m.length)&&n.enableBoardOfExperts?e.emitter:n.name,children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:(null===(g=e.emitter)||void 0===g?void 0:g.length)&&n.enableBoardOfExperts?e.emitter:n.name,src:(null===(v=e.emitter)||void 0===v?void 0:v.length)&&n.enableBoardOfExperts&&(null==h?void 0:h.find((t=>t.name===e.emitter)))?`${o}/api/v1/memoriai/memori/avatar/${null===(y=h.find((t=>t.name===e.emitter)))||void 0===y?void 0:y.expertMemoriID}`:n.avatarURL&&n.avatarURL.length>0?xd({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i,apiURL:o}):xd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i||"https://app.twincreator.com",apiURL:o}),onError:e=>{e.currentTarget.src=n.avatarURL&&n.avatarURL.length>0?xd({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i}):xd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i}),e.currentTarget.onerror=null}})}),(0,s.jsxs)(Gc.Child,{as:"div",className:t(vs)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&c||a&&l,"memori-chat--ai-generated":e.generatedByAI&&c,"memori-chat--with-feedback":a}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),children:[(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:w}}),(e.generatedByAI&&c||a&&l)&&(0,s.jsxs)("div",{className:"memori-chat--bubble-addon",children:[a&&!!l&&(0,s.jsx)(Yd,{memori:n,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:e=>{e&&l(e)}}),e.generatedByAI&&c&&(0,s.jsx)(Ad,{align:"left",content:x("generatedByAI"),className:"memori-chat--bubble-ai-icon",children:(0,s.jsx)("span",{children:(0,s.jsx)(Cd,{title:x("generatedByAI")||void 0})})})]})]}),e.fromUser&&(0,s.jsx)(s.Fragment,{children:p&&"string"==typeof p||!p&&(null===(b=null==d?void 0:d.avatarURL)||void 0===b?void 0:b.length)?(0,s.jsx)(Gc.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:null!==(S=null==d?void 0:d.userName)&&void 0!==S?S:"User",src:null!=p?p:null==d?void 0:d.avatarURL})}):p?(0,s.jsx)(Gc.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:p}):(0,s.jsx)(Gc.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)(wd,{})})})]})]})};c=o("85Hg2"),c=o("85Hg2");var ep,tp=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})}),np={};ep=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function n(e,n){var r=e.el,i=e.elStyle,o=e.elHeight,s=e.rowsLimit,a=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(a===s+1)return t({},e);var d=c,p=a,h=o;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(i.height)>parseFloat(o)&&(p++,h=i.height,p===s+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:h,rowsWrapped:p})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:h,rowsWrapped:p}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},a=t({},s,o),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var p=d.innerHTML.split(a.delimiter);d.innerHTML="";var h=window.getComputedStyle(d);p.reduce(n,{el:d,buffer:d.innerHTML,elStyle:h,elHeight:0,rowsLimit:i,rowsWrapped:0,options:a})}if(a.responsive){var f=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,i,t({},o,{responsive:!1}))}},v=function(){clearTimeout(f),f=setTimeout(g,a.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],ep):ep(np);var rp=({loading:e=!1,className:n,title:r,description:i,cover:o,hoverable:a=!1,children:l})=>(0,s.jsx)("div",{className:t(vs)("memori-card",n,{"memori-card--loading":e,"memori-card--with-cover":o,"memori-card--hoverable":a}),children:(0,s.jsxs)(Wc,{spinning:e,children:[o&&(0,s.jsx)("div",{className:"memori-card--cover",children:o}),(0,s.jsxs)("div",{className:"memori-card--content",children:[r&&(0,s.jsx)("h3",{className:"memori-card--title",children:r}),i&&(0,s.jsx)("p",{className:"memori-card--description",children:i}),(0,s.jsx)("div",{className:"memori-card--children",children:l})]})]})});const ip=({isChild:e=!1,item:n,baseUrl:r,onLinkPreviewInfo:i,descriptionOneLine:o=!1})=>{var a,l,u,d;const[p,h]=(0,c.useState)(null),f=(null===(a=n.url)||void 0===a?void 0:a.startsWith("http"))||!n.url||0===(null===(l=n.url)||void 0===l?void 0:l.length)?n.url:`https://${n.url}`;(0,c.useEffect)((()=>{var e,t;let o=(null===(e=n.url)||void 0===e?void 0:e.startsWith("http"))||!n.url||0===(null===(t=n.url)||void 0===t?void 0:t.length)?n.url:`https://${n.url}`;o&&o!==(null==p?void 0:p.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://app.twincreator.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(o,r).then((e=>{h(e?{...e,urlKey:o}:null),i&&e&&i(e)}))}),[null==n?void 0:n.url,r,i]);const m=n.title&&n.title.length>0?n.title:null==p?void 0:p.title,g=null==p?void 0:p.description,v=null==p?void 0:p.video,y=null!==(u=null==p?void 0:p.image)&&void 0!==u?u:null===(d=null==p?void 0:p.images)||void 0===d?void 0:d[0];return(0,c.useEffect)((()=>{setTimeout((()=>{(0,np.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[g,n.mediumID]),(0,s.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:t(vs)("memori-link-item--link",{"memori-link-item--link--child":e}),onClick:t=>{e||(t.preventDefault(),t.stopPropagation(),window.open(f,"_blank",`toolbar=yes,top=${.1*window.innerHeight},left=${.1*window.innerWidth},width=${.8*window.innerWidth},height=${.8*window.innerHeight}`))},children:(0,s.jsx)(rp,{hoverable:!0,className:t(vs)("memori-link-item--card",{"memori-link-item--card-description-oneline":o,"memori-link-item--card-has-image":y,"memori-link-item--card-has-video":v}),cover:v?(0,s.jsx)("iframe",{width:"100%",height:"100%",src:v,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):y?(0,s.jsx)("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",srcSet:y.includes("data:image")?void 0:y,alt:n.title}):(0,s.jsx)("div",{className:"memori-link-item--card-cover-icon",children:(0,s.jsx)(tp,{className:"memori-link-item--icon"})}),title:m,description:g})})};var op=({items:e,baseUrl:t,descriptionOneLine:n=!1,onLinkPreviewInfo:r})=>(0,s.jsx)(Gc,{appear:!0,show:!0,as:"div",className:"memori-link-items",children:(0,s.jsx)("div",{className:"memori-link-items--grid",children:e.map(((e,i)=>(0,s.jsx)(Gc.Child,{as:"div",className:"memori-link-item",enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(ip,{item:e,baseUrl:t,descriptionOneLine:n,onLinkPreviewInfo:r})},e.mediumID)))})});c=o("85Hg2");const sp=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],ap=async(e,t,n,r)=>{var i;const o=sp.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),s=await fetch(`${r||"https://app.twincreator.com"}/api/translate?text=${encodeURIComponent(e)}&target_lang=${t.toUpperCase()}${o?`&source_lang=${o}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),a=await s.json();return null===(i=null==a?void 0:a.translations)||void 0===i?void 0:i[0]},lp=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"}],cp="👤",up=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],dp={it:[{text:"",delayAfter:10},{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"",delayAfter:10},{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]};c=o("85Hg2");var pp=({src:e,poster:t,alt:n=""})=>((0,c.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,s.jsx)("div",{className:"model-viewer",children:(0,s.jsx)("model-viewer",{src:e,"ios-src":"",poster:t,alt:n,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));var hp=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})}),fp={};function mp(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}(fp=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){mp(o,r,i,s,a,"next",e)}function a(e){mp(o,r,i,s,a,"throw",e)}s(void 0)}))}}).__esModule=!0,fp.default=fp;var gp={};function vp(){return gp=vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gp.__esModule=!0,gp.default=gp,vp.apply(this,arguments)}(gp=vp).__esModule=!0,gp.default=gp;Q=o("ffgrs"),Y=o("22y1y");var yp={},bp={};function Sp(e,t){return bp=Sp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bp.__esModule=!0,bp.default=bp,Sp(e,t)}(bp=Sp).__esModule=!0,bp.default=bp,(yp=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bp(e,t)}).__esModule=!0,yp.default=yp;var xp={},wp=o("lEJSL").default,Cp={};(Cp=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,Cp.default=Cp,(xp=function(e,t){if(t&&("object"===wp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Cp(e)}).__esModule=!0,xp.default=xp;var Ap={};function Ep(e){return Ap=Ep=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ap.__esModule=!0,Ap.default=Ap,Ep(e)}(Ap=Ep).__esModule=!0,Ap.default=Ap;var Mp,_p=o("7qcgS")();Mp=_p;try{regeneratorRuntime=_p}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=_p:Function("r","regeneratorRuntime = r")(_p)}c=o("85Hg2");var Tp={},Ip={};(Ip=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}).__esModule=!0,Ip.default=Ip,(Tp=function(e,t){if(null==e)return{};var n,r,i=Ip(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}).__esModule=!0,Tp.default=Tp;var Rp={},Pp={},kp=o("e3mvX");(Pp=function(e){if(Array.isArray(e))return kp(e)}).__esModule=!0,Pp.default=Pp;var Op={};(Op=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,Op.default=Op;var Np=o("8xD61"),Lp={};(Lp=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,Lp.default=Lp,(Rp=function(e){return Pp(e)||Op(e)||Np(e)||Lp()}).__esModule=!0,Rp.default=Rp;c=o("85Hg2"),c=o("85Hg2");function Dp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bp(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Dp(Object(r),!0).forEach((function(n){t(K)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var zp={};function Fp(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return zp[r]||(zp[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),zp[r]}function Up(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),i=Fp(r);return i.reduce((function(e,t){return Bp(Bp({},e),n[t])}),t)}function jp(e){return e.join(" ")}function Hp(e){var n=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,s=e.useInlineStyles,a=e.key,l=n.properties,u=n.type,d=n.tagName,p=n.value;if("text"===u)return p;if(d){var h,f=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,i){return Hp({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})}))}}(r,s);if(s){var m=Object.keys(r).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));h=Bp(Bp({},l),{},{className:jp(v)||void 0,style:Up(l.className,Object.assign({},l.style,o),r)})}else h=Bp(Bp({},l),{},{className:jp(l.className)});var y=f(n.children);return t(c).createElement(d,t(gp)({key:a},h),y)}}var Vp=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Gp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wp(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Gp(Object(r),!0).forEach((function(n){t(K)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qp=/\n/g;function Kp(e){var n=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,s=e.numberStyle,a=void 0===s?{}:s,l=e.startingLineNumber;return t(c).createElement("code",{style:Object.assign({},r,o)},function(e){var n=e.lines,r=e.startingLineNumber,i=e.style;return n.map((function(e,n){var o=n+r;return t(c).createElement("span",{key:"line-".concat(n),className:"react-syntax-highlighter-line-number",style:"function"==typeof i?i(o):i},"".concat(o,"\n"))}))}({lines:n.replace(/\n$/,"").split("\n"),style:a,startingLineNumber:l}))}function Jp(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Qp(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return Wp(Wp({},i),o)}function Yp(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,s=e.lineProps,a=void 0===s?{}:s,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,p="function"==typeof a?a(n):a;if(p.className=c,n&&o){var h=Qp(r,n,i);t.unshift(Jp(n,h))}return d&u&&(p.style=Wp(Wp({},p.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:p,children:t}}function Xp(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0;i<e.length;i++){var o=e[i];if("text"===o.type)r.push(Yp({children:[o],className:t(Rp)(new Set(n))}));else if(o.children){var s=n.concat(o.properties.className);Xp(o.children,s).forEach((function(e){return r.push(e)}))}}return r}function $p(e,t,n,r,i,o,s,a,l){var c,u=Xp(e.value),d=[],p=-1,h=0;function f(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Yp({children:e,lineNumber:t,lineNumberStyle:a,largestLineNumber:s,showInlineLineNumbers:i,lineProps:n,className:o,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&i){var n=Qp(a,t,s);e.unshift(Jp(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?f(e,n,r):m(e,n)}for(var v=function(){var e=u[h],t=e.children[0].value;if(t.match(qp)){var n=t.split("\n");n.forEach((function(t,i){var s=r&&d.length+o,a={type:"text",value:"".concat(t,"\n")};if(0===i){var l=g(u.slice(p+1,h).concat(Yp({children:[a],className:e.properties.className})),s);d.push(l)}else if(i===n.length-1){var c=u[h+1]&&u[h+1].children&&u[h+1].children[0],f={type:"text",value:"".concat(t)};if(c){var m=Yp({children:[f],className:e.properties.className});u.splice(h+1,0,m)}else{var v=g([f],s,e.properties.className);d.push(v)}}else{var y=g([a],s,e.properties.className);d.push(y)}})),p=h}h++};h<u.length;)v();if(p!==u.length-1){var y=u.slice(p+1,u.length);if(y&&y.length){var b=g(y,r&&d.length+o);d.push(b)}}return t?d:(c=[]).concat.apply(c,d)}function Zp(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return Hp({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function eh(e){return e&&void 0!==e.highlightAuto}function th(e,n){return function(r){var i=r.language,o=r.children,s=r.style,a=void 0===s?n:s,l=r.customStyle,u=void 0===l?{}:l,d=r.codeTagProps,p=void 0===d?{className:i?"language-".concat(i):void 0,style:Wp(Wp({},a['code[class*="language-"]']),a['code[class*="language-'.concat(i,'"]')])}:d,h=r.useInlineStyles,f=void 0===h||h,m=r.showLineNumbers,g=void 0!==m&&m,v=r.showInlineLineNumbers,y=void 0===v||v,b=r.startingLineNumber,S=void 0===b?1:b,x=r.lineNumberContainerStyle,w=r.lineNumberStyle,C=void 0===w?{}:w,A=r.wrapLines,E=r.wrapLongLines,M=void 0!==E&&E,_=r.lineProps,T=void 0===_?{}:_,I=r.renderer,R=r.PreTag,P=void 0===R?"pre":R,k=r.CodeTag,O=void 0===k?"code":k,N=r.code,L=void 0===N?(Array.isArray(o)?o[0]:o)||"":N,D=r.astGenerator,B=t(Tp)(r,Vp);D=D||e;var z=g?t(c).createElement(Kp,{containerStyle:x,codeStyle:p.style||{},numberStyle:C,startingLineNumber:S,codeString:L}):null,F=a.hljs||a['pre[class*="language-"]']||{backgroundColor:"#fff"},U=eh(D)?"hljs":"prismjs",j=f?Object.assign({},B,{style:Object.assign({},F,u)}):Object.assign({},B,{className:B.className?"".concat(U," ").concat(B.className):U,style:Object.assign({},u)});if(p.style=Wp(Wp({},p.style),{},M?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!D)return t(c).createElement(P,j,z,t(c).createElement(O,p,L));(void 0===A&&I||M)&&(A=!0),I=I||Zp;var H=[{type:"text",value:L}],V=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(eh(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(e){return{value:i}}}({astGenerator:D,language:i,code:L,defaultCodeValue:H});null===V.language&&(V.value=H);var G=$p(V,A,T,g,y,S,V.value.length+S,C,M);return t(c).createElement(P,j,t(c).createElement(O,p,!y&&z,I({rows:G,stylesheet:a,useInlineStyles:f})))}}function nh(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=t(Ap)(e);if(n){var o=t(Ap)(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return t(xp)(this,r)}}var rh,ih,oh,sh,ah,lh,ch,uh=function(e,n){return function(){var r=t(fp)(t(Mp).mark((function r(i){var o;return t(Mp).wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:o=t.sent,i(e,o.default||o);case 4:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},dh={abap:uh("abap",(function(){return o("bwHpE")})),abnf:uh("abnf",(function(){return o("daD87")})),actionscript:uh("actionscript",(function(){return o("lpEgO")})),ada:uh("ada",(function(){return o("1sGW9")})),agda:uh("agda",(function(){return o("e9VyR")})),al:uh("al",(function(){return o("kMFSe")})),antlr4:uh("antlr4",(function(){return o("8HlsP")})),apacheconf:uh("apacheconf",(function(){return o("isFCh")})),apex:uh("apex",(function(){return o("gUXVM")})),apl:uh("apl",(function(){return o("2L15v")})),applescript:uh("applescript",(function(){return o("8XyFT")})),aql:uh("aql",(function(){return o("gFWTI")})),arduino:uh("arduino",(function(){return o("jI3VB")})),arff:uh("arff",(function(){return o("6uYTH")})),asciidoc:uh("asciidoc",(function(){return o("gdYKH")})),asm6502:uh("asm6502",(function(){return o("ahFLg")})),asmatmel:uh("asmatmel",(function(){return o("4irIu")})),aspnet:uh("aspnet",(function(){return o("yDC6n")})),autohotkey:uh("autohotkey",(function(){return o("a4xpy")})),autoit:uh("autoit",(function(){return o("iNSix")})),avisynth:uh("avisynth",(function(){return o("kEBnk")})),avroIdl:uh("avroIdl",(function(){return o("lzthi")})),bash:uh("bash",(function(){return Promise.resolve(o("3aDLI"))})),basic:uh("basic",(function(){return o("cxDu6")})),batch:uh("batch",(function(){return o("6zDll")})),bbcode:uh("bbcode",(function(){return o("bPS87")})),bicep:uh("bicep",(function(){return o("8dy5f")})),birb:uh("birb",(function(){return o("3vHrY")})),bison:uh("bison",(function(){return o("bCjBS")})),bnf:uh("bnf",(function(){return o("4NqDW")})),brainfuck:uh("brainfuck",(function(){return o("4s0KX")})),brightscript:uh("brightscript",(function(){return o("jTsQ4")})),bro:uh("bro",(function(){return o("5lMc2")})),bsl:uh("bsl",(function(){return o("jBYxC")})),c:uh("c",(function(){return Promise.resolve(o("lyZgY"))})),cfscript:uh("cfscript",(function(){return o("coZDy")})),chaiscript:uh("chaiscript",(function(){return o("e1zEN")})),cil:uh("cil",(function(){return o("crKoM")})),clike:uh("clike",(function(){return o("4kO9t")})),clojure:uh("clojure",(function(){return o("01SpB")})),cmake:uh("cmake",(function(){return o("9yG4p")})),cobol:uh("cobol",(function(){return o("967Hn")})),coffeescript:uh("coffeescript",(function(){return o("7Yi6H")})),concurnas:uh("concurnas",(function(){return o("5tXmX")})),coq:uh("coq",(function(){return o("ektdr")})),cpp:uh("cpp",(function(){return Promise.resolve(o("lR39A"))})),crystal:uh("crystal",(function(){return o("8gt4L")})),csharp:uh("csharp",(function(){return o("7K6eJ")})),cshtml:uh("cshtml",(function(){return o("cVu4i")})),csp:uh("csp",(function(){return o("ecKo1")})),cssExtras:uh("cssExtras",(function(){return o("gnpv8")})),css:uh("css",(function(){return o("jx0H8")})),csv:uh("csv",(function(){return o("f9kmW")})),cypher:uh("cypher",(function(){return o("lojor")})),d:uh("d",(function(){return o("6Qa0U")})),dart:uh("dart",(function(){return o("74K1B")})),dataweave:uh("dataweave",(function(){return o("93H6c")})),dax:uh("dax",(function(){return o("cf9Y9")})),dhall:uh("dhall",(function(){return o("f6UWv")})),diff:uh("diff",(function(){return o("klPVo")})),django:uh("django",(function(){return o("jfxe9")})),dnsZoneFile:uh("dnsZoneFile",(function(){return o("5aMz5")})),docker:uh("docker",(function(){return o("kOauC")})),dot:uh("dot",(function(){return o("btE6k")})),ebnf:uh("ebnf",(function(){return o("aT88c")})),editorconfig:uh("editorconfig",(function(){return o("jWOl8")})),eiffel:uh("eiffel",(function(){return o("kHJaX")})),ejs:uh("ejs",(function(){return o("frfnA")})),elixir:uh("elixir",(function(){return o("hcrJ2")})),elm:uh("elm",(function(){return o("jd271")})),erb:uh("erb",(function(){return o("gczXL")})),erlang:uh("erlang",(function(){return o("FsabW")})),etlua:uh("etlua",(function(){return o("9DI9l")})),excelFormula:uh("excelFormula",(function(){return o("3QVue")})),factor:uh("factor",(function(){return o("ltNCT")})),falselang:uh("falselang",(function(){return o("g0Q6p")})),firestoreSecurityRules:uh("firestoreSecurityRules",(function(){return o("ukA2V")})),flow:uh("flow",(function(){return o("e5prn")})),fortran:uh("fortran",(function(){return o("gIEL6")})),fsharp:uh("fsharp",(function(){return o("3wQkt")})),ftl:uh("ftl",(function(){return o("7ZVWs")})),gap:uh("gap",(function(){return o("hOFj6")})),gcode:uh("gcode",(function(){return o("95BzQ")})),gdscript:uh("gdscript",(function(){return o("iul6t")})),gedcom:uh("gedcom",(function(){return o("e0qJM")})),gherkin:uh("gherkin",(function(){return o("2SHak")})),git:uh("git",(function(){return o("l6VFH")})),glsl:uh("glsl",(function(){return o("cEMfJ")})),gml:uh("gml",(function(){return o("8UVTr")})),gn:uh("gn",(function(){return o("kvibD")})),goModule:uh("goModule",(function(){return o("icqjF")})),go:uh("go",(function(){return o("jLkg8")})),graphql:uh("graphql",(function(){return o("aYGNi")})),groovy:uh("groovy",(function(){return o("4bTmH")})),haml:uh("haml",(function(){return o("h2A6V")})),handlebars:uh("handlebars",(function(){return o("79YVJ")})),haskell:uh("haskell",(function(){return o("bsiLW")})),haxe:uh("haxe",(function(){return o("94Kdj")})),hcl:uh("hcl",(function(){return o("9CheR")})),hlsl:uh("hlsl",(function(){return o("h3dqW")})),hoon:uh("hoon",(function(){return o("9WbsW")})),hpkp:uh("hpkp",(function(){return o("GiPN3")})),hsts:uh("hsts",(function(){return o("eaSn9")})),http:uh("http",(function(){return o("1uj7b")})),ichigojam:uh("ichigojam",(function(){return o("ge562")})),icon:uh("icon",(function(){return o("lVHUf")})),icuMessageFormat:uh("icuMessageFormat",(function(){return o("aYoUL")})),idris:uh("idris",(function(){return o("1RVAE")})),iecst:uh("iecst",(function(){return o("bi7Dr")})),ignore:uh("ignore",(function(){return o("cq0Pi")})),inform7:uh("inform7",(function(){return o("31K4E")})),ini:uh("ini",(function(){return o("l05OZ")})),io:uh("io",(function(){return o("6bY1b")})),j:uh("j",(function(){return o("1ebDS")})),java:uh("java",(function(){return o("iEZZI")})),javadoc:uh("javadoc",(function(){return o("aHy5a")})),javadoclike:uh("javadoclike",(function(){return o("5f3rE")})),javascript:uh("javascript",(function(){return o("7JDFI")})),javastacktrace:uh("javastacktrace",(function(){return o("gdCGE")})),jexl:uh("jexl",(function(){return o("cqMb9")})),jolie:uh("jolie",(function(){return o("cEDX4")})),jq:uh("jq",(function(){return o("kEWsh")})),jsExtras:uh("jsExtras",(function(){return o("74PI8")})),jsTemplates:uh("jsTemplates",(function(){return o("30TPr")})),jsdoc:uh("jsdoc",(function(){return o("9DH5c")})),json:uh("json",(function(){return Promise.resolve(o("l1Rj1"))})),json5:uh("json5",(function(){return o("920rv")})),jsonp:uh("jsonp",(function(){return o("9AwS1")})),jsstacktrace:uh("jsstacktrace",(function(){return o("bYXMr")})),jsx:uh("jsx",(function(){return Promise.resolve(o("6ho3O"))})),julia:uh("julia",(function(){return o("g0ibH")})),keepalived:uh("keepalived",(function(){return o("2hdnH")})),keyman:uh("keyman",(function(){return o("cIufI")})),kotlin:uh("kotlin",(function(){return o("c26dU")})),kumir:uh("kumir",(function(){return o("iYAha")})),kusto:uh("kusto",(function(){return o("9z1oX")})),latex:uh("latex",(function(){return o("lCPLU")})),latte:uh("latte",(function(){return o("c9oN0")})),less:uh("less",(function(){return o("hA3V9")})),lilypond:uh("lilypond",(function(){return o("hpHTA")})),liquid:uh("liquid",(function(){return o("kpZTm")})),lisp:uh("lisp",(function(){return o("chgK5")})),livescript:uh("livescript",(function(){return o("2gdiv")})),llvm:uh("llvm",(function(){return o("jUeFO")})),log:uh("log",(function(){return o("3BFSQ")})),lolcode:uh("lolcode",(function(){return o("lG9br")})),lua:uh("lua",(function(){return o("cVGpd")})),magma:uh("magma",(function(){return o("4LVzY")})),makefile:uh("makefile",(function(){return o("2NviD")})),markdown:uh("markdown",(function(){return o("jUFCF")})),markupTemplating:uh("markupTemplating",(function(){return Promise.resolve(o("t3W0d"))})),markup:uh("markup",(function(){return o("5hIXu")})),matlab:uh("matlab",(function(){return o("kPAC0")})),maxscript:uh("maxscript",(function(){return o("gHOJy")})),mel:uh("mel",(function(){return o("9mj6e")})),mermaid:uh("mermaid",(function(){return o("kozw5")})),mizar:uh("mizar",(function(){return o("2bN6W")})),mongodb:uh("mongodb",(function(){return o("eHKWX")})),monkey:uh("monkey",(function(){return o("7Fh0C")})),moonscript:uh("moonscript",(function(){return o("hDXwC")})),n1ql:uh("n1ql",(function(){return o("j9bkC")})),n4js:uh("n4js",(function(){return o("eTmBF")})),nand2tetrisHdl:uh("nand2tetrisHdl",(function(){return o("ezjCf")})),naniscript:uh("naniscript",(function(){return o("VxHk1")})),nasm:uh("nasm",(function(){return o("ly95T")})),neon:uh("neon",(function(){return o("7Fk34")})),nevod:uh("nevod",(function(){return o("3U8Qv")})),nginx:uh("nginx",(function(){return o("c6qVk")})),nim:uh("nim",(function(){return o("1JdCk")})),nix:uh("nix",(function(){return o("jcstS")})),nsis:uh("nsis",(function(){return o("kEJqW")})),objectivec:uh("objectivec",(function(){return o("lUP8A")})),ocaml:uh("ocaml",(function(){return o("lhTAD")})),opencl:uh("opencl",(function(){return o("8rxKO")})),openqasm:uh("openqasm",(function(){return o("ib0uL")})),oz:uh("oz",(function(){return o("csCUS")})),parigp:uh("parigp",(function(){return o("2DkHE")})),parser:uh("parser",(function(){return o("2cp75")})),pascal:uh("pascal",(function(){return o("fViVl")})),pascaligo:uh("pascaligo",(function(){return o("9Uuxa")})),pcaxis:uh("pcaxis",(function(){return o("jUdnN")})),peoplecode:uh("peoplecode",(function(){return o("l8w4e")})),perl:uh("perl",(function(){return o("aX7dM")})),phpExtras:uh("phpExtras",(function(){return o("3cMZl")})),php:uh("php",(function(){return Promise.resolve(o("5li5P"))})),phpdoc:uh("phpdoc",(function(){return o("bDyJN")})),plsql:uh("plsql",(function(){return o("cPuMN")})),powerquery:uh("powerquery",(function(){return o("jE1gU")})),powershell:uh("powershell",(function(){return o("k7t0j")})),processing:uh("processing",(function(){return o("jr8hV")})),prolog:uh("prolog",(function(){return o("hpuat")})),promql:uh("promql",(function(){return o("ckXC5")})),properties:uh("properties",(function(){return o("fAh6P")})),protobuf:uh("protobuf",(function(){return o("R6WqB")})),psl:uh("psl",(function(){return o("Al65w")})),pug:uh("pug",(function(){return o("dxbNS")})),puppet:uh("puppet",(function(){return o("lrSuh")})),pure:uh("pure",(function(){return o("6DKQK")})),purebasic:uh("purebasic",(function(){return o("7ZkSb")})),purescript:uh("purescript",(function(){return o("dBTYx")})),python:uh("python",(function(){return Promise.resolve(o("kiy5M"))})),q:uh("q",(function(){return o("4FXyy")})),qml:uh("qml",(function(){return o("2zZFj")})),qore:uh("qore",(function(){return o("iCK1Y")})),qsharp:uh("qsharp",(function(){return o("dvH9H")})),r:uh("r",(function(){return o("lQqRt")})),racket:uh("racket",(function(){return o("eHKmq")})),reason:uh("reason",(function(){return o("kkeLT")})),regex:uh("regex",(function(){return o("llX50")})),rego:uh("rego",(function(){return o("9hKdZ")})),renpy:uh("renpy",(function(){return o("cJgw5")})),rest:uh("rest",(function(){return o("867DK")})),rip:uh("rip",(function(){return o("3Odjx")})),roboconf:uh("roboconf",(function(){return o("gQ0Us")})),robotframework:uh("robotframework",(function(){return o("bLCgx")})),ruby:uh("ruby",(function(){return Promise.resolve(o("ch1PX"))})),rust:uh("rust",(function(){return o("cInT8")})),sas:uh("sas",(function(){return o("iz7eP")})),sass:uh("sass",(function(){return o("hrDC3")})),scala:uh("scala",(function(){return o("ub8Bf")})),scheme:uh("scheme",(function(){return o("7NAAt")})),scss:uh("scss",(function(){return Promise.resolve(o("fU6a0"))})),shellSession:uh("shellSession",(function(){return o("7kKCv")})),smali:uh("smali",(function(){return o("2lkCb")})),smalltalk:uh("smalltalk",(function(){return o("4280y")})),smarty:uh("smarty",(function(){return o("4hXYK")})),sml:uh("sml",(function(){return o("jh2E8")})),solidity:uh("solidity",(function(){return o("dTdF2")})),solutionFile:uh("solutionFile",(function(){return o("iI5tm")})),soy:uh("soy",(function(){return o("aoU5C")})),sparql:uh("sparql",(function(){return o("ggrvb")})),splunkSpl:uh("splunkSpl",(function(){return o("8LhCX")})),sqf:uh("sqf",(function(){return o("3tDsu")})),sql:uh("sql",(function(){return Promise.resolve(o("bnDV9"))})),squirrel:uh("squirrel",(function(){return o("bxaUV")})),stan:uh("stan",(function(){return o("dBqrq")})),stylus:uh("stylus",(function(){return o("JlHVK")})),swift:uh("swift",(function(){return o("c7NBs")})),systemd:uh("systemd",(function(){return o("jprZl")})),t4Cs:uh("t4Cs",(function(){return o("edsMI")})),t4Templating:uh("t4Templating",(function(){return o("bS9Wa")})),t4Vb:uh("t4Vb",(function(){return o("gYk20")})),tap:uh("tap",(function(){return o("byv7d")})),tcl:uh("tcl",(function(){return o("lUAIZ")})),textile:uh("textile",(function(){return o("7J2LO")})),toml:uh("toml",(function(){return o("eXtdM")})),tremor:uh("tremor",(function(){return o("vyajH")})),tsx:uh("tsx",(function(){return Promise.resolve(o("7cTnl"))})),tt2:uh("tt2",(function(){return o("8XOOm")})),turtle:uh("turtle",(function(){return o("1XvLQ")})),twig:uh("twig",(function(){return o("i9Fpp")})),typescript:uh("typescript",(function(){return Promise.resolve(o("fzL8k"))})),typoscript:uh("typoscript",(function(){return o("kKk69")})),unrealscript:uh("unrealscript",(function(){return o("jgq8Y")})),uorazor:uh("uorazor",(function(){return o("dsZ00")})),uri:uh("uri",(function(){return o("fqJRp")})),v:uh("v",(function(){return o("bgfyB")})),vala:uh("vala",(function(){return o("68x4q")})),vbnet:uh("vbnet",(function(){return o("eUhQs")})),velocity:uh("velocity",(function(){return o("fPNdV")})),verilog:uh("verilog",(function(){return o("2fM1V")})),vhdl:uh("vhdl",(function(){return o("hNF6q")})),vim:uh("vim",(function(){return o("75TCr")})),visualBasic:uh("visualBasic",(function(){return o("fc93z")})),warpscript:uh("warpscript",(function(){return o("jgHlG")})),wasm:uh("wasm",(function(){return o("dVZkI")})),webIdl:uh("webIdl",(function(){return o("9Jnxv")})),wiki:uh("wiki",(function(){return o("1Gimo")})),wolfram:uh("wolfram",(function(){return o("4SyRT")})),wren:uh("wren",(function(){return o("gaIVs")})),xeora:uh("xeora",(function(){return o("lagad")})),xmlDoc:uh("xmlDoc",(function(){return o("9DNYE")})),xojo:uh("xojo",(function(){return o("ksF4f")})),xquery:uh("xquery",(function(){return o("gXxHJ")})),yaml:uh("yaml",(function(){return o("6rk3j")})),yang:uh("yang",(function(){return o("kTyrQ")})),zig:uh("zig",(function(){return o("d3mFC")}))},ph=(ih=(rh={loader:function(){return o("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:dh,registerLanguage:function(e,t,n){return e.register(n)}}).loader,oh=rh.isLanguageRegistered,sh=rh.registerLanguage,ah=rh.languageLoaders,lh=rh.noAsyncLoadingLanguages,ch=function(e){t(yp)(i,e);var n,r=nh(i);function i(){return t(Q)(this,i),r.apply(this,arguments)}return t(Y)(i,[{key:"componentDidUpdate",value:function(){!i.isRegistered(this.props.language)&&ah&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;i.astGeneratorPromise||i.loadAstGenerator(),i.astGenerator||i.astGeneratorPromise.then((function(){e.forceUpdate()})),!i.isRegistered(this.props.language)&&ah&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&i.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return i.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return t(c).createElement(i.highlightInstance,t(gp)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:i.astGenerator}))}}],[{key:"preload",value:function(){return i.loadAstGenerator()}},{key:"loadLanguage",value:(n=t(fp)(t(Mp).mark((function e(n){var r;return t(Mp).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(r=ah[n])){e.next=5;break}return e.abrupt("return",r(i.registerLanguage));case 5:throw new Error("Language ".concat(n," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return i.isRegistered(e)||"function"==typeof ah[e]}},{key:"loadAstGenerator",value:function(){return i.astGeneratorPromise=ih().then((function(e){i.astGenerator=e,sh&&i.languages.forEach((function(t,n){return sh(e,n,t)}))})),i.astGeneratorPromise}}]),i}(t(c).PureComponent),t(K)(ch,"astGenerator",null),t(K)(ch,"highlightInstance",th(null,{})),t(K)(ch,"astGeneratorPromise",null),t(K)(ch,"languages",new Map),t(K)(ch,"supportedLanguages",rh.supportedLanguages||Object.keys(ah||{})),t(K)(ch,"isRegistered",(function(e){if(lh)return!0;if(!sh)throw new Error("Current syntax highlighter doesn't support registration of languages");return ch.astGenerator?oh(ch.astGenerator,e):ch.languages.has(e)})),t(K)(ch,"registerLanguage",(function(e,t){if(!sh)throw new Error("Current syntax highlighter doesn't support registration of languages");if(ch.astGenerator)return sh(ch.astGenerator,e,t);ch.languages.set(e,t)})),ch),hh={},fh={};(fh=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,fh.default=fh,Object.defineProperty(hh,"__esModule",{value:!0}),Object.defineProperty(hh,"a11yDark",{enumerable:!0,get:function(){return Ch.default}}),Object.defineProperty(hh,"atomDark",{enumerable:!0,get:function(){return Ah.default}}),Object.defineProperty(hh,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return Eh.default}}),Object.defineProperty(hh,"cb",{enumerable:!0,get:function(){return Mh.default}}),Object.defineProperty(hh,"coldarkCold",{enumerable:!0,get:function(){return _h.default}}),Object.defineProperty(hh,"coldarkDark",{enumerable:!0,get:function(){return Th.default}}),Object.defineProperty(hh,"coy",{enumerable:!0,get:function(){return mh.default}}),Object.defineProperty(hh,"coyWithoutShadows",{enumerable:!0,get:function(){return Ih.default}}),Object.defineProperty(hh,"darcula",{enumerable:!0,get:function(){return Rh.default}}),Object.defineProperty(hh,"dark",{enumerable:!0,get:function(){return gh.default}}),Object.defineProperty(hh,"dracula",{enumerable:!0,get:function(){return Ph.default}}),Object.defineProperty(hh,"duotoneDark",{enumerable:!0,get:function(){return kh.default}}),Object.defineProperty(hh,"duotoneEarth",{enumerable:!0,get:function(){return Oh.default}}),Object.defineProperty(hh,"duotoneForest",{enumerable:!0,get:function(){return Nh.default}}),Object.defineProperty(hh,"duotoneLight",{enumerable:!0,get:function(){return Lh.default}}),Object.defineProperty(hh,"duotoneSea",{enumerable:!0,get:function(){return Dh.default}}),Object.defineProperty(hh,"duotoneSpace",{enumerable:!0,get:function(){return Bh.default}}),Object.defineProperty(hh,"funky",{enumerable:!0,get:function(){return vh.default}}),Object.defineProperty(hh,"ghcolors",{enumerable:!0,get:function(){return zh.default}}),Object.defineProperty(hh,"gruvboxDark",{enumerable:!0,get:function(){return Fh.default}}),Object.defineProperty(hh,"gruvboxLight",{enumerable:!0,get:function(){return Uh.default}}),Object.defineProperty(hh,"holiTheme",{enumerable:!0,get:function(){return jh.default}}),Object.defineProperty(hh,"hopscotch",{enumerable:!0,get:function(){return Hh.default}}),Object.defineProperty(hh,"lucario",{enumerable:!0,get:function(){return Vh.default}}),Object.defineProperty(hh,"materialDark",{enumerable:!0,get:function(){return Gh.default}}),Object.defineProperty(hh,"materialLight",{enumerable:!0,get:function(){return Wh.default}}),Object.defineProperty(hh,"materialOceanic",{enumerable:!0,get:function(){return qh.default}}),Object.defineProperty(hh,"nightOwl",{enumerable:!0,get:function(){return Kh.default}}),Object.defineProperty(hh,"nord",{enumerable:!0,get:function(){return Jh.default}}),Object.defineProperty(hh,"okaidia",{enumerable:!0,get:function(){return yh.default}}),Object.defineProperty(hh,"oneDark",{enumerable:!0,get:function(){return Qh.default}}),Object.defineProperty(hh,"oneLight",{enumerable:!0,get:function(){return Yh.default}}),Object.defineProperty(hh,"pojoaque",{enumerable:!0,get:function(){return Xh.default}}),Object.defineProperty(hh,"prism",{enumerable:!0,get:function(){return wh.default}}),Object.defineProperty(hh,"shadesOfPurple",{enumerable:!0,get:function(){return $h.default}}),Object.defineProperty(hh,"solarizedDarkAtom",{enumerable:!0,get:function(){return Zh.default}}),Object.defineProperty(hh,"solarizedlight",{enumerable:!0,get:function(){return bh.default}}),Object.defineProperty(hh,"synthwave84",{enumerable:!0,get:function(){return ef.default}}),Object.defineProperty(hh,"tomorrow",{enumerable:!0,get:function(){return Sh.default}}),Object.defineProperty(hh,"twilight",{enumerable:!0,get:function(){return xh.default}}),Object.defineProperty(hh,"vs",{enumerable:!0,get:function(){return tf.default}}),Object.defineProperty(hh,"vscDarkPlus",{enumerable:!0,get:function(){return nf.default}}),Object.defineProperty(hh,"xonokai",{enumerable:!0,get:function(){return rf.default}}),Object.defineProperty(hh,"zTouch",{enumerable:!0,get:function(){return of.default}});var mh=fh(o("jcF8U")),gh=fh(o("3Tppx")),vh=fh(o("dBuK7")),yh=fh(o("eEjWK")),bh=fh(o("awG2g")),Sh=fh(o("2oFzQ")),xh=fh(o("4Au6Q")),wh=fh(o("dAPqs")),Ch=fh(o("8eAql")),Ah=fh(o("cv2QE")),Eh=fh(o("h5I9g")),Mh=fh(o("i4C5w")),_h=fh(o("3kFKo")),Th=fh(o("17zK0")),Ih=fh(o("5Avqr")),Rh=fh(o("1jHMv")),Ph=fh(o("7Q8CE")),kh=fh(o("jKUos")),Oh=fh(o("Uzm4J")),Nh=fh(o("7yfkN")),Lh=fh(o("lT2l1")),Dh=fh(o("fZ9um")),Bh=fh(o("1MoQL")),zh=fh(o("4uys7")),Fh=fh(o("kaYsk")),Uh=fh(o("kN6Vu")),jh=fh(o("2Z6pG")),Hh=fh(o("4jQJK")),Vh=fh(o("bpXw0")),Gh=fh(o("i4S8s")),Wh=fh(o("5bNr4")),qh=fh(o("5ZYWT")),Kh=fh(o("ihJCU")),Jh=fh(o("8iIbg")),Qh=fh(o("424u7")),Yh=fh(o("jPiNI")),Xh=fh(o("OHVOA")),$h=fh(o("2OKTL")),Zh=fh(o("2Mg8H")),ef=fh(o("9Kud0")),tf=fh(o("eCrmR")),nf=fh(o("8UhcQ")),rf=fh(o("dtU9z")),of=fh(o("4xtLO")),sf={};Object.defineProperty(sf,"__esModule",{value:!0}),sf.default=void 0;var af=fh(o("7cTnl")).default;sf.default=af;var lf={};Object.defineProperty(lf,"__esModule",{value:!0}),lf.default=void 0;var cf=fh(o("l1Rj1")).default;lf.default=cf;var uf={};Object.defineProperty(uf,"__esModule",{value:!0}),uf.default=void 0;var df=fh(o("fU6a0")).default;uf.default=df;var pf={};Object.defineProperty(pf,"__esModule",{value:!0}),pf.default=void 0;var hf=fh(o("3aDLI")).default;pf.default=hf;var ff={};Object.defineProperty(ff,"__esModule",{value:!0}),ff.default=void 0;var mf=fh(o("kiy5M")).default;ff.default=mf;var gf={};Object.defineProperty(gf,"__esModule",{value:!0}),gf.default=void 0;var vf=fh(o("lR39A")).default;gf.default=vf;var yf={};Object.defineProperty(yf,"__esModule",{value:!0}),yf.default=void 0;var bf=fh(o("5li5P")).default;yf.default=bf;var Sf={};Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.default=void 0;var xf=fh(o("ch1PX")).default;Sf.default=xf;var wf={};Object.defineProperty(wf,"__esModule",{value:!0}),wf.default=void 0;var Cf=fh(o("bnDV9")).default;wf.default=Cf,ph.registerLanguage("tsx",t(sf)),ph.registerLanguage("json",t(lf)),ph.registerLanguage("scss",t(uf)),ph.registerLanguage("bash",t(pf)),ph.registerLanguage("python",t(ff)),ph.registerLanguage("cpp",t(gf)),ph.registerLanguage("php",t(yf)),ph.registerLanguage("ruby",t(Sf)),ph.registerLanguage("sql",t(wf));var Af=({medium:e,className:t,preview:n=!1})=>{var r,i,o,a;const{t:l}=ge();return(0,s.jsxs)("div",{className:"memori-snippet",children:[(0,s.jsxs)("div",{className:"memori-snippet--content",children:[(0,s.jsx)(ph,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:hh.atomDark,showLineNumbers:!0,language:null!==(i=null===(r=up.find((t=>e.mimeType===t.mimeType)))||void 0===r?void 0:r.lang)&&void 0!==i?i:"text",children:(null===(o=e.content)||void 0===o?void 0:o.length)&&e.content.length>200&&n?`${e.content.slice(0,200)}\n...`:`${e.content}`}),(0,s.jsx)(Na,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:l("copy")||"Copy",icon:(0,s.jsx)(hp,{}),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})]}),!!(null===(a=e.title)||void 0===a?void 0:a.length)&&(0,s.jsx)("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption",children:e.title})]})};var Ef=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var Mf=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var _f=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"})});var Tf=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"})});const If=({isChild:e=!1,item:t,sessionID:n,tenantID:r,preview:i=!1,baseURL:o,apiURL:a,onClick:l,customMediaRenderer:c})=>{const u=xd({resourceURI:t.url,sessionID:n,tenantID:r,baseURL:o,apiURL:a}),d=null==c?void 0:c(t.mimeType);if(d)return d;switch(t.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,s.jsxs)("picture",{className:"memori-media-item--figure",children:[!i&&(0,s.jsx)("source",{srcSet:[u,t.url,t.content].join(", "),type:t.mimeType}),(0,s.jsx)("img",{alt:t.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),t.title&&(0,s.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:t.title})]})})});case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)(Tf,{className:"memori-media-item--icon"}),title:t.title})});case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)(_f,{className:"memori-media-item--icon"}),title:t.title})});case"application/pdf":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)(Mf,{className:"memori-media-item--icon"}),title:t.title})});case"video/mp4":case"video/avi":case"video/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)("video",{style:{width:"100%",height:"100%"},controls:!0,src:u,title:t.title}),title:t.title})});case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)("audio",{style:{width:"100%",height:"100%"},controls:!0,src:u}),title:t.title})});case"model/gltf-binary":return(0,s.jsx)(pp,{src:u,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(rp,{hoverable:!0,cover:(0,s.jsx)(Ef,{className:"memori-media-item--icon"}),title:t.title})})}};var Rf=(0,c.memo)((({items:e,sessionID:t,tenantID:n,translateTo:r,baseURL:i,apiURL:o,customMediaRenderer:a})=>{const[l,u]=(0,c.useState)(e),[d,p]=(0,c.useState)(),h=(0,c.useCallback)((async()=>{if(!r)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await ap(e.title,r);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));u(t)}),[r,e]);return(0,c.useEffect)((()=>{r&&h()}),[r,h]),(0,s.jsxs)(Gc,{appear:!0,show:!0,as:"div",className:"memori-media-items",children:[(0,s.jsx)("div",{className:"memori-media-items--grid",children:l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!up.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)).map(((e,r)=>(0,s.jsx)(Gc.Child,{as:"div",className:"memori-media-item",enter:"ease-out duration-500 delay-"+100*r,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(If,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,onClick:e=>{p(l.find((t=>t.mediumID===e)))},item:{...e,title:e.title,url:e.url,content:e.content},customMediaRenderer:a})},e.url+"&index="+r)))}),l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&up.map((e=>e.mimeType)).includes(e.mimeType)})).map((e=>(0,s.jsx)(Gc.Child,{as:"div",className:"memori-media-item--snippet",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Af,{medium:e},e.mediumID)},e.mediumID))),l.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).map((e=>(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:e.content||""}},e.mediumID))),(null==d?void 0:d.mediumID)&&(0,s.jsx)(Kc,{width:"100%",widthMd:"100%",className:"memori-media-item--modal",open:!!d,onClose:()=>p(void 0),footer:null,children:(0,s.jsx)(If,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,item:{...d,title:d.title,url:d.url,content:d.content},customMediaRenderer:a})})]})}));var Pf=(0,c.memo)((({hints:e=[],links:n=[],media:r=[],simulateUserPrompt:i=(()=>{}),sessionID:o,baseUrl:a,apiUrl:l,translateTo:u,customMediaRenderer:d})=>{const{t:p}=ge(),[h,f]=(0,c.useState)(!0),[m,g]=(0,c.useState)(6);return(0,c.useEffect)((()=>{f(!0)}),[e]),(0,s.jsxs)("div",{className:"memori-media-widget",children:[(null==r?void 0:r.length)>0&&(0,s.jsx)(Rf,{items:r,sessionID:o,translateTo:u,baseURL:a,apiURL:l,customMediaRenderer:d}),(null==n?void 0:n.length)>0&&(0,s.jsx)(op,{items:n,baseUrl:a}),(null==e?void 0:e.length)>0&&h&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Gc,{appear:!0,show:!0,as:"ul",className:"memori-media--hints",children:e.slice(0,m).map(((e,n)=>(0,s.jsx)(Gc.Child,{as:"li",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Na,{className:t(vs)("memori-media--hint"),primary:!0,onClick:()=>{i(e.originalText,e.text),f(!1)},onTouchEnd:()=>{i(e.originalText,e.text),f(!1)},children:e.text},e.text+n)},e.text+n)))}),e.length>m&&(0,s.jsx)("div",{className:"memori-hints--show-more",children:(0,s.jsx)(Na,{className:"memori-hints--show-more-button",id:"showMoreHints",onClick:()=>g(m+6),children:p("expand")||"Expand"})})]})]})}));c=o("85Hg2"),c=o("85Hg2");function kf(e=0){let[t,n]=(0,c.useState)(e),r=(0,c.useCallback)((e=>n((t=>t|e))),[t]),i=(0,c.useCallback)((e=>Boolean(t&e)),[t]),o=(0,c.useCallback)((e=>n((t=>t&~e))),[n]),s=(0,c.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:s}}let Of=(0,(c=o("85Hg2")).createContext)(null);function Nf(){let e=(0,c.useContext)(Of);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Nf),e}return e}function Lf(){let[e,n]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Ja((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t(c).createElement(Of.Provider,{value:i},e.children)}),[n])]}let Df=Ha((function(e,t){let{passive:n=!1,...r}=e,i=Nf(),o=`headlessui-label-${sl()}`,s=Xa(t);qa((()=>i.register(o)),[o,i.register]);let a={ref:s,...i.props,id:o};return n&&("onClick"in a&&delete a.onClick,"onClick"in r&&delete r.onClick),Fa({ourProps:a,theirProps:r,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})}));function Bf(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))Ff(n,zf(t,r),i);return n}function zf(e,t){return e?e+"["+t+"]":t}function Ff(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())Ff(e,zf(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):Bf(n,t,e)}function Uf(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}c=o("85Hg2");function jf(e,t,n){let[r,i]=(0,c.useState)(n),o=void 0!==e,s=(0,c.useRef)(o),a=(0,c.useRef)(!1),l=(0,c.useRef)(!1);return!o||s.current||a.current?!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[o?e:r,Ja((e=>(o||i(e),null==t?void 0:t(e))))]}var Hf,Vf=((Hf=Vf||{})[Hf.RegisterOption=0]="RegisterOption",Hf[Hf.UnregisterOption=1]="UnregisterOption",Hf);let Gf={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Al(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},Wf=(0,c.createContext)(null);function qf(e){let t=(0,c.useContext)(Wf);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,qf),t}return t}function Kf(e,t){return La(t.type,Gf,e,t)}Wf.displayName="RadioGroupContext";let Jf=Ha((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,...u}=e,d=Ja("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a),[p,h]=(0,c.useReducer)(Kf,{options:[]}),f=p.options,[m,g]=Lf(),[v,y]=$l(),b=`headlessui-radiogroup-${sl()}`,S=(0,c.useRef)(null),x=Xa(S,n),[w,C]=jf(r,s,i),A=(0,c.useMemo)((()=>f.find((e=>!e.propsRef.current.disabled))),[f]),E=(0,c.useMemo)((()=>f.some((e=>d(e.propsRef.current.value,w)))),[f,w]),M=Ja((e=>{var t;if(l||d(e,w))return!1;let n=null==(t=f.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==C||C(e),!0)}));_d({container:S.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let _=Ja((e=>{let t=S.current;if(!t)return;let n=dl(t),r=f.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case Za.Enter:Uf(e.currentTarget);break;case Za.ArrowLeft:case Za.ArrowUp:if(e.preventDefault(),e.stopPropagation(),Ml(r,ml.Previous|ml.WrapAround)===gl.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&M(e.propsRef.current.value)}break;case Za.ArrowRight:case Za.ArrowDown:if(e.preventDefault(),e.stopPropagation(),Ml(r,ml.Next|ml.WrapAround)===gl.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&M(e.propsRef.current.value)}break;case Za.Space:{e.preventDefault(),e.stopPropagation();let t=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&M(t.propsRef.current.value)}}})),T=Ja((e=>(h({type:0,...e}),()=>h({type:1,id:e.id})))),I=(0,c.useMemo)((()=>({registerOption:T,firstOption:A,containsCheckedOption:E,change:M,disabled:l,value:w,compare:d})),[T,A,E,M,l,w,d]),R={ref:x,id:b,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:_},P=(0,c.useMemo)((()=>({value:w})),[w]);return t(c).createElement(y,{name:"RadioGroup.Description"},t(c).createElement(g,{name:"RadioGroup.Label"},t(c).createElement(Wf.Provider,{value:I},null!=o&&null!=w&&Bf({[o]:w}).map((([e,n])=>t(c).createElement(ll,{features:al.Hidden,...Va({key:e,as:"input",type:"radio",checked:null!=n,hidden:!0,readOnly:!0,name:e,value:n})}))),Fa({ourProps:R,theirProps:u,slot:P,defaultTag:"div",name:"RadioGroup"}))))}));var Qf=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(Qf||{});let Yf=Ha((function(e,n){let r=(0,c.useRef)(null),i=Xa(r,n),o=`headlessui-radiogroup-option-${sl()}`,[s,a]=Lf(),[l,u]=$l(),{addFlag:d,removeFlag:p,hasFlag:h}=kf(1),{value:f,disabled:m=!1,...g}=e,v=(0,c.useRef)({value:f,disabled:m});qa((()=>{v.current.value=f}),[f,v]),qa((()=>{v.current.disabled=m}),[m,v]);let{registerOption:y,disabled:b,change:S,firstOption:x,containsCheckedOption:w,value:C,compare:A}=qf("RadioGroup.Option");qa((()=>y({id:o,element:r,propsRef:v})),[o,y,r,e]);let E=Ja((e=>{var t;if(el(e.currentTarget))return e.preventDefault();!S(f)||(d(2),null==(t=r.current)||t.focus())})),M=Ja((e=>{if(el(e.currentTarget))return e.preventDefault();d(2)})),_=Ja((()=>p(2))),T=(null==x?void 0:x.id)===o,I=b||m,R=A(C,f),P={ref:i,id:o,role:"radio","aria-checked":R?"true":"false","aria-labelledby":s,"aria-describedby":l,"aria-disabled":!!I||void 0,tabIndex:I?-1:R||!w&&T?0:-1,onClick:I?void 0:E,onFocus:I?void 0:M,onBlur:I?void 0:_},k=(0,c.useMemo)((()=>({checked:R,disabled:I,active:h(2)})),[R,I,h]);return t(c).createElement(u,{name:"RadioGroup.Description"},t(c).createElement(a,{name:"RadioGroup.Label"},Fa({ourProps:P,theirProps:g,slot:k,defaultTag:"div",name:"RadioGroup.Option"})))})),Xf=Object.assign(Jf,{Option:Yf,Label:Df,Description:Zl});var $f=({sendOnEnter:e,setSendOnEnter:n})=>{const{t:r}=ge();return(0,s.jsxs)(Wd,{as:"div",className:"memori-send-on-enter-menu",children:[(0,s.jsx)(Wd.Button,{className:t(vs)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)("span",{style:{display:"block",width:"1rem",height:"1rem"},children:"…"})})}),(0,s.jsx)(Wd.Items,{className:"memori-menu--overlay",children:(0,s.jsxs)(Xf,{value:e,onChange:n,children:[(0,s.jsx)(Xf.Option,{value:"keypress",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(Wd.Item,{children:(0,s.jsx)(Na,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnKeypress")})})}),(0,s.jsx)(Xf.Option,{value:"click",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(Wd.Item,{children:(0,s.jsx)(Na,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnClick")})})})]})})]})};c=o("85Hg2");var Zf=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});var em=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});var tm=({disabled:e=!1,value:n,onChange:r,onPressEnter:i,onFocus:o,onBlur:a})=>{const{t:l}=ge(),[u,d]=(0,c.useState)(!1);return(0,s.jsx)("div",{"data-testid":"chat-textarea",className:t(vs)("memori-chat-textarea",{"memori-chat-textarea--expanded":u,"memori-chat-textarea--disabled":e}),children:(0,s.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,s.jsx)("textarea",{className:"memori-chat-textarea--input",disabled:e,value:n,onChange:e=>{r(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&i&&i(e)},onFocus:o,onBlur:a}),(0,s.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,s.jsx)(Na,{className:t(vs)("memori-chat-textarea--expand-button"),onClick:()=>d(!u),padded:!1,ghost:!0,title:u?l("collapse")||"Collapse":l("expand")||"Expand",icon:u?(0,s.jsx)(em,{}):(0,s.jsx)(Zf,{})})})]})})};var nm=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});c=o("85Hg2");var rm=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});var im=({listening:e,stopAudio:n,startListening:r,stopListening:i})=>{const{t:o}=ge(),[a,l]=(0,c.useState)(),u=(0,c.useRef)(null),d=e=>{e.preventDefault(),l(o("write_and_speak.holdToSpeak")||"Hold to record"),u.current||(u.current=setTimeout((()=>{n(),l(o("write_and_speak.releaseToEndListening")||"Release to end listening"),r()}),300))},p=()=>{u.current&&(clearTimeout(u.current),u.current=null),i(),l(void 0)};return(0,c.useEffect)((()=>()=>p()),[]),(0,s.jsx)(Ad,{visible:!!a,content:(0,s.jsx)("span",{children:a||o("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,s.jsx)(Na,{primary:!0,className:t(vs)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":e}),title:e?o("write_and_speak.micButtonPopoverListening")||"Listening":o("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:d,onTouchStart:d,onMouseUp:p,onMouseLeave:p,onTouchEnd:p,shape:"circle",icon:(0,s.jsx)(rm,{})})})};var om=({dialogState:e,sendOnEnter:n="click",setSendOnEnter:r,userMessage:i="",onChangeUserMessage:o,sendMessage:a,onTextareaFocus:l,onTextareaBlur:c,onTextareaPressEnter:u,showMicrophone:d=!1,microphoneMode:p="HOLD_TO_TALK",listening:h=!1,stopAudio:f,startListening:m,stopListening:g})=>{const{t:v}=ge();return(0,s.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state),children:[(0,s.jsx)($f,{sendOnEnter:n,setSendOnEnter:r}),(0,s.jsx)(tm,{value:i,onChange:o,onPressEnter:u,onFocus:l,onBlur:c,disabled:["R2","R3","R4","R5","G3","X3"].includes((null==e?void 0:e.state)||"")}),(0,s.jsx)(Na,{shape:"circle",primary:!!(null==i?void 0:i.length),disabled:!i||0===i.length,className:"memori-chat-inputs--send",onClick:()=>{a(i),f(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:v("send")||"Send",icon:(0,s.jsx)(nm,{})}),d&&"HOLD_TO_TALK"===p&&(0,s.jsx)(im,{listening:h,startListening:m,stopListening:()=>{g(),(null==i?void 0:i.length)&&a(i)},stopAudio:f}),d&&"CONTINUOUS"===p&&(0,s.jsx)(Na,{primary:!0,className:t(vs)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":h}),title:h?v("write_and_speak.micButtonPopoverListening")||"Listening":v("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{h?g():(f(),m())},shape:"circle",icon:(0,s.jsx)(rm,{})})]})};c=o("85Hg2");const sm={en:[{delayAfter:3,text:"Generating an accurate and fancy response..."},{delayAfter:3,text:"Generating a response that will blow your mind..."},{delayAfter:3,text:"Generating a response that will make you smile..."},{delayAfter:3,text:"Thinking of a response..."},{delayAfter:3,text:"Thinking of a response that will make you smile..."},{delayAfter:3,text:"Gathering my thoughts..."},{delayAfter:3,text:"Gathering my thoughts to give you a response..."}],it:[{delayAfter:3,text:"Sto generando una risposta accurata e fantasiosa..."},{delayAfter:3,text:"Sto generando una risposta che ti farà impazzire..."},{delayAfter:3,text:"Sto generando una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto pensando ad una risposta..."},{delayAfter:3,text:"Sto pensando ad una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri per darti una risposta..."}]},am=(e=3)=>new Array(20*e).fill(" ").join("");var lm=({useDefaultSentences:e=!1,lang:t="en",sentence:n,sentences:r})=>{var i;const[o,a]=(0,c.useState)(0),[l,u]=(0,c.useState)((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)?`${r[t][0].text.endsWith("...")||!r[t][0].text.length?r[t][0].text:`${r[t][0].text}...`}${am(r[t][0].delayAfter)}`:n?`${n.endsWith("...")||!n.length?n:`${n}...`}${am()}`:""),[d,p]=(0,c.useState)("");return(0,c.useEffect)((()=>{const i=setInterval((()=>{var i;const s=l[d.length];if(void 0!==s&&l.length>0)p((e=>e+s));else if((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)&&o<r[t].length-1){const e=o+1,n=r[t][e];u(`${n.text.endsWith("...")||!n.text.length?n.text:`${n.text}...`}${am(n.delayAfter)}`),p(""),a(e)}else if(!r&&!n&&e){const e=sm[t][Math.floor(Math.random()*sm[t].length)];u(`${e.text}${am(e.delayAfter)}`),p("")}}),50);return()=>clearInterval(i)})),(0,s.jsx)("div",{className:"memori-chat--bubble",children:(0,s.jsxs)("div",{className:"memori-chat--bubble-typing",children:[(0,s.jsxs)("div",{id:"wave",children:[(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"})]}),l.length>0&&(0,s.jsx)("p",{children:d})]})})};var cm=(0,c.memo)((({memori:e,tenant:n,sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,memoriTyping:l,typingText:u,showTypingText:d=!1,history:p=[],authToken:h,dialogState:f,simulateUserPrompt:m,showDates:g=!1,showContextPerLine:v=!1,showAIicon:y=!0,selectReceiverTag:b,preview:S=!1,instruct:x=!1,showInputs:w=!0,showMicrophone:C=!1,microphoneMode:A="HOLD_TO_TALK",sendOnEnter:E,setSendOnEnter:M,attachmentsMenuOpen:_,setAttachmentsMenuOpen:T,userMessage:I="",onChangeUserMessage:R,sendMessage:P,listening:k,isPlayingAudio:O,stopAudio:N,startListening:L,stopListening:D,resetTranscript:B,customMediaRenderer:z,user:F,userAvatar:U,experts:j})=>{var H,V,G,W,q,K,J,Q;const Y=()=>{setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),200)};(0,c.useEffect)((()=>{!S&&Y()}),[p,S]);return(0,s.jsxs)("div",{className:t(vs)("memori-chat--wrapper",{"memori-chat-wrapper--translate":a}),id:"chat-wrapper",lang:null==a?void 0:a.toUpperCase(),"data-memori-lang":null!==(W=null===(G=null===(V=null===(H=e.culture)||void 0===H?void 0:H.split("-"))||void 0===V?void 0:V[0])||void 0===G?void 0:G.toUpperCase())&&void 0!==W?W:"EN",children:[(0,s.jsx)("div",{className:t(vs)("memori-chat--history",{"memori-chat--history-touch":gd()}),children:(0,s.jsxs)("div",{className:t(vs)("memori-chat--content",{"memori-chat--content-touch":gd()}),children:[(0,s.jsx)("div",{className:t(vs)("memori-chat--cover"),style:{backgroundImage:`url("${xd({type:"cover",tenantID:null==n?void 0:n.id,resourceURI:e.coverURL,baseURL:i,apiURL:o})}"), url("${xd({type:"cover",tenantID:null==n?void 0:n.id,baseURL:i||"https://app.twincreator.com",apiURL:o})}")`}}),p.map(((l,u)=>{var d,h,b,S;return(0,s.jsxs)(t(c).Fragment,{children:[(0,s.jsx)(Zd,{isFirst:0===u,message:l,memori:e,tenant:n,baseUrl:i,apiUrl:o,simulateUserPrompt:m,showAIicon:y,showFeedback:u===p.length-1&&!l.fromUser&&(null==f?void 0:f.acceptsFeedback),user:F,userAvatar:U,experts:j}),g&&!!l.timestamp&&(0,s.jsx)("small",{className:"memori-chat--timestamp "+(l.fromUser?"text-right":"text-left"),children:new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(l.timestamp.endsWith("Z")?l.timestamp:`${l.timestamp}Z`))}),v&&!!Object.keys(null!==(d=l.contextVars)&&void 0!==d?d:{}).length&&(0,s.jsx)("div",{className:"memori-chat--context-vars",children:Object.keys(null!==(h=l.contextVars)&&void 0!==h?h:{}).map((e=>{var t,n,r;return"-"===(null===(t=l.contextVars)||void 0===t?void 0:t[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):"✔️"===(null===(n=l.contextVars)||void 0===n?void 0:n[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsxs)("span",{className:"memori-chat--context-tag-text",children:[e,": ",null===(r=l.contextVars)||void 0===r?void 0:r[e]]})},e)}))}),(0,s.jsx)(Pf,{simulateUserPrompt:m,media:null===(b=null==l?void 0:l.media)||void 0===b?void 0:b.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(S=null==l?void 0:l.media)||void 0===S?void 0:S.filter((e=>"text/html"===e.mimeType)),sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,customMediaRenderer:z})]},u)})),(null==f?void 0:f.hints)&&f.hints.length>0&&(0,s.jsx)(Pf,{simulateUserPrompt:m,hints:f.translatedHints?f.translatedHints:f.hints.map((e=>({text:e,originalText:e})))}),!!l&&(0,s.jsx)(lm,{useDefaultSentences:d,lang:a?"it"===a.toLowerCase()?"it":"en":"it"===(null===(J=null===(K=null===(q=e.culture)||void 0===q?void 0:q.split("-"))||void 0===K?void 0:K[0])||void 0===J?void 0:J.toLowerCase())?"it":"en",sentence:u,sentences:e.enableBoardOfExperts?dp:void 0},u),(0,s.jsx)("div",{id:"end-messages-ref"})]})}),"X3"===(null==f?void 0:f.state)&&r&&(0,s.jsx)("div",{className:"memori-chat--known-tags",children:Object.keys(null!==(Q=f.knownTags)&&void 0!==Q?Q:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return(0,s.jsx)(Na,{icon:(0,s.jsx)("span",{className:"memori-chat--known-tag-icon",children:e}),className:"memori-chat--known-tag",onClick:()=>b(e),children:null===(t=f.knownTags)||void 0===t?void 0:t[e]},e)}))}),w&&(0,s.jsx)(om,{userMessage:I,onChangeUserMessage:R,dialogState:f,instruct:x,authToken:h,sendMessage:P,microphoneMode:A,sendOnEnter:E,setSendOnEnter:M,attachmentsMenuOpen:_,setAttachmentsMenuOpen:T,onTextareaPressEnter:()=>{"keypress"===E&&(null==I?void 0:I.length)>0&&(D(),P(I),R(""),B())},onTextareaFocus:()=>{var e,t,n,r;D(),gd()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),null===(r=null===(n=document.querySelector(".memori.memori-widget"))||void 0===n?void 0:n.classList)||void 0===r||r.add("chat-focused"),setTimeout((()=>{Y()}),300))},onTextareaBlur:()=>{var e,t,n,r,i;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),null===(i=null===(r=document.querySelector(".memori.memori-widget"))||void 0===r?void 0:r.classList)||void 0===i||i.remove("chat-focused"),Y())},startListening:L,stopListening:D,stopAudio:N,listening:k,isPlayingAudio:O,showMicrophone:C})]})}));c=o("85Hg2");var um=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),(0,s.jsx)("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"})]});var dm=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"})});var pm=({memoriName:e,blockedUntil:t,showGiverInfo:n=!1,showTitle:r=!1,marginLeft:i=!1})=>{const{t:o}=ge(),a=new Date(t);return a>new Date?(0,s.jsx)(Ad,{className:"blocked-memori-badge--tooltip",content:(0,s.jsxs)(s.Fragment,{children:[!n&&o("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&o("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&` ${o("memoriBlockedReasonExceedChats")}`,n&&(0,s.jsx)("br",{}),n&&`\n${o("memoriBlockedGiverHelper")}`]}),children:(0,s.jsxs)("div",{className:"blocked-memori-badge--wrapper",children:[(0,s.jsx)("div",{className:"blocked-memori-badge "+(i?" margin-left":""),children:(0,s.jsx)(dm,{className:"blocked-memori-badge--icon"})}),r&&(0,s.jsx)("span",{className:"blocked-memori-badge--title",children:o("memoriBlockedTitle")})]})}):null};var hm=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",width:"20",height:"16",viewBox:"0 0 640 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M211.2 96a64 64 0 10-128 0 64 64 0 10128 0zM32 256c0 17.7 14.3 32 32 32h85.6c10.1-39.4 38.6-71.5 75.8-86.6-9.7-6-21.2-9.4-33.4-9.4H96c-35.3 0-64 28.7-64 64zm461.6 32H576c17.7 0 32-14.3 32-32 0-35.3-28.7-64-64-64h-96c-11.7 0-22.7 3.1-32.1 8.6 38.1 14.8 67.4 47.3 77.7 87.4zm-102.4-61.6c-6.9-1.6-14.2-2.4-21.6-2.4h-96c-8.5 0-16.7 1.1-24.5 3.1-30.8 8.1-55.6 31.1-66.1 60.9-3.5 10-5.5 20.8-5.5 32 0 17.7 14.3 32 32 32h224c17.7 0 32-14.3 32-32 0-11.2-1.9-22-5.5-32-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 10-128 0 64 64 0 10128 0zm-241.6 96a80 80 0 100-160 80 80 0 100 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32h576c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"})});var fm=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",width:"20",height:"20",viewBox:"0 0 48 48",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M30.106 48v-2.745a2.213 2.213 0 012.213-2.212h6.11a2.392 2.392 0 002.326-2.466v-3.223a1.834 1.834 0 01.459-1.145 2.912 2.912 0 00.712-1.926l-.007-.667a1.016 1.016 0 01.651-.952h1.067a1.363 1.363 0 001.051-.456 1.304 1.304 0 00.19-1.395 67.032 67.032 0 01-3.037-7.51 4.767 4.767 0 01-.217-1.507l-.002-4.994a14.513 14.513 0 00-.552-3.963l-.006-.022a13.959 13.959 0 00-3.137-5.702q-.479-.516-1.006-1.003a17.67 17.67 0 00-.677-.623A18.303 18.303 0 0024.194 1a19.617 19.617 0 00-12.539 4.489 17.555 17.555 0 00-3.945 21.69C9.945 31.507 11.694 38.622 12.14 46v2",strokeMiterlimit:10}),(0,s.jsx)("path",{d:"M27.917 12L31.417 12"}),(0,s.jsx)("path",{d:"M27.917 26L31.417 26"}),(0,s.jsx)("path",{d:"M29.667 12L29.667 26"}),(0,s.jsx)("path",{d:"M23.992 26L19.904 12 19.226 12 15.159 26"}),(0,s.jsx)("path",{d:"M16.854 21.133L22.276 21.133"})]});c=o("85Hg2");var mm=({forceStatus:e,provider:t})=>{var n;const{t:r}=ge(),[i,o]=(0,c.useState)(null!=e?e:"none"),a=(e=>{switch(e){case"DEFAULT":case"OpenAI":return{getStatus:async()=>{var e;const t=await fetch("https://status.openai.com/api/v2/summary.json");return null!==(e=(await t.json()).status.indicator)&&void 0!==e?e:"none"},statusPage:"https://status.openai.com/"};default:return{getStatus:async()=>"none",statusPage:""}}})(t);return(0,c.useEffect)((()=>{e||a.getStatus().then((e=>o(e)))}),[e,t]),"none"!==i?(0,s.jsx)(Ad,{className:"memori--completion-provider-status--tooltip",align:"topLeft",content:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:r("completionProviderDown",{provider:null!=t?t:r("completionProviderFallbackName")})}),!!(null===(n=a.statusPage)||void 0===n?void 0:n.length)&&(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:a.statusPage,rel:"noopener noreferrer",target:"_blank",children:r("completionProviderCheckStatusPage")})})]}),children:(0,s.jsx)(dm,{className:"memori--completion-provider-status--icon"})}):null};var gm=({memori:e,tenant:t,gamificationLevel:n,language:r,userLang:i,setUserLang:o,baseUrl:a,apiUrl:l,position:u,openPositionDrawer:d,integrationConfig:p,instruct:h=!1,clickedStart:f,onClickStart:m,initializeTTS:g,_TEST_forceProviderStatus:v,isUserLoggedIn:y=!1})=>{var b,S;const{t:x,i18n:w}=ge(),[C,A]=(0,c.useState)(e.description),[E,M]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{var t,n,i,o,s,l;(null!==(n=null===(t=w.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(i=null==r?void 0:r.toUpperCase())&&void 0!==i?i:"IT")&&(null===(o=e.description)||void 0===o?void 0:o.length)&&ap(e.description,null!==(l=null===(s=w.language)||void 0===s?void 0:s.toUpperCase())&&void 0!==l?l:"IT",r,a).then((e=>{A(e.text)})).catch(console.error)}),[w.language,r,e.description,a]),(0,s.jsxs)("div",{className:"memori--start-panel",children:[(0,s.jsxs)("div",{className:"memori--cover",style:{backgroundImage:`url("${xd({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:a,apiURL:l})}"), url("${xd({type:"cover",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})}")`},children:[!!(null===(b=null==n?void 0:n.badge)||void 0===b?void 0:b.length)&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--gamification-badge",children:(0,s.jsx)(Ad,{align:"left",content:`${x("gamification.level")} ${n.badge}, ${n.points} ${x("gamification.points")}`,children:(0,s.jsx)("span",{"aria-label":`${x("gamification.level")} ${n.badge}, ${n.points} ${x("gamification.points")}`,children:n.badge})})}),!!e.enableCompletions&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--completions-enabled",children:(0,s.jsx)(Ad,{align:"left",content:x("completionsEnabled"),children:(0,s.jsx)("span",{"aria-label":x("completionsEnabled")||"Completions",children:(0,s.jsx)(Cd,{})})})}),!!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--board-of-experts",children:(0,s.jsx)(Ad,{align:"left",content:x("boardOfExperts"),children:(0,s.jsx)("span",{"aria-label":x("boardOfExperts")||"Board of Experts",children:(0,s.jsx)(hm,{})})})}),!!e.nsfw&&(0,s.jsx)("div",{className:"memori--nsfw",children:(0,s.jsx)(Ad,{align:"left",content:x("nsfw"),children:(0,s.jsx)("span",{title:x("nsfw")||"NSFW",children:"🔞"})})})]}),(0,s.jsxs)("picture",{className:"memori--avatar",children:[(0,s.jsx)("source",{src:null!==(S=e.avatarURL)&&void 0!==S?S:xd({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l})}),(0,s.jsx)("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?xd({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l}):xd({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})})]}),(0,s.jsx)("h2",{className:"memori--title",children:e.name}),e.needsPosition&&!u&&(0,s.jsxs)("div",{className:"memori--needsPosition",children:[(0,s.jsx)("p",{children:x("write_and_speak.requirePosition")}),(0,s.jsx)(Na,{primary:!0,onClick:()=>d(),className:"memori--start-button",children:x("widget.position")})]}),(e.needsPosition&&u||!e.needsPosition)&&(0,s.jsxs)("div",{className:"memori--description",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"memori--description-text",children:C&&E?C:e.description}),C!==e.description&&(0,s.jsx)(Na,{ghost:!0,className:"memori--translation-toggle",icon:(0,s.jsx)(um,{}),onClick:()=>{M((e=>!e))},children:x(E?"showOriginalText":"showTranslatedText")})]}),(null==p?void 0:p.multilanguage)&&!h&&(0,s.jsxs)("div",{className:"memori--language-chooser",children:[(0,s.jsx)("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref",children:x("write_and_speak.iWantToTalkToIn",{name:e.name})}),(0,s.jsx)("select",{id:"user-lang-pref",className:"memori-select--button",value:(null!=i?i:w.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{o(e.target.value)},children:lp.map((e=>(0,s.jsx)("option",{value:e.value,"aria-label":e.label,children:e.label},e.value)))})]}),(0,s.jsx)(Na,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver,loading:f,onClick:e=>{try{window.speechSynthesis.speak(new SpeechSynthesisUtterance(""))}catch(e){console.error(e)}g&&g(),m&&m()},className:"memori--start-button",children:x("write_and_speak."+(h?"instructButton":"tryMeButton"))}),(0,s.jsx)(mm,{provider:e.completionProvider,forceStatus:v}),(0,s.jsx)("p",{className:"memori--start-description",children:x(h?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")}),!!e.blockedUntil&&(0,s.jsx)(pm,{memoriName:e.name,blockedUntil:e.blockedUntil,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0}),!!e.enableDeepThought&&!h&&!!y&&(0,s.jsxs)("div",{className:"memori--deep-thought-disclaimer",children:[(0,s.jsx)(Ad,{align:"left",content:x("deepThoughtHelper"),children:(0,s.jsx)(fm,{})}),(0,s.jsx)("h2",{children:x("deepThoughtDisclaimerTitle")}),(0,s.jsx)("p",{children:x("deepThoughtDisclaimer")}),(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:"https://app.twincreator.com/en/privacy_and_cookie",target:"_blank",rel:"noopener noreferrer",children:"Privacy policy"})})]})]})]})},vm=(c=o("85Hg2"),c=o("85Hg2"),q=o("hcaHr"),c=o("85Hg2"),["forwardedRef"]);function ym(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bm(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?ym(Object(r),!0).forEach((function(n){t(K)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ym(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class Sm extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,s.jsxs)("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"},children:[(0,s.jsx)("h2",{children:this.props.t("error.generic")}),(0,s.jsx)(Na,{primary:!0,onClick:()=>this.setState({hasError:!1}),children:this.props.t("error.tryAgain")||"Try again"})]}):this.props.children}}var xm=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,s=t(Tp)(i,vm),a=ge(e,bm(bm({},s),{},{keyPrefix:n.keyPrefix})),l=t(q)(a,3),u=l[0],d=l[1],p=l[2],h=bm(bm({},s),{},{t:u,i18n:d,tReady:p});return n.withRef&&o?h.ref=o:!n.withRef&&o&&(h.forwardedRef=o),(0,c.createElement)(r,h)}i.displayName="withI18nextTranslation(".concat(pe(r),")"),i.WrappedComponent=r;return n.withRef?(0,c.forwardRef)((function(e,t){return(0,c.createElement)(i,Object.assign({},e,{forwardedRef:t}))})):i}}(["common"])(Sm),wm=(c=o("85Hg2"),c=o("85Hg2"),{});e(wm,"REVISION",(()=>Cm)),e(wm,"MOUSE",(()=>Am)),e(wm,"TOUCH",(()=>Em)),e(wm,"CullFaceNone",(()=>Mm)),e(wm,"CullFaceBack",(()=>_m)),e(wm,"CullFaceFront",(()=>Tm)),e(wm,"CullFaceFrontBack",(()=>Im)),e(wm,"BasicShadowMap",(()=>Rm)),e(wm,"PCFShadowMap",(()=>Pm)),e(wm,"PCFSoftShadowMap",(()=>km)),e(wm,"VSMShadowMap",(()=>Om)),e(wm,"FrontSide",(()=>Nm)),e(wm,"BackSide",(()=>Lm)),e(wm,"DoubleSide",(()=>Dm)),e(wm,"NoBlending",(()=>Bm)),e(wm,"NormalBlending",(()=>zm)),e(wm,"AdditiveBlending",(()=>Fm)),e(wm,"SubtractiveBlending",(()=>Um)),e(wm,"MultiplyBlending",(()=>jm)),e(wm,"CustomBlending",(()=>Hm)),e(wm,"AddEquation",(()=>Vm)),e(wm,"SubtractEquation",(()=>Gm)),e(wm,"ReverseSubtractEquation",(()=>Wm)),e(wm,"MinEquation",(()=>qm)),e(wm,"MaxEquation",(()=>Km)),e(wm,"ZeroFactor",(()=>Jm)),e(wm,"OneFactor",(()=>Qm)),e(wm,"SrcColorFactor",(()=>Ym)),e(wm,"OneMinusSrcColorFactor",(()=>Xm)),e(wm,"SrcAlphaFactor",(()=>$m)),e(wm,"OneMinusSrcAlphaFactor",(()=>Zm)),e(wm,"DstAlphaFactor",(()=>eg)),e(wm,"OneMinusDstAlphaFactor",(()=>tg)),e(wm,"DstColorFactor",(()=>ng)),e(wm,"OneMinusDstColorFactor",(()=>rg)),e(wm,"SrcAlphaSaturateFactor",(()=>ig)),e(wm,"NeverDepth",(()=>og)),e(wm,"AlwaysDepth",(()=>sg)),e(wm,"LessDepth",(()=>ag)),e(wm,"LessEqualDepth",(()=>lg)),e(wm,"EqualDepth",(()=>cg)),e(wm,"GreaterEqualDepth",(()=>ug)),e(wm,"GreaterDepth",(()=>dg)),e(wm,"NotEqualDepth",(()=>pg)),e(wm,"MultiplyOperation",(()=>hg)),e(wm,"MixOperation",(()=>fg)),e(wm,"AddOperation",(()=>mg)),e(wm,"NoToneMapping",(()=>gg)),e(wm,"LinearToneMapping",(()=>vg)),e(wm,"ReinhardToneMapping",(()=>yg)),e(wm,"CineonToneMapping",(()=>bg)),e(wm,"ACESFilmicToneMapping",(()=>Sg)),e(wm,"CustomToneMapping",(()=>xg)),e(wm,"UVMapping",(()=>wg)),e(wm,"CubeReflectionMapping",(()=>Cg)),e(wm,"CubeRefractionMapping",(()=>Ag)),e(wm,"EquirectangularReflectionMapping",(()=>Eg)),e(wm,"EquirectangularRefractionMapping",(()=>Mg)),e(wm,"CubeUVReflectionMapping",(()=>_g)),e(wm,"RepeatWrapping",(()=>Tg)),e(wm,"ClampToEdgeWrapping",(()=>Ig)),e(wm,"MirroredRepeatWrapping",(()=>Rg)),e(wm,"NearestFilter",(()=>Pg)),e(wm,"NearestMipmapNearestFilter",(()=>kg)),e(wm,"NearestMipMapNearestFilter",(()=>Og)),e(wm,"NearestMipmapLinearFilter",(()=>Ng)),e(wm,"NearestMipMapLinearFilter",(()=>Lg)),e(wm,"LinearFilter",(()=>Dg)),e(wm,"LinearMipmapNearestFilter",(()=>Bg)),e(wm,"LinearMipMapNearestFilter",(()=>zg)),e(wm,"LinearMipmapLinearFilter",(()=>Fg)),e(wm,"LinearMipMapLinearFilter",(()=>Ug)),e(wm,"UnsignedByteType",(()=>jg)),e(wm,"ByteType",(()=>Hg)),e(wm,"ShortType",(()=>Vg)),e(wm,"UnsignedShortType",(()=>Gg)),e(wm,"IntType",(()=>Wg)),e(wm,"UnsignedIntType",(()=>qg)),e(wm,"FloatType",(()=>Kg)),e(wm,"HalfFloatType",(()=>Jg)),e(wm,"UnsignedShort4444Type",(()=>Qg)),e(wm,"UnsignedShort5551Type",(()=>Yg)),e(wm,"UnsignedInt248Type",(()=>Xg)),e(wm,"AlphaFormat",(()=>$g)),e(wm,"RGBFormat",(()=>Zg)),e(wm,"RGBAFormat",(()=>ev)),e(wm,"LuminanceFormat",(()=>tv)),e(wm,"LuminanceAlphaFormat",(()=>nv)),e(wm,"DepthFormat",(()=>rv)),e(wm,"DepthStencilFormat",(()=>iv)),e(wm,"RedFormat",(()=>ov)),e(wm,"RedIntegerFormat",(()=>sv)),e(wm,"RGFormat",(()=>av)),e(wm,"RGIntegerFormat",(()=>lv)),e(wm,"RGBAIntegerFormat",(()=>cv)),e(wm,"RGB_S3TC_DXT1_Format",(()=>uv)),e(wm,"RGBA_S3TC_DXT1_Format",(()=>dv)),e(wm,"RGBA_S3TC_DXT3_Format",(()=>pv)),e(wm,"RGBA_S3TC_DXT5_Format",(()=>hv)),e(wm,"RGB_PVRTC_4BPPV1_Format",(()=>fv)),e(wm,"RGB_PVRTC_2BPPV1_Format",(()=>mv)),e(wm,"RGBA_PVRTC_4BPPV1_Format",(()=>gv)),e(wm,"RGBA_PVRTC_2BPPV1_Format",(()=>vv)),e(wm,"RGB_ETC1_Format",(()=>yv)),e(wm,"RGB_ETC2_Format",(()=>bv)),e(wm,"RGBA_ETC2_EAC_Format",(()=>Sv)),e(wm,"RGBA_ASTC_4x4_Format",(()=>xv)),e(wm,"RGBA_ASTC_5x4_Format",(()=>wv)),e(wm,"RGBA_ASTC_5x5_Format",(()=>Cv)),e(wm,"RGBA_ASTC_6x5_Format",(()=>Av)),e(wm,"RGBA_ASTC_6x6_Format",(()=>Ev)),e(wm,"RGBA_ASTC_8x5_Format",(()=>Mv)),e(wm,"RGBA_ASTC_8x6_Format",(()=>_v)),e(wm,"RGBA_ASTC_8x8_Format",(()=>Tv)),e(wm,"RGBA_ASTC_10x5_Format",(()=>Iv)),e(wm,"RGBA_ASTC_10x6_Format",(()=>Rv)),e(wm,"RGBA_ASTC_10x8_Format",(()=>Pv)),e(wm,"RGBA_ASTC_10x10_Format",(()=>kv)),e(wm,"RGBA_ASTC_12x10_Format",(()=>Ov)),e(wm,"RGBA_ASTC_12x12_Format",(()=>Nv)),e(wm,"RGBA_BPTC_Format",(()=>Lv)),e(wm,"LoopOnce",(()=>Dv)),e(wm,"LoopRepeat",(()=>Bv)),e(wm,"LoopPingPong",(()=>zv)),e(wm,"InterpolateDiscrete",(()=>Fv)),e(wm,"InterpolateLinear",(()=>Uv)),e(wm,"InterpolateSmooth",(()=>jv)),e(wm,"ZeroCurvatureEnding",(()=>Hv)),e(wm,"ZeroSlopeEnding",(()=>Vv)),e(wm,"WrapAroundEnding",(()=>Gv)),e(wm,"NormalAnimationBlendMode",(()=>Wv)),e(wm,"AdditiveAnimationBlendMode",(()=>qv)),e(wm,"TrianglesDrawMode",(()=>Kv)),e(wm,"TriangleStripDrawMode",(()=>Jv)),e(wm,"TriangleFanDrawMode",(()=>Qv)),e(wm,"LinearEncoding",(()=>Yv)),e(wm,"sRGBEncoding",(()=>Xv)),e(wm,"BasicDepthPacking",(()=>$v)),e(wm,"RGBADepthPacking",(()=>Zv)),e(wm,"TangentSpaceNormalMap",(()=>ey)),e(wm,"ObjectSpaceNormalMap",(()=>ty)),e(wm,"NoColorSpace",(()=>ny)),e(wm,"SRGBColorSpace",(()=>ry)),e(wm,"LinearSRGBColorSpace",(()=>iy)),e(wm,"ZeroStencilOp",(()=>oy)),e(wm,"KeepStencilOp",(()=>sy)),e(wm,"ReplaceStencilOp",(()=>ay)),e(wm,"IncrementStencilOp",(()=>ly)),e(wm,"DecrementStencilOp",(()=>cy)),e(wm,"IncrementWrapStencilOp",(()=>uy)),e(wm,"DecrementWrapStencilOp",(()=>dy)),e(wm,"InvertStencilOp",(()=>py)),e(wm,"NeverStencilFunc",(()=>hy)),e(wm,"LessStencilFunc",(()=>fy)),e(wm,"EqualStencilFunc",(()=>my)),e(wm,"LessEqualStencilFunc",(()=>gy)),e(wm,"GreaterStencilFunc",(()=>vy)),e(wm,"NotEqualStencilFunc",(()=>yy)),e(wm,"GreaterEqualStencilFunc",(()=>by)),e(wm,"AlwaysStencilFunc",(()=>Sy)),e(wm,"StaticDrawUsage",(()=>xy)),e(wm,"DynamicDrawUsage",(()=>wy)),e(wm,"StreamDrawUsage",(()=>Cy)),e(wm,"StaticReadUsage",(()=>Ay)),e(wm,"DynamicReadUsage",(()=>Ey)),e(wm,"StreamReadUsage",(()=>My)),e(wm,"StaticCopyUsage",(()=>_y)),e(wm,"DynamicCopyUsage",(()=>Ty)),e(wm,"StreamCopyUsage",(()=>Iy)),e(wm,"GLSL1",(()=>Ry)),e(wm,"GLSL3",(()=>Py)),e(wm,"_SRGBAFormat",(()=>ky)),e(wm,"EventDispatcher",(()=>Oy)),e(wm,"MathUtils",(()=>Ky)),e(wm,"Vector2",(()=>Jy)),e(wm,"Matrix3",(()=>Qy)),e(wm,"ColorManagement",(()=>rb)),e(wm,"Color",(()=>ub)),e(wm,"ImageUtils",(()=>pb)),e(wm,"Source",(()=>hb)),e(wm,"Texture",(()=>gb)),e(wm,"Vector4",(()=>vb)),e(wm,"WebGLRenderTarget",(()=>yb)),e(wm,"DataArrayTexture",(()=>bb)),e(wm,"WebGLArrayRenderTarget",(()=>Sb)),e(wm,"Data3DTexture",(()=>xb)),e(wm,"WebGL3DRenderTarget",(()=>wb)),e(wm,"WebGLMultipleRenderTargets",(()=>Cb)),e(wm,"Quaternion",(()=>Ab)),e(wm,"Vector3",(()=>Eb)),e(wm,"Box3",(()=>Tb)),e(wm,"Sphere",(()=>Kb)),e(wm,"Ray",(()=>tS)),e(wm,"Matrix4",(()=>nS)),e(wm,"Euler",(()=>pS)),e(wm,"Layers",(()=>hS)),e(wm,"Object3D",(()=>_S)),e(wm,"Triangle",(()=>zS)),e(wm,"Material",(()=>US)),e(wm,"MeshBasicMaterial",(()=>jS)),e(wm,"BufferAttribute",(()=>GS)),e(wm,"Int8BufferAttribute",(()=>WS)),e(wm,"Uint8BufferAttribute",(()=>qS)),e(wm,"Uint8ClampedBufferAttribute",(()=>KS)),e(wm,"Int16BufferAttribute",(()=>JS)),e(wm,"Uint16BufferAttribute",(()=>QS)),e(wm,"Int32BufferAttribute",(()=>YS)),e(wm,"Uint32BufferAttribute",(()=>XS)),e(wm,"Float16BufferAttribute",(()=>$S)),e(wm,"Float32BufferAttribute",(()=>ZS)),e(wm,"Float64BufferAttribute",(()=>ex)),e(wm,"BufferGeometry",(()=>lx)),e(wm,"Mesh",(()=>Mx)),e(wm,"BoxGeometry",(()=>Tx)),e(wm,"UniformsUtils",(()=>Px)),e(wm,"ShaderMaterial",(()=>kx)),e(wm,"Camera",(()=>Ox)),e(wm,"PerspectiveCamera",(()=>Nx)),e(wm,"CubeCamera",(()=>Dx)),e(wm,"CubeTexture",(()=>Bx)),e(wm,"WebGLCubeRenderTarget",(()=>zx)),e(wm,"Plane",(()=>Hx)),e(wm,"Frustum",(()=>Wx)),e(wm,"PlaneGeometry",(()=>Jx)),e(wm,"ShaderChunk",(()=>Qx)),e(wm,"UniformsLib",(()=>Yx)),e(wm,"ShaderLib",(()=>Xx)),e(wm,"OrthographicCamera",(()=>iw)),e(wm,"PMREMGenerator",(()=>hw)),e(wm,"MeshDepthMaterial",(()=>cA)),e(wm,"MeshDistanceMaterial",(()=>uA)),e(wm,"WebGLUtils",(()=>fA)),e(wm,"ArrayCamera",(()=>mA)),e(wm,"Group",(()=>gA)),e(wm,"DepthTexture",(()=>bA)),e(wm,"WebGLRenderer",(()=>CA)),e(wm,"WebGL1Renderer",(()=>AA)),e(wm,"FogExp2",(()=>EA)),e(wm,"Fog",(()=>MA)),e(wm,"Scene",(()=>_A)),e(wm,"InterleavedBuffer",(()=>TA)),e(wm,"InterleavedBufferAttribute",(()=>RA)),e(wm,"SpriteMaterial",(()=>PA)),e(wm,"Sprite",(()=>WA)),e(wm,"LOD",(()=>QA)),e(wm,"SkinnedMesh",(()=>tE)),e(wm,"Bone",(()=>nE)),e(wm,"DataTexture",(()=>rE)),e(wm,"Skeleton",(()=>sE)),e(wm,"InstancedBufferAttribute",(()=>aE)),e(wm,"InstancedMesh",(()=>pE)),e(wm,"LineBasicMaterial",(()=>hE)),e(wm,"Line",(()=>bE)),e(wm,"LineSegments",(()=>wE)),e(wm,"LineLoop",(()=>CE)),e(wm,"PointsMaterial",(()=>AE)),e(wm,"Points",(()=>IE)),e(wm,"VideoTexture",(()=>PE)),e(wm,"FramebufferTexture",(()=>kE)),e(wm,"CompressedTexture",(()=>OE)),e(wm,"CanvasTexture",(()=>NE)),e(wm,"Curve",(()=>LE)),e(wm,"EllipseCurve",(()=>DE)),e(wm,"ArcCurve",(()=>BE)),e(wm,"CatmullRomCurve3",(()=>VE)),e(wm,"CubicBezierCurve",(()=>KE)),e(wm,"CubicBezierCurve3",(()=>JE)),e(wm,"LineCurve",(()=>QE)),e(wm,"LineCurve3",(()=>YE)),e(wm,"QuadraticBezierCurve",(()=>XE)),e(wm,"QuadraticBezierCurve3",(()=>$E)),e(wm,"SplineCurve",(()=>ZE)),e(wm,"CurvePath",(()=>tM)),e(wm,"Path",(()=>nM)),e(wm,"LatheGeometry",(()=>rM)),e(wm,"CapsuleGeometry",(()=>iM)),e(wm,"CircleGeometry",(()=>oM)),e(wm,"CylinderGeometry",(()=>sM)),e(wm,"ConeGeometry",(()=>aM)),e(wm,"PolyhedronGeometry",(()=>lM)),e(wm,"DodecahedronGeometry",(()=>cM)),e(wm,"EdgesGeometry",(()=>fM)),e(wm,"Shape",(()=>mM)),e(wm,"ShapeUtils",(()=>jM)),e(wm,"ExtrudeGeometry",(()=>GM)),e(wm,"IcosahedronGeometry",(()=>qM)),e(wm,"OctahedronGeometry",(()=>KM)),e(wm,"RingGeometry",(()=>JM)),e(wm,"ShapeGeometry",(()=>QM)),e(wm,"SphereGeometry",(()=>YM)),e(wm,"TetrahedronGeometry",(()=>XM)),e(wm,"TorusGeometry",(()=>$M)),e(wm,"TorusKnotGeometry",(()=>ZM)),e(wm,"TubeGeometry",(()=>e_)),e(wm,"WireframeGeometry",(()=>t_)),e(wm,"ShadowMaterial",(()=>i_)),e(wm,"RawShaderMaterial",(()=>o_)),e(wm,"MeshStandardMaterial",(()=>s_)),e(wm,"MeshPhysicalMaterial",(()=>a_)),e(wm,"MeshPhongMaterial",(()=>l_)),e(wm,"MeshToonMaterial",(()=>c_)),e(wm,"MeshNormalMaterial",(()=>u_)),e(wm,"MeshLambertMaterial",(()=>d_)),e(wm,"MeshMatcapMaterial",(()=>p_)),e(wm,"LineDashedMaterial",(()=>h_)),e(wm,"AnimationUtils",(()=>S_)),e(wm,"Interpolant",(()=>x_)),e(wm,"CubicInterpolant",(()=>w_)),e(wm,"LinearInterpolant",(()=>C_)),e(wm,"DiscreteInterpolant",(()=>A_)),e(wm,"KeyframeTrack",(()=>E_)),e(wm,"BooleanKeyframeTrack",(()=>M_)),e(wm,"ColorKeyframeTrack",(()=>__)),e(wm,"NumberKeyframeTrack",(()=>T_)),e(wm,"QuaternionLinearInterpolant",(()=>I_)),e(wm,"QuaternionKeyframeTrack",(()=>R_)),e(wm,"StringKeyframeTrack",(()=>P_)),e(wm,"VectorKeyframeTrack",(()=>k_)),e(wm,"AnimationClip",(()=>O_)),e(wm,"Cache",(()=>L_)),e(wm,"LoadingManager",(()=>D_)),e(wm,"DefaultLoadingManager",(()=>B_)),e(wm,"Loader",(()=>z_)),e(wm,"FileLoader",(()=>j_)),e(wm,"AnimationLoader",(()=>H_)),e(wm,"CompressedTextureLoader",(()=>V_)),e(wm,"ImageLoader",(()=>G_)),e(wm,"CubeTextureLoader",(()=>W_)),e(wm,"DataTextureLoader",(()=>q_)),e(wm,"TextureLoader",(()=>K_)),e(wm,"Light",(()=>J_)),e(wm,"HemisphereLight",(()=>Q_)),e(wm,"SpotLight",(()=>tT)),e(wm,"PointLight",(()=>sT)),e(wm,"DirectionalLight",(()=>lT)),e(wm,"AmbientLight",(()=>cT)),e(wm,"RectAreaLight",(()=>uT)),e(wm,"SphericalHarmonics3",(()=>dT)),e(wm,"LightProbe",(()=>pT)),e(wm,"MaterialLoader",(()=>hT)),e(wm,"LoaderUtils",(()=>fT)),e(wm,"InstancedBufferGeometry",(()=>mT)),e(wm,"BufferGeometryLoader",(()=>gT)),e(wm,"ObjectLoader",(()=>vT)),e(wm,"ImageBitmapLoader",(()=>xT)),e(wm,"AudioContext",(()=>CT)),e(wm,"AudioLoader",(()=>AT)),e(wm,"HemisphereLightProbe",(()=>ET)),e(wm,"AmbientLightProbe",(()=>MT)),e(wm,"StereoCamera",(()=>RT)),e(wm,"Clock",(()=>PT)),e(wm,"AudioListener",(()=>BT)),e(wm,"Audio",(()=>zT)),e(wm,"PositionalAudio",(()=>VT)),e(wm,"AudioAnalyser",(()=>GT)),e(wm,"PropertyMixer",(()=>WT)),e(wm,"PropertyBinding",(()=>$T)),e(wm,"AnimationObjectGroup",(()=>ZT)),e(wm,"AnimationMixer",(()=>nI)),e(wm,"Uniform",(()=>rI)),e(wm,"UniformsGroup",(()=>oI)),e(wm,"InstancedInterleavedBuffer",(()=>sI)),e(wm,"GLBufferAttribute",(()=>aI)),e(wm,"Raycaster",(()=>lI)),e(wm,"Spherical",(()=>dI)),e(wm,"Cylindrical",(()=>pI)),e(wm,"Box2",(()=>fI)),e(wm,"Line3",(()=>vI)),e(wm,"SpotLightHelper",(()=>bI)),e(wm,"SkeletonHelper",(()=>CI)),e(wm,"PointLightHelper",(()=>EI)),e(wm,"HemisphereLightHelper",(()=>II)),e(wm,"GridHelper",(()=>RI)),e(wm,"PolarGridHelper",(()=>PI)),e(wm,"DirectionalLightHelper",(()=>LI)),e(wm,"CameraHelper",(()=>zI)),e(wm,"BoxHelper",(()=>jI)),e(wm,"Box3Helper",(()=>HI)),e(wm,"PlaneHelper",(()=>VI)),e(wm,"ArrowHelper",(()=>KI)),e(wm,"AxesHelper",(()=>JI)),e(wm,"ShapePath",(()=>QI)),e(wm,"DataUtils",(()=>$I)),e(wm,"ImmediateRenderObject",(()=>ZI)),e(wm,"WebGLMultisampleRenderTarget",(()=>eR)),e(wm,"DataTexture2DArray",(()=>tR)),e(wm,"DataTexture3D",(()=>nR)),e(wm,"BoxBufferGeometry",(()=>rR)),e(wm,"CapsuleBufferGeometry",(()=>iR)),e(wm,"CircleBufferGeometry",(()=>oR)),e(wm,"ConeBufferGeometry",(()=>sR)),e(wm,"CylinderBufferGeometry",(()=>aR)),e(wm,"DodecahedronBufferGeometry",(()=>lR)),e(wm,"ExtrudeBufferGeometry",(()=>cR)),e(wm,"IcosahedronBufferGeometry",(()=>uR)),e(wm,"LatheBufferGeometry",(()=>dR)),e(wm,"OctahedronBufferGeometry",(()=>pR)),e(wm,"PlaneBufferGeometry",(()=>hR)),e(wm,"PolyhedronBufferGeometry",(()=>fR)),e(wm,"RingBufferGeometry",(()=>mR)),e(wm,"ShapeBufferGeometry",(()=>gR)),e(wm,"SphereBufferGeometry",(()=>vR)),e(wm,"TetrahedronBufferGeometry",(()=>yR)),e(wm,"TorusBufferGeometry",(()=>bR)),e(wm,"TorusKnotBufferGeometry",(()=>SR)),e(wm,"TubeBufferGeometry",(()=>xR));
|
|
236
236
|
/**
|
|
237
237
|
* @license
|
|
238
238
|
* Copyright 2010-2022 Three.js Authors
|
|
@@ -243,4 +243,4 @@ const Cm="144",Am={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Em={ROTATE:0,
|
|
|
243
243
|
* @license qrcode.react
|
|
244
244
|
* Copyright (c) Paul O'Shannessy
|
|
245
245
|
* SPDX-License-Identifier: ISC
|
|
246
|
-
*/function nL(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}function rL(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function iL(e,t,n,r){if(null==r)return null;const i=n?4:0,o=e.length+2*i,s=Math.floor(.1*t),a=o/t,l=(r.width||s)*a,c=(r.height||s)*a,u=null==r.x?e.length/2-l/2:r.x*a,d=null==r.y?e.length/2-c/2:r.y*a;let p=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);p={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:p}}var oL=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function sL(e){const n=e,{value:r,size:i=XN,level:o=$N,bgColor:s=ZN,fgColor:a=eL,includeMargin:l=tL,style:u,imageSettings:d}=n,p=JN(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=null==d?void 0:d.src,f=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let n=QN.QrCode.encodeText(r,YN[o]).getModules();const c=l?4:0,u=n.length+2*c,p=iL(n,i,l,d),h=m.current,g=null!=p&&null!==h&&h.complete&&0!==h.naturalHeight&&0!==h.naturalWidth;g&&null!=p.excavation&&(n=rL(n,p.excavation));const v=window.devicePixelRatio||1;e.height=e.width=i*v;const y=i/u*v;t.scale(y,y),t.fillStyle=s,t.fillRect(0,0,u,u),t.fillStyle=a,oL?t.fill(new Path2D(nL(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(h,p.x+c,p.y+c,p.w,p.h)}})),(0,c.useEffect)((()=>{v(!1)}),[h]);const y=KN({height:i,width:i},u);let b=null;return null!=h&&(b=t(c).createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),t(c).createElement(t(c).Fragment,null,t(c).createElement("canvas",KN({style:y,height:i,width:i,ref:f},p)),b)}var aL=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=ge(),[p,h]=(0,c.useState)(n),f=(0,c.useMemo)((()=>(null==e?void 0:e.theme)?`${null!=o?o:"https://app.twincreator.com"}/images/${e.theme}/square_logo.png`:`${null!=o?o:"https://app.twincreator.com"}/images/memori_logo.png`),[e,o]);(0,c.useEffect)((()=>{n||h(window.location.href)}),[n]);const m=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${p}`,icon:ON},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${p}`,icon:NN},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${p}`,icon:LN},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${p}`,icon:DN},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${p}`,icon:jN},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${p}`,icon:BN}];return(0,s.jsxs)(Wd,{as:"div",className:t(vs)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(Wd.Button,{className:t(vs)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",i,{"memori-button--primary":a}),title:d("widget.share")||void 0,children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(zN,{})})}),(0,s.jsxs)(Wd.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(Wd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Na,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(tp,{}),onClick:()=>{p&&navigator.clipboard.writeText(p)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(Wd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(vs)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(n=e.url)&&void 0!==n?n:"",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(e.icon,{})}),e.title]})},e.id)})),l&&(0,s.jsxs)(Wd.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(sL,{id:"qr-canvas",value:null!=p?p:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:f,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,s.jsx)("div",{children:(0,s.jsx)(Na,{onClick:()=>{const e=document.getElementById("qr-canvas");if(!e)return;const t=document.createElement("a");t.href=e.toDataURL(),t.download=`memori-${r}-share.png`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,s.jsx)(FN,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var lL=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M290 236.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0 0 13.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 0 0 0 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 0 0-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"})});var cL=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",focusable:"false",role:"img",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","aria-label":t,children:[(0,s.jsx)("path",{d:"M23 4L23 10 17 10"}),(0,s.jsx)("path",{d:"M1 20L1 14 7 14"}),(0,s.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]});var uL=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6c-.3 1.5-.4 3-.4 4.4 0 14.4 11.6 26 26 26h723c1.5 0 3-.1 4.4-.4 14.2-2.4 23.7-15.9 21.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"})});var dL=({className:e,memori:n,tenant:r,history:i,position:o,setShowPositionDrawer:a,setShowSettingsDrawer:l,setShowKnownFactsDrawer:u,setShowExpertsDrawer:d,speakerMuted:p,setSpeakerMuted:h,hasUserActivatedSpeak:f=!1,showShare:m=!0,showSettings:g=!0,showSpeaker:v=!0,showReload:y=!1,showClear:b=!1,clearHistory:S,loginToken:x,sessionID:w})=>{const{t:C}=ge(),[A,E]=(0,c.useState)(!1),[M,_]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&E(!0)}),[]),(0,s.jsxs)("div",{className:t(vs)("memori-header",e),children:[y&&(0,s.jsx)(Na,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:C("reload")||"Reload",icon:(0,s.jsx)(cL,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(Na,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:C("clearHistory")||"Clear chat",icon:(0,s.jsx)(uL,{}),onClick:S}),n.needsPosition&&o&&(0,s.jsxs)("div",{className:"memori-header--position",children:[(0,s.jsx)("span",{className:"memori-header--position-placeName",children:o.placeName}),(0,s.jsx)(Na,{icon:(0,s.jsx)(aN,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>a(!0)})]}),A&&(0,s.jsx)(Na,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:M?C("fullscreenExit")||"Exit fullscreen":C("fullscreenEnter")||"Enter fullscreen",icon:M?(0,s.jsx)(em,{}):(0,s.jsx)(lL,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),_(!1)):(document.documentElement.requestFullscreen(),_(!0))}}),n.enableDeepThought&&!!x&&(0,s.jsx)(Na,{primary:!!w&&!!f,shape:"circle",icon:(0,s.jsx)(fm,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!w,onClick:()=>u(!0),title:C("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(Na,{primary:!0,shape:"circle",icon:(0,s.jsx)(hm,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!w,onClick:()=>d(!0),title:C("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(Na,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:p?(0,s.jsx)(lN,{}):(0,s.jsx)(uN,{}),onClick:()=>h(!p),title:C("widget.sound")||"Sound"}),(0,s.jsx)(PN,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(Na,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(kN,{}),onClick:()=>l(!0),title:C("widget.settings")||"Settings"}),m&&(0,s.jsx)(aL,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"})]})};var pL=({tenant:e,userLang:t="en"})=>{const n="memorytwin"===(null==e?void 0:e.theme)?"memorytwin":"twincreator";return(0,s.jsxs)("div",{className:"memori--powered-by",children:[(0,s.jsx)("img",{src:`https://app.twincreator.com/images/${n}/logo.png`,alt:""}),(0,s.jsxs)("p",{children:["Powered by"," ",(0,s.jsx)("a",{href:`https://app.${n}.com/${t?t.toLowerCase():""}`,target:"_blank",rel:"noopener noreferrer",children:"memorytwin"===n?"MemoryTwin":"TwinCreator"})]})]})},hL={};function fL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,o=void 0,"symbol"==typeof(o=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"))?o:String(o)),r)}var i,o}function mL(e,t,n){return t&&fL(e.prototype,t),n&&fL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gL(){return gL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gL.apply(this,arguments)}function vL(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,bL(e,t)}function yL(e){return yL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yL(e)}function bL(e,t){return bL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bL(e,t)}function SL(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function xL(e,t,n){return xL=SL()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&bL(i,n.prototype),i},xL.apply(null,arguments)}function wL(e){var t="function"==typeof Map?new Map:void 0;return wL=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return xL(e,arguments,yL(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),bL(r,e)},wL(e)}function CL(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function AL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EL(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return AL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?AL(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(hL,"__esModule",{value:!0});var ML=function(e){function t(){return e.apply(this,arguments)||this}return vL(t,e),t}(wL(Error)),_L=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return vL(t,e),t}(ML),TL=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return vL(t,e),t}(ML),IL=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return vL(t,e),t}(ML),RL=function(e){function t(){return e.apply(this,arguments)||this}return vL(t,e),t}(ML),PL=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return vL(t,e),t}(ML),kL=function(e){function t(){return e.apply(this,arguments)||this}return vL(t,e),t}(ML),OL=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return vL(t,e),t}(ML),NL="numeric",LL="short",DL="long",BL={year:NL,month:NL,day:NL},zL={year:NL,month:LL,day:NL},FL={year:NL,month:LL,day:NL,weekday:LL},UL={year:NL,month:DL,day:NL},jL={year:NL,month:DL,day:NL,weekday:DL},HL={hour:NL,minute:NL},VL={hour:NL,minute:NL,second:NL},GL={hour:NL,minute:NL,second:NL,timeZoneName:LL},WL={hour:NL,minute:NL,second:NL,timeZoneName:DL},qL={hour:NL,minute:NL,hourCycle:"h23"},KL={hour:NL,minute:NL,second:NL,hourCycle:"h23"},JL={hour:NL,minute:NL,second:NL,hourCycle:"h23",timeZoneName:LL},QL={hour:NL,minute:NL,second:NL,hourCycle:"h23",timeZoneName:DL},YL={year:NL,month:NL,day:NL,hour:NL,minute:NL},XL={year:NL,month:NL,day:NL,hour:NL,minute:NL,second:NL},$L={year:NL,month:LL,day:NL,hour:NL,minute:NL},ZL={year:NL,month:LL,day:NL,hour:NL,minute:NL,second:NL},eD={year:NL,month:LL,day:NL,weekday:LL,hour:NL,minute:NL},tD={year:NL,month:DL,day:NL,hour:NL,minute:NL,timeZoneName:LL},nD={year:NL,month:DL,day:NL,hour:NL,minute:NL,second:NL,timeZoneName:LL},rD={year:NL,month:DL,day:NL,weekday:DL,hour:NL,minute:NL,timeZoneName:DL},iD={year:NL,month:DL,day:NL,weekday:DL,hour:NL,minute:NL,second:NL,timeZoneName:DL},oD=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new OL},t.formatOffset=function(e,t){throw new OL},t.offset=function(e){throw new OL},t.equals=function(e){throw new OL},mL(e,[{key:"type",get:function(){throw new OL}},{key:"name",get:function(){throw new OL}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new OL}},{key:"isValid",get:function(){throw new OL}}]),e}(),sD=null,aD=function(e){function t(){return e.apply(this,arguments)||this}vL(t,e);var n=t.prototype;return n.offsetName=function(e,t){return wB(e,t.format,t.locale)},n.formatOffset=function(e,t){return MB(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},mL(t,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===sD&&(sD=new t),sD}}]),t}(oD),lD={};var cD={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var uD={},dD=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}vL(t,e),t.create=function(e){return uD[e]||(uD[e]=new t(e)),uD[e]},t.resetCache=function(){uD={},lD={}},t.isValidSpecifier=function(e){return this.isValidZone(e)},t.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var n=t.prototype;return n.offsetName=function(e,t){return wB(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return MB(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,lD[n]||(lD[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),lD[n]),i=r.formatToParts?function(e,t){for(var n=e.formatToParts(t),r=[],i=0;i<n.length;i++){var o=n[i],s=o.type,a=o.value,l=cD[s];"era"===s?r[l]=a:tB(l)||(r[l]=parseInt(a,10))}return r}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),i=r[1],o=r[2];return[r[3],i,o,r[4],r[5],r[6],r[7]]}(r,t),o=i[0],s=i[1],a=i[2],l=i[3],c=i[4],u=i[5],d=i[6];"BC"===l&&(o=1-Math.abs(o));var p=+t,h=p%1e3;return(yB({year:o,month:s,day:a,hour:24===c?0:c,minute:u,second:d,millisecond:0})-(p-=h>=0?h:1e3+h))/6e4},n.equals=function(e){return"iana"===e.type&&e.name===this.name},mL(t,[{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),t}(oD),pD=["base"],hD=["padTo","floor"],fD={};var mD={};function gD(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=mD[n];return r||(r=new Intl.DateTimeFormat(e,t),mD[n]=r),r}var vD={};var yD={};var bD=null;var SD={};function xD(e,t,n,r){var i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}var wD=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=CL(n,hD);if(!t||Object.keys(r).length>0){var i=gL({useGrouping:!1},n);n.padTo>0&&(i.minimumIntegerDigits=n.padTo),this.inf=function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=vD[n];return r||(r=new Intl.NumberFormat(e,t),vD[n]=r),r}(e,i)}}return e.prototype.format=function(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return uB(this.floor?Math.floor(e):fB(e,3),this.padTo)},e}(),CD=function(){function e(e,t,n){this.opts=n,this.originalZone=void 0;var r=void 0;if(this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){var i=e.offset/60*-1,o=i>=0?"Etc/GMT+"+i:"Etc/GMT"+i;0!==e.offset&&dD.create(o).valid?(r=o,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);var s=gL({},this.opts);s.timeZone=s.timeZone||r,this.dtf=gD(t,s)}var t=e.prototype;return t.format=function(){return this.originalZone?this.formatToParts().map((function(e){return e.value})).join(""):this.dtf.format(this.dt.toJSDate())},t.formatToParts=function(){var e=this,t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map((function(t){return"timeZoneName"===t.type?gL({},t,{value:e.originalZone.offsetName(e.dt.ts,{locale:e.dt.locale,format:e.opts.timeZoneName})}):t})):t},t.resolvedOptions=function(){return this.dtf.resolvedOptions()},e}(),AD=function(){function e(e,t,n){this.opts=gL({style:"long"},n),!t&&iB()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=CL(n,pD),i=JSON.stringify([e,r]),o=yD[i];return o||(o=new Intl.RelativeTimeFormat(e,t),yD[i]=o),o}(e,n))}var t=e.prototype;return t.format=function(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n,r){void 0===n&&(n="always");void 0===r&&(r=!1);var i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&o){var s="days"===e;switch(t){case 1:return s?"tomorrow":"next "+i[e][0];case-1:return s?"yesterday":"last "+i[e][0];case 0:return s?"today":"this "+i[e][0]}}var a=Object.is(t,-0)||t<0,l=Math.abs(t),c=1===l,u=i[e],d=r?c?u[1]:u[2]||u[1]:c?i[e][0]:e;return a?l+" "+d+" ago":"in "+l+" "+d}(t,e,this.opts.numeric,"long"!==this.opts.style)},t.formatToParts=function(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]},e}(),ED={firstDay:1,minimalDays:4,weekend:[6,7]},MD=function(){function e(e,t,n,r,i){var o=function(e){var t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));var n,r,i=e.indexOf("-u-");if(-1===i)return[e];try{n=gD(e).resolvedOptions(),r=e}catch(t){var o=e.substring(0,i);n=gD(o).resolvedOptions(),r=o}var s=n;return[r,s.numberingSystem,s.calendar]}(e),s=o[0],a=o[1],l=o[2];this.locale=s,this.numberingSystem=t||a||null,this.outputCalendar=n||l||null,this.weekSettings=r,this.intl=function(e,t,n){return n||t?(e.includes("-u-")||(e+="-u"),n&&(e+="-ca-"+n),t&&(e+="-nu-"+t),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}e.fromOpts=function(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)},e.create=function(t,n,r,i,o){void 0===o&&(o=!1);var s=t||FD.defaultLocale;return new e(s||(o?"en-US":bD||(bD=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||FD.defaultNumberingSystem,r||FD.defaultOutputCalendar,lB(i)||FD.defaultWeekSettings,s)},e.resetCache=function(){bD=null,mD={},vD={},yD={}},e.fromObject=function(t){var n=void 0===t?{}:t,r=n.locale,i=n.numberingSystem,o=n.outputCalendar,s=n.weekSettings;return e.create(r,i,o,s)};var t=e.prototype;return t.listingMode=function(){var e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"},t.clone=function(t){return t&&0!==Object.getOwnPropertyNames(t).length?e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,lB(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(gL({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(gL({},e,{defaultToEN:!1}))},t.months=function(e,t){var n=this;return void 0===t&&(t=!1),xD(this,e,PB,(function(){var r=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return n.monthsCache[i][e]||(n.monthsCache[i][e]=function(e){for(var t=[],n=1;n<=12;n++){var r=LF.utc(2009,n,1);t.push(e(r))}return t}((function(e){return n.extract(e,r,"month")}))),n.monthsCache[i][e]}))},t.weekdays=function(e,t){var n=this;return void 0===t&&(t=!1),xD(this,e,LB,(function(){var r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return n.weekdaysCache[i][e]||(n.weekdaysCache[i][e]=function(e){for(var t=[],n=1;n<=7;n++){var r=LF.utc(2016,11,13+n);t.push(e(r))}return t}((function(e){return n.extract(e,r,"weekday")}))),n.weekdaysCache[i][e]}))},t.meridiems=function(){var e=this;return xD(this,void 0,(function(){return DB}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[LF.utc(2016,11,13,9),LF.utc(2016,11,13,19)].map((function(n){return e.extract(n,t,"dayperiod")}))}return e.meridiemCache}))},t.eras=function(e){var t=this;return xD(this,e,UB,(function(){var n={era:e};return t.eraCache[e]||(t.eraCache[e]=[LF.utc(-40,1,1),LF.utc(2017,1,1)].map((function(e){return t.extract(e,n,"era")}))),t.eraCache[e]}))},t.extract=function(e,t,n){var r=this.dtFormatter(e,t).formatToParts().find((function(e){return e.type.toLowerCase()===n}));return r?r.value:null},t.numberFormatter=function(e){return void 0===e&&(e={}),new wD(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new CD(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new AD(this.intl,this.isEnglish(),e)},t.listFormatter=function(e){return void 0===e&&(e={}),function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=fD[n];return r||(r=new Intl.ListFormat(e,t),fD[n]=r),r}(this.intl,e)},t.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},t.getWeekSettings=function(){return this.weekSettings?this.weekSettings:oB()?function(e){var t=SD[e];if(!t){var n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,SD[e]=t}return t}(this.locale):ED},t.getStartOfWeek=function(){return this.getWeekSettings().firstDay},t.getMinDaysInFirstWeek=function(){return this.getWeekSettings().minimalDays},t.getWeekendDays=function(){return this.getWeekSettings().weekend},t.equals=function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},mL(e,[{key:"fastNumbers",get:function(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),e}(),_D=null,TD=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}vL(t,e),t.instance=function(e){return 0===e?t.utcInstance:new t(e)},t.parseSpecifier=function(e){if(e){var n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(CB(n[1],n[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return MB(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},mL(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+MB(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+MB(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===_D&&(_D=new t(0)),_D}}]),t}(oD),ID=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}vL(t,e);var n=t.prototype;return n.offsetName=function(){return null},n.formatOffset=function(){return""},n.offset=function(){return NaN},n.equals=function(){return!1},mL(t,[{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),t}(oD);function RD(e,t){if(tB(e)||null===e)return t;if(e instanceof oD)return e;if(function(e){return"string"==typeof e}(e)){var n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?aD.instance:"utc"===n||"gmt"===n?TD.utcInstance:TD.parseSpecifier(n)||dD.create(e)}return nB(e)?TD.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new ID(e)}var PD,kD=function(){return Date.now()},OD="system",ND=null,LD=null,DD=null,BD=60,zD=null,FD=function(){function e(){}return e.resetCaches=function(){MD.resetCache(),dD.resetCache()},mL(e,null,[{key:"now",get:function(){return kD},set:function(e){kD=e}},{key:"defaultZone",get:function(){return RD(OD,aD.instance)},set:function(e){OD=e}},{key:"defaultLocale",get:function(){return ND},set:function(e){ND=e}},{key:"defaultNumberingSystem",get:function(){return LD},set:function(e){LD=e}},{key:"defaultOutputCalendar",get:function(){return DD},set:function(e){DD=e}},{key:"defaultWeekSettings",get:function(){return zD},set:function(e){zD=lB(e)}},{key:"twoDigitCutoffYear",get:function(){return BD},set:function(e){BD=e%100}},{key:"throwOnInvalid",get:function(){return PD},set:function(e){PD=e}}]),e}(),UD=function(){function e(e,t){this.reason=e,this.explanation=t}return e.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},e}(),jD=[0,31,59,90,120,151,181,212,243,273,304,334],HD=[0,31,60,91,121,152,182,213,244,274,305,335];function VD(e,t){return new UD("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function GD(e,t,n){var r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);var i=r.getUTCDay();return 0===i?7:i}function WD(e,t,n){return n+(mB(e)?HD:jD)[t-1]}function qD(e,t){var n=mB(e)?HD:jD,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function KD(e,t){return(e-t+7)%7+1}function JD(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r,i=e.year,o=e.month,s=e.day,a=WD(i,o,s),l=KD(GD(i,o,s),n),c=Math.floor((a-l+14-t)/7);return c<1?c=SB(r=i-1,t,n):c>SB(i,t,n)?(r=i+1,c=1):r=i,gL({weekYear:r,weekNumber:c,weekday:l},_B(e))}function QD(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r,i=e.weekYear,o=e.weekNumber,s=e.weekday,a=KD(GD(i,1,t),n),l=gB(i),c=7*o+s-a-7+t;c<1?c+=gB(r=i-1):c>l?(r=i+1,c-=gB(i)):r=i;var u=qD(r,c);return gL({year:r,month:u.month,day:u.day},_B(e))}function YD(e){var t=e.year;return gL({year:t,ordinal:WD(t,e.month,e.day)},_B(e))}function XD(e){var t=e.year,n=qD(t,e.ordinal);return gL({year:t,month:n.month,day:n.day},_B(e))}function $D(e,t){if(!tB(e.localWeekday)||!tB(e.localWeekNumber)||!tB(e.localWeekYear)){if(!tB(e.weekday)||!tB(e.weekNumber)||!tB(e.weekYear))throw new RL("Cannot mix locale-based week fields with ISO-based week fields");return tB(e.localWeekday)||(e.weekday=e.localWeekday),tB(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),tB(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function ZD(e){var t=rB(e.year),n=cB(e.month,1,12),r=cB(e.day,1,vB(e.year,e.month));return t?n?!r&&VD("day",e.day):VD("month",e.month):VD("year",e.year)}function eB(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=cB(t,0,23)||24===t&&0===n&&0===r&&0===i,s=cB(n,0,59),a=cB(r,0,59),l=cB(i,0,999);return o?s?a?!l&&VD("millisecond",i):VD("second",r):VD("minute",n):VD("hour",t)}function tB(e){return void 0===e}function nB(e){return"number"==typeof e}function rB(e){return"number"==typeof e&&e%1==0}function iB(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function oB(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function sB(e,t,n){if(0!==e.length)return e.reduce((function(e,r){var i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i}),null)[1]}function aB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function lB(e){if(null==e)return null;if("object"!=typeof e)throw new kL("Week settings must be an object");if(!cB(e.firstDay,1,7)||!cB(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!cB(e,1,7)})))throw new kL("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function cB(e,t,n){return rB(e)&&e>=t&&e<=n}function uB(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function dB(e){return tB(e)||null===e||""===e?void 0:parseInt(e,10)}function pB(e){return tB(e)||null===e||""===e?void 0:parseFloat(e)}function hB(e){if(!tB(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function fB(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function mB(e){return e%4==0&&(e%100!=0||e%400==0)}function gB(e){return mB(e)?366:365}function vB(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?mB(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function yB(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function bB(e,t,n){return-KD(GD(e,1,t),n)+t-1}function SB(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=bB(e,t,n),i=bB(e+1,t,n);return(gB(e)-r+i)/7}function xB(e){return e>99?e:e>FD.twoDigitCutoffYear?1900+e:2e3+e}function wB(e,t,n,r){void 0===r&&(r=null);var i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);var s=gL({timeZoneName:t},o),a=new Intl.DateTimeFormat(n,s).formatToParts(i).find((function(e){return"timezonename"===e.type.toLowerCase()}));return a?a.value:null}function CB(e,t){var n=parseInt(e,10);Number.isNaN(n)&&(n=0);var r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function AB(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new kL("Invalid unit value "+e);return t}function EB(e,t){var n={};for(var r in e)if(aB(e,r)){var i=e[r];if(null==i)continue;n[t(r)]=AB(i)}return n}function MB(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return""+i+uB(n,2)+":"+uB(r,2);case"narrow":return""+i+n+(r>0?":"+r:"");case"techie":return""+i+uB(n,2)+uB(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function _B(e){return function(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}(e,["hour","minute","second","millisecond"])}var TB=["January","February","March","April","May","June","July","August","September","October","November","December"],IB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],RB=["J","F","M","A","M","J","J","A","S","O","N","D"];function PB(e){switch(e){case"narrow":return[].concat(RB);case"short":return[].concat(IB);case"long":return[].concat(TB);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var kB=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],OB=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],NB=["M","T","W","T","F","S","S"];function LB(e){switch(e){case"narrow":return[].concat(NB);case"short":return[].concat(OB);case"long":return[].concat(kB);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var DB=["AM","PM"],BB=["Before Christ","Anno Domini"],zB=["BC","AD"],FB=["B","A"];function UB(e){switch(e){case"narrow":return[].concat(FB);case"short":return[].concat(zB);case"long":return[].concat(BB);default:return null}}function jB(e,t){for(var n,r="",i=EL(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var HB={D:BL,DD:zL,DDD:UL,DDDD:jL,t:HL,tt:VL,ttt:GL,tttt:WL,T:qL,TT:KL,TTT:JL,TTTT:QL,f:YL,ff:$L,fff:tD,ffff:rD,F:XL,FF:ZL,FFF:nD,FFFF:iD},VB=function(){function e(e,t){this.opts=t,this.loc=e,this.systemLoc=null}e.create=function(t,n){return void 0===n&&(n={}),new e(t,n)},e.parseFormat=function(e){for(var t=null,n="",r=!1,i=[],o=0;o<e.length;o++){var s=e.charAt(o);"'"===s?(n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||s===t?n+=s:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=s,t=s)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i},e.macroTokenToFormatOpts=function(e){return HB[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,gL({},this.opts,t)).format()},t.dtFormatter=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,gL({},this.opts,t))},t.formatDateTime=function(e,t){return this.dtFormatter(e,t).format()},t.formatDateTimeParts=function(e,t){return this.dtFormatter(e,t).formatToParts()},t.formatInterval=function(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())},t.resolvedOptions=function(e,t){return this.dtFormatter(e,t).resolvedOptions()},t.num=function(e,t){if(void 0===t&&(t=0),this.opts.forceSimple)return uB(e,t);var n=gL({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)},t.formatDateTimeFromString=function(t,n){var r=this,i="en"===this.loc.listingMode(),o=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=function(e,n){return r.loc.extract(t,e,n)},a=function(e){return t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):""},l=function(){return i?function(e){return DB[e.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function(e,n){return i?function(e,t){return PB(t)[e.month-1]}(t,e):s(n?{month:e}:{month:e,day:"numeric"},"month")},u=function(e,n){return i?function(e,t){return LB(t)[e.weekday-1]}(t,e):s(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday")},d=function(e){return i?function(e,t){return UB(t)[e.year<0?0:1]}(t,e):s({era:e},"era")};return jB(e.parseFormat(n),(function(n){switch(n){case"S":return r.num(t.millisecond);case"u":case"SSS":return r.num(t.millisecond,3);case"s":return r.num(t.second);case"ss":return r.num(t.second,2);case"uu":return r.num(Math.floor(t.millisecond/10),2);case"uuu":return r.num(Math.floor(t.millisecond/100));case"m":return r.num(t.minute);case"mm":return r.num(t.minute,2);case"h":return r.num(t.hour%12==0?12:t.hour%12);case"hh":return r.num(t.hour%12==0?12:t.hour%12,2);case"H":return r.num(t.hour);case"HH":return r.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:r.opts.allowZ});case"ZZ":return a({format:"short",allowZ:r.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:r.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:r.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:r.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return o?s({day:"numeric"},"day"):r.num(t.day);case"dd":return o?s({day:"2-digit"},"day"):r.num(t.day,2);case"c":case"E":return r.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return o?s({month:"numeric",day:"numeric"},"month"):r.num(t.month);case"LL":return o?s({month:"2-digit",day:"numeric"},"month"):r.num(t.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return o?s({month:"numeric"},"month"):r.num(t.month);case"MM":return o?s({month:"2-digit"},"month"):r.num(t.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return o?s({year:"numeric"},"year"):r.num(t.year);case"yy":return o?s({year:"2-digit"},"year"):r.num(t.year.toString().slice(-2),2);case"yyyy":return o?s({year:"numeric"},"year"):r.num(t.year,4);case"yyyyyy":return o?s({year:"numeric"},"year"):r.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return r.num(t.weekYear.toString().slice(-2),2);case"kkkk":return r.num(t.weekYear,4);case"W":return r.num(t.weekNumber);case"WW":return r.num(t.weekNumber,2);case"n":return r.num(t.localWeekNumber);case"nn":return r.num(t.localWeekNumber,2);case"ii":return r.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return r.num(t.localWeekYear,4);case"o":return r.num(t.ordinal);case"ooo":return r.num(t.ordinal,3);case"q":return r.num(t.quarter);case"qq":return r.num(t.quarter,2);case"X":return r.num(Math.floor(t.ts/1e3));case"x":return r.num(t.ts);default:return function(n){var i=e.macroTokenToFormatOpts(n);return i?r.formatWithSystemDefault(t,i):n}(n)}}))},t.formatDurationFromString=function(t,n){var r,i=this,o=function(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=e.parseFormat(n),a=s.reduce((function(e,t){var n=t.literal,r=t.val;return n?e:e.concat(r)}),[]),l=t.shiftTo.apply(t,a.map(o).filter((function(e){return e})));return jB(s,(r=l,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),GB=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function WB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce((function(e,t){return e+t.source}),"");return RegExp("^"+r+"$")}function qB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce((function(t,n){var r=t[0],i=t[1],o=t[2],s=n(e,o),a=s[0],l=s[1],c=s[2];return[gL({},r,a),l||i,c]}),[{},null,1]).slice(0,2)}}function KB(e){if(null==e)return[null,null];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s[0],l=s[1],c=a.exec(e);if(c)return l(c)}return[null,null]}function JB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n){var r,i={};for(r=0;r<t.length;r++)i[t[r]]=dB(e[n+r]);return[i,null,n+r]}}var QB=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,YB=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,XB=RegExp(""+YB.source+("(?:"+QB.source+"?(?:\\[("+GB.source+")\\])?)?")),$B=RegExp("(?:T"+XB.source+")?"),ZB=JB("weekYear","weekNumber","weekDay"),ez=JB("year","ordinal"),tz=RegExp(YB.source+" ?(?:"+QB.source+"|("+GB.source+"))?"),nz=RegExp("(?: "+tz.source+")?");function rz(e,t,n){var r=e[t];return tB(r)?n:dB(r)}function iz(e,t){return[{hours:rz(e,t,0),minutes:rz(e,t+1,0),seconds:rz(e,t+2,0),milliseconds:hB(e[t+3])},null,t+4]}function oz(e,t){var n=!e[t]&&!e[t+1],r=CB(e[t+1],e[t+2]);return[{},n?null:TD.instance(r),t+3]}function sz(e,t){return[{},e[t]?dD.create(e[t]):null,t+1]}var az=RegExp("^T?"+YB.source+"$"),lz=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function cz(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u="-"===t[0],d=l&&"-"===l[0],p=function(e,t){return void 0===t&&(t=!1),void 0!==e&&(t||e&&u)?-e:e};return[{years:p(pB(n)),months:p(pB(r)),weeks:p(pB(i)),days:p(pB(o)),hours:p(pB(s)),minutes:p(pB(a)),seconds:p(pB(l),"-0"===l),milliseconds:p(hB(c),d)}]}var uz={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function dz(e,t,n,r,i,o,s){var a={year:2===t.length?xB(dB(t)):dB(t),month:IB.indexOf(n)+1,day:dB(r),hour:dB(i),minute:dB(o)};return s&&(a.second=dB(s)),e&&(a.weekday=e.length>3?kB.indexOf(e)+1:OB.indexOf(e)+1),a}var pz=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function hz(e){var t,n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],h=dz(n,o,i,r,s,a,l);return t=c?uz[c]:u?0:CB(d,p),[h,new TD(t)]}var fz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,mz=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,gz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function vz(e){var t=e[1],n=e[2],r=e[3];return[dz(t,e[4],r,n,e[5],e[6],e[7]),TD.utcInstance]}function yz(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],s=e[6];return[dz(t,e[7],n,r,i,o,s),TD.utcInstance]}var bz=WB(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,$B),Sz=WB(/(\d{4})-?W(\d\d)(?:-?(\d))?/,$B),xz=WB(/(\d{4})-?(\d{3})/,$B),wz=WB(XB),Cz=qB((function(e,t){return[{year:rz(e,t),month:rz(e,t+1,1),day:rz(e,t+2,1)},null,t+3]}),iz,oz,sz),Az=qB(ZB,iz,oz,sz),Ez=qB(ez,iz,oz,sz),Mz=qB(iz,oz,sz);var _z=qB(iz);var Tz=WB(/(\d{4})-(\d\d)-(\d\d)/,nz),Iz=WB(tz),Rz=qB(iz,oz,sz);var Pz="Invalid Duration",kz={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Oz=gL({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},kz),Nz=365.2425,Lz=30.436875,Dz=gL({years:{quarters:4,months:12,weeks:52.1775,days:Nz,hours:8765.82,minutes:525949.2,seconds:31556952,milliseconds:31556952e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:7889238,milliseconds:7889238e3},months:{weeks:4.3481250000000005,days:Lz,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},kz),Bz=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],zz=Bz.slice(0).reverse();function Fz(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:gL({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Hz(r)}function Uz(e,t){for(var n,r,i=null!=(n=t.milliseconds)?n:0,o=EL(zz.slice(1));!(r=o()).done;){var s=r.value;t[s]&&(i+=t[s]*e[s].milliseconds)}return i}function jz(e,t){var n=Uz(e,t)<0?-1:1;Bz.reduceRight((function(r,i){if(tB(t[i]))return r;if(r){var o=t[r]*n,s=e[i][r],a=Math.floor(o/s);t[i]+=a*n,t[r]-=a*s*n}return i}),null),Bz.reduce((function(n,r){if(tB(t[r]))return n;if(n){var i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r}),null)}var Hz=function(e){function t(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Dz:Oz;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||MD.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}t.fromMillis=function(e,n){return t.fromObject({milliseconds:e},n)},t.fromObject=function(e,n){if(void 0===n&&(n={}),null==e||"object"!=typeof e)throw new kL("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new t({values:EB(e,t.normalizeUnit),loc:MD.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},t.fromDurationLike=function(e){if(nB(e))return t.fromMillis(e);if(t.isDuration(e))return e;if("object"==typeof e)return t.fromObject(e);throw new kL("Unknown duration argument "+e+" of type "+typeof e)},t.fromISO=function(e,n){var r=function(e){return KB(e,[lz,cz])}(e),i=r[0];return i?t.fromObject(i,n):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.fromISOTime=function(e,n){var r=function(e){return KB(e,[az,_z])}(e),i=r[0];return i?t.fromObject(i,n):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new kL("need to specify a reason the Duration is invalid");var r=e instanceof UD?e:new UD(e,n);if(FD.throwOnInvalid)throw new IL(r);return new t({invalid:r})},t.normalizeUnit=function(e){var t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new PL(e);return t},t.isDuration=function(e){return e&&e.isLuxonDuration||!1};var n=t.prototype;return n.toFormat=function(e,t){void 0===t&&(t={});var n=gL({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?VB.create(this.loc,n).formatDurationFromString(this,e):Pz},n.toHuman=function(e){var t=this;if(void 0===e&&(e={}),!this.isValid)return Pz;var n=Bz.map((function(n){var r=t.values[n];return tB(r)?null:t.loc.numberFormatter(gL({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(gL({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},n.toObject=function(){return this.isValid?gL({},this.values):{}},n.toISO=function(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=fB(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e},n.toISOTime=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=this.toMillis();return t<0||t>=864e5?null:(e=gL({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),LF.fromMillis(t,{zone:"UTC"}).toISOTime(e))},n.toJSON=function(){return this.toISO()},n.toString=function(){return this.toISO()},n[e]=function(){return this.isValid?"Duration { values: "+JSON.stringify(this.values)+" }":"Duration { Invalid, reason: "+this.invalidReason+" }"},n.toMillis=function(){return this.isValid?Uz(this.matrix,this.values):NaN},n.valueOf=function(){return this.toMillis()},n.plus=function(e){if(!this.isValid)return this;for(var n=t.fromDurationLike(e),r={},i=0,o=Bz;i<o.length;i++){var s=o[i];(aB(n.values,s)||aB(this.values,s))&&(r[s]=n.get(s)+this.get(s))}return Fz(this,{values:r},!0)},n.minus=function(e){if(!this.isValid)return this;var n=t.fromDurationLike(e);return this.plus(n.negate())},n.mapUnits=function(e){if(!this.isValid)return this;for(var t={},n=0,r=Object.keys(this.values);n<r.length;n++){var i=r[n];t[i]=AB(e(this.values[i],i))}return Fz(this,{values:t},!0)},n.get=function(e){return this[t.normalizeUnit(e)]},n.set=function(e){return this.isValid?Fz(this,{values:gL({},this.values,EB(e,t.normalizeUnit))}):this},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.conversionAccuracy,o=t.matrix;return Fz(this,{loc:this.loc.clone({locale:n,numberingSystem:r}),matrix:o,conversionAccuracy:i})},n.as=function(e){return this.isValid?this.shiftTo(e).get(e):NaN},n.normalize=function(){if(!this.isValid)return this;var e=this.toObject();return jz(this.matrix,e),Fz(this,{values:e},!0)},n.rescale=function(){return this.isValid?Fz(this,{values:function(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],o=i[0],s=i[1];0!==s&&(t[o]=s)}return t}(this.normalize().shiftToAll().toObject())},!0):this},n.shiftTo=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!this.isValid)return this;if(0===n.length)return this;n=n.map((function(e){return t.normalizeUnit(e)}));for(var i,o={},s={},a=this.toObject(),l=0,c=Bz;l<c.length;l++){var u=c[l];if(n.indexOf(u)>=0){i=u;var d=0;for(var p in s)d+=this.matrix[p][u]*s[p],s[p]=0;nB(a[u])&&(d+=a[u]);var h=Math.trunc(d);o[u]=h,s[u]=(1e3*d-1e3*h)/1e3}else nB(a[u])&&(s[u]=a[u])}for(var f in s)0!==s[f]&&(o[i]+=f===i?s[f]:s[f]/this.matrix[i][f]);return jz(this.matrix,o),Fz(this,{values:o},!0)},n.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},n.negate=function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);t<n.length;t++){var r=n[t];e[r]=0===this.values[r]?0:-this.values[r]}return Fz(this,{values:e},!0)},n.equals=function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t=0,n=Bz;t<n.length;t++){var r=n[t];if(i=this.values[r],o=e.values[r],!(void 0===i||0===i?void 0===o||0===o:i===o))return!1}var i,o;return!0},mL(t,[{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),Vz="Invalid Interval";var Gz=function(e){function t(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new kL("need to specify a reason the Interval is invalid");var r=e instanceof UD?e:new UD(e,n);if(FD.throwOnInvalid)throw new TL(r);return new t({invalid:r})},t.fromDateTimes=function(e,n){var r=DF(e),i=DF(n),o=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Gz.invalid("end before start","The end of an interval must be after its start, but you had start="+e.toISO()+" and end="+t.toISO()):null:Gz.invalid("missing or invalid end"):Gz.invalid("missing or invalid start")}(r,i);return null==o?new t({start:r,end:i}):o},t.after=function(e,n){var r=Hz.fromDurationLike(n),i=DF(e);return t.fromDateTimes(i,i.plus(r))},t.before=function(e,n){var r=Hz.fromDurationLike(n),i=DF(e);return t.fromDateTimes(i.minus(r),i)},t.fromISO=function(e,n){var r=(e||"").split("/",2),i=r[0],o=r[1];if(i&&o){var s,a,l,c;try{a=(s=LF.fromISO(i,n)).isValid}catch(e){a=!1}try{c=(l=LF.fromISO(o,n)).isValid}catch(e){c=!1}if(a&&c)return t.fromDateTimes(s,l);if(a){var u=Hz.fromISO(o,n);if(u.isValid)return t.after(s,u)}else if(c){var d=Hz.fromISO(i,n);if(d.isValid)return t.before(l,d)}}return t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.isInterval=function(e){return e&&e.isLuxonInterval||!1};var n=t.prototype;return n.length=function(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},n.count=function(e,t){if(void 0===e&&(e="milliseconds"),!this.isValid)return NaN;var n,r=this.start.startOf(e,t);return n=(n=null!=t&&t.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end).startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())},n.hasSame=function(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},n.isEmpty=function(){return this.s.valueOf()===this.e.valueOf()},n.isAfter=function(e){return!!this.isValid&&this.s>e},n.isBefore=function(e){return!!this.isValid&&this.e<=e},n.contains=function(e){return!!this.isValid&&(this.s<=e&&this.e>e)},n.set=function(e){var n=void 0===e?{}:e,r=n.start,i=n.end;return this.isValid?t.fromDateTimes(r||this.s,i||this.e):this},n.splitAt=function(){var e=this;if(!this.isValid)return[];for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=r.map(DF).filter((function(t){return e.contains(t)})).sort((function(e,t){return e.toMillis()-t.toMillis()})),s=[],a=this.s,l=0;a<this.e;){var c=o[l]||this.e,u=+c>+this.e?this.e:c;s.push(t.fromDateTimes(a,u)),a=u,l+=1}return s},n.splitBy=function(e){var n=Hz.fromDurationLike(e);if(!this.isValid||!n.isValid||0===n.as("milliseconds"))return[];for(var r,i=this.s,o=1,s=[];i<this.e;){var a=this.start.plus(n.mapUnits((function(e){return e*o})));r=+a>+this.e?this.e:a,s.push(t.fromDateTimes(i,r)),i=r,o+=1}return s},n.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},n.overlaps=function(e){return this.e>e.s&&this.s<e.e},n.abutsStart=function(e){return!!this.isValid&&+this.e==+e.s},n.abutsEnd=function(e){return!!this.isValid&&+e.e==+this.s},n.engulfs=function(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)},n.equals=function(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},n.intersection=function(e){if(!this.isValid)return this;var n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)},n.union=function(e){if(!this.isValid)return this;var n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)},t.merge=function(e){var t=e.sort((function(e,t){return e.s-t.s})).reduce((function(e,t){var n=e[0],r=e[1];return r?r.overlaps(t)||r.abutsStart(t)?[n,r.union(t)]:[n.concat([r]),t]:[n,t]}),[[],null]),n=t[0],r=t[1];return r&&n.push(r),n},t.xor=function(e){for(var n,r,i=null,o=0,s=[],a=e.map((function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]})),l=(n=Array.prototype).concat.apply(n,a).sort((function(e,t){return e.time-t.time})),c=EL(l);!(r=c()).done;){var u=r.value;1===(o+="s"===u.type?1:-1)?i=u.time:(i&&+i!=+u.time&&s.push(t.fromDateTimes(i,u.time)),i=null)}return t.merge(s)},n.difference=function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.xor([this].concat(r)).map((function(t){return e.intersection(t)})).filter((function(e){return e&&!e.isEmpty()}))},n.toString=function(){return this.isValid?"["+this.s.toISO()+" – "+this.e.toISO()+")":Vz},n[e]=function(){return this.isValid?"Interval { start: "+this.s.toISO()+", end: "+this.e.toISO()+" }":"Interval { Invalid, reason: "+this.invalidReason+" }"},n.toLocaleString=function(e,t){return void 0===e&&(e=BL),void 0===t&&(t={}),this.isValid?VB.create(this.s.loc.clone(t),e).formatInterval(this):Vz},n.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):Vz},n.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():Vz},n.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):Vz},n.toFormat=function(e,t){var n=(void 0===t?{}:t).separator,r=void 0===n?" – ":n;return this.isValid?""+this.s.toFormat(e)+r+this.e.toFormat(e):Vz},n.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):Hz.invalid(this.invalidReason)},n.mapEndpoints=function(e){return t.fromDateTimes(e(this.s),e(this.e))},mL(t,[{key:"start",get:function(){return this.isValid?this.s:null}},{key:"end",get:function(){return this.isValid?this.e:null}},{key:"isValid",get:function(){return null===this.invalidReason}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),Wz=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=FD.defaultZone);var t=LF.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return dD.isValidZone(e)},e.normalizeZone=function(e){return RD(e,FD.defaultZone)},e.getStartOfWeek=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||MD.create(r)).getStartOfWeek()},e.getMinimumDaysInFirstWeek=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||MD.create(r)).getMinDaysInFirstWeek()},e.getWeekendWeekdays=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||MD.create(r)).getWeekendDays().slice()},e.months=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj,l=void 0===a?null:a,c=n.outputCalendar,u=void 0===c?"gregory":c;return(l||MD.create(i,s,u)).months(e)},e.monthsFormat=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj,l=void 0===a?null:a,c=n.outputCalendar,u=void 0===c?"gregory":c;return(l||MD.create(i,s,u)).months(e,!0)},e.weekdays=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj;return((void 0===a?null:a)||MD.create(i,s,null)).weekdays(e)},e.weekdaysFormat=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj;return((void 0===a?null:a)||MD.create(i,s,null)).weekdays(e,!0)},e.meridiems=function(e){var t=(void 0===e?{}:e).locale,n=void 0===t?null:t;return MD.create(n).meridiems()},e.eras=function(e,t){void 0===e&&(e="short");var n=(void 0===t?{}:t).locale,r=void 0===n?null:n;return MD.create(r,null,"gregory").eras(e)},e.features=function(){return{relative:iB(),localeWeek:oB()}},e}();function qz(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=n(t)-n(e);return Math.floor(Hz.fromMillis(r).as("days"))}function Kz(e,t,n,r){var i=function(e,t,n){for(var r,i,o=[["years",function(e,t){return t.year-e.year}],["quarters",function(e,t){return t.quarter-e.quarter+4*(t.year-e.year)}],["months",function(e,t){return t.month-e.month+12*(t.year-e.year)}],["weeks",function(e,t){var n=qz(e,t);return(n-n%7)/7}],["days",qz]],s={},a=e,l=0,c=o;l<c.length;l++){var u=c[l],d=u[0],p=u[1];n.indexOf(d)>=0&&(r=d,s[d]=p(e,t),(i=a.plus(s))>t?(s[d]--,(e=a.plus(s))>t&&(i=e,s[d]--,e=a.plus(s))):e=i)}return[e,s,i,r]}(e,t,n),o=i[0],s=i[1],a=i[2],l=i[3],c=t-o,u=n.filter((function(e){return["hours","minutes","seconds","milliseconds"].indexOf(e)>=0}));if(0===u.length){var d;if(a<t)a=o.plus(((d={})[l]=1,d));a!==o&&(s[l]=(s[l]||0)+c/(a-o))}var p,h=Hz.fromObject(s,r);return u.length>0?(p=Hz.fromMillis(c,r)).shiftTo.apply(p,u).plus(h):h}var Jz={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Qz={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Yz=Jz.hanidec.replace(/[\[|\]]/g,"").split("");function Xz(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+Jz[n||"latn"]+t)}function $z(e,t){return void 0===t&&(t=function(e){return e}),{regex:e,deser:function(e){var n=e[0];return t(function(e){var t=parseInt(e,10);if(isNaN(t)){t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(-1!==e[n].search(Jz.hanidec))t+=Yz.indexOf(e[n]);else for(var i in Qz){var o=Qz[i],s=o[0],a=o[1];r>=s&&r<=a&&(t+=r-s)}}return parseInt(t,10)}return t}(n))}}}var Zz="[ "+String.fromCharCode(160)+"]",eF=new RegExp(Zz,"g");function tF(e){return e.replace(/\./g,"\\.?").replace(eF,Zz)}function nF(e){return e.replace(/\./g,"").replace(eF," ").toLowerCase()}function rF(e,t){return null===e?null:{regex:RegExp(e.map(tF).join("|")),deser:function(n){var r=n[0];return e.findIndex((function(e){return nF(r)===nF(e)}))+t}}}function iF(e,t){return{regex:e,deser:function(e){return CB(e[1],e[2])},groups:t}}function oF(e){return{regex:e,deser:function(e){return e[0]}}}var sF={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};var aF=null;function lF(e,t){var n;return(n=Array.prototype).concat.apply(n,e.map((function(e){return function(e,t){if(e.literal)return e;var n=uF(VB.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function cF(e,t,n){var r=lF(VB.parseFormat(n),e),i=r.map((function(t){return n=t,i=Xz(r=e),o=Xz(r,"{2}"),s=Xz(r,"{3}"),a=Xz(r,"{4}"),l=Xz(r,"{6}"),c=Xz(r,"{1,2}"),u=Xz(r,"{1,3}"),d=Xz(r,"{1,6}"),p=Xz(r,"{1,9}"),h=Xz(r,"{2,4}"),f=Xz(r,"{4,6}"),m=function(e){return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:function(e){return e[0]},literal:!0};var t},g=function(e){if(n.literal)return m(e);switch(e.val){case"G":return rF(r.eras("short"),0);case"GG":return rF(r.eras("long"),0);case"y":return $z(d);case"yy":case"kk":return $z(h,xB);case"yyyy":case"kkkk":return $z(a);case"yyyyy":return $z(f);case"yyyyyy":return $z(l);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return $z(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return $z(o);case"MMM":return rF(r.months("short",!0),1);case"MMMM":return rF(r.months("long",!0),1);case"LLL":return rF(r.months("short",!1),1);case"LLLL":return rF(r.months("long",!1),1);case"o":case"S":return $z(u);case"ooo":case"SSS":return $z(s);case"u":return oF(p);case"uu":return oF(c);case"uuu":case"E":case"c":return $z(i);case"a":return rF(r.meridiems(),0);case"EEE":return rF(r.weekdays("short",!1),1);case"EEEE":return rF(r.weekdays("long",!1),1);case"ccc":return rF(r.weekdays("short",!0),1);case"cccc":return rF(r.weekdays("long",!0),1);case"Z":case"ZZ":return iF(new RegExp("([+-]"+c.source+")(?::("+o.source+"))?"),2);case"ZZZ":return iF(new RegExp("([+-]"+c.source+")("+o.source+")?"),2);case"z":return oF(/[a-z_+-/]{1,256}?/i);case" ":return oF(/[^\S\n\r]/);default:return m(e)}}(n)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"},g.token=n,g;var n,r,i,o,s,a,l,c,u,d,p,h,f,m,g})),o=i.find((function(e){return e.invalidReason}));if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};var s=function(e){var t=e.map((function(e){return e.regex})).reduce((function(e,t){return e+"("+t.source+")"}),"");return["^"+t+"$",e]}(i),a=s[0],l=s[1],c=RegExp(a,"i"),u=function(e,t,n){var r=e.match(t);if(r){var i={},o=1;for(var s in n)if(aB(n,s)){var a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}return[r,{}]}(t,c,l),d=u[0],p=u[1],h=p?function(e){var t,n=null;tB(e.z)||(n=dD.create(e.z)),tB(e.Z)||(n||(n=new TD(e.Z)),t=e.Z),tB(e.q)||(e.M=3*(e.q-1)+1),tB(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),tB(e.u)||(e.S=hB(e.u));var r=Object.keys(e).reduce((function(t,n){var r=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(n);return r&&(t[r]=e[n]),t}),{});return[r,n,t]}(p):[null,null,void 0],f=h[0],m=h[1],g=h[2];if(aB(p,"a")&&aB(p,"H"))throw new RL("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:c,rawMatches:d,matches:p,result:f,zone:m,specificOffset:g}}function uF(e,t){if(!e)return null;var n=VB.create(t,e).dtFormatter((aF||(aF=LF.fromMillis(1555555555555)),aF)),r=n.formatToParts(),i=n.resolvedOptions();return r.map((function(t){return function(e,t,n){var r=e.type,i=e.value;if("literal"===r){var o=/^\s+$/.test(i);return{literal:!o,val:o?" ":i}}var s=t[r],a=r;"hour"===r&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");var l=sF[a];if("object"==typeof l&&(l=l[s]),l)return{literal:!1,val:l}}(t,e,i)}))}var dF="Invalid DateTime",pF=864e13;function hF(e){return new UD("unsupported zone",'the zone "'+e.name+'" is not supported')}function fF(e){return null===e.weekData&&(e.weekData=JD(e.c)),e.weekData}function mF(e){return null===e.localWeekData&&(e.localWeekData=JD(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function gF(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new LF(gL({},n,t,{old:n}))}function vF(e,t,n){var r=e-6e4*t,i=n.offset(r);if(t===i)return[r,t];r-=6e4*(i-t);var o=n.offset(r);return i===o?[r,i]:[e-6e4*Math.min(i,o),Math.max(i,o)]}function yF(e,t){var n=new Date(e+=6e4*t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function bF(e,t,n){return vF(yB(e),t,n)}function SF(e,t){var n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o=gL({},e.c,{year:r,month:i,day:Math.min(e.c.day,vB(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=Hz.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=vF(yB(o),n,e.zone),l=a[0],c=a[1];return 0!==s&&(l+=s,c=e.zone.offset(l)),{ts:l,o:c}}function xF(e,t,n,r,i,o){var s=n.setZone,a=n.zone;if(e&&0!==Object.keys(e).length||t){var l=t||a,c=LF.fromObject(e,gL({},n,{zone:l,specificOffset:o}));return s?c:c.setZone(a)}return LF.invalid(new UD("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function wF(e,t,n){return void 0===n&&(n=!0),e.isValid?VB.create(MD.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function CF(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=uB(e.c.year,n?6:4),t?(r+="-",r+=uB(e.c.month),r+="-",r+=uB(e.c.day)):(r+=uB(e.c.month),r+=uB(e.c.day)),r}function AF(e,t,n,r,i,o){var s=uB(e.c.hour);return t?(s+=":",s+=uB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=":")):s+=uB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=uB(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=uB(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?s+="Z":e.o<0?(s+="-",s+=uB(Math.trunc(-e.o/60)),s+=":",s+=uB(Math.trunc(-e.o%60))):(s+="+",s+=uB(Math.trunc(e.o/60)),s+=":",s+=uB(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}var EF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},MF={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},_F={ordinal:1,hour:0,minute:0,second:0,millisecond:0},TF=["year","month","day","hour","minute","second","millisecond"],IF=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],RF=["year","ordinal","hour","minute","second","millisecond"];function PF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){var t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new PL(e);return t}(e)}}function kF(e,t){var n,r,i=RD(t.zone,FD.defaultZone),o=MD.fromObject(t),s=FD.now();if(tB(e.year))n=s;else{for(var a=0,l=TF;a<l.length;a++){var c=l[a];tB(e[c])&&(e[c]=EF[c])}var u=ZD(e)||eB(e);if(u)return LF.invalid(u);var d=bF(e,i.offset(s),i);n=d[0],r=d[1]}return new LF({ts:n,zone:i,loc:o,o:r})}function OF(e,t,n){var r=!!tB(n.round)||n.round,i=function(e,i){return e=fB(e,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(e,i)},o=function(r){return n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r)};if(n.unit)return i(o(n.unit),n.unit);for(var s,a=EL(n.units);!(s=a()).done;){var l=s.value,c=o(l);if(Math.abs(c)>=1)return i(c,l)}return i(e>t?-0:0,n.units[n.units.length-1])}function NF(e){var t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}var LF=function(e){function t(e){var t=e.zone||FD.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new UD("invalid input"):null)||(t.isValid?null:hF(t));this.ts=tB(e.ts)?FD.now():e.ts;var r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var o=[e.old.c,e.old.o];r=o[0],i=o[1]}else{var s=t.offset(this.ts);r=yF(this.ts,s),r=(n=Number.isNaN(r.year)?new UD("invalid input"):null)?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||MD.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}t.now=function(){return new t({})},t.local=function(){var e=NF(arguments),t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return kF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.utc=function(){var e=NF(arguments),t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return t.zone=TD.utcInstance,kF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.fromJSDate=function(e,n){void 0===n&&(n={});var r=function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");var i=RD(n.zone,FD.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:MD.fromObject(n)}):t.invalid(hF(i))},t.fromMillis=function(e,n){if(void 0===n&&(n={}),nB(e))return e<-864e13||e>pF?t.invalid("Timestamp out of range"):new t({ts:e,zone:RD(n.zone,FD.defaultZone),loc:MD.fromObject(n)});throw new kL("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},t.fromSeconds=function(e,n){if(void 0===n&&(n={}),nB(e))return new t({ts:1e3*e,zone:RD(n.zone,FD.defaultZone),loc:MD.fromObject(n)});throw new kL("fromSeconds requires a numerical input")},t.fromObject=function(e,n){void 0===n&&(n={}),e=e||{};var r=RD(n.zone,FD.defaultZone);if(!r.isValid)return t.invalid(hF(r));var i=MD.fromObject(n),o=EB(e,PF),s=$D(o,i),a=s.minDaysInFirstWeek,l=s.startOfWeek,c=FD.now(),u=tB(n.specificOffset)?r.offset(c):n.specificOffset,d=!tB(o.ordinal),p=!tB(o.year),h=!tB(o.month)||!tB(o.day),f=p||h,m=o.weekYear||o.weekNumber;if((f||d)&&m)throw new RL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&d)throw new RL("Can't mix ordinal dates with month/day");var g,v,y=m||o.weekday&&!f,b=yF(c,u);y?(g=IF,v=MF,b=JD(b,a,l)):d?(g=RF,v=_F,b=YD(b)):(g=TF,v=EF);for(var S,x=!1,w=EL(g);!(S=w()).done;){var C=S.value;tB(o[C])?o[C]=x?v[C]:b[C]:x=!0}var A=y?function(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=rB(e.weekYear),i=cB(e.weekNumber,1,SB(e.weekYear,t,n)),o=cB(e.weekday,1,7);return r?i?!o&&VD("weekday",e.weekday):VD("week",e.weekNumber):VD("weekYear",e.weekYear)}(o,a,l):d?function(e){var t=rB(e.year),n=cB(e.ordinal,1,gB(e.year));return t?!n&&VD("ordinal",e.ordinal):VD("year",e.year)}(o):ZD(o),E=A||eB(o);if(E)return t.invalid(E);var M=bF(y?QD(o,a,l):d?XD(o):o,u,r),_=new t({ts:M[0],zone:r,o:M[1],loc:i});return o.weekday&&f&&e.weekday!==_.weekday?t.invalid("mismatched weekday","you can't specify both a weekday of "+o.weekday+" and a date of "+_.toISO()):_},t.fromISO=function(e,t){void 0===t&&(t={});var n=function(e){return KB(e,[bz,Cz],[Sz,Az],[xz,Ez],[wz,Mz])}(e);return xF(n[0],n[1],t,"ISO 8601",e)},t.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return KB(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[pz,hz])}(e);return xF(n[0],n[1],t,"RFC 2822",e)},t.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return KB(e,[fz,vz],[mz,vz],[gz,yz])}(e);return xF(n[0],n[1],t,"HTTP",t)},t.fromFormat=function(e,n,r){if(void 0===r&&(r={}),tB(e)||tB(n))throw new kL("fromFormat requires an input string and a format");var i=r,o=i.locale,s=void 0===o?null:o,a=i.numberingSystem,l=void 0===a?null:a,c=function(e,t,n){var r=cF(e,t,n);return[r.result,r.zone,r.specificOffset,r.invalidReason]}(MD.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),e,n),u=c[0],d=c[1],p=c[2],h=c[3];return h?t.invalid(h):xF(u,d,r,"format "+n,e,p)},t.fromString=function(e,n,r){return void 0===r&&(r={}),t.fromFormat(e,n,r)},t.fromSQL=function(e,t){void 0===t&&(t={});var n=function(e){return KB(e,[Tz,Cz],[Iz,Rz])}(e);return xF(n[0],n[1],t,"SQL",e)},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new kL("need to specify a reason the DateTime is invalid");var r=e instanceof UD?e:new UD(e,n);if(FD.throwOnInvalid)throw new _L(r);return new t({invalid:r})},t.isDateTime=function(e){return e&&e.isLuxonDateTime||!1},t.parseFormatForOpts=function(e,t){void 0===t&&(t={});var n=uF(e,MD.fromObject(t));return n?n.map((function(e){return e?e.val:null})).join(""):null},t.expandFormat=function(e,t){return void 0===t&&(t={}),lF(VB.parseFormat(e),MD.fromObject(t)).map((function(e){return e.val})).join("")};var n=t.prototype;return n.get=function(e){return this[e]},n.getPossibleOffsets=function(){if(!this.isValid||this.isOffsetFixed)return[this];var e=864e5,t=6e4,n=yB(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),o=this.zone.offset(n-r*t),s=this.zone.offset(n-i*t);if(o===s)return[this];var a=n-o*t,l=n-s*t,c=yF(a,o),u=yF(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[gF(this,{ts:a}),gF(this,{ts:l})]:[this]},n.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=VB.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},n.toUTC=function(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(TD.instance(e),t)},n.toLocal=function(){return this.setZone(FD.defaultZone)},n.setZone=function(e,n){var r=void 0===n?{}:n,i=r.keepLocalTime,o=void 0!==i&&i,s=r.keepCalendarTime,a=void 0!==s&&s;if((e=RD(e,FD.defaultZone)).equals(this.zone))return this;if(e.isValid){var l=this.ts;if(o||a){var c=e.offset(this.ts);l=bF(this.toObject(),c,e)[0]}return gF(this,{ts:l,zone:e})}return t.invalid(hF(e))},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return gF(this,{loc:this.loc.clone({locale:n,numberingSystem:r,outputCalendar:i})})},n.setLocale=function(e){return this.reconfigure({locale:e})},n.set=function(e){if(!this.isValid)return this;var t,n=EB(e,PF),r=$D(n,this.loc),i=r.minDaysInFirstWeek,o=r.startOfWeek,s=!tB(n.weekYear)||!tB(n.weekNumber)||!tB(n.weekday),a=!tB(n.ordinal),l=!tB(n.year),c=!tB(n.month)||!tB(n.day),u=l||c,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new RL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new RL("Can't mix ordinal dates with month/day");s?t=QD(gL({},JD(this.c,i,o),n),i,o):tB(n.ordinal)?(t=gL({},this.toObject(),n),tB(n.day)&&(t.day=Math.min(vB(t.year,t.month),t.day))):t=XD(gL({},YD(this.c),n));var p=bF(t,this.o,this.zone);return gF(this,{ts:p[0],o:p[1]})},n.plus=function(e){return this.isValid?gF(this,SF(this,Hz.fromDurationLike(e))):this},n.minus=function(e){return this.isValid?gF(this,SF(this,Hz.fromDurationLike(e).negate())):this},n.startOf=function(e,t){var n=(void 0===t?{}:t).useLocaleWeeks,r=void 0!==n&&n;if(!this.isValid)return this;var i={},o=Hz.normalizeUnit(e);switch(o){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===o)if(r){var s=this.loc.getStartOfWeek();this.weekday<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if("quarters"===o){var a=Math.ceil(this.month/3);i.month=3*(a-1)+1}return this.set(i)},n.endOf=function(e,t){var n;return this.isValid?this.plus((n={},n[e]=1,n)).startOf(e,t).minus(1):this},n.toFormat=function(e,t){return void 0===t&&(t={}),this.isValid?VB.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):dF},n.toLocaleString=function(e,t){return void 0===e&&(e=BL),void 0===t&&(t={}),this.isValid?VB.create(this.loc.clone(t),e).formatDateTime(this):dF},n.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?VB.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},n.toISO=function(e){var t=void 0===e?{}:e,n=t.format,r=void 0===n?"extended":n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.suppressMilliseconds,a=void 0!==s&&s,l=t.includeOffset,c=void 0===l||l,u=t.extendedZone,d=void 0!==u&&u;if(!this.isValid)return null;var p="extended"===r,h=CF(this,p);return h+="T",h+=AF(this,p,o,a,c,d)},n.toISODate=function(e){var t=(void 0===e?{}:e).format,n=void 0===t?"extended":t;return this.isValid?CF(this,"extended"===n):null},n.toISOWeekDate=function(){return wF(this,"kkkk-'W'WW-c")},n.toISOTime=function(e){var t=void 0===e?{}:e,n=t.suppressMilliseconds,r=void 0!==n&&n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.includeOffset,a=void 0===s||s,l=t.includePrefix,c=void 0!==l&&l,u=t.extendedZone,d=void 0!==u&&u,p=t.format,h=void 0===p?"extended":p;return this.isValid?(c?"T":"")+AF(this,"extended"===h,o,r,a,d):null},n.toRFC2822=function(){return wF(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},n.toHTTP=function(){return wF(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},n.toSQLDate=function(){return this.isValid?CF(this,!0):null},n.toSQLTime=function(e){var t=void 0===e?{}:e,n=t.includeOffset,r=void 0===n||n,i=t.includeZone,o=void 0!==i&&i,s=t.includeOffsetSpace,a="HH:mm:ss.SSS";return(o||r)&&((void 0===s||s)&&(a+=" "),o?a+="z":r&&(a+="ZZ")),wF(this,a,!0)},n.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},n.toString=function(){return this.isValid?this.toISO():dF},n[e]=function(){return this.isValid?"DateTime { ts: "+this.toISO()+", zone: "+this.zone.name+", locale: "+this.locale+" }":"DateTime { Invalid, reason: "+this.invalidReason+" }"},n.valueOf=function(){return this.toMillis()},n.toMillis=function(){return this.isValid?this.ts:NaN},n.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},n.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},n.toJSON=function(){return this.toISO()},n.toBSON=function(){return this.toJSDate()},n.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=gL({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},n.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},n.diff=function(e,t,n){if(void 0===t&&(t="milliseconds"),void 0===n&&(n={}),!this.isValid||!e.isValid)return Hz.invalid("created by diffing an invalid DateTime");var r,i=gL({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(Hz.normalizeUnit),s=e.valueOf()>this.valueOf(),a=Kz(s?this:e,s?e:this,o,i);return s?a.negate():a},n.diffNow=function(e,n){return void 0===e&&(e="milliseconds"),void 0===n&&(n={}),this.diff(t.now(),e,n)},n.until=function(e){return this.isValid?Gz.fromDateTimes(this,e):this},n.hasSame=function(e,t,n){if(!this.isValid)return!1;var r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)},n.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},n.toRelative=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],o=e.unit;return Array.isArray(e.unit)&&(i=e.unit,o=void 0),OF(n,this.plus(r),gL({},e,{numeric:"always",units:i,unit:o}))},n.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?OF(e.base||t.fromObject({},{zone:this.zone}),this,gL({},e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null},t.min=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.every(t.isDateTime))throw new kL("min requires all arguments be DateTimes");return sB(n,(function(e){return e.valueOf()}),Math.min)},t.max=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.every(t.isDateTime))throw new kL("max requires all arguments be DateTimes");return sB(n,(function(e){return e.valueOf()}),Math.max)},t.fromFormatExplain=function(e,t,n){void 0===n&&(n={});var r=n,i=r.locale,o=void 0===i?null:i,s=r.numberingSystem,a=void 0===s?null:s;return cF(MD.fromOpts({locale:o,numberingSystem:a,defaultToEN:!0}),e,t)},t.fromStringExplain=function(e,n,r){return void 0===r&&(r={}),t.fromFormatExplain(e,n,r)},mL(t,[{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function(){return this._zone}},{key:"zoneName",get:function(){return this.isValid?this.zone.name:null}},{key:"year",get:function(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function(){return this.isValid?this.c.month:NaN}},{key:"day",get:function(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function(){return this.isValid?fF(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?fF(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?fF(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?mF(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?mF(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?mF(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?YD(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?Wz.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?Wz.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?Wz.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?Wz.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return mB(this.year)}},{key:"daysInMonth",get:function(){return vB(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?gB(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?SB(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?SB(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return BL}},{key:"DATE_MED",get:function(){return zL}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return FL}},{key:"DATE_FULL",get:function(){return UL}},{key:"DATE_HUGE",get:function(){return jL}},{key:"TIME_SIMPLE",get:function(){return HL}},{key:"TIME_WITH_SECONDS",get:function(){return VL}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return GL}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return WL}},{key:"TIME_24_SIMPLE",get:function(){return qL}},{key:"TIME_24_WITH_SECONDS",get:function(){return KL}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return JL}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return QL}},{key:"DATETIME_SHORT",get:function(){return YL}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return XL}},{key:"DATETIME_MED",get:function(){return $L}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return ZL}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return eD}},{key:"DATETIME_FULL",get:function(){return tD}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return nD}},{key:"DATETIME_HUGE",get:function(){return rD}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return iD}}]),t}(Symbol.for("nodejs.util.inspect.custom"));function DF(e){if(LF.isDateTime(e))return e;if(e&&e.valueOf&&nB(e.valueOf()))return LF.fromJSDate(e);if(e&&"object"==typeof e)return LF.fromObject(e);throw new kL("Unknown datetime argument: "+e+", of type "+typeof e)}hL.DateTime=LF,hL.Duration=Hz,hL.FixedOffsetZone=TD,hL.IANAZone=dD,hL.Info=Wz,hL.Interval=Gz,hL.InvalidZone=ID,hL.Settings=FD,hL.SystemZone=aD,hL.VERSION="3.4.4",hL.Zone=oD;c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function BF(e,t){let[n,r]=(0,c.useState)(e),i=Ka(e);return qa((()=>r(i.current)),[i,r,...t]),n}var zF=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(zF||{}),FF=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(FF||{}),UF=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(UF||{}),jF=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(jF||{});function HF(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=Al(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let VF={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{value:n,mode:r,compare:i}=e.propsRef.current,o=e.options.findIndex((e=>{let t=e.dataRef.current.value;return La(r,{1:()=>n.some((e=>i(e,t))),0:()=>i(n,t)})}));return-1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){var n;if(e.disabled||1===e.listboxState)return e;let r=HF(e),i=Md(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=HF(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;La(o,{1:()=>i.some((e=>s(e,a))),0:()=>s(i,a)})&&(r.activeOptionIndex=r.options.indexOf(n))}return{...e,...r}},8:(e,t)=>{let n=HF(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},GF=(0,c.createContext)(null);function WF(e){let t=(0,c.useContext)(GF);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,WF),t}return t}function qF(e,t){return La(t.type,VF,e,t)}GF.displayName="ListboxContext";let KF=c.Fragment,JF=Ha((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,horizontal:u=!1,multiple:d=!1,...p}=e;const h=u?"horizontal":"vertical";let f=Xa(n),[m,g]=jf(r,s,i),v=(0,c.useReducer)(qF,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Ja("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a)}},labelRef:(0,c.createRef)(),buttonRef:(0,c.createRef)(),optionsRef:(0,c.createRef)(),disabled:l,orientation:h,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:y,propsRef:b,optionsRef:S,buttonRef:x},w]=v;b.current.value=m,b.current.mode=d?1:0,qa((()=>{b.current.onChange=e=>La(b.current.mode,{0:()=>g(e),1(){let t=b.current.value.slice(),{compare:n}=b.current,r=t.findIndex((t=>n(t,e)));return-1===r?t.push(e):t.splice(r,1),g(t)}})}),[g,b]),qa((()=>w({type:2,disabled:l})),[l]),qa((()=>w({type:3,orientation:h})),[h]),lc([x,S],((e,t)=>{var n;w({type:1}),Sl(t,bl.Loose)||(e.preventDefault(),null==(n=x.current)||n.focus())}),0===y);let C=(0,c.useMemo)((()=>({open:0===y,disabled:l,value:m})),[y,l,m]),A={ref:f};return t(c).createElement(GF.Provider,{value:v},t(c).createElement(rc,{value:La(y,{0:tc.Open,1:tc.Closed})},null!=o&&null!=m&&Bf({[o]:m}).map((([e,n])=>t(c).createElement(ll,{features:al.Hidden,...Va({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),Fa({ourProps:A,theirProps:p,slot:C,defaultTag:KF,name:"Listbox"})))})),QF=Ha((function(e,t){var n;let[r,i]=WF("Listbox.Button"),o=Xa(r.buttonRef,t),s=`headlessui-listbox-button-${sl()}`,a=Tc(),l=Ja((e=>{switch(e.key){case Za.Space:case Za.Enter:case Za.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Ed.First})}));break;case Za.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Ed.Last})}))}})),u=Ja((e=>{if(e.key===Za.Space)e.preventDefault()})),d=Ja((e=>{if(el(e.currentTarget))return e.preventDefault();0===r.listboxState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),i({type:0}))})),p=BF((()=>{if(r.labelRef.current)return[r.labelRef.current.id,s].join(" ")}),[r.labelRef.current,s]),h=(0,c.useMemo)((()=>({open:0===r.listboxState,disabled:r.disabled,value:r.propsRef.current.value})),[r]),f=e;return Fa({ourProps:{ref:o,id:s,type:Id(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.listboxState,"aria-labelledby":p,disabled:r.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:h,defaultTag:"button",name:"Listbox.Button"})})),YF=Ha((function(e,t){let[n]=WF("Listbox.Label"),r=`headlessui-listbox-label-${sl()}`;return Fa({ourProps:{ref:Xa(n.labelRef,t),id:r,onClick:Ja((()=>{var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n.listboxState,disabled:n.disabled})),[n]),defaultTag:"label",name:"Listbox.Label"})})),XF=Ba.RenderStrategy|Ba.Static,$F=Ha((function(e,t){var n;let[r,i]=WF("Listbox.Options"),o=Xa(r.optionsRef,t),s=`headlessui-listbox-options-${sl()}`,a=Tc(),l=Tc(),u=nc(),d=null!==u?u===tc.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=dl(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let p=Ja((e=>{switch(l.dispose(),e.key){case Za.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case Za.Enter:if(e.preventDefault(),e.stopPropagation(),null!==r.activeOptionIndex){let{dataRef:e}=r.options[r.activeOptionIndex];r.propsRef.current.onChange(e.current.value)}0===r.propsRef.current.mode&&(i({type:1}),ul().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case La(r.orientation,{vertical:Za.ArrowDown,horizontal:Za.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ed.Next});case La(r.orientation,{vertical:Za.ArrowUp,horizontal:Za.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ed.Previous});case Za.Home:case Za.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ed.First});case Za.End:case Za.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ed.Last});case Za.Escape:return e.preventDefault(),e.stopPropagation(),i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case Za.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),h=BF((()=>{var e,t,n;return null!=(n=null==(e=r.labelRef.current)?void 0:e.id)?n:null==(t=r.buttonRef.current)?void 0:t.id}),[r.labelRef.current,r.buttonRef.current]),f=(0,c.useMemo)((()=>({open:0===r.listboxState})),[r]),m=e;return Fa({ourProps:{"aria-activedescendant":null===r.activeOptionIndex||null==(n=r.options[r.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===r.propsRef.current.mode||void 0,"aria-labelledby":h,"aria-orientation":r.orientation,id:s,onKeyDown:p,role:"listbox",tabIndex:0,ref:o},theirProps:m,slot:f,defaultTag:"ul",features:XF,visible:d,name:"Listbox.Options"})})),ZF=Ha((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=WF("Listbox.Option"),a=`headlessui-listbox-option-${sl()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,p=La(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),h=(0,c.useRef)(null),f=Xa(t,h);qa((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=ul();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=h.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[h,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]);let m=(0,c.useRef)({disabled:n,value:r,domRef:h});qa((()=>{m.current.disabled=n}),[m,n]),qa((()=>{m.current.value=r}),[m,r]),qa((()=>{var e,t;m.current.textValue=null==(t=null==(e=h.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,h]);let g=Ja((()=>o.propsRef.current.onChange(r)));qa((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Ja((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),ul().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Ja((()=>{if(n)return s({type:4,focus:Ed.Nothing});s({type:4,focus:Ed.Specific,id:a})})),b=Ja((()=>{n||l||s({type:4,focus:Ed.Specific,id:a,trigger:0})})),S=Ja((()=>{n||!l||s({type:4,focus:Ed.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:p,disabled:n})),[l,p,n]);return Fa({ourProps:{id:a,ref:f,role:"option",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,"aria-selected":p,disabled:void 0,onClick:v,onFocus:y,onPointerMove:b,onMouseMove:b,onPointerLeave:S,onMouseLeave:S},theirProps:i,slot:x,defaultTag:"li",name:"Listbox.Option"})})),eU=Object.assign(JF,{Button:QF,Label:YF,Options:$F,Option:ZF});var tU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false",role:"img",className:e,fill:"currentColor","aria-label":t,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",clipRule:"evenodd"})});const nU={en:["January","February","March","April","May","June","July","August","September","October","November","December"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},rU=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=ge(),[o,a]=(0,c.useState)(e?"string"==typeof e?hL.DateTime.fromISO(e):hL.DateTime.fromJSDate(e):hL.DateTime.now());return(0,c.useEffect)((()=>{t(o)}),[o,t]),(0,s.jsxs)("div",{className:"memori--date-selector",children:[(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(eU,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(eU.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(eU.Button,{"aria-label":r("day"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.day}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(tU,{})})]}),(0,s.jsx)(Gc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(eU.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(eU.Option,{value:o.set({day:e+1}),className:"memori--date-selector__select-option",children:e+1},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(eU,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(eU.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(eU.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:nU["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(tU,{})})]}),(0,s.jsx)(Gc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(eU.Options,{className:"memori--date-selector__select-options",children:nU["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(eU.Option,{className:"memori--date-selector__select-option",value:o.set({month:nU["it"===i.language?"it":"en"].findIndex((t=>t===e))+1}),children:e},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(eU,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(eU.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(eU.Button,{"aria-label":r("year"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.year}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(tU,{})})]}),(0,s.jsx)(Gc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(eU.Options,{className:"memori--date-selector__select-options",children:[...Array(hL.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(eU.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));rU.displayName="DateSelector";var iU=rU;c=o("85Hg2");var oU=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=ge(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),[d,p]=(0,c.useState)(!1),h=(0,c.useCallback)((()=>{if(p(!0),!o)return t(bs).error(i("requiredField")),u(i("requiredField")||"Required field"),void p(!1);if(hL.DateTime.now().diff(o,"years").years<r)return t(bs).error(i("underageTwinSession",{age:r})),u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`),void p(!1);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(Kc,{open:e,title:i("ageVerification"),className:"age-verification-modal",closable:!0,onClose:()=>n(),children:[(0,s.jsx)("p",{children:i("ageVerificationText",{minAge:r})}),(0,s.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),h()},children:[(0,s.jsx)("div",{className:"form-item",children:(0,s.jsxs)("fieldset",{name:"birthDate",children:[(0,s.jsx)("legend",{className:"sr-only",children:i("birthDate")}),(0,s.jsx)(iU,{defaultDate:new Date(Date.now()),onChange:e=>{a(e)}}),(0,s.jsx)("p",{className:"form-item-help",children:i("birthDateHelper")}),l&&(0,s.jsx)("p",{className:"form-item-error",children:l})]})}),(0,s.jsx)("div",{className:"form-item form-submit",children:(0,s.jsx)(Na,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var sU=({open:e=!1,onClose:n,className:r,title:i,description:o,children:a,footer:l,loading:u=!1,side:d="right",closable:p=!0,width:h="100%",widthMd:f="80%",widthLg:m="60%"})=>(0,s.jsx)(Gc,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(wc,{open:e,onClose:n,className:t(vs)("memori-drawer",r),children:[(0,s.jsx)(Gc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"memori-drawer--backdrop"})}),(0,s.jsx)("div",{className:"memori-drawer--container",children:(0,s.jsx)("div",{className:"memori-drawer--container-scrollable",children:(0,s.jsx)(Gc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"max-w-0 opacity-0",enterTo:"max-w-100 opacity-100",leave:"ease-in duration-200",leaveFrom:"max-w-100 opacity-100",leaveTo:"max-w-0 opacity-0",children:(0,s.jsxs)(wc.Panel,{className:t(vs)("memori-drawer--panel",{"memori-drawer--panel-left":"left"===d,"memori-drawer--with-footer":!!l}),children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-drawer--panel {\n --memori-drawer--width: ${h};\n --memori-drawer--width-lg: ${m};\n --memori-drawer--width-md: ${f};\n }\n `}}),p&&(0,s.jsx)("div",{className:"memori-drawer--close",children:(0,s.jsx)(Na,{shape:"circle",outlined:!0,icon:(0,s.jsx)(qc,{}),onClick:()=>n(!1)})}),(0,s.jsxs)(Wc,{spinning:u,children:[i&&(0,s.jsx)(wc.Title,{className:"memori-drawer--title",children:i}),o&&(0,s.jsx)(wc.Description,{className:"memori-drawer--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-drawer--footer",children:l})]})]})})})})]})});c=o("85Hg2");var aU=({label:e,className:n,disabled:r=!1,indeterminate:i=!1,checked:o,children:a,onChange:l,name:u,...d})=>{const p=(0,c.useRef)(null);return(0,c.useEffect)((()=>{p.current&&(p.current.indeterminate=i)}),[p,i]),(0,s.jsxs)("label",{className:t(vs)("memori-checkbox",n,{"memori-checkbox--disabled":r,"memori-checkbox--indeterminate":i}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{ref:p,type:"checkbox",...d,name:u,disabled:r,checked:o||i,className:"memori-checkbox--input",onChange:l}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),!!(null==e?void 0:e.length)&&(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]})};c=o("85Hg2");var lU=({className:e,value:n,displayValue:r,options:i,onChange:o,disabled:a=!1,label:l,placeholder:u})=>(0,s.jsx)("div",{className:t(vs)("memori-select",e),children:(0,s.jsxs)(eU,{value:n,onChange:e=>{o(e)},disabled:a,name:"day",children:[l&&(0,s.jsxs)(eU.Label,{className:"memori-select--label",children:[l,":"]}),(0,s.jsxs)(eU.Button,{"aria-label":l,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(vs)("memori-select--value",{"memori-select--value-placeholder":!n}),children:n?r||n:u}),(0,s.jsx)("span",{className:"memori-select--icon",children:(0,s.jsx)(tU,{})})]}),(0,s.jsx)(Gc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(eU.Options,{className:"memori-select--options",children:i.map((e=>(0,s.jsx)(eU.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const cU={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions"},uU=(e,t)=>{var n;const r=window.localStorage.getItem(null!==(n=cU[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}},dU=(e,t)=>{var n;window.localStorage.setItem(null!==(n=cU[e])&&void 0!==n?n:e,t.toString())},pU=[2,3,5,10,15,20,30,60];var hU=({open:e,layout:t="DEFAULT",onClose:n,microphoneMode:r="HOLD_TO_TALK",continuousSpeechTimeout:i,setMicrophoneMode:o,setContinuousSpeechTimeout:a,controlsPosition:l,setControlsPosition:c,hideEmissions:u,setHideEmissions:d,additionalSettings:p})=>{const{t:h}=ge();return(0,s.jsxs)(sU,{className:"memori-settings-drawer",open:e,onClose:n,title:h("widget.settings")||"Settings",description:h("write_and_speak.settingsHeaderLabel"),children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#microphoneMode",children:[h("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,s.jsxs)(Xf,{id:"microphoneMode",name:"microphoneMode",value:r,defaultValue:r,className:"memori-settings-drawer--microphoneMode-radio",onChange:e=>{let t="CONTINUOUS"===e?"CONTINUOUS":"HOLD_TO_TALK";o(t),dU("microphoneMode",t)},children:[(0,s.jsx)(Xf.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Na,{primary:e,children:h("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)(Xf.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Na,{primary:e,children:h("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(lU,{label:h("write_and_speak.secondsLabel")||"Seconds",placeholder:h("write_and_speak.secondsLabel")||"Seconds",options:pU.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),dU("continuousSpeechTimeout",e)}})}),"TOTEM"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#controlsPosition",children:[h("write_and_speak.controlsPosition")||"Controls",":"]}),(0,s.jsxs)(Xf,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),dU("controlsPosition",e)},children:[(0,s.jsx)(Xf.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Na,{primary:e,children:h("center")||"Center"})}),(0,s.jsx)(Xf.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Na,{primary:e,children:h("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(aU,{label:h("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),dU("hideEmissions",e.target.checked)}})})]}),p&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:p})]})};c=o("85Hg2");const fU=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_CANT_EDIT_INTEGRATIONS:-37,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905}).map((([e,t])=>[t,e]))),mU=e=>{if(!e)return"error.generic";if(401===e||403===e)return"error.unauthorized";if(404===e)return"error.notFound";if(422===e)return"error.unprocessableEntity";if(500===e)return"internal server error";let t=fU.get(e);return t?`errors.${t}`:"error.generic"};var gU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})});var vU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M15 18L9 12 15 6"})});var yU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M9 18L15 12 9 6"})});var bU=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=ge(),d=W(e),{getKnownFactsPaginated:p,deleteKnownFact:h}=d.knownFacts,[f,m]=(0,c.useState)(o),[g,v]=(0,c.useState)(25),[y,b]=(0,c.useState)(0),[S,x]=(0,c.useState)(null!==(l=null==o?void 0:o.length)&&void 0!==l?l:0),[w,C]=(0,c.useState)(!1),A=async(e,r,i)=>{if(n||e){C(!0);try{const{knownFacts:o,count:s,...a}=await p(null!=e?e:n,null!=r?r:y,null!=i?i:g);m(null!=o?o:[]),x(null!=s?s:0),0!==a.resultCode&&(console.error(a),t(bs).error(u(mU(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}C(!1)}};(0,c.useEffect)((()=>{A()}),[]);const[E,M]=(0,c.useState)(!1),[_,T]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(sU,{open:i,width:"80%",className:"memori-known-facts-drawer",onClose:()=>a(),title:u("knownFacts.title"),children:[(0,s.jsx)("p",{children:u("knownFacts.description",{memoriName:r.name})}),(0,s.jsxs)(Wc,{spinning:w,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(Na,{primary:!0,danger:!0,onClick:()=>{M(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(gU,{}),loading:w,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Kc,{className:"memori-known-facts-modal",open:E,closable:!0,title:I.length>1?u("knownFacts.deleteSelectedConfirmTitle"):u("knownFacts.deleteConfirmTitle"),description:I.length>1?u("knownFacts.deleteSelectedConfirmMessage",{number:I.length}):u("knownFacts.deleteConfirmMessage"),onClose:()=>{M(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Na,{ghost:!0,onClick:()=>{M(!1)},children:u("cancel")}),(0,s.jsx)(Na,{primary:!0,danger:!0,onClick:async()=>{try{const e=I.map((e=>h(n,e)));Promise.all(e).then((e=>{if(e.every((e=>0===e.resultCode)))t(bs).success(u("knownFacts.deleteSuccess")),R([]),A(),M(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(bs).error(u(mU(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(bs).error(u("Error")+n.message)}},children:u("confirm")})]})})]}),S>25&&(0,s.jsxs)("nav",{className:"memori--table--pagination",children:[S>g&&(0,s.jsxs)("div",{className:"memori--table--pagination--pages",children:[(0,s.jsx)(Na,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(vU,{}),onClick:()=>{let e=(y/g-1)*g;b(e),A(void 0,e,g)}}),(0,s.jsxs)("span",{className:"memori--table--pagination--pages--current",children:[Math.ceil(y/g)+1," /"," ",Math.ceil(S/g)]}),(0,s.jsx)(Na,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(yU,{}),disabled:(y/g+1)*g>=S,onClick:()=>{let e=(y/g+1)*g;b(e),A(void 0,e,g)}})]}),(0,s.jsx)(lU,{options:[{label:`25 / ${u("page")||"page"}`,value:25},{label:`50 / ${u("page")||"page"}`,value:50},{label:`100 / ${u("page")||"page"}`,value:100}],value:g,displayValue:`${g} / ${u("page")||"page"}`,onChange:e=>{v(e),b(0),A(void 0,0,e)}})]}),(0,s.jsxs)("table",{className:"memori--table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(aU,{checked:!!(null==f?void 0:f.length)&&(null==I?void 0:I.length)===f.length,indeterminate:!!(null==f?void 0:f.length)&&!!(null==I?void 0:I.length)&&(null==I?void 0:I.length)!==(null==f?void 0:f.length),onChange:e=>{e.target.checked?R(f.map((e=>e.knownFactID))):R([])}})}),(0,s.jsx)("th",{children:u("knownFacts.text")}),(0,s.jsx)("th",{className:"mobile-hidden",children:u("createdAt")}),(0,s.jsx)("th",{className:"memori--table--column-right",children:u("actions")})]})}),(0,s.jsx)("tbody",{children:f.map((e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(aU,{checked:null==I?void 0:I.includes(e.knownFactID),onChange:t=>{t.target.checked?R((t=>[...new Set([...t,e.knownFactID])])):R((t=>t.filter((t=>t!==e.knownFactID))))}})}),(0,s.jsx)("td",{children:e.text}),(0,s.jsx)("td",{className:"mobile-hidden",children:(0,s.jsx)("span",{className:"memori--table--date",children:e.creationTimestamp?new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date(e.creationTimestamp)):"-"})}),(0,s.jsx)("td",{className:"memori--table--column-right",children:(0,s.jsxs)("div",{className:"memori--table--action-column",children:[(0,s.jsx)(Na,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(gU,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>T(e.knownFactID)}),(0,s.jsx)(Kc,{className:"memori-known-facts-modal",open:_===e.knownFactID,closable:!0,title:u("knownFacts.deleteConfirmTitle"),description:u("knownFacts.deleteConfirmMessage"),onClose:()=>{T(void 0)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Na,{ghost:!0,onClick:()=>{T(void 0)},children:u("cancel")}),(0,s.jsx)(Na,{primary:!0,danger:!0,onClick:async()=>{try{const r=await h(n,e.knownFactID);0===r.resultCode?(t(bs).success(u("knownFacts.deleteSuccess")),R([]),A(),T(void 0)):(console.error(r),t(bs).error(u(mU(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(bs).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var SU=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=ge();return(0,s.jsx)(sU,{open:e,onClose:o,className:"memori--experts-drawer",title:(0,s.jsx)("h2",{className:"memori--experts-drawer--title",children:a("widget.expertsInTheBoard")}),children:(0,s.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map((e=>(0,s.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,s.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,s.jsx)("img",{src:`${n}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=xd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,s.jsxs)("div",{className:"memori--experts-drawer--content",children:[(0,s.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name}),(0,s.jsx)("p",{className:"memori--experts-drawer--description",children:e.description})]})]},e.expertID)))})})};var xU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(Wc,{spinning:g,children:[m&&d&&p&&(0,s.jsx)(d,{...p}),e&&t&&(0,s.jsx)(e,{...t}),(0,s.jsxs)("div",{className:"memori--grid",children:[(0,s.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[n&&r&&(0,s.jsx)(n,{...r}),(0,s.jsx)("div",{id:"extension"})]}),(0,s.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null}),v]})]})]});var wU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(Wc,{spinning:g,className:"memori-totem-layout",children:[v,m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,s.jsx)(n,{...r})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-totem-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]});var CU=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:o,integrationStyle:a,integrationBackground:l,ChangeMode:c,changeModeProps:u,sessionId:d,hasUserActivatedSpeak:p,showInstruct:h=!1,loading:f=!1,poweredBy:m})=>(0,s.jsxs)(s.Fragment,{children:[a,l,(0,s.jsxs)(Wc,{spinning:f,className:"memori-chat-layout",children:[m,h&&c&&u&&(0,s.jsx)(c,{...u}),(0,s.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-chat-layout--controls",children:d&&p&&n&&r?(0,s.jsx)(n,{...r}):o?(0,s.jsx)(i,{...o}):null})]})]});c=o("85Hg2"),c=o("85Hg2");var AU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>{var y,b;const{t:S}=ge(),[x,w]=(0,c.useState)(!0),[C,A]=(0,c.useState)(),E=(0,c.useMemo)((()=>null==o?void 0:o.stopAudio),[null==o?void 0:o.stopAudio]),M=e=>{w(e),A(e?void 0:(new Date).toISOString());try{null==E||E()}catch(e){console.log(e)}};return(0,s.jsx)("div",{className:"memori-website_assistant--"+(x?"collapsed":"expanded"),children:x?(0,s.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,s.jsx)(Na,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>M(!1),title:S("expand")||"Expand",children:(0,s.jsx)(tN,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(Wc,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Na,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>M(!0),icon:(0,s.jsx)(qc,{}),title:S("close")||"Close"})}),m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--header",children:e&&t&&(0,s.jsx)(e,{...t,showSettings:!1,showReload:!1})}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,c.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null===(y=r.integrationConfig)||void 0===y?void 0:y.avatarURL)?`${null===(b=r.integrationConfig)||void 0===b?void 0:b.avatarURL.split("#")[0]}#${C}`:void 0}:{},key:C})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]})})};const{deleteSession:EU,getStatistics:MU,initSession:_U}=W(),TU=new Map([[0,"🆕"],[10,"🐹"],[20,"🐇"],[30,"🐰"],[40,"💡"],[50,"🏆"],[60,"🏅"],[70,"🥉"],[80,"🥈"],[90,"🥇"],[100,"🔥"],[110,"🎓"],[120,"🤖"],[130,"👾"],[150,"🌍"],[180,"💜"],[200,"💙"],[250,"🧡"],[300,"💚"],[350,"💛"],[400,"💖"],[450,"💝"],[500,"🖤"],[550,"❤️"],[600,"🧠"]]),IU=e=>{const t=Array.from(TU.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return TU.get(e)}return""},RU=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of TU){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},PU=e=>{let t=0;for(const[n,r]of TU)if(r===e){t=n;break}return t},kU=e=>{const t=Math.round(e),n=IU(t);return{points:t,badge:n,pointsForCurrentBadge:PU(n),nextBadge:RU(n)}},OU=(e,t=!0,n=!1,r,i=!1,o=!1)=>{const s=new CustomEvent("MemoriTextEntered",{detail:{text:e,waitForPrevious:t,hidden:n,typingText:r,useLoaderTextAsMsg:i,hasBatchQueued:o}});document.dispatchEvent(s);window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))}),300)};let NU,LU,DU,BU,zU,FU;window.getMemoriState=e=>{var t,n,r,i,o;let s=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(i=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector(".memori-widget"));if(!s)return null;let a=null===(o=s.dataset)||void 0===o?void 0:o.memoriEngineState;return a?JSON.parse(a):null},window.typeMessage=OU,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>OU(e,t,!0,n,r,i),window.typeBatchMessages=e=>{function t(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.setAttribute("disabled","");const i="opacity: 0.5; touch-action: none; pointer-events: none;";null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.setAttribute("style",i),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.setAttribute("style",i),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.setAttribute("style",i)}function n(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.removeAttribute("disabled"),null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.removeAttribute("style"),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.removeAttribute("style"),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.removeAttribute("style")}function r(){var e;return!!(null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e?void 0:e.hasAttribute("disabled"))}const i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),o=function*(){yield*e}();t();const s=()=>{const e=o.next(),a=e.value;if(a){r()||t();let o=a.waitForPrevious;i&&(o=!1),OU(a.message,o,a.hidden,a.typingText,a.useLoaderTextAsMsg,!e.done),i&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),n()}),3e3)}else r()&&n();if(e.done)return document.removeEventListener("MemoriEndSpeak",s),void(r()&&n())};document.addEventListener("MemoriEndSpeak",s),s()};let UU=!1,jU=!1;var HU=({memori:e,memoriConfigs:n,memoriLang:r,multilingual:i,integration:o,layout:a="DEFAULT",customLayout:l,showInstruct:u=!1,showShare:d,preview:p=!1,embed:h=!1,showInputs:f=!0,showDates:m=!1,showContextPerLine:g=!1,showSettings:v=!0,showTypingText:y=!1,showClear:b=!1,showOnlyLastMessages:S,height:x="100vh",secret:w,baseUrl:C="https://app.twincreator.com",apiUrl:A="https://backend.memori.ai",initialContextVars:E,initialQuestion:M,ogImage:_,sessionID:T,tenant:I,personification:R,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:k,onStateChange:O,additionalInfo:N,additionalSettings:L,customMediaRenderer:D,userAvatar:B})=>{var z,F,U,j,H,V,G,q,K,J,Q,Y,X,$,Z,ee,te,ne,re,ie,oe,se;const{t:ae,i18n:le}=ge(),[ce,ue]=(0,c.useState)(!1);(0,c.useEffect)((()=>{ue(!0)}),[]);const de=W(A),{initSession:pe,postTextEnteredEvent:he,postPlaceChangedEvent:fe,postTimeoutEvent:me,postTagChangedEvent:ve,getSession:ye,getContentQualityIndexes:be,getExpertReferences:Se}=de,[xe,we]=(0,c.useState)(!1),[Ce,Ae]=(0,c.useState)({avatarURL:"string"==typeof B?B:void 0}),[Ee,Me]=(0,c.useState)(!1),[_e,Te]=(0,c.useState)(!1),Ie=(null===(U=null===(F=null===(z=e.culture)||void 0===z?void 0:z.split("-"))||void 0===F?void 0:F[0])||void 0===U?void 0:U.toUpperCase())||(null===(G=null===(V=null===(H=null===(j=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===j?void 0:j.culture)||void 0===H?void 0:H.split("-"))||void 0===V?void 0:V[0])||void 0===G?void 0:G.toUpperCase()),Re=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,Pe=void 0!==i?i:!!(null==Re?void 0:Re.multilanguage),[ke,Oe]=(0,c.useState)(null!==(Q=null!==(J=null!==(K=null!==(q=null!=r?r:null==Re?void 0:Re.lang)&&void 0!==q?q:Ie)&&void 0!==K?K:null==Re?void 0:Re.uiLang)&&void 0!==J?J:le.language)&&void 0!==Q?Q:"IT"),[Ne,Le]=(0,c.useState)(!1),[De,Be]=(0,c.useState)(!1),[ze,Fe]=(0,c.useState)(),Ue=a||(null==Re?void 0:Re.layout)||"DEFAULT",[je,He]=(0,c.useState)(!1),[Ve,Ge]=(0,c.useState)(!1),[We,qe]=(0,c.useState)(!1),[Ke,Je]=(0,c.useState)(!1),[Qe,Ye]=(0,c.useState)(!1),[Xe,$e]=(0,c.useState)(!1),[Ze,et]=(0,c.useState)(!1),[tt,nt]=(0,c.useState)(!1),[rt,it]=(0,c.useState)(2),[ot,st]=(0,c.useState)(!1),[at,lt]=(0,c.useState)("center"),[ct,ut]=(0,c.useState)(!1);(0,c.useEffect)((()=>{st(!!DU),jU=!!DU}),[DU]),(0,c.useEffect)((()=>{let e="bottom",t=uU("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(e="bottom",t="HOLD_TO_TALK"):e=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",et(uU("muteSpeaker",!1)),UU=uU("muteSpeaker",!1),nt("CONTINUOUS"===t),it(uU("continuousSpeechTimeout",2)),lt(uU("controlsPosition",e)),ut(uU("hideEmissions",!1))}),[]);const[dt,pt]=(0,c.useState)(w),[ht,ft]=(0,c.useState)(),[mt,gt]=(0,c.useState)(null),[vt,yt]=(0,c.useState)(),bt=async(e,t)=>{var n;const r=null!=t?t:Nt;if(e&&r){const{currentState:t,...i}=await fe({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===i.resultCode&&zt({...Dt,...t})}},[St,xt]=(0,c.useState)(""),[wt,Ct]=(0,c.useState)(!1),[At,Et]=(0,c.useState)([]),Mt=e=>{Et((t=>{var n,r;return[...t,{...e,media:null!==(r=null===(n=e.media)||void 0===n?void 0:n.filter((e=>{var t;return!("text/javascript"===e.mimeType&&(null===(t=e.properties)||void 0===t?void 0:t.executable))})))&&void 0!==r?r:[]}]}))},_t=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,p,h,f;const m=i||Nt||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||Mt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Nt?!!i&&i!==Nt:!!i}),Be(!0),Fe(l);let g=n,v=!1;if(o&&!xe&&Pe&&ke.toUpperCase()!==Ie.toUpperCase()){g=(await ap(n,Ie,ke,C)).text}const{currentState:y,...b}=await he({sessionId:m,text:g});if(0===b.resultCode&&y){const n=c&&l?l:null!==(p=y.emission)&&void 0!==p?p:null==Dt?void 0:Dt.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await ve(m,e.giverTag);0===i.resultCode?(zt(r),n&&(Mt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),en(n))):(console.error(b,i),t(bs).error(ae(mU(i.resultCode))),v=!0)}else if("X2d"===y.state&&e.giverTag){const{currentState:r,...i}=await he({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await ve(m,e.giverTag);0===i.resultCode?(zt(r),n&&(Mt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),en(n))):(console.error(b,i),t(bs).error(ae(mU(i.resultCode))),v=!0)}else console.error(b,i),t(bs).error(ae(mU(i.resultCode))),v=!0}else ke.toLowerCase()!==Ie.toLowerCase()&&n&&!xe&&Pe?Tt(y,ke).then((e=>{e.emission&&en(e.emission)})):(zt({...y,emission:n}),n&&(Mt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,generatedByAI:!!y.completion}),en(n)))}else 404===b.resultCode&&(Et((e=>[...e.slice(0,e.length-1)])),Ut(!1,dt||e.secretToken,ht,xe&&e.giverTag?e.giverTag:void 0,xe&&e.giverPIN?e.giverPIN:void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(f=null===(h=window.location.pathname)||void 0===h?void 0:h.split("/"))||void 0===f?void 0:f.pop())||"",...E||{}},M).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{_t(n,r,null==e?void 0:e.sessionID)}),500)})));u||(Fe(void 0),Be(!1))},Tt=async(e,t)=>{var n,r,i;const o=null!==(n=e.emission)&&void 0!==n?n:null==Dt?void 0:Dt.emission;let s={...e},a=null;if(o&&!xe&&Ie.toUpperCase()!==t.toUpperCase()&&Pe){const n=await ap(o,t,Ie,C);if(e.hints&&e.hints.length>0){const i=await Promise.all((null!==(r=e.hints)&&void 0!==r?r:[]).map((async e=>{var n;const r=await ap(e,t,Ie,C);return{text:null!==(n=null==r?void 0:r.text)&&void 0!==n?n:e,originalText:e}})));s={...e,emission:n.text,translatedHints:i}}else s={...e,emission:n.text,hints:null!==(i=e.hints)&&void 0!==i?i:"G1"===e.state?null==Dt?void 0:Dt.hints:[]};n.text.length>0&&(a={text:n.text,emitter:e.emitter,media:e.media,fromUser:!1,generatedByAI:!!e.completion})}else s={...e,emission:o},o&&(a={text:o,emitter:e.emitter,media:e.media,fromUser:!1});return zt(s),a&&Mt(a),s},It=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[Rt,Pt]=(0,c.useState)(),[kt,Ot]=(0,c.useState)(!1),[Nt,Lt]=(0,c.useState)(T),[Dt,Bt]=(0,c.useState)(),zt=e=>{var t;Bt(e),O&&O(e);const n=null===(t=null==e?void 0:e.media)||void 0===t?void 0:t.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)}));null==n||n.forEach((e=>{try{setTimeout((()=>{var t;console.log("snippet",e),new Function(null!==(t=e.content)&&void 0!==t?t:"")(),setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),400)}),1e3)}catch(e){console.error(e)}}))},Ft=async n=>{var r,i,o,s,a;let l=uU("birthDate",void 0);if(Rt||l||!It)if("PUBLIC"===e.privacyType||e.secretToken||dt||ht){Le(!0);try{if(!e.giverTag&&(null===(r=e.receivedInvitations)||void 0===r?void 0:r.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}let l;try{l=window.location.href}catch(e){console.error(e)}const c=await pe({...n,tag:null!==(i=n.tag)&&void 0!==i?i:null==R?void 0:R.tag,pin:null!==(o=n.pin)&&void 0!==o?o:null==R?void 0:R.pin,additionalInfo:{...N||{},loginToken:null!==(a=null!==(s=null==N?void 0:N.loginToken)&&void 0!==s?s:kn)&&void 0!==a?a:P,language:Yt(ke),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Lt(c.sessionID),vt&&bt(vt,c.sessionID),Le(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(c),t(bs).error(ae("underageTwinSession",{age:It})),Te(!0)):403===(null==c?void 0:c.resultCode)?(pt(void 0),gt("password")):(console.error(c),t(bs).error(ae(mU(null==c?void 0:c.resultCode))),Te(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else gt("password");else Ot(!0)},Ut=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,p,h,f;Le(!0);try{let m,g=uU("birthDate",void 0);if(!c&&!g&&It)return void Ot(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||dt||i||ht))return void gt("password");try{m=window.location.href}catch(e){console.error(e)}const{sessionID:v,currentState:y,...b}=await pe({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||dt||e.secretToken,recoveryTokens:i||ht,tag:o,pin:s,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(p=null===(d=window.location.pathname)||void 0===d?void 0:d.split("/"))||void 0===p?void 0:p.pop())||"",...a||{}},initialQuestion:l,birthDate:c||g||void 0,additionalInfo:{...N||{},loginToken:null!==(f=null!==(h=null==N?void 0:N.loginToken)&&void 0!==h?h:kn)&&void 0!==f?f:P,language:Yt(ke),referral:m}});if(v&&y&&0===b.resultCode)return Lt(v),n&&(zt(y),y.emission&&(At.length<=1?Et([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}]):Mt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}))),vt&&bt(vt,v),Le(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(bs).error(ae("underageTwinSession",{age:It})),Te(!0)):403===(null==b?void 0:b.resultCode)?(pt(void 0),gt("password")):(console.error(b),t(bs).error(ae(mU(b.resultCode))),Te(!0))}catch(e){console.error(e)}return Le(!1),null},jt=async(t,n,r,i)=>{var o,s,a,l,c;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:u}=await ve(n,null!=r?r:cp);if(0===u){let d=0;if(r!==cp&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await he({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await ye(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(u)){console.warn("[APPCONTEXT/CHANGETAG]",u);let t,n=uU("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}Ft({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:w||dt||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...E||{}},initialQuestion:M,birthDate:Rt||n||void 0,additionalInfo:{...N||{},loginToken:null!==(c=null!==(l=null==N?void 0:N.loginToken)&&void 0!==l?l:kn)&&void 0!==c?c:P,language:Yt(ke),referral:t}})}else if(t)return{currentState:t,sessionId:n,resultCode:u}}}catch(e){let t=e;return console.error("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,c.useEffect)((()=>()=>{Dt&&(null==Dt?void 0:Dt.currentTag)===e.giverTag||(async()=>{Nt&&e.giverTag&&e.giverPIN&&(Et([]),await jt(e.engineMemoriID,Nt,e.giverTag,e.giverPIN))})()}),[]);const[Ht,Vt]=(0,c.useState)(),Gt=(0,c.useRef)(),Wt=()=>{Ht&&(clearTimeout(Ht),Vt(void 0)),(null==Gt?void 0:Gt.current)&&(clearTimeout(Gt.current),Gt.current=void 0)},qt=()=>{Wt(),!(null==Dt?void 0:Dt.acceptsTimeout)||DU||ot||St.length||De||wt||Jt()},Kt=async()=>{var e;if(DU||ot||St.length||De||wt)qt();else if(Nt&&je&&(null==Dt?void 0:Dt.acceptsTimeout)){const{currentState:t,...n}=await me(Nt);if(0===n.resultCode&&t){const n=t.emission;!xe&&Pe&&ke!==(null==le?void 0:le.language)&&n&&n.length>0?Tt({...t,emission:n},ke).then((e=>{e.emission&&en(e.emission)})):n&&n.length>0&&(Mt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion}),en(n),zt({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==Dt?void 0:Dt.hints:[]}))}}},Jt=()=>{let e=null==Dt?void 0:Dt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==Dt?void 0:Dt.emission){e+=Dt.emission.length/26.5}}let t=setTimeout(Kt,1e3*e);Vt(t),Gt.current=t};(0,c.useEffect)((()=>{(St.length||ot||De)&&Wt(),Nt&&!St.length&&qt()}),[null==Dt?void 0:Dt.acceptsTimeout,null==Dt?void 0:Dt.timeout,null==Dt?void 0:Dt.state,ot,Nt,At,St,De]),(0,c.useEffect)((()=>()=>{He(!1),Me(!1),Wt(),Gt.current=void 0}),[]);const Qt=(0,c.useCallback)((t=>{var n,r,i,o;let s="";switch((null!==(o=null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i?i:le.language)&&void 0!==o?o:"IT").toUpperCase()){case"IT":s=""+("MALE"===e.voiceType?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":s=""+("MALE"===e.voiceType?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":s=""+("MALE"===e.voiceType?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":s=""+("MALE"===e.voiceType?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":s=""+("MALE"===e.voiceType?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":s=""+("MALE"===e.voiceType?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":s=""+("MALE"===e.voiceType?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":s=""+("MALE"===e.voiceType?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;case"PL":s=""+("MALE"===e.voiceType?"pl-PL-MarekNeural":"pl-PL-AgnieszkaNeural");break;case"FI":s=""+("MALE"===e.voiceType?"fi-FI-HarriNeural":"fi-FI-SelmaNeural");break;default:s=""+("MALE"===e.voiceType?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return s}),[e.voiceType,le.language,e.culture]),Yt=t=>{var n,r;let i="";switch((t||(null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])||le.language||"IT").toUpperCase()){case"IT":default:i="it-IT";break;case"DE":i="de-DE";break;case"EN":i="en-GB";break;case"ES":i="es-ES";break;case"FR":i="fr-FR";break;case"PT":i="pt-PT";break;case"UK":i="uk-UK";break;case"RU":i="ru-RU";break;case"PL":i="pl-PL";break;case"FI":i="fi-FI"}return i},[Xt,$t]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${C||"https://app.twincreator.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{$t(e)}))}),[]);const Zt=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},en=e=>{if(!k||p)return void Zt();if(dn(),p)return;if(Ze||UU)return jU=!1,Be(!1),Zt(),void(tt&&ln());BU&&BU.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===zU.state)return void zU.resume().then((()=>en(e)));if("closed"===zU.state){zU=new Go;let e=zU.createBuffer(1,1e4,22050),t=zU.createBufferSource();t.buffer=e,t.connect(zU.destination)}else if("suspended"===zU.state){tn(),zU=new Go;let e=zU.createBuffer(1,1e4,22050),t=zU.createBufferSource();t.buffer=e,t.connect(zU.destination)}if(!DU){n||(BU=new fs.SpeakerAudioDestination);let e=fs.AudioConfig.fromSpeakerOutput(BU);DU=new fs.SpeechSynthesizer(LU,e)}const r=zU.createBufferSource();r.addEventListener("ended",(()=>{st(!1),jU=!1})),BU.onAudioEnd=()=>{st(!1),jU=!1,r.disconnect(),Zt(),gn()},DU.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${Yt(ke)}"><voice name="${Qt(ke)}"><s>${((e,t)=>{var n;if(!Xt)return e;const r={...null!==(n=Xt.common)&&void 0!==n?n:{},...(null==I?void 0:I.id)&&Xt[I.id]?Xt[I.id]:{}},i=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t.toLowerCase()])&&void 0!==n?n:r[e].default,caseSensitive:r[e].caseSensitive}}));return i.reduce(((e,{word:t,phoneme:n,caseSensitive:r})=>e.replace(new RegExp(`\\b${t}\\b`,r?"g":"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})((e=>{const t=document.createElement("textarea");return t.textContent=e,t.innerHTML})(bd(e)),ke.toLowerCase())}</s></voice></speak>`,(i=>{if(i){st(!0),jU=!0;try{zU.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(zU.destination),(At.length<1||t&&n)&&r.start(0)})),zU.onstatechange=()=>{"suspended"===zU.state||"closed"===zU.state?(r.disconnect(),st(!1),jU=!1):"interrupted"===zU.state&&zU.resume()},zU.resume(),DU&&(DU.close(),DU=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),st(!1),jU=!1,DU&&(DU.close(),DU=null),Zt()}}else zU.resume(),st(!1),jU=!1,Zt()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),st(!1),jU=!1,Zt()})),Be(!1)},tn=()=>{st(!1),jU=!1;try{DU&&(DU.close(),DU=null),"closed"!==zU.state&&zU.close(),BU&&(BU.pause(),BU.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==Dt?void 0:Dt.emission]);const[nn,rn]=(0,c.useState)(""),on=()=>rn(""),[sn,an]=(0,c.useState)(null),ln=()=>{let e=setTimeout((async()=>{pn();const e=yd(nn);e.length>0&&wt?(_t(e),on(),xt("")):wt&&qt()}),1e3*rt);an(e)},cn=()=>{sn&&(clearTimeout(sn),an(null))};(0,c.useEffect)((()=>{cn(),tt&&ln(),qt()}),[nn]);const un=()=>{if(k){pn(),rn(""),on();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){Ge(!0),LU||(LU=fs.SpeechConfig.fromSubscription(k,"eastus"),LU.speechRecognitionLanguage=Yt(ke),LU.speechSynthesisLanguage=Yt(ke),LU.speechSynthesisVoiceName=Qt(ke));const t=fs.AudioConfig.fromDefaultMicrophoneInput();NU=new fs.SpeechRecognizer(LU,t),Ct(!0),NU.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===fs.ResultReason.RecognizedSpeech){let e=t.result.text;if(rn(e||""),(null==e?void 0:e.length)>0){const t=yd(e);t.length>0&&xt((e=>`${e} ${t}`))}}else t.result.reason===fs.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},NU.canceled=(e,t)=>{t.reason===fs.CancellationReason.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),dn()},NU.sessionStopped=(e,t)=>{dn()},on(),NU.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},dn=()=>{NU&&(NU.stopContinuousRecognitionAsync(),NU.close(),NU=null),Ct(!1)},pn=()=>{Ge(!1),dn(),cn()},hn=()=>{try{pn(),Wt(),Me(!1),Gt.current=void 0,tn()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{hn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",hn),()=>{document.removeEventListener("MemoriResetUIEffects",hn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==Dt?void 0:Dt.state)&&pn()}),[null==Dt?void 0:Dt.state]);const[fn,mn]=(0,c.useState)(!1),gn=(0,c.useCallback)((e=>{ot&&DU&&(DU.close(),DU=null),!tt||!Ve&&fn||(mn(!0),un())}),[tt,Ve]);(0,c.useEffect)((()=>{At.length>1&&!ot&&tt&&(Ve||!fn)?un():ot&&wt&&dn()}),[ot]),(0,c.useEffect)((()=>{wt&&(pn(),on(),xt(""),un())}),[Ie]);const[vn,yn]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=uU("sendOnEnter","keypress");window.innerWidth<=768?yn("click"):yn(e)}),[]),(0,c.useEffect)((()=>{dU("sendOnEnter",vn)}),[vn]);const[bn,Sn]=(0,c.useState)(),xn=null==Re?void 0:Re.globalBackground,wn=xn?`url(${xn})`:null,Cn=o?{"--memori-chat-bubble-bg":"#fff",...Re&&!u?{"--memori-text-color":null!==(Y=Re.textColor)&&void 0!==Y?Y:"#000"}:{},...(null==Re?void 0:Re.buttonBgColor)?{"--memori-button-bg":Re.buttonBgColor,"--memori-primary":Re.buttonBgColor}:{},...(null==Re?void 0:Re.buttonTextColor)?{"--memori-button-text":Re.buttonTextColor}:{},...(null==Re?void 0:Re.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==Re?void 0:Re.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===Re.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(X=Re.innerBgAlpha)&&void 0!==X?X:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===Re.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==($=null==Re?void 0:Re.innerBgAlpha)&&void 0!==$?$:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},An=`\n ${p?"#preview,":"WEBSITE_ASSISTANT"===Ue?"":":root,"} .memori-widget {\n ${Object.entries(Cn).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,En=void 0===(null==Re?void 0:Re.showAIicon)||(null==Re?void 0:Re.showAIicon),[Mn,_n]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===Ue||"FULLPAGE"!==Ue)&&_n(!0)}),[]);const[Tn,In]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await be(e);0===s.resultCode&&(t=r,n=o)}catch(e){let t=e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{In(kU(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==Re?void 0:Re.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",Re.seoTitle),document.head.append(e)}if(null==Re?void 0:Re.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",Re.seoDescription),document.head.append(e)}if(null==Re?void 0:Re.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",Re.seoUrl),document.head.append(e)}let t=_||e.avatarURL;if((null==Re?void 0:Re.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[Re,e.avatarURL,_]);const Rn=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!UU&&(jU||De)?setTimeout((()=>{Rn(e)}),1e3):(dn(),tn(),_t(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Nt,ot,De,ke]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",Rn),()=>{document.removeEventListener("MemoriTextEntered",Rn)})),[Nt,ke]);const Pn=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c;const u=(null==t?void 0:t.sessionID)||Nt,d=(null==t?void 0:t.dialogState)||Dt;Me(!0);let p=document.getElementById("memori-audio"),h=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");p&&h&&(p.muted=!1,p.play().catch((e=>{console.error("error playing intro audio",e)})));let f=uU("birthDate",void 0),m=Rt||f||void 0;if(u||!It||m){if(!u&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!dt&&!ht||!u&&_e)return gt("password"),void Me(!1);if(!u){Me(!1),Te(!1);const t=await Ft({memoriID:e.engineMemoriID,password:w||dt||e.secretToken,tag:null==R?void 0:R.tag,pin:null==R?void 0:R.pin,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},initialQuestion:M,birthDate:m});return void((null==t?void 0:t.dialogState)?(Et([]),Tt(t.dialogState,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}))):await Pn(t||void 0))}if(T){const{currentState:t,...n}=await ye(u);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Te(!0),Lt(void 0),Me(!1),void await Pn();if(Et([]),xe&&e.giverTag&&(null==Dt?void 0:Dt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await jt(e.engineMemoriID,u,"-");const t=await jt(e.engineMemoriID,u,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Tt(t.currentState,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #2",t),Ut(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,{PATHNAME:window.location.pathname,ROUTE:(null===(o=null===(i=window.location.pathname)||void 0===i?void 0:i.split("/"))||void 0===o?void 0:o.pop())||"",...E||{}},M,m).then((()=>{He(!0)}))}else if(!xe&&R&&(null==Dt?void 0:Dt.currentTag)!==R.tag)try{console.debug("change tag #3"),await jt(e.engineMemoriID,u,"-");const t=await jt(e.engineMemoriID,u,R.tag,R.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Tt(t.currentState,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #5",t),Ut(!0,null==e?void 0:e.secretToken,void 0,R.tag,R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...E||{}},M,m).then((()=>{He(!0)}))}else if(xe||R||(null==Dt?void 0:Dt.currentTag)===cp)Tt(t,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}));else try{console.debug("change tag #6"),await jt(e.engineMemoriID,u,"-");const t=await jt(e.engineMemoriID,u,cp);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Tt(t.currentState,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #8",t),Ut(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(c=null===(l=window.location.pathname)||void 0===l?void 0:l.split("/"))||void 0===c?void 0:c.pop())||"",...E||{}},M,m).then((()=>{He(!0)}))}}else Et([]),Tt(d,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}))}else Ot(!0),Me(!1)}),[dt,e,ht,Rt,Nt,ke]),[kn,On]=(0,c.useState)(null!==(Z=null==N?void 0:N.loginToken)&&void 0!==Z?Z:P);(0,c.useEffect)((()=>{const t=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!t)return;const n=new MutationObserver(((e,t)=>{var n,r,i;for(const t of e)"attributes"===t.type&&"authtoken"===(null===(n=t.attributeName)||void 0===n?void 0:n.toLowerCase())&&("MEMORI-CLIENT"===t.target.nodeName?On(t.target.getAttribute("authtoken")||void 0):On((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[Nn,Ln]=(0,c.useState)(),Dn=(0,c.useCallback)((async()=>{if(Nt&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Se(Nt);0===n.resultCode?Ln(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Nt,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Dn()}),[Nt,Dn]);const Bn=void 0===S?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!S,zn={memori:e,tenant:I,history:At,showShare:null===(ee=null!=d?d:null==Re?void 0:Re.showShare)||void 0===ee||ee,position:vt,setShowPositionDrawer:qe,setShowSettingsDrawer:Je,setShowKnownFactsDrawer:Ye,setShowExpertsDrawer:$e,showSpeaker:!!k,speakerMuted:Ze||UU,setSpeakerMuted:e=>{if(UU=!!e,et(e),dU("muteSpeaker",!!e),e)tn();else{zU=new Go;let e=zU.createBuffer(1,1e4,22050),t=zU.createBufferSource();t.buffer=e,t.connect(zU.destination)}},showSettings:v,hasUserActivatedSpeak:je,showReload:"TOTEM"===Ue,showClear:b,clearHistory:()=>Et((e=>e.slice(-1))),loginToken:kn,sessionID:Nt},Fn={memori:e,integration:o,integrationConfig:Re,tenant:I,instruct:xe,avatar3dVisible:Mn,setAvatar3dVisible:_n,hasUserActivatedSpeak:je,isPlayingAudio:ot&&!Ze,loading:!!De,baseUrl:C,apiUrl:A},Un={memori:e,tenant:I,gamificationLevel:Tn,language:Ie,userLang:ke,setUserLang:Oe,baseUrl:C,apiUrl:A,position:vt,openPositionDrawer:()=>qe(!0),integrationConfig:Re,instruct:xe,sessionId:Nt,clickedStart:Ee,onClickStart:Pn,initializeTTS:()=>{if(!k)return;LU=fs.SpeechConfig.fromSubscription(k,"eastus"),LU.speechSynthesisLanguage=Yt(ke),LU.speechSynthesisVoiceName=Qt(ke),LU.speechRecognitionLanguage=Yt(ke),gd()&&(LU.speechSynthesisOutputFormat=fs.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),zU=new Go;let e=zU.createBuffer(1,1e4,22050),t=zU.createBufferSource();t.buffer=e,t.connect(zU.destination),BU=new fs.SpeakerAudioDestination;let n=fs.AudioConfig.fromSpeakerOutput(BU);DU=new fs.SpeechSynthesizer(LU,n)},isUserLoggedIn:!!kn},jn={memori:e,sessionID:Nt||"",tenant:I,translateTo:Pe&&ke.toUpperCase()!==(null===(oe=null!==(ie=null!==(re=null===(ne=null===(te=e.culture)||void 0===te?void 0:te.split("-"))||void 0===ne?void 0:ne[0])&&void 0!==re?re:le.language)&&void 0!==ie?ie:"IT")||void 0===oe?void 0:oe.toUpperCase())?ke:void 0,baseUrl:C,apiUrl:A,layout:a,memoriTyping:De,typingText:ze,showTypingText:y,history:Bn?At:At.slice(-2),authToken:kn,dialogState:Dt,setDialogState:zt,pushMessage:Mt,simulateUserPrompt:(e,t)=>{dn(),tn(),_t(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:En,client:de,selectReceiverTag:async n=>{var r;if(Nt)try{const{currentState:i,...o}=await ve(Nt,n);if(0===o.resultCode)if(Mt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await de.postTagChangedEvent(Nt,e.giverTag);0===r.resultCode?(zt(n),n.emission&&Mt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1})):(console.error(r),t(bs).error(ae(mU(r.resultCode))))}else zt(i),i.emission&&Mt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1});else console.error(o,n,null===(r=null==Dt?void 0:Dt.knownTags)||void 0===r?void 0:r[n]),t(bs).error(ae(mU(o.resultCode)))}catch(e){let n=e;console.error(n),t(bs).error(n.message)}},preview:p,sendOnEnter:vn,setSendOnEnter:yn,microphoneMode:tt?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:bn,setAttachmentsMenuOpen:Sn,instruct:xe,showInputs:f,showMicrophone:!!k,userMessage:St,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return xt(""),void qt();xt(e),Wt()},sendMessage:e=>{tn(),dn(),_t(e),xt(""),on()},stopListening:pn,startListening:un,stopAudio:tn,resetTranscript:on,listening:wt,isPlayingAudio:ot,customMediaRenderer:D,user:Ce,userAvatar:B,experts:Nn},Hn=o&&wn?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:wn}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Vn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:An}}):null,Gn={canInstruct:!!e.giverTag,instruct:!!xe,onChangeMode:e=>{we("instruct"===e),He(!1),Me(!1)}},Wn=(0,s.jsx)(pL,{tenant:I,userLang:ke}),qn=l||("TOTEM"===Ue?wU:"CHAT"===Ue?CU:"FULLPAGE"===Ue?xU:"WEBSITE_ASSISTANT"===Ue?AU:xU);return(0,s.jsxs)("div",{className:t(vs)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${at.toLowerCase()}`,`memori--avatar-${(null==Re?void 0:Re.avatar)||"default"}`,{"memori--preview":p,"memori--embed":h,"memori--with-integration":o,"memori--with-speechkey":!!k,"memori--active":je,"memori--hide-emissions":ct,"memori--has-active-session":!!Nt}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":Nt,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...Dt,sessionID:Nt}),style:{height:x},children:[(0,s.jsx)(qn,{Header:dL,headerProps:zn,Avatar:oN,avatarProps:Fn,Chat:cm,chatProps:jn,StartPanel:gm,startPanelProps:Un,integrationStyle:Vn,integrationBackground:Hn,ChangeMode:sN,changeModeProps:Gn,poweredBy:Wn,sessionId:Nt,hasUserActivatedSpeak:je,showInstruct:u,loading:Ne}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://app.twincreator.com/intro.mp3"}),ce&&(0,s.jsx)(md,{withModal:!0,pwdOrTokens:mt,openModal:!!mt,setPwdOrTokens:gt,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r;t.password&&pt(t.password),t.password&&(FU=t.password),t.tokens&&ft(t.tokens),Ut(!Nt,t.password,t.tokens,xe?e.giverTag:null==R?void 0:R.tag,xe?e.giverPIN:null==R?void 0:R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},M,Rt).then((e=>{gt(null),Pn(e||void 0)})).catch((()=>{gt(null),Te(!0)}))},minimumNumberOfRecoveryTokens:null!==(se=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==se?se:1}),ce&&(0,s.jsx)(oU,{visible:kt,minAge:It,onClose:t=>{var n,r;t?(Pt(t),dU("birthDate",t),Ut(!Nt,FU||dt||(null==e?void 0:e.secretToken),ht,xe?e.giverTag:null==R?void 0:R.tag,xe?e.giverPIN:null==R?void 0:R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},M,t).then((e=>{Ot(!1),gt(null),Pn(e||void 0)})).catch((()=>{Ot(!1),Te(!0)}))):(Ot(!1),Me(!1))}}),Ke&&(0,s.jsx)(hU,{layout:Ue,open:!!Ke,onClose:()=>Je(!1),microphoneMode:tt?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:rt,setMicrophoneMode:e=>nt("CONTINUOUS"===e),setContinuousSpeechTimeout:it,controlsPosition:at,setControlsPosition:lt,hideEmissions:ct,setHideEmissions:ut,additionalSettings:L}),Qe&&Nt&&(0,s.jsx)(bU,{apiURL:A,memori:e,sessionID:Nt,visible:Qe,closeDrawer:()=>Ye(!1)}),Xe&&!!Nn&&(0,s.jsx)(SU,{apiUrl:A,baseUrl:C,tenant:I,experts:Nn,open:Xe,onClose:()=>$e(!1)})]})};const VU={id:"app.twincreator.com",theme:"twincreator",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},GU=async(e,t)=>{const n=t?new URL(`${t.startsWith("http")?"":t.includes("localhost")?"http://":"https://"}${t}`).origin:"https://app.twincreator.com";try{const t=await fetch(`${n}/api/tenant/${e}`),{tenant:r}=await t.json();return r||{...VU,tenantID:e}}catch(t){return{...VU,tenantID:e}}};function WU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,GO(r.key),r)}}function KU(e,t,n){return t&&qU(e.prototype,t),n&&qU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function JU(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QU(e,t){return QU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},QU(e,t)}function YU(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QU(e,t)}function XU(e,t){if(t&&("object"===HO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return JU(e)}function $U(e){return $U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$U(e)}function ZU(e){if(Array.isArray(e))return e}function ej(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function tj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nj(e,t){if(e){if("string"==typeof e)return tj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tj(e,t):void 0}}function rj(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ij(e){return ZU(e)||ej(e)||nj(e)||rj()}function oj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var aj={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},lj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};WU(this,e),this.init(t,n)}return KU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||aj,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,sj(sj({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),cj=new lj,uj=function(){function e(){WU(this,e),this.observers={}}return KU(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function dj(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function pj(e){return null==e?"":""+e}function hj(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function fj(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function mj(e,t,n){var r=fj(e,t,Object);r.obj[r.k]=n}function gj(e,t){var n=fj(e,t),r=n.obj,i=n.k;if(r)return r[i]}function vj(e,t,n){var r=gj(e,n);return void 0!==r?r:gj(t,n)}function yj(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):yj(e[r],t[r],n):e[r]=t[r]);return e}function bj(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Sj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function xj(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Sj[e]})):e}var wj="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Cj=[" ",",","?","!",";"];function Aj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ej(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Aj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Aj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$U(e);if(t){var i=$U(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return XU(this,n)}}function _j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;o<r.length;++o){if(!i)return;if("string"==typeof i[r[o]]&&o+1<r.length)return;if(void 0===i[r[o]]){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];void 0===l&&r.length>o+s;)s++,l=i[a=r.slice(o,o+s).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}var c=r.slice(o+s).join(n);return c?_j(l,c,n):void 0}i=i[r[o]]}return i}}var Tj=function(e){YU(n,e);var t=Mj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return WU(this,n),r=t.call(this),wj&&uj.call(JU(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return KU(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."));var a=gj(this.data,s);return a||!o||"string"!=typeof n?a:_j(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),mj(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=gj(this.data,s)||{};r?yj(a,n,i):a=Ej(Ej({},a),n),mj(this.data,s,a),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Ej(Ej({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(uj),Ij={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}};function Rj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$U(e);if(t){var i=$U(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return XU(this,n)}}var Oj={},Nj=function(e){YU(n,e);var t=kj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return WU(this,n),r=t.call(this),wj&&uj.call(JU(r)),hj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,JU(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=cj.create("translator"),r}return KU(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=Cj.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,n,r));if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==HO(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),l=a.key,c=a.namespaces,u=c[c.length-1],d=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(u).concat(h).concat(l),f):"".concat(u).concat(h).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,v=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],S=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&w&&b.indexOf(y)<0&&("string"!=typeof S||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,Pj(Pj({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=C,f):C}if(s){var A="[object Array]"===y,E=A?[]:{},M=A?v:g;for(var _ in m)if(Object.prototype.hasOwnProperty.call(m,_)){var T="".concat(M).concat(s).concat(_);E[_]=this.translate(T,Pj(Pj({},t),{joinArrays:!1,ns:c})),E[_]===T&&(E[_]=m[_])}m=E}}else if(x&&"string"==typeof S&&"[object Array]"===y)(m=m.join(S))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,R=!1,P=void 0!==t.count&&"string"!=typeof t.count,k=n.hasDefaultValue(t),O=P?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(O)]||t.defaultValue;!this.isValidLookup(m)&&k&&(I=!0,m=N),this.isValidLookup(m)||(R=!0,m=l);var L=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=L&&R?void 0:m,B=k&&N!==m&&this.options.updateMissing;if(R||I||B){if(this.logger.log(B?"updateKey":"missingKey",d,u,l,B?N:m),s){var z=this.resolve(l,Pj(Pj({},t),{},{keySeparator:!1}));z&&z.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.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var j=0;j<U.length;j++)F.push(U[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r:D;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,o,B,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,o,B,t),i.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,f,r),R&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(R||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Pj(Pj({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Pj(Pj({},n),{interpolation:Pj(Pj({},this.options.interpolation),n.interpolation)}));var s,a="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var l=e.match(this.interpolator.nestingRegexp);s=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=Pj(Pj({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),a){var u=e.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,p="string"==typeof d?[d]:d;return null!=e&&p&&p.length&&!1!==n.applyPostProcessor&&(e=Ij.handle(p,e,t,this.options&&this.options.postProcessPassResolved?Pj({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var l=s.extractFromKey(e,a),c=l.key;n=c;var u=l.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,p=d&&!a.ordinal&&0===a.count&&s.pluralResolver.shouldUseIntlApi(),h=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,f=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(o=e,!Oj["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(Oj["".concat(f[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(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!!!")),f.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,l=[c];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(l,c,n,e,a);else{var u;d&&(u=s.pluralResolver.getSuffix(n,a.count,a));var f="".concat(s.options.pluralSeparator,"zero");if(d&&(l.push(c+u),p&&l.push(c+f)),h){var m="".concat(c).concat(s.options.contextSeparator).concat(a.context);l.push(m),d&&(l.push(m+u),p&&l.push(m+f))}}for(;o=l.pop();)s.isValidLookup(t)||(r=o,t=s.getResource(n,e,o,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(uj);function Lj(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Dj=function(){function e(t){WU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=cj.create("languageUtils")}return KU(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Lj(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Lj(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Lj(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var 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||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),Bj=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],zj={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},Fj=["v1","v2","v3"],Uj={zero:0,one:1,two:2,few:3,many:4,other:5};function jj(){var e={};return Bj.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:zj[t.fc]}}))})),e}var Hj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};WU(this,e),this.languageUtils=t,this.options=n,this.logger=cj.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=jj()}return KU(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return Uj[e]-Uj[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!Fj.includes(this.options.compatibilityJSON)}}]),e}();function Vj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Wj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};WU(this,e),this.logger=cj.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return KU(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:xj,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?bj(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?bj(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?bj(t.nestingPrefix):t.nestingPrefixEscaped||bj("$t("),this.nestingSuffix=t.nestingSuffix?bj(t.nestingSuffix):t.nestingSuffixEscaped||bj(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0){var i=vj(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,Gj(Gj(Gj({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(vj(t,l,s),c,n,Gj(Gj(Gj({},r),t),{},{interpolationkey:s}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,p=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof d){var l=d(e,i,r);o="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))o="";else{if(p){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=pj(o));var c=t.safeValue(o);if(e=e.replace(i[0],c),p?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Gj({},o);function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,s)).match(/'/g),a=i.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{s=JSON.parse(i),t&&(s=Gj(Gj({},t),s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=pj(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,o.lng,Gj(Gj({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function qj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jj(e){var t={};return function(n,r,i){var o=r+JSON.stringify(i),s=t[o];return s||(s=e(r,i),t[o]=s),s(n)}}var Qj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};WU(this,e),this.logger=cj.create("formatter"),this.options=t,this.formats={number:Jj((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:Jj((function(e,t){var n=new Intl.NumberFormat(e,Kj(Kj({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:Jj((function(e,t){var n=new Intl.DateTimeFormat(e,Kj({},t));return function(e){return n.format(e)}})),relativetime:Jj((function(e,t){var n=new Intl.RelativeTimeFormat(e,Kj({},t));return function(e){return n.format(e,t.range||"day")}})),list:Jj((function(e,t){var n=new Intl.ListFormat(e,Kj({},t));return function(e){return n.format(e)}}))},this.init(t)}return KU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=Jj(t)}},{key:"format",value:function(e,t,n,r){var i=this,o=t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=ij(e.split(":")),r=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=i),"false"===i&&(n[r.trim()]=!1),"true"===i&&(n[r.trim()]=!0),isNaN(i)||(n[r.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),s=o.formatName,a=o.formatOptions;if(i.formats[s]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[s](e,u,Kj(Kj(Kj({},a),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(s)),e}),e);return o}}]),e}();function Yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$U(e);if(t){var i=$U(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return XU(this,n)}}var Zj=function(e){YU(n,e);var t=$j(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return WU(this,n),o=t.call(this),wj&&uj.call(JU(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=cj.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,s.backend,s),o}return KU(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o={},s={},a={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===s[a]&&(s[a]=!0):(i.state[a]=1,r=!1,void 0===s[a]&&(s[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(a[e]=!0)})),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,l,c,u,d;r=n.loaded,a=o,c=fj(r,[i],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(a)),l||u[d].push(a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:o,callback:s}):(this.readingCalls++,this.backend[n](e,t,(function(a,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}a&&l&&i<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,l)}))):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(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!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,Xj(Xj({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(uj);function eH(){return{debug:!1,initImmediate:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===HO(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===HO(e[2])||"object"===HO(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function tH(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function nH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nH(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function iH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$U(e);if(t){var i=$U(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return XU(this,n)}}function oH(){}function sH(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var aH=function(e){YU(n,e);var t=iH(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(WU(this,n),e=t.call(this),wj&&uj.call(JU(e)),e.options=tH(r),e.services={},e.logger=cj,e.modules={external:[]},sH(JU(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),XU(e,JU(e));setTimeout((function(){e.init(r,i)}),0)}return e}return KU(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=eH();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=rH(rH(rH({},r),this.options),tH(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=rH(rH({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?cj.init(i(this.modules.logger),this.options):cj.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Qj);var s=new Dj(this.options);this.store=new Tj(this.options.resources,this.options);var a=this.services;a.logger=cj,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new Hj(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=i(o),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new Wj(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new Zj(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new Nj(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=oH),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=dj(),p=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oH,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=dj();return e||(e=this.languages),t||(t=this.options.ns),n||(n=oH),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(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"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Ij.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=dj();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var s="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==HO(i)){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else o=rH({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return r.t(u,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(r,e)||i&&!s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=dj();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=dj();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["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"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oH,i=rH(rH(rH({},this.options),t),{isClone:!0}),o=new n(i);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var s=["store","services","language"];return s.forEach((function(t){o[t]=e[t]})),o.services=rH({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new Nj(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(uj);WO(aH,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new aH(e,t)}));var lH=aH.createInstance();lH.createInstance=aH.createInstance;var cH,uH=lH.createInstance;lH.init,lH.loadResources,lH.reloadResources,lH.use,lH.changeLanguage,lH.getFixedT,lH.t,lH.exists,lH.setDefaultNamespace,lH.hasLoadedNamespace,lH.loadNamespaces,lH.loadLanguages;cH=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","apply":"Applica","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","close":"Chiudi","edit":"Modifica","delete":"Elimina","loading":"Caricamento","expand":"Espandi","collapse":"Riduci","fullscreenEnter":"Passa a schermo intero","fullscreenExit":"Esci da schermo intero","center":"Centro","bottom":"In basso","hidden":"Nascosto","day":"Giorno","month":"Mese","year":"Anno","createdAt":"Data creazione","selected":"Selezionati","page":"pagina","actions":"Azioni","next":"Successivo","previous":"Precedente","copy":"Copia","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","generatedByAI":"Risposta generata da IA, può talvolta generare informazioni non corrette","completionsEnabled":"IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette","completionProviderDown":"Questo Twin è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.","completionProviderFallbackName":"un provider esterno","completionProviderCheckStatusPage":"Vedi pagina di stato","boardOfExperts":"Gruppo di esperti","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","underage":"Devi avere almeno {{age}} anni per registrarti.","underageTwinSession":"Devi avere almeno {{age}} anni per interagire con questo Twin.","ageVerification":"Verifica dell\'età","ageVerificationText":"Per interagire con questo Twin, devi aver almeno {{minAge}} anni.","nsfw":"NSFW: Questo Twin contiene contenuti per adulti","deepThought":"Pensiero profondo","deepThoughtHelper":"Permette di stabilire una relazione univoca tra l\'IA e la persona che la interroga, permettendo all\'IA memoria di questa relazione supportando quindi le persone con domande mirate alle loro esperienze. Una volta che le persone avvieranno le loro relazioni, il creatore delle AI vedrà la propria community crescere di Follower e potrà osservare i fatti noti raccolti durante le conversazioni.","deepThoughtDisclaimerTitle":"Pensiero profondo abilitato","deepThoughtDisclaimer":"Proseguendo nella conversazione autorizzo il trattamento dei miei dati personali così come specificato nell\'informativa di cui dichiaro di aver preso visione.","knownFacts":{"title":"Fatti noti","description":"Dettagli delle informazioni condivise tra te e {{memoriName}}","type":"Tipo","typeShortTerm":"Breve termine","typeLongTerm":"Lungo termine","typeHelper":"Tipi:\\n- Breve termine: questo fatto noto è sempre utilizzato durante le conversazioni\\n- Lungo termine: questo fatto noto è utilizzato durante le conversazioni solo se rilevante per la domanda corrente","text":"Testo","deleteSuccess":"Fatto noto eliminato","deleteConfirmTitle":"Elimina il fatto noto","deleteConfirmMessage":"Confermi di voler eliminare questo fatto noto?","deleteSelectedConfirmTitle":"Elimina i fatti noti selezionati","deleteSelectedConfirmMessage":"Confermi di voler eliminare i fatti noti selezionati?"},"auth":{"title":"Autenticazione","useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","boardOfExperts":"Gruppo di esperti","showExpertsInTheBoard":"Mostra gli esperti di questo gruppo","expertsInTheBoard":"Esperti di questo gruppo","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","holdToSpeak":"Tieni premuto per parlare","releaseToEndListening":"Rilascia per smettere di parlare","pressAndHoldToSpeak":"Premi e tieni premuto per parlare","microphoneMode":"Modalità microfono","hideEmissionsLabel":"Nascondi testo emesso dal Twin","secondsLabel":"Secondi","controlsPosition":"Posizione dei controlli","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePosition":"Inserisci la posizione prima di iniziare","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"media":{"title":"Titolo","editAttributes":"Modifica attributi media","uploadMimeTypeNotAllowed":"Il tipo di file non è permesso","uploadSizeLimitMessage":"Il file caricato è troppo grande (max {{size}}MB)","uploadWrongResolutionMessage":"La risoluzione deve essere {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"Hai già un Twin con questo nome","uploadHelperImages":"Caricare un file con estensione png, jpg, jpeg o gif e con dimensione massima di {{size}}MB","uploadHelper":"Caricare un file di dimensione massima di {{size}}MB","uploadError":"Errore nel caricamento","square":"quadrato","scaleRatio":"Proporzioni","addMediaLabel":"Aggiungi media","insertThisMediaMsg":"Inserisci questi media","mediaUploadMessage":"Clicca per caricare un nuovo media","addLinkLabel":"Aggiungi un link","linkKey":"URL","linkValue":"Titolo link","insertThisLink":"Inserisci un link a {{url}} con titolo {{title}}"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_CANT_EDIT_INTEGRATIONS":"Utente non abilitato a gestire integrazioni","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido"}}');const dH=uH({resources:{en:{translation:t(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","apply":"Apply","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","close":"Close","edit":"Edit","delete":"Delete","loading":"Loading","expand":"Expand","collapse":"Collapse","fullscreenEnter":"Enter fullscreen","fullscreenExit":"Exit fullscreen","center":"Center","bottom":"Bottom","hidden":"Hidden","day":"Day","month":"Month","year":"Year","createdAt":"Creation date","selected":"Selected","page":"page","actions":"Actions","next":"Next","previous":"Previous","copy":"Copy","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","generatedByAI":"Answer generated by AI, may occasionally generate incorrect informations","completionsEnabled":"Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information","completionProviderDown":"This Twin is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.","completionProviderFallbackName":"an external provider","completionProviderCheckStatusPage":"Check status page","boardOfExperts":"Board of experts","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","underage":"You must be at least {{age}} years old to sign up.","underageTwinSession":"You must be at least {{age}} years old to interact with this Twin.","ageVerification":"Age verification","ageVerificationText":"To interact with this Twin, you must be at least {{minAge}} years old.","nsfw":"NSFW: This Twin contains adult contents","deepThought":"Deep Thought","deepThoughtHelper":"Allows to establish a unique relationship between the AI and the person who interrogates it, allowing the AI to remember this relationship and therefore supporting people with questions targeted to their experiences. Once people start their relationships, the creator of the AI will see their community grow with Followers and will be able to observe the known facts collected during the conversations.","deepThoughtDisclaimerTitle":"Deep Thought enabled","deepThoughtDisclaimer":"By continuing the conversation I authorize the processing of my personal data as specified in the information notice which I declare to have read.","knownFacts":{"title":"Known facts","description":"Details of the information shared between you and {{memoriName}}","type":"Type","typeShortTerm":"Short term","typeLongTerm":"Long term","typeHelper":"Types:\\n- Short Term: this Known Fact is always used during conversations\\n- Long Term: this Known Fact is used during conversations only if relevant to the current question","text":"Text","deleteSuccess":"Known fact deleted","deleteConfirmTitle":"Delete known fact","deleteConfirmMessage":"Are you sure you want to delete this known fact?","deleteSelectedConfirmTitle":"Delete selected known facts","deleteSelectedConfirmMessage":"Are you sure you want to delete the selected known facts?"},"auth":{"title":"Authentication","useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","boardOfExperts":"Board of experts","showExpertsInTheBoard":"Show experts in this board","expertsInTheBoard":"Experts in this board","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","holdToSpeak":"Hold to speak","releaseToEndListening":"Release to end listening","pressAndHoldToSpeak":"Press and hold to speak","microphoneMode":"Microphone mode","hideEmissionsLabel":"Hide text emitted by the Twin","secondsLabel":"Set seconds","controlsPosition":"Controls position","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"media":{"title":"Title","editAttributes":"Edit media attributes","uploadMimeTypeNotAllowed":"The file type is not allowed","uploadSizeLimitMessage":"The uploaded size is too big (max {{size}}MB)","uploadWrongResolutionMessage":"The resolution must be {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"You already have a Twin with this name","uploadHelperImages":"Upload a file with extension png, jpg, jpeg or gif, and having at maximum a size of {{size}}MB","uploadHelper":"Upload a file having at maximum a size of {{size}}MB","uploadError":"Upload failed","square":"square","scaleRatio":"Scale ratio","addMediaLabel":"Add a media","insertThisMediaMsg":"Insert these media","mediaUploadMessage":"Click to load a new media","addLinkLabel":"Add a link","linkKey":"URL","linkValue":"Link title","insertThisLink":"Insert a link to {{url}} with title {{title}}"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_CANT_EDIT_INTEGRATIONS":"User not allowed to manage integrations","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID"}}'))},it:{translation:t(cH)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});dH.init();var pH=dH;c=o("85Hg2");function hH(e){var t=e.i18n,n=e.defaultNS,r=e.children,i=(0,c.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,c.createElement)(ne.Provider,{value:i},r)}const fH=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:r,integrationID:i,tenantID:o,secretToken:a,sessionID:l,layout:u="DEFAULT",customLayout:d,showShare:p=!0,showSettings:h=!0,showInstruct:f=!1,showTypingText:m=!1,showClear:g=!1,showOnlyLastMessages:v=!1,showInputs:y=!0,showDates:b=!1,showContextPerLine:S=!1,height:x="100%",baseURL:w,apiURL:C="https://backend.memori.ai",tag:A,pin:E,context:M,initialQuestion:_,uiLang:T,spokenLang:I,multilingual:R,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:k,onStateChange:O,additionalInfo:N,customMediaRenderer:L,additionalSettings:D,userAvatar:B})=>{var z,F,U;const[j,H]=(0,c.useState)(),[V,G]=(0,c.useState)(),[q,K]=(0,c.useState)(k),{t:J}=ge();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const Q=W(C),Y=(0,c.useCallback)((async()=>{const e=w||(o.startsWith("https://")?o:`https://${o}`),t=await fetch(`${e}/api/speechkey`),n=await t.json();n.AZURE_COGNITIVE_SERVICES_TTS_KEY&&K(n.AZURE_COGNITIVE_SERVICES_TTS_KEY)}),[]);(0,c.useEffect)((()=>{k||Y()}),[k]);const X=(0,c.useCallback)((async()=>{if(r&&t){const{memori:e,...n}=await Q.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?H(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await Q.backend.getMemori(o,e,n);0===r.resultCode&&t?H(t):console.error("[MEMORI]",r,t)}}),[r,t,n,e,o]);(0,c.useEffect)((()=>{X()}),[X,o]);const $=(0,c.useCallback)((async()=>{const e=await GU(o,w);e&&G(e)}),[o,C]);(0,c.useEffect)((()=>{$()}),[$]),(0,c.useEffect)((()=>{if(T)pH.changeLanguage(T.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();pH.changeLanguage(e).catch((()=>{pH.changeLanguage(t)}))}}),[T]);const Z=j?(0,s.jsx)(HU,{layout:u,customLayout:d,height:x,baseUrl:w||(o.startsWith("https://")?o:`https://${o}`),apiUrl:C,memori:{...j,secretToken:a},memoriLang:null!=I?I:null===(F=null===(z=j.culture)||void 0===z?void 0:z.split("-"))||void 0===F?void 0:F[0],multilingual:R,tenant:V,secret:a,sessionID:l,showShare:p,showSettings:h,showInstruct:f,showTypingText:m,showClear:g,showOnlyLastMessages:v,showInputs:y,showDates:b,showContextPerLine:S,integration:null===(U=null==j?void 0:j.integrations)||void 0===U?void 0:U.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:M,initialQuestion:_,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:q||k,onStateChange:O,additionalInfo:N,customMediaRenderer:L,additionalSettings:D,userAvatar:B,...A&&E?{personification:{tag:A,pin:E}}:{}}):(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)("p",{style:{textAlign:"center",margin:"2rem auto",textTransform:"capitalize"},children:[J("loading")||"Loading","..."]})});return(0,s.jsxs)(hH,{i18n:pH,children:[(0,s.jsx)(bs.Toaster,{position:"top-center",reverseOrder:!0}),Z]})};fH.propTypes={memoriName:t(l).string,memoriID:t(l).string,ownerUserName:t(l).string,ownerUserID:t(l).string,integrationID:t(l).string,tenantID:t(l).string.isRequired,secretToken:t(l).string,sessionID:t(l).string,layout:t(l).oneOf(["DEFAULT","FULLPAGE","TOTEM","WEBSITE_ASSISTANT","CHAT"]),customLayout:t(l).any,showShare:t(l).bool,showInstruct:t(l).bool,showInputs:t(l).bool,showDates:t(l).bool,showContextPerLine:t(l).bool,showSettings:t(l).bool,showClear:t(l).bool,showOnlyLastMessages:t(l).bool,showTypingText:t(l).bool,height:t(l).oneOfType([t(l).string,t(l).number]),baseURL:t(l).string,apiURL:t(l).string,tag:t(l).string,pin:t(l).string,context:t(l).objectOf(t(l).any),initialQuestion:t(l).string,uiLang:t(l).oneOf(["en","it"]),spokenLang:t(l).string,multilingual:t(l).bool,authToken:t(l).string,AZURE_COGNITIVE_SERVICES_TTS_KEY:t(l).string,onStateChange:t(l).func,additionalInfo:t(l).objectOf(t(l).any),customMediaRenderer:t(l).func,additionalSettings:t(l).any,userAvatar:t(l).oneOfType([t(l).string,t(l).any])};var mH=fH;class gH extends HTMLElement{connectedCallback(){const e=document.createElement("div"),n=document.createElement("div");n.setAttribute("id","memori-root"),e.appendChild(n),this.appendChild(e);const r=Object.keys(mH.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t)),e)),{}),i=this.getAttribute("tenantId"),o=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{}),l=(e=>{try{return JSON.parse(e)}catch(e){return null}})(this.getAttribute("additionalInfo")||"{}")||{};i?t(a).render((0,s.jsx)(mH,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",gH)})();
|
|
246
|
+
*/function nL(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}function rL(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function iL(e,t,n,r){if(null==r)return null;const i=n?4:0,o=e.length+2*i,s=Math.floor(.1*t),a=o/t,l=(r.width||s)*a,c=(r.height||s)*a,u=null==r.x?e.length/2-l/2:r.x*a,d=null==r.y?e.length/2-c/2:r.y*a;let p=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);p={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:p}}var oL=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function sL(e){const n=e,{value:r,size:i=XN,level:o=$N,bgColor:s=ZN,fgColor:a=eL,includeMargin:l=tL,style:u,imageSettings:d}=n,p=JN(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=null==d?void 0:d.src,f=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let n=QN.QrCode.encodeText(r,YN[o]).getModules();const c=l?4:0,u=n.length+2*c,p=iL(n,i,l,d),h=m.current,g=null!=p&&null!==h&&h.complete&&0!==h.naturalHeight&&0!==h.naturalWidth;g&&null!=p.excavation&&(n=rL(n,p.excavation));const v=window.devicePixelRatio||1;e.height=e.width=i*v;const y=i/u*v;t.scale(y,y),t.fillStyle=s,t.fillRect(0,0,u,u),t.fillStyle=a,oL?t.fill(new Path2D(nL(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(h,p.x+c,p.y+c,p.w,p.h)}})),(0,c.useEffect)((()=>{v(!1)}),[h]);const y=KN({height:i,width:i},u);let b=null;return null!=h&&(b=t(c).createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),t(c).createElement(t(c).Fragment,null,t(c).createElement("canvas",KN({style:y,height:i,width:i,ref:f},p)),b)}var aL=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=ge(),[p,h]=(0,c.useState)(n),f=(0,c.useMemo)((()=>(null==e?void 0:e.theme)?`${null!=o?o:"https://app.twincreator.com"}/images/${e.theme}/square_logo.png`:`${null!=o?o:"https://app.twincreator.com"}/images/memori_logo.png`),[e,o]);(0,c.useEffect)((()=>{n||h(window.location.href)}),[n]);const m=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${p}`,icon:ON},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${p}`,icon:NN},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${p}`,icon:LN},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${p}`,icon:DN},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${p}`,icon:jN},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${p}`,icon:BN}];return(0,s.jsxs)(Wd,{as:"div",className:t(vs)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(Wd.Button,{className:t(vs)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",i,{"memori-button--primary":a}),title:d("widget.share")||void 0,children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(zN,{})})}),(0,s.jsxs)(Wd.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(Wd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Na,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(tp,{}),onClick:()=>{p&&navigator.clipboard.writeText(p)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(Wd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(vs)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(n=e.url)&&void 0!==n?n:"",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(e.icon,{})}),e.title]})},e.id)})),l&&(0,s.jsxs)(Wd.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(sL,{id:"qr-canvas",value:null!=p?p:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:f,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,s.jsx)("div",{children:(0,s.jsx)(Na,{onClick:()=>{const e=document.getElementById("qr-canvas");if(!e)return;const t=document.createElement("a");t.href=e.toDataURL(),t.download=`memori-${r}-share.png`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,s.jsx)(FN,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var lL=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M290 236.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0 0 13.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 0 0 0 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 0 0-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"})});var cL=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",focusable:"false",role:"img",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","aria-label":t,children:[(0,s.jsx)("path",{d:"M23 4L23 10 17 10"}),(0,s.jsx)("path",{d:"M1 20L1 14 7 14"}),(0,s.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]});var uL=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6c-.3 1.5-.4 3-.4 4.4 0 14.4 11.6 26 26 26h723c1.5 0 3-.1 4.4-.4 14.2-2.4 23.7-15.9 21.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"})});var dL=({className:e,memori:n,tenant:r,history:i,position:o,setShowPositionDrawer:a,setShowSettingsDrawer:l,setShowKnownFactsDrawer:u,setShowExpertsDrawer:d,speakerMuted:p,setSpeakerMuted:h,hasUserActivatedSpeak:f=!1,showShare:m=!0,showSettings:g=!0,showSpeaker:v=!0,showReload:y=!1,showClear:b=!1,clearHistory:S,loginToken:x,sessionID:w})=>{const{t:C}=ge(),[A,E]=(0,c.useState)(!1),[M,_]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&E(!0)}),[]),(0,s.jsxs)("div",{className:t(vs)("memori-header",e),children:[y&&(0,s.jsx)(Na,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:C("reload")||"Reload",icon:(0,s.jsx)(cL,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(Na,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:C("clearHistory")||"Clear chat",icon:(0,s.jsx)(uL,{}),onClick:S}),n.needsPosition&&o&&(0,s.jsxs)("div",{className:"memori-header--position",children:[(0,s.jsx)("span",{className:"memori-header--position-placeName",children:o.placeName}),(0,s.jsx)(Na,{icon:(0,s.jsx)(aN,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>a(!0)})]}),A&&(0,s.jsx)(Na,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:M?C("fullscreenExit")||"Exit fullscreen":C("fullscreenEnter")||"Enter fullscreen",icon:M?(0,s.jsx)(em,{}):(0,s.jsx)(lL,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),_(!1)):(document.documentElement.requestFullscreen(),_(!0))}}),n.enableDeepThought&&!!x&&(0,s.jsx)(Na,{primary:!!w&&!!f,shape:"circle",icon:(0,s.jsx)(fm,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!w,onClick:()=>u(!0),title:C("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(Na,{primary:!0,shape:"circle",icon:(0,s.jsx)(hm,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!w,onClick:()=>d(!0),title:C("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(Na,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:p?(0,s.jsx)(lN,{}):(0,s.jsx)(uN,{}),onClick:()=>h(!p),title:C("widget.sound")||"Sound"}),(0,s.jsx)(PN,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(Na,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(kN,{}),onClick:()=>l(!0),title:C("widget.settings")||"Settings"}),m&&(0,s.jsx)(aL,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"})]})};var pL=({tenant:e,userLang:t="en"})=>{const n="memorytwin"===(null==e?void 0:e.theme)?"memorytwin":"twincreator";return(0,s.jsxs)("div",{className:"memori--powered-by",children:[(0,s.jsx)("img",{src:`https://app.twincreator.com/images/${n}/logo.png`,alt:""}),(0,s.jsxs)("p",{children:["Powered by"," ",(0,s.jsx)("a",{href:`https://app.${n}.com/${t?t.toLowerCase():""}`,target:"_blank",rel:"noopener noreferrer",children:"memorytwin"===n?"MemoryTwin":"TwinCreator"})]})]})},hL={};function fL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,o=void 0,"symbol"==typeof(o=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"))?o:String(o)),r)}var i,o}function mL(e,t,n){return t&&fL(e.prototype,t),n&&fL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gL(){return gL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gL.apply(this,arguments)}function vL(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,bL(e,t)}function yL(e){return yL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yL(e)}function bL(e,t){return bL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bL(e,t)}function SL(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function xL(e,t,n){return xL=SL()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&bL(i,n.prototype),i},xL.apply(null,arguments)}function wL(e){var t="function"==typeof Map?new Map:void 0;return wL=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return xL(e,arguments,yL(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),bL(r,e)},wL(e)}function CL(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function AL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EL(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return AL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?AL(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(hL,"__esModule",{value:!0});var ML=function(e){function t(){return e.apply(this,arguments)||this}return vL(t,e),t}(wL(Error)),_L=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return vL(t,e),t}(ML),TL=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return vL(t,e),t}(ML),IL=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return vL(t,e),t}(ML),RL=function(e){function t(){return e.apply(this,arguments)||this}return vL(t,e),t}(ML),PL=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return vL(t,e),t}(ML),kL=function(e){function t(){return e.apply(this,arguments)||this}return vL(t,e),t}(ML),OL=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return vL(t,e),t}(ML),NL="numeric",LL="short",DL="long",BL={year:NL,month:NL,day:NL},zL={year:NL,month:LL,day:NL},FL={year:NL,month:LL,day:NL,weekday:LL},UL={year:NL,month:DL,day:NL},jL={year:NL,month:DL,day:NL,weekday:DL},HL={hour:NL,minute:NL},VL={hour:NL,minute:NL,second:NL},GL={hour:NL,minute:NL,second:NL,timeZoneName:LL},WL={hour:NL,minute:NL,second:NL,timeZoneName:DL},qL={hour:NL,minute:NL,hourCycle:"h23"},KL={hour:NL,minute:NL,second:NL,hourCycle:"h23"},JL={hour:NL,minute:NL,second:NL,hourCycle:"h23",timeZoneName:LL},QL={hour:NL,minute:NL,second:NL,hourCycle:"h23",timeZoneName:DL},YL={year:NL,month:NL,day:NL,hour:NL,minute:NL},XL={year:NL,month:NL,day:NL,hour:NL,minute:NL,second:NL},$L={year:NL,month:LL,day:NL,hour:NL,minute:NL},ZL={year:NL,month:LL,day:NL,hour:NL,minute:NL,second:NL},eD={year:NL,month:LL,day:NL,weekday:LL,hour:NL,minute:NL},tD={year:NL,month:DL,day:NL,hour:NL,minute:NL,timeZoneName:LL},nD={year:NL,month:DL,day:NL,hour:NL,minute:NL,second:NL,timeZoneName:LL},rD={year:NL,month:DL,day:NL,weekday:DL,hour:NL,minute:NL,timeZoneName:DL},iD={year:NL,month:DL,day:NL,weekday:DL,hour:NL,minute:NL,second:NL,timeZoneName:DL},oD=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new OL},t.formatOffset=function(e,t){throw new OL},t.offset=function(e){throw new OL},t.equals=function(e){throw new OL},mL(e,[{key:"type",get:function(){throw new OL}},{key:"name",get:function(){throw new OL}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new OL}},{key:"isValid",get:function(){throw new OL}}]),e}(),sD=null,aD=function(e){function t(){return e.apply(this,arguments)||this}vL(t,e);var n=t.prototype;return n.offsetName=function(e,t){return wB(e,t.format,t.locale)},n.formatOffset=function(e,t){return MB(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},mL(t,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===sD&&(sD=new t),sD}}]),t}(oD),lD={};var cD={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var uD={},dD=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}vL(t,e),t.create=function(e){return uD[e]||(uD[e]=new t(e)),uD[e]},t.resetCache=function(){uD={},lD={}},t.isValidSpecifier=function(e){return this.isValidZone(e)},t.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var n=t.prototype;return n.offsetName=function(e,t){return wB(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return MB(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,lD[n]||(lD[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),lD[n]),i=r.formatToParts?function(e,t){for(var n=e.formatToParts(t),r=[],i=0;i<n.length;i++){var o=n[i],s=o.type,a=o.value,l=cD[s];"era"===s?r[l]=a:tB(l)||(r[l]=parseInt(a,10))}return r}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),i=r[1],o=r[2];return[r[3],i,o,r[4],r[5],r[6],r[7]]}(r,t),o=i[0],s=i[1],a=i[2],l=i[3],c=i[4],u=i[5],d=i[6];"BC"===l&&(o=1-Math.abs(o));var p=+t,h=p%1e3;return(yB({year:o,month:s,day:a,hour:24===c?0:c,minute:u,second:d,millisecond:0})-(p-=h>=0?h:1e3+h))/6e4},n.equals=function(e){return"iana"===e.type&&e.name===this.name},mL(t,[{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),t}(oD),pD=["base"],hD=["padTo","floor"],fD={};var mD={};function gD(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=mD[n];return r||(r=new Intl.DateTimeFormat(e,t),mD[n]=r),r}var vD={};var yD={};var bD=null;var SD={};function xD(e,t,n,r){var i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}var wD=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=CL(n,hD);if(!t||Object.keys(r).length>0){var i=gL({useGrouping:!1},n);n.padTo>0&&(i.minimumIntegerDigits=n.padTo),this.inf=function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=vD[n];return r||(r=new Intl.NumberFormat(e,t),vD[n]=r),r}(e,i)}}return e.prototype.format=function(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return uB(this.floor?Math.floor(e):fB(e,3),this.padTo)},e}(),CD=function(){function e(e,t,n){this.opts=n,this.originalZone=void 0;var r=void 0;if(this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){var i=e.offset/60*-1,o=i>=0?"Etc/GMT+"+i:"Etc/GMT"+i;0!==e.offset&&dD.create(o).valid?(r=o,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);var s=gL({},this.opts);s.timeZone=s.timeZone||r,this.dtf=gD(t,s)}var t=e.prototype;return t.format=function(){return this.originalZone?this.formatToParts().map((function(e){return e.value})).join(""):this.dtf.format(this.dt.toJSDate())},t.formatToParts=function(){var e=this,t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map((function(t){return"timeZoneName"===t.type?gL({},t,{value:e.originalZone.offsetName(e.dt.ts,{locale:e.dt.locale,format:e.opts.timeZoneName})}):t})):t},t.resolvedOptions=function(){return this.dtf.resolvedOptions()},e}(),AD=function(){function e(e,t,n){this.opts=gL({style:"long"},n),!t&&iB()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=CL(n,pD),i=JSON.stringify([e,r]),o=yD[i];return o||(o=new Intl.RelativeTimeFormat(e,t),yD[i]=o),o}(e,n))}var t=e.prototype;return t.format=function(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n,r){void 0===n&&(n="always");void 0===r&&(r=!1);var i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&o){var s="days"===e;switch(t){case 1:return s?"tomorrow":"next "+i[e][0];case-1:return s?"yesterday":"last "+i[e][0];case 0:return s?"today":"this "+i[e][0]}}var a=Object.is(t,-0)||t<0,l=Math.abs(t),c=1===l,u=i[e],d=r?c?u[1]:u[2]||u[1]:c?i[e][0]:e;return a?l+" "+d+" ago":"in "+l+" "+d}(t,e,this.opts.numeric,"long"!==this.opts.style)},t.formatToParts=function(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]},e}(),ED={firstDay:1,minimalDays:4,weekend:[6,7]},MD=function(){function e(e,t,n,r,i){var o=function(e){var t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));var n,r,i=e.indexOf("-u-");if(-1===i)return[e];try{n=gD(e).resolvedOptions(),r=e}catch(t){var o=e.substring(0,i);n=gD(o).resolvedOptions(),r=o}var s=n;return[r,s.numberingSystem,s.calendar]}(e),s=o[0],a=o[1],l=o[2];this.locale=s,this.numberingSystem=t||a||null,this.outputCalendar=n||l||null,this.weekSettings=r,this.intl=function(e,t,n){return n||t?(e.includes("-u-")||(e+="-u"),n&&(e+="-ca-"+n),t&&(e+="-nu-"+t),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}e.fromOpts=function(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)},e.create=function(t,n,r,i,o){void 0===o&&(o=!1);var s=t||FD.defaultLocale;return new e(s||(o?"en-US":bD||(bD=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||FD.defaultNumberingSystem,r||FD.defaultOutputCalendar,lB(i)||FD.defaultWeekSettings,s)},e.resetCache=function(){bD=null,mD={},vD={},yD={}},e.fromObject=function(t){var n=void 0===t?{}:t,r=n.locale,i=n.numberingSystem,o=n.outputCalendar,s=n.weekSettings;return e.create(r,i,o,s)};var t=e.prototype;return t.listingMode=function(){var e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"},t.clone=function(t){return t&&0!==Object.getOwnPropertyNames(t).length?e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,lB(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(gL({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(gL({},e,{defaultToEN:!1}))},t.months=function(e,t){var n=this;return void 0===t&&(t=!1),xD(this,e,PB,(function(){var r=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return n.monthsCache[i][e]||(n.monthsCache[i][e]=function(e){for(var t=[],n=1;n<=12;n++){var r=LF.utc(2009,n,1);t.push(e(r))}return t}((function(e){return n.extract(e,r,"month")}))),n.monthsCache[i][e]}))},t.weekdays=function(e,t){var n=this;return void 0===t&&(t=!1),xD(this,e,LB,(function(){var r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return n.weekdaysCache[i][e]||(n.weekdaysCache[i][e]=function(e){for(var t=[],n=1;n<=7;n++){var r=LF.utc(2016,11,13+n);t.push(e(r))}return t}((function(e){return n.extract(e,r,"weekday")}))),n.weekdaysCache[i][e]}))},t.meridiems=function(){var e=this;return xD(this,void 0,(function(){return DB}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[LF.utc(2016,11,13,9),LF.utc(2016,11,13,19)].map((function(n){return e.extract(n,t,"dayperiod")}))}return e.meridiemCache}))},t.eras=function(e){var t=this;return xD(this,e,UB,(function(){var n={era:e};return t.eraCache[e]||(t.eraCache[e]=[LF.utc(-40,1,1),LF.utc(2017,1,1)].map((function(e){return t.extract(e,n,"era")}))),t.eraCache[e]}))},t.extract=function(e,t,n){var r=this.dtFormatter(e,t).formatToParts().find((function(e){return e.type.toLowerCase()===n}));return r?r.value:null},t.numberFormatter=function(e){return void 0===e&&(e={}),new wD(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new CD(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new AD(this.intl,this.isEnglish(),e)},t.listFormatter=function(e){return void 0===e&&(e={}),function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=fD[n];return r||(r=new Intl.ListFormat(e,t),fD[n]=r),r}(this.intl,e)},t.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},t.getWeekSettings=function(){return this.weekSettings?this.weekSettings:oB()?function(e){var t=SD[e];if(!t){var n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,SD[e]=t}return t}(this.locale):ED},t.getStartOfWeek=function(){return this.getWeekSettings().firstDay},t.getMinDaysInFirstWeek=function(){return this.getWeekSettings().minimalDays},t.getWeekendDays=function(){return this.getWeekSettings().weekend},t.equals=function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},mL(e,[{key:"fastNumbers",get:function(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),e}(),_D=null,TD=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}vL(t,e),t.instance=function(e){return 0===e?t.utcInstance:new t(e)},t.parseSpecifier=function(e){if(e){var n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(CB(n[1],n[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return MB(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},mL(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+MB(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+MB(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===_D&&(_D=new t(0)),_D}}]),t}(oD),ID=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}vL(t,e);var n=t.prototype;return n.offsetName=function(){return null},n.formatOffset=function(){return""},n.offset=function(){return NaN},n.equals=function(){return!1},mL(t,[{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),t}(oD);function RD(e,t){if(tB(e)||null===e)return t;if(e instanceof oD)return e;if(function(e){return"string"==typeof e}(e)){var n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?aD.instance:"utc"===n||"gmt"===n?TD.utcInstance:TD.parseSpecifier(n)||dD.create(e)}return nB(e)?TD.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new ID(e)}var PD,kD=function(){return Date.now()},OD="system",ND=null,LD=null,DD=null,BD=60,zD=null,FD=function(){function e(){}return e.resetCaches=function(){MD.resetCache(),dD.resetCache()},mL(e,null,[{key:"now",get:function(){return kD},set:function(e){kD=e}},{key:"defaultZone",get:function(){return RD(OD,aD.instance)},set:function(e){OD=e}},{key:"defaultLocale",get:function(){return ND},set:function(e){ND=e}},{key:"defaultNumberingSystem",get:function(){return LD},set:function(e){LD=e}},{key:"defaultOutputCalendar",get:function(){return DD},set:function(e){DD=e}},{key:"defaultWeekSettings",get:function(){return zD},set:function(e){zD=lB(e)}},{key:"twoDigitCutoffYear",get:function(){return BD},set:function(e){BD=e%100}},{key:"throwOnInvalid",get:function(){return PD},set:function(e){PD=e}}]),e}(),UD=function(){function e(e,t){this.reason=e,this.explanation=t}return e.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},e}(),jD=[0,31,59,90,120,151,181,212,243,273,304,334],HD=[0,31,60,91,121,152,182,213,244,274,305,335];function VD(e,t){return new UD("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function GD(e,t,n){var r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);var i=r.getUTCDay();return 0===i?7:i}function WD(e,t,n){return n+(mB(e)?HD:jD)[t-1]}function qD(e,t){var n=mB(e)?HD:jD,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function KD(e,t){return(e-t+7)%7+1}function JD(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r,i=e.year,o=e.month,s=e.day,a=WD(i,o,s),l=KD(GD(i,o,s),n),c=Math.floor((a-l+14-t)/7);return c<1?c=SB(r=i-1,t,n):c>SB(i,t,n)?(r=i+1,c=1):r=i,gL({weekYear:r,weekNumber:c,weekday:l},_B(e))}function QD(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r,i=e.weekYear,o=e.weekNumber,s=e.weekday,a=KD(GD(i,1,t),n),l=gB(i),c=7*o+s-a-7+t;c<1?c+=gB(r=i-1):c>l?(r=i+1,c-=gB(i)):r=i;var u=qD(r,c);return gL({year:r,month:u.month,day:u.day},_B(e))}function YD(e){var t=e.year;return gL({year:t,ordinal:WD(t,e.month,e.day)},_B(e))}function XD(e){var t=e.year,n=qD(t,e.ordinal);return gL({year:t,month:n.month,day:n.day},_B(e))}function $D(e,t){if(!tB(e.localWeekday)||!tB(e.localWeekNumber)||!tB(e.localWeekYear)){if(!tB(e.weekday)||!tB(e.weekNumber)||!tB(e.weekYear))throw new RL("Cannot mix locale-based week fields with ISO-based week fields");return tB(e.localWeekday)||(e.weekday=e.localWeekday),tB(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),tB(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function ZD(e){var t=rB(e.year),n=cB(e.month,1,12),r=cB(e.day,1,vB(e.year,e.month));return t?n?!r&&VD("day",e.day):VD("month",e.month):VD("year",e.year)}function eB(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=cB(t,0,23)||24===t&&0===n&&0===r&&0===i,s=cB(n,0,59),a=cB(r,0,59),l=cB(i,0,999);return o?s?a?!l&&VD("millisecond",i):VD("second",r):VD("minute",n):VD("hour",t)}function tB(e){return void 0===e}function nB(e){return"number"==typeof e}function rB(e){return"number"==typeof e&&e%1==0}function iB(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function oB(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function sB(e,t,n){if(0!==e.length)return e.reduce((function(e,r){var i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i}),null)[1]}function aB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function lB(e){if(null==e)return null;if("object"!=typeof e)throw new kL("Week settings must be an object");if(!cB(e.firstDay,1,7)||!cB(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!cB(e,1,7)})))throw new kL("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function cB(e,t,n){return rB(e)&&e>=t&&e<=n}function uB(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function dB(e){return tB(e)||null===e||""===e?void 0:parseInt(e,10)}function pB(e){return tB(e)||null===e||""===e?void 0:parseFloat(e)}function hB(e){if(!tB(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function fB(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function mB(e){return e%4==0&&(e%100!=0||e%400==0)}function gB(e){return mB(e)?366:365}function vB(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?mB(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function yB(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function bB(e,t,n){return-KD(GD(e,1,t),n)+t-1}function SB(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=bB(e,t,n),i=bB(e+1,t,n);return(gB(e)-r+i)/7}function xB(e){return e>99?e:e>FD.twoDigitCutoffYear?1900+e:2e3+e}function wB(e,t,n,r){void 0===r&&(r=null);var i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);var s=gL({timeZoneName:t},o),a=new Intl.DateTimeFormat(n,s).formatToParts(i).find((function(e){return"timezonename"===e.type.toLowerCase()}));return a?a.value:null}function CB(e,t){var n=parseInt(e,10);Number.isNaN(n)&&(n=0);var r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function AB(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new kL("Invalid unit value "+e);return t}function EB(e,t){var n={};for(var r in e)if(aB(e,r)){var i=e[r];if(null==i)continue;n[t(r)]=AB(i)}return n}function MB(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return""+i+uB(n,2)+":"+uB(r,2);case"narrow":return""+i+n+(r>0?":"+r:"");case"techie":return""+i+uB(n,2)+uB(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function _B(e){return function(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}(e,["hour","minute","second","millisecond"])}var TB=["January","February","March","April","May","June","July","August","September","October","November","December"],IB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],RB=["J","F","M","A","M","J","J","A","S","O","N","D"];function PB(e){switch(e){case"narrow":return[].concat(RB);case"short":return[].concat(IB);case"long":return[].concat(TB);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var kB=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],OB=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],NB=["M","T","W","T","F","S","S"];function LB(e){switch(e){case"narrow":return[].concat(NB);case"short":return[].concat(OB);case"long":return[].concat(kB);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var DB=["AM","PM"],BB=["Before Christ","Anno Domini"],zB=["BC","AD"],FB=["B","A"];function UB(e){switch(e){case"narrow":return[].concat(FB);case"short":return[].concat(zB);case"long":return[].concat(BB);default:return null}}function jB(e,t){for(var n,r="",i=EL(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var HB={D:BL,DD:zL,DDD:UL,DDDD:jL,t:HL,tt:VL,ttt:GL,tttt:WL,T:qL,TT:KL,TTT:JL,TTTT:QL,f:YL,ff:$L,fff:tD,ffff:rD,F:XL,FF:ZL,FFF:nD,FFFF:iD},VB=function(){function e(e,t){this.opts=t,this.loc=e,this.systemLoc=null}e.create=function(t,n){return void 0===n&&(n={}),new e(t,n)},e.parseFormat=function(e){for(var t=null,n="",r=!1,i=[],o=0;o<e.length;o++){var s=e.charAt(o);"'"===s?(n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||s===t?n+=s:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=s,t=s)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i},e.macroTokenToFormatOpts=function(e){return HB[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,gL({},this.opts,t)).format()},t.dtFormatter=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,gL({},this.opts,t))},t.formatDateTime=function(e,t){return this.dtFormatter(e,t).format()},t.formatDateTimeParts=function(e,t){return this.dtFormatter(e,t).formatToParts()},t.formatInterval=function(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())},t.resolvedOptions=function(e,t){return this.dtFormatter(e,t).resolvedOptions()},t.num=function(e,t){if(void 0===t&&(t=0),this.opts.forceSimple)return uB(e,t);var n=gL({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)},t.formatDateTimeFromString=function(t,n){var r=this,i="en"===this.loc.listingMode(),o=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=function(e,n){return r.loc.extract(t,e,n)},a=function(e){return t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):""},l=function(){return i?function(e){return DB[e.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function(e,n){return i?function(e,t){return PB(t)[e.month-1]}(t,e):s(n?{month:e}:{month:e,day:"numeric"},"month")},u=function(e,n){return i?function(e,t){return LB(t)[e.weekday-1]}(t,e):s(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday")},d=function(e){return i?function(e,t){return UB(t)[e.year<0?0:1]}(t,e):s({era:e},"era")};return jB(e.parseFormat(n),(function(n){switch(n){case"S":return r.num(t.millisecond);case"u":case"SSS":return r.num(t.millisecond,3);case"s":return r.num(t.second);case"ss":return r.num(t.second,2);case"uu":return r.num(Math.floor(t.millisecond/10),2);case"uuu":return r.num(Math.floor(t.millisecond/100));case"m":return r.num(t.minute);case"mm":return r.num(t.minute,2);case"h":return r.num(t.hour%12==0?12:t.hour%12);case"hh":return r.num(t.hour%12==0?12:t.hour%12,2);case"H":return r.num(t.hour);case"HH":return r.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:r.opts.allowZ});case"ZZ":return a({format:"short",allowZ:r.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:r.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:r.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:r.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return o?s({day:"numeric"},"day"):r.num(t.day);case"dd":return o?s({day:"2-digit"},"day"):r.num(t.day,2);case"c":case"E":return r.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return o?s({month:"numeric",day:"numeric"},"month"):r.num(t.month);case"LL":return o?s({month:"2-digit",day:"numeric"},"month"):r.num(t.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return o?s({month:"numeric"},"month"):r.num(t.month);case"MM":return o?s({month:"2-digit"},"month"):r.num(t.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return o?s({year:"numeric"},"year"):r.num(t.year);case"yy":return o?s({year:"2-digit"},"year"):r.num(t.year.toString().slice(-2),2);case"yyyy":return o?s({year:"numeric"},"year"):r.num(t.year,4);case"yyyyyy":return o?s({year:"numeric"},"year"):r.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return r.num(t.weekYear.toString().slice(-2),2);case"kkkk":return r.num(t.weekYear,4);case"W":return r.num(t.weekNumber);case"WW":return r.num(t.weekNumber,2);case"n":return r.num(t.localWeekNumber);case"nn":return r.num(t.localWeekNumber,2);case"ii":return r.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return r.num(t.localWeekYear,4);case"o":return r.num(t.ordinal);case"ooo":return r.num(t.ordinal,3);case"q":return r.num(t.quarter);case"qq":return r.num(t.quarter,2);case"X":return r.num(Math.floor(t.ts/1e3));case"x":return r.num(t.ts);default:return function(n){var i=e.macroTokenToFormatOpts(n);return i?r.formatWithSystemDefault(t,i):n}(n)}}))},t.formatDurationFromString=function(t,n){var r,i=this,o=function(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=e.parseFormat(n),a=s.reduce((function(e,t){var n=t.literal,r=t.val;return n?e:e.concat(r)}),[]),l=t.shiftTo.apply(t,a.map(o).filter((function(e){return e})));return jB(s,(r=l,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),GB=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function WB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce((function(e,t){return e+t.source}),"");return RegExp("^"+r+"$")}function qB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce((function(t,n){var r=t[0],i=t[1],o=t[2],s=n(e,o),a=s[0],l=s[1],c=s[2];return[gL({},r,a),l||i,c]}),[{},null,1]).slice(0,2)}}function KB(e){if(null==e)return[null,null];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s[0],l=s[1],c=a.exec(e);if(c)return l(c)}return[null,null]}function JB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n){var r,i={};for(r=0;r<t.length;r++)i[t[r]]=dB(e[n+r]);return[i,null,n+r]}}var QB=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,YB=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,XB=RegExp(""+YB.source+("(?:"+QB.source+"?(?:\\[("+GB.source+")\\])?)?")),$B=RegExp("(?:T"+XB.source+")?"),ZB=JB("weekYear","weekNumber","weekDay"),ez=JB("year","ordinal"),tz=RegExp(YB.source+" ?(?:"+QB.source+"|("+GB.source+"))?"),nz=RegExp("(?: "+tz.source+")?");function rz(e,t,n){var r=e[t];return tB(r)?n:dB(r)}function iz(e,t){return[{hours:rz(e,t,0),minutes:rz(e,t+1,0),seconds:rz(e,t+2,0),milliseconds:hB(e[t+3])},null,t+4]}function oz(e,t){var n=!e[t]&&!e[t+1],r=CB(e[t+1],e[t+2]);return[{},n?null:TD.instance(r),t+3]}function sz(e,t){return[{},e[t]?dD.create(e[t]):null,t+1]}var az=RegExp("^T?"+YB.source+"$"),lz=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function cz(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u="-"===t[0],d=l&&"-"===l[0],p=function(e,t){return void 0===t&&(t=!1),void 0!==e&&(t||e&&u)?-e:e};return[{years:p(pB(n)),months:p(pB(r)),weeks:p(pB(i)),days:p(pB(o)),hours:p(pB(s)),minutes:p(pB(a)),seconds:p(pB(l),"-0"===l),milliseconds:p(hB(c),d)}]}var uz={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function dz(e,t,n,r,i,o,s){var a={year:2===t.length?xB(dB(t)):dB(t),month:IB.indexOf(n)+1,day:dB(r),hour:dB(i),minute:dB(o)};return s&&(a.second=dB(s)),e&&(a.weekday=e.length>3?kB.indexOf(e)+1:OB.indexOf(e)+1),a}var pz=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function hz(e){var t,n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],h=dz(n,o,i,r,s,a,l);return t=c?uz[c]:u?0:CB(d,p),[h,new TD(t)]}var fz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,mz=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,gz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function vz(e){var t=e[1],n=e[2],r=e[3];return[dz(t,e[4],r,n,e[5],e[6],e[7]),TD.utcInstance]}function yz(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],s=e[6];return[dz(t,e[7],n,r,i,o,s),TD.utcInstance]}var bz=WB(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,$B),Sz=WB(/(\d{4})-?W(\d\d)(?:-?(\d))?/,$B),xz=WB(/(\d{4})-?(\d{3})/,$B),wz=WB(XB),Cz=qB((function(e,t){return[{year:rz(e,t),month:rz(e,t+1,1),day:rz(e,t+2,1)},null,t+3]}),iz,oz,sz),Az=qB(ZB,iz,oz,sz),Ez=qB(ez,iz,oz,sz),Mz=qB(iz,oz,sz);var _z=qB(iz);var Tz=WB(/(\d{4})-(\d\d)-(\d\d)/,nz),Iz=WB(tz),Rz=qB(iz,oz,sz);var Pz="Invalid Duration",kz={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Oz=gL({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},kz),Nz=365.2425,Lz=30.436875,Dz=gL({years:{quarters:4,months:12,weeks:52.1775,days:Nz,hours:8765.82,minutes:525949.2,seconds:31556952,milliseconds:31556952e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:7889238,milliseconds:7889238e3},months:{weeks:4.3481250000000005,days:Lz,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},kz),Bz=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],zz=Bz.slice(0).reverse();function Fz(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:gL({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Hz(r)}function Uz(e,t){for(var n,r,i=null!=(n=t.milliseconds)?n:0,o=EL(zz.slice(1));!(r=o()).done;){var s=r.value;t[s]&&(i+=t[s]*e[s].milliseconds)}return i}function jz(e,t){var n=Uz(e,t)<0?-1:1;Bz.reduceRight((function(r,i){if(tB(t[i]))return r;if(r){var o=t[r]*n,s=e[i][r],a=Math.floor(o/s);t[i]+=a*n,t[r]-=a*s*n}return i}),null),Bz.reduce((function(n,r){if(tB(t[r]))return n;if(n){var i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r}),null)}var Hz=function(e){function t(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Dz:Oz;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||MD.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}t.fromMillis=function(e,n){return t.fromObject({milliseconds:e},n)},t.fromObject=function(e,n){if(void 0===n&&(n={}),null==e||"object"!=typeof e)throw new kL("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new t({values:EB(e,t.normalizeUnit),loc:MD.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},t.fromDurationLike=function(e){if(nB(e))return t.fromMillis(e);if(t.isDuration(e))return e;if("object"==typeof e)return t.fromObject(e);throw new kL("Unknown duration argument "+e+" of type "+typeof e)},t.fromISO=function(e,n){var r=function(e){return KB(e,[lz,cz])}(e),i=r[0];return i?t.fromObject(i,n):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.fromISOTime=function(e,n){var r=function(e){return KB(e,[az,_z])}(e),i=r[0];return i?t.fromObject(i,n):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new kL("need to specify a reason the Duration is invalid");var r=e instanceof UD?e:new UD(e,n);if(FD.throwOnInvalid)throw new IL(r);return new t({invalid:r})},t.normalizeUnit=function(e){var t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new PL(e);return t},t.isDuration=function(e){return e&&e.isLuxonDuration||!1};var n=t.prototype;return n.toFormat=function(e,t){void 0===t&&(t={});var n=gL({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?VB.create(this.loc,n).formatDurationFromString(this,e):Pz},n.toHuman=function(e){var t=this;if(void 0===e&&(e={}),!this.isValid)return Pz;var n=Bz.map((function(n){var r=t.values[n];return tB(r)?null:t.loc.numberFormatter(gL({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(gL({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},n.toObject=function(){return this.isValid?gL({},this.values):{}},n.toISO=function(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=fB(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e},n.toISOTime=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=this.toMillis();return t<0||t>=864e5?null:(e=gL({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),LF.fromMillis(t,{zone:"UTC"}).toISOTime(e))},n.toJSON=function(){return this.toISO()},n.toString=function(){return this.toISO()},n[e]=function(){return this.isValid?"Duration { values: "+JSON.stringify(this.values)+" }":"Duration { Invalid, reason: "+this.invalidReason+" }"},n.toMillis=function(){return this.isValid?Uz(this.matrix,this.values):NaN},n.valueOf=function(){return this.toMillis()},n.plus=function(e){if(!this.isValid)return this;for(var n=t.fromDurationLike(e),r={},i=0,o=Bz;i<o.length;i++){var s=o[i];(aB(n.values,s)||aB(this.values,s))&&(r[s]=n.get(s)+this.get(s))}return Fz(this,{values:r},!0)},n.minus=function(e){if(!this.isValid)return this;var n=t.fromDurationLike(e);return this.plus(n.negate())},n.mapUnits=function(e){if(!this.isValid)return this;for(var t={},n=0,r=Object.keys(this.values);n<r.length;n++){var i=r[n];t[i]=AB(e(this.values[i],i))}return Fz(this,{values:t},!0)},n.get=function(e){return this[t.normalizeUnit(e)]},n.set=function(e){return this.isValid?Fz(this,{values:gL({},this.values,EB(e,t.normalizeUnit))}):this},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.conversionAccuracy,o=t.matrix;return Fz(this,{loc:this.loc.clone({locale:n,numberingSystem:r}),matrix:o,conversionAccuracy:i})},n.as=function(e){return this.isValid?this.shiftTo(e).get(e):NaN},n.normalize=function(){if(!this.isValid)return this;var e=this.toObject();return jz(this.matrix,e),Fz(this,{values:e},!0)},n.rescale=function(){return this.isValid?Fz(this,{values:function(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],o=i[0],s=i[1];0!==s&&(t[o]=s)}return t}(this.normalize().shiftToAll().toObject())},!0):this},n.shiftTo=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!this.isValid)return this;if(0===n.length)return this;n=n.map((function(e){return t.normalizeUnit(e)}));for(var i,o={},s={},a=this.toObject(),l=0,c=Bz;l<c.length;l++){var u=c[l];if(n.indexOf(u)>=0){i=u;var d=0;for(var p in s)d+=this.matrix[p][u]*s[p],s[p]=0;nB(a[u])&&(d+=a[u]);var h=Math.trunc(d);o[u]=h,s[u]=(1e3*d-1e3*h)/1e3}else nB(a[u])&&(s[u]=a[u])}for(var f in s)0!==s[f]&&(o[i]+=f===i?s[f]:s[f]/this.matrix[i][f]);return jz(this.matrix,o),Fz(this,{values:o},!0)},n.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},n.negate=function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);t<n.length;t++){var r=n[t];e[r]=0===this.values[r]?0:-this.values[r]}return Fz(this,{values:e},!0)},n.equals=function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t=0,n=Bz;t<n.length;t++){var r=n[t];if(i=this.values[r],o=e.values[r],!(void 0===i||0===i?void 0===o||0===o:i===o))return!1}var i,o;return!0},mL(t,[{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),Vz="Invalid Interval";var Gz=function(e){function t(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new kL("need to specify a reason the Interval is invalid");var r=e instanceof UD?e:new UD(e,n);if(FD.throwOnInvalid)throw new TL(r);return new t({invalid:r})},t.fromDateTimes=function(e,n){var r=DF(e),i=DF(n),o=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Gz.invalid("end before start","The end of an interval must be after its start, but you had start="+e.toISO()+" and end="+t.toISO()):null:Gz.invalid("missing or invalid end"):Gz.invalid("missing or invalid start")}(r,i);return null==o?new t({start:r,end:i}):o},t.after=function(e,n){var r=Hz.fromDurationLike(n),i=DF(e);return t.fromDateTimes(i,i.plus(r))},t.before=function(e,n){var r=Hz.fromDurationLike(n),i=DF(e);return t.fromDateTimes(i.minus(r),i)},t.fromISO=function(e,n){var r=(e||"").split("/",2),i=r[0],o=r[1];if(i&&o){var s,a,l,c;try{a=(s=LF.fromISO(i,n)).isValid}catch(e){a=!1}try{c=(l=LF.fromISO(o,n)).isValid}catch(e){c=!1}if(a&&c)return t.fromDateTimes(s,l);if(a){var u=Hz.fromISO(o,n);if(u.isValid)return t.after(s,u)}else if(c){var d=Hz.fromISO(i,n);if(d.isValid)return t.before(l,d)}}return t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.isInterval=function(e){return e&&e.isLuxonInterval||!1};var n=t.prototype;return n.length=function(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},n.count=function(e,t){if(void 0===e&&(e="milliseconds"),!this.isValid)return NaN;var n,r=this.start.startOf(e,t);return n=(n=null!=t&&t.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end).startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())},n.hasSame=function(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},n.isEmpty=function(){return this.s.valueOf()===this.e.valueOf()},n.isAfter=function(e){return!!this.isValid&&this.s>e},n.isBefore=function(e){return!!this.isValid&&this.e<=e},n.contains=function(e){return!!this.isValid&&(this.s<=e&&this.e>e)},n.set=function(e){var n=void 0===e?{}:e,r=n.start,i=n.end;return this.isValid?t.fromDateTimes(r||this.s,i||this.e):this},n.splitAt=function(){var e=this;if(!this.isValid)return[];for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=r.map(DF).filter((function(t){return e.contains(t)})).sort((function(e,t){return e.toMillis()-t.toMillis()})),s=[],a=this.s,l=0;a<this.e;){var c=o[l]||this.e,u=+c>+this.e?this.e:c;s.push(t.fromDateTimes(a,u)),a=u,l+=1}return s},n.splitBy=function(e){var n=Hz.fromDurationLike(e);if(!this.isValid||!n.isValid||0===n.as("milliseconds"))return[];for(var r,i=this.s,o=1,s=[];i<this.e;){var a=this.start.plus(n.mapUnits((function(e){return e*o})));r=+a>+this.e?this.e:a,s.push(t.fromDateTimes(i,r)),i=r,o+=1}return s},n.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},n.overlaps=function(e){return this.e>e.s&&this.s<e.e},n.abutsStart=function(e){return!!this.isValid&&+this.e==+e.s},n.abutsEnd=function(e){return!!this.isValid&&+e.e==+this.s},n.engulfs=function(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)},n.equals=function(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},n.intersection=function(e){if(!this.isValid)return this;var n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)},n.union=function(e){if(!this.isValid)return this;var n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)},t.merge=function(e){var t=e.sort((function(e,t){return e.s-t.s})).reduce((function(e,t){var n=e[0],r=e[1];return r?r.overlaps(t)||r.abutsStart(t)?[n,r.union(t)]:[n.concat([r]),t]:[n,t]}),[[],null]),n=t[0],r=t[1];return r&&n.push(r),n},t.xor=function(e){for(var n,r,i=null,o=0,s=[],a=e.map((function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]})),l=(n=Array.prototype).concat.apply(n,a).sort((function(e,t){return e.time-t.time})),c=EL(l);!(r=c()).done;){var u=r.value;1===(o+="s"===u.type?1:-1)?i=u.time:(i&&+i!=+u.time&&s.push(t.fromDateTimes(i,u.time)),i=null)}return t.merge(s)},n.difference=function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.xor([this].concat(r)).map((function(t){return e.intersection(t)})).filter((function(e){return e&&!e.isEmpty()}))},n.toString=function(){return this.isValid?"["+this.s.toISO()+" – "+this.e.toISO()+")":Vz},n[e]=function(){return this.isValid?"Interval { start: "+this.s.toISO()+", end: "+this.e.toISO()+" }":"Interval { Invalid, reason: "+this.invalidReason+" }"},n.toLocaleString=function(e,t){return void 0===e&&(e=BL),void 0===t&&(t={}),this.isValid?VB.create(this.s.loc.clone(t),e).formatInterval(this):Vz},n.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):Vz},n.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():Vz},n.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):Vz},n.toFormat=function(e,t){var n=(void 0===t?{}:t).separator,r=void 0===n?" – ":n;return this.isValid?""+this.s.toFormat(e)+r+this.e.toFormat(e):Vz},n.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):Hz.invalid(this.invalidReason)},n.mapEndpoints=function(e){return t.fromDateTimes(e(this.s),e(this.e))},mL(t,[{key:"start",get:function(){return this.isValid?this.s:null}},{key:"end",get:function(){return this.isValid?this.e:null}},{key:"isValid",get:function(){return null===this.invalidReason}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),Wz=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=FD.defaultZone);var t=LF.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return dD.isValidZone(e)},e.normalizeZone=function(e){return RD(e,FD.defaultZone)},e.getStartOfWeek=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||MD.create(r)).getStartOfWeek()},e.getMinimumDaysInFirstWeek=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||MD.create(r)).getMinDaysInFirstWeek()},e.getWeekendWeekdays=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||MD.create(r)).getWeekendDays().slice()},e.months=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj,l=void 0===a?null:a,c=n.outputCalendar,u=void 0===c?"gregory":c;return(l||MD.create(i,s,u)).months(e)},e.monthsFormat=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj,l=void 0===a?null:a,c=n.outputCalendar,u=void 0===c?"gregory":c;return(l||MD.create(i,s,u)).months(e,!0)},e.weekdays=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj;return((void 0===a?null:a)||MD.create(i,s,null)).weekdays(e)},e.weekdaysFormat=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj;return((void 0===a?null:a)||MD.create(i,s,null)).weekdays(e,!0)},e.meridiems=function(e){var t=(void 0===e?{}:e).locale,n=void 0===t?null:t;return MD.create(n).meridiems()},e.eras=function(e,t){void 0===e&&(e="short");var n=(void 0===t?{}:t).locale,r=void 0===n?null:n;return MD.create(r,null,"gregory").eras(e)},e.features=function(){return{relative:iB(),localeWeek:oB()}},e}();function qz(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=n(t)-n(e);return Math.floor(Hz.fromMillis(r).as("days"))}function Kz(e,t,n,r){var i=function(e,t,n){for(var r,i,o=[["years",function(e,t){return t.year-e.year}],["quarters",function(e,t){return t.quarter-e.quarter+4*(t.year-e.year)}],["months",function(e,t){return t.month-e.month+12*(t.year-e.year)}],["weeks",function(e,t){var n=qz(e,t);return(n-n%7)/7}],["days",qz]],s={},a=e,l=0,c=o;l<c.length;l++){var u=c[l],d=u[0],p=u[1];n.indexOf(d)>=0&&(r=d,s[d]=p(e,t),(i=a.plus(s))>t?(s[d]--,(e=a.plus(s))>t&&(i=e,s[d]--,e=a.plus(s))):e=i)}return[e,s,i,r]}(e,t,n),o=i[0],s=i[1],a=i[2],l=i[3],c=t-o,u=n.filter((function(e){return["hours","minutes","seconds","milliseconds"].indexOf(e)>=0}));if(0===u.length){var d;if(a<t)a=o.plus(((d={})[l]=1,d));a!==o&&(s[l]=(s[l]||0)+c/(a-o))}var p,h=Hz.fromObject(s,r);return u.length>0?(p=Hz.fromMillis(c,r)).shiftTo.apply(p,u).plus(h):h}var Jz={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Qz={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Yz=Jz.hanidec.replace(/[\[|\]]/g,"").split("");function Xz(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+Jz[n||"latn"]+t)}function $z(e,t){return void 0===t&&(t=function(e){return e}),{regex:e,deser:function(e){var n=e[0];return t(function(e){var t=parseInt(e,10);if(isNaN(t)){t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(-1!==e[n].search(Jz.hanidec))t+=Yz.indexOf(e[n]);else for(var i in Qz){var o=Qz[i],s=o[0],a=o[1];r>=s&&r<=a&&(t+=r-s)}}return parseInt(t,10)}return t}(n))}}}var Zz="[ "+String.fromCharCode(160)+"]",eF=new RegExp(Zz,"g");function tF(e){return e.replace(/\./g,"\\.?").replace(eF,Zz)}function nF(e){return e.replace(/\./g,"").replace(eF," ").toLowerCase()}function rF(e,t){return null===e?null:{regex:RegExp(e.map(tF).join("|")),deser:function(n){var r=n[0];return e.findIndex((function(e){return nF(r)===nF(e)}))+t}}}function iF(e,t){return{regex:e,deser:function(e){return CB(e[1],e[2])},groups:t}}function oF(e){return{regex:e,deser:function(e){return e[0]}}}var sF={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};var aF=null;function lF(e,t){var n;return(n=Array.prototype).concat.apply(n,e.map((function(e){return function(e,t){if(e.literal)return e;var n=uF(VB.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function cF(e,t,n){var r=lF(VB.parseFormat(n),e),i=r.map((function(t){return n=t,i=Xz(r=e),o=Xz(r,"{2}"),s=Xz(r,"{3}"),a=Xz(r,"{4}"),l=Xz(r,"{6}"),c=Xz(r,"{1,2}"),u=Xz(r,"{1,3}"),d=Xz(r,"{1,6}"),p=Xz(r,"{1,9}"),h=Xz(r,"{2,4}"),f=Xz(r,"{4,6}"),m=function(e){return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:function(e){return e[0]},literal:!0};var t},g=function(e){if(n.literal)return m(e);switch(e.val){case"G":return rF(r.eras("short"),0);case"GG":return rF(r.eras("long"),0);case"y":return $z(d);case"yy":case"kk":return $z(h,xB);case"yyyy":case"kkkk":return $z(a);case"yyyyy":return $z(f);case"yyyyyy":return $z(l);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return $z(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return $z(o);case"MMM":return rF(r.months("short",!0),1);case"MMMM":return rF(r.months("long",!0),1);case"LLL":return rF(r.months("short",!1),1);case"LLLL":return rF(r.months("long",!1),1);case"o":case"S":return $z(u);case"ooo":case"SSS":return $z(s);case"u":return oF(p);case"uu":return oF(c);case"uuu":case"E":case"c":return $z(i);case"a":return rF(r.meridiems(),0);case"EEE":return rF(r.weekdays("short",!1),1);case"EEEE":return rF(r.weekdays("long",!1),1);case"ccc":return rF(r.weekdays("short",!0),1);case"cccc":return rF(r.weekdays("long",!0),1);case"Z":case"ZZ":return iF(new RegExp("([+-]"+c.source+")(?::("+o.source+"))?"),2);case"ZZZ":return iF(new RegExp("([+-]"+c.source+")("+o.source+")?"),2);case"z":return oF(/[a-z_+-/]{1,256}?/i);case" ":return oF(/[^\S\n\r]/);default:return m(e)}}(n)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"},g.token=n,g;var n,r,i,o,s,a,l,c,u,d,p,h,f,m,g})),o=i.find((function(e){return e.invalidReason}));if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};var s=function(e){var t=e.map((function(e){return e.regex})).reduce((function(e,t){return e+"("+t.source+")"}),"");return["^"+t+"$",e]}(i),a=s[0],l=s[1],c=RegExp(a,"i"),u=function(e,t,n){var r=e.match(t);if(r){var i={},o=1;for(var s in n)if(aB(n,s)){var a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}return[r,{}]}(t,c,l),d=u[0],p=u[1],h=p?function(e){var t,n=null;tB(e.z)||(n=dD.create(e.z)),tB(e.Z)||(n||(n=new TD(e.Z)),t=e.Z),tB(e.q)||(e.M=3*(e.q-1)+1),tB(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),tB(e.u)||(e.S=hB(e.u));var r=Object.keys(e).reduce((function(t,n){var r=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(n);return r&&(t[r]=e[n]),t}),{});return[r,n,t]}(p):[null,null,void 0],f=h[0],m=h[1],g=h[2];if(aB(p,"a")&&aB(p,"H"))throw new RL("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:c,rawMatches:d,matches:p,result:f,zone:m,specificOffset:g}}function uF(e,t){if(!e)return null;var n=VB.create(t,e).dtFormatter((aF||(aF=LF.fromMillis(1555555555555)),aF)),r=n.formatToParts(),i=n.resolvedOptions();return r.map((function(t){return function(e,t,n){var r=e.type,i=e.value;if("literal"===r){var o=/^\s+$/.test(i);return{literal:!o,val:o?" ":i}}var s=t[r],a=r;"hour"===r&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");var l=sF[a];if("object"==typeof l&&(l=l[s]),l)return{literal:!1,val:l}}(t,e,i)}))}var dF="Invalid DateTime",pF=864e13;function hF(e){return new UD("unsupported zone",'the zone "'+e.name+'" is not supported')}function fF(e){return null===e.weekData&&(e.weekData=JD(e.c)),e.weekData}function mF(e){return null===e.localWeekData&&(e.localWeekData=JD(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function gF(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new LF(gL({},n,t,{old:n}))}function vF(e,t,n){var r=e-6e4*t,i=n.offset(r);if(t===i)return[r,t];r-=6e4*(i-t);var o=n.offset(r);return i===o?[r,i]:[e-6e4*Math.min(i,o),Math.max(i,o)]}function yF(e,t){var n=new Date(e+=6e4*t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function bF(e,t,n){return vF(yB(e),t,n)}function SF(e,t){var n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o=gL({},e.c,{year:r,month:i,day:Math.min(e.c.day,vB(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=Hz.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=vF(yB(o),n,e.zone),l=a[0],c=a[1];return 0!==s&&(l+=s,c=e.zone.offset(l)),{ts:l,o:c}}function xF(e,t,n,r,i,o){var s=n.setZone,a=n.zone;if(e&&0!==Object.keys(e).length||t){var l=t||a,c=LF.fromObject(e,gL({},n,{zone:l,specificOffset:o}));return s?c:c.setZone(a)}return LF.invalid(new UD("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function wF(e,t,n){return void 0===n&&(n=!0),e.isValid?VB.create(MD.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function CF(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=uB(e.c.year,n?6:4),t?(r+="-",r+=uB(e.c.month),r+="-",r+=uB(e.c.day)):(r+=uB(e.c.month),r+=uB(e.c.day)),r}function AF(e,t,n,r,i,o){var s=uB(e.c.hour);return t?(s+=":",s+=uB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=":")):s+=uB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=uB(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=uB(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?s+="Z":e.o<0?(s+="-",s+=uB(Math.trunc(-e.o/60)),s+=":",s+=uB(Math.trunc(-e.o%60))):(s+="+",s+=uB(Math.trunc(e.o/60)),s+=":",s+=uB(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}var EF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},MF={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},_F={ordinal:1,hour:0,minute:0,second:0,millisecond:0},TF=["year","month","day","hour","minute","second","millisecond"],IF=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],RF=["year","ordinal","hour","minute","second","millisecond"];function PF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){var t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new PL(e);return t}(e)}}function kF(e,t){var n,r,i=RD(t.zone,FD.defaultZone),o=MD.fromObject(t),s=FD.now();if(tB(e.year))n=s;else{for(var a=0,l=TF;a<l.length;a++){var c=l[a];tB(e[c])&&(e[c]=EF[c])}var u=ZD(e)||eB(e);if(u)return LF.invalid(u);var d=bF(e,i.offset(s),i);n=d[0],r=d[1]}return new LF({ts:n,zone:i,loc:o,o:r})}function OF(e,t,n){var r=!!tB(n.round)||n.round,i=function(e,i){return e=fB(e,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(e,i)},o=function(r){return n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r)};if(n.unit)return i(o(n.unit),n.unit);for(var s,a=EL(n.units);!(s=a()).done;){var l=s.value,c=o(l);if(Math.abs(c)>=1)return i(c,l)}return i(e>t?-0:0,n.units[n.units.length-1])}function NF(e){var t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}var LF=function(e){function t(e){var t=e.zone||FD.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new UD("invalid input"):null)||(t.isValid?null:hF(t));this.ts=tB(e.ts)?FD.now():e.ts;var r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var o=[e.old.c,e.old.o];r=o[0],i=o[1]}else{var s=t.offset(this.ts);r=yF(this.ts,s),r=(n=Number.isNaN(r.year)?new UD("invalid input"):null)?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||MD.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}t.now=function(){return new t({})},t.local=function(){var e=NF(arguments),t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return kF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.utc=function(){var e=NF(arguments),t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return t.zone=TD.utcInstance,kF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.fromJSDate=function(e,n){void 0===n&&(n={});var r=function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");var i=RD(n.zone,FD.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:MD.fromObject(n)}):t.invalid(hF(i))},t.fromMillis=function(e,n){if(void 0===n&&(n={}),nB(e))return e<-864e13||e>pF?t.invalid("Timestamp out of range"):new t({ts:e,zone:RD(n.zone,FD.defaultZone),loc:MD.fromObject(n)});throw new kL("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},t.fromSeconds=function(e,n){if(void 0===n&&(n={}),nB(e))return new t({ts:1e3*e,zone:RD(n.zone,FD.defaultZone),loc:MD.fromObject(n)});throw new kL("fromSeconds requires a numerical input")},t.fromObject=function(e,n){void 0===n&&(n={}),e=e||{};var r=RD(n.zone,FD.defaultZone);if(!r.isValid)return t.invalid(hF(r));var i=MD.fromObject(n),o=EB(e,PF),s=$D(o,i),a=s.minDaysInFirstWeek,l=s.startOfWeek,c=FD.now(),u=tB(n.specificOffset)?r.offset(c):n.specificOffset,d=!tB(o.ordinal),p=!tB(o.year),h=!tB(o.month)||!tB(o.day),f=p||h,m=o.weekYear||o.weekNumber;if((f||d)&&m)throw new RL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&d)throw new RL("Can't mix ordinal dates with month/day");var g,v,y=m||o.weekday&&!f,b=yF(c,u);y?(g=IF,v=MF,b=JD(b,a,l)):d?(g=RF,v=_F,b=YD(b)):(g=TF,v=EF);for(var S,x=!1,w=EL(g);!(S=w()).done;){var C=S.value;tB(o[C])?o[C]=x?v[C]:b[C]:x=!0}var A=y?function(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=rB(e.weekYear),i=cB(e.weekNumber,1,SB(e.weekYear,t,n)),o=cB(e.weekday,1,7);return r?i?!o&&VD("weekday",e.weekday):VD("week",e.weekNumber):VD("weekYear",e.weekYear)}(o,a,l):d?function(e){var t=rB(e.year),n=cB(e.ordinal,1,gB(e.year));return t?!n&&VD("ordinal",e.ordinal):VD("year",e.year)}(o):ZD(o),E=A||eB(o);if(E)return t.invalid(E);var M=bF(y?QD(o,a,l):d?XD(o):o,u,r),_=new t({ts:M[0],zone:r,o:M[1],loc:i});return o.weekday&&f&&e.weekday!==_.weekday?t.invalid("mismatched weekday","you can't specify both a weekday of "+o.weekday+" and a date of "+_.toISO()):_},t.fromISO=function(e,t){void 0===t&&(t={});var n=function(e){return KB(e,[bz,Cz],[Sz,Az],[xz,Ez],[wz,Mz])}(e);return xF(n[0],n[1],t,"ISO 8601",e)},t.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return KB(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[pz,hz])}(e);return xF(n[0],n[1],t,"RFC 2822",e)},t.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return KB(e,[fz,vz],[mz,vz],[gz,yz])}(e);return xF(n[0],n[1],t,"HTTP",t)},t.fromFormat=function(e,n,r){if(void 0===r&&(r={}),tB(e)||tB(n))throw new kL("fromFormat requires an input string and a format");var i=r,o=i.locale,s=void 0===o?null:o,a=i.numberingSystem,l=void 0===a?null:a,c=function(e,t,n){var r=cF(e,t,n);return[r.result,r.zone,r.specificOffset,r.invalidReason]}(MD.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),e,n),u=c[0],d=c[1],p=c[2],h=c[3];return h?t.invalid(h):xF(u,d,r,"format "+n,e,p)},t.fromString=function(e,n,r){return void 0===r&&(r={}),t.fromFormat(e,n,r)},t.fromSQL=function(e,t){void 0===t&&(t={});var n=function(e){return KB(e,[Tz,Cz],[Iz,Rz])}(e);return xF(n[0],n[1],t,"SQL",e)},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new kL("need to specify a reason the DateTime is invalid");var r=e instanceof UD?e:new UD(e,n);if(FD.throwOnInvalid)throw new _L(r);return new t({invalid:r})},t.isDateTime=function(e){return e&&e.isLuxonDateTime||!1},t.parseFormatForOpts=function(e,t){void 0===t&&(t={});var n=uF(e,MD.fromObject(t));return n?n.map((function(e){return e?e.val:null})).join(""):null},t.expandFormat=function(e,t){return void 0===t&&(t={}),lF(VB.parseFormat(e),MD.fromObject(t)).map((function(e){return e.val})).join("")};var n=t.prototype;return n.get=function(e){return this[e]},n.getPossibleOffsets=function(){if(!this.isValid||this.isOffsetFixed)return[this];var e=864e5,t=6e4,n=yB(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),o=this.zone.offset(n-r*t),s=this.zone.offset(n-i*t);if(o===s)return[this];var a=n-o*t,l=n-s*t,c=yF(a,o),u=yF(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[gF(this,{ts:a}),gF(this,{ts:l})]:[this]},n.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=VB.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},n.toUTC=function(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(TD.instance(e),t)},n.toLocal=function(){return this.setZone(FD.defaultZone)},n.setZone=function(e,n){var r=void 0===n?{}:n,i=r.keepLocalTime,o=void 0!==i&&i,s=r.keepCalendarTime,a=void 0!==s&&s;if((e=RD(e,FD.defaultZone)).equals(this.zone))return this;if(e.isValid){var l=this.ts;if(o||a){var c=e.offset(this.ts);l=bF(this.toObject(),c,e)[0]}return gF(this,{ts:l,zone:e})}return t.invalid(hF(e))},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return gF(this,{loc:this.loc.clone({locale:n,numberingSystem:r,outputCalendar:i})})},n.setLocale=function(e){return this.reconfigure({locale:e})},n.set=function(e){if(!this.isValid)return this;var t,n=EB(e,PF),r=$D(n,this.loc),i=r.minDaysInFirstWeek,o=r.startOfWeek,s=!tB(n.weekYear)||!tB(n.weekNumber)||!tB(n.weekday),a=!tB(n.ordinal),l=!tB(n.year),c=!tB(n.month)||!tB(n.day),u=l||c,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new RL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new RL("Can't mix ordinal dates with month/day");s?t=QD(gL({},JD(this.c,i,o),n),i,o):tB(n.ordinal)?(t=gL({},this.toObject(),n),tB(n.day)&&(t.day=Math.min(vB(t.year,t.month),t.day))):t=XD(gL({},YD(this.c),n));var p=bF(t,this.o,this.zone);return gF(this,{ts:p[0],o:p[1]})},n.plus=function(e){return this.isValid?gF(this,SF(this,Hz.fromDurationLike(e))):this},n.minus=function(e){return this.isValid?gF(this,SF(this,Hz.fromDurationLike(e).negate())):this},n.startOf=function(e,t){var n=(void 0===t?{}:t).useLocaleWeeks,r=void 0!==n&&n;if(!this.isValid)return this;var i={},o=Hz.normalizeUnit(e);switch(o){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===o)if(r){var s=this.loc.getStartOfWeek();this.weekday<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if("quarters"===o){var a=Math.ceil(this.month/3);i.month=3*(a-1)+1}return this.set(i)},n.endOf=function(e,t){var n;return this.isValid?this.plus((n={},n[e]=1,n)).startOf(e,t).minus(1):this},n.toFormat=function(e,t){return void 0===t&&(t={}),this.isValid?VB.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):dF},n.toLocaleString=function(e,t){return void 0===e&&(e=BL),void 0===t&&(t={}),this.isValid?VB.create(this.loc.clone(t),e).formatDateTime(this):dF},n.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?VB.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},n.toISO=function(e){var t=void 0===e?{}:e,n=t.format,r=void 0===n?"extended":n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.suppressMilliseconds,a=void 0!==s&&s,l=t.includeOffset,c=void 0===l||l,u=t.extendedZone,d=void 0!==u&&u;if(!this.isValid)return null;var p="extended"===r,h=CF(this,p);return h+="T",h+=AF(this,p,o,a,c,d)},n.toISODate=function(e){var t=(void 0===e?{}:e).format,n=void 0===t?"extended":t;return this.isValid?CF(this,"extended"===n):null},n.toISOWeekDate=function(){return wF(this,"kkkk-'W'WW-c")},n.toISOTime=function(e){var t=void 0===e?{}:e,n=t.suppressMilliseconds,r=void 0!==n&&n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.includeOffset,a=void 0===s||s,l=t.includePrefix,c=void 0!==l&&l,u=t.extendedZone,d=void 0!==u&&u,p=t.format,h=void 0===p?"extended":p;return this.isValid?(c?"T":"")+AF(this,"extended"===h,o,r,a,d):null},n.toRFC2822=function(){return wF(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},n.toHTTP=function(){return wF(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},n.toSQLDate=function(){return this.isValid?CF(this,!0):null},n.toSQLTime=function(e){var t=void 0===e?{}:e,n=t.includeOffset,r=void 0===n||n,i=t.includeZone,o=void 0!==i&&i,s=t.includeOffsetSpace,a="HH:mm:ss.SSS";return(o||r)&&((void 0===s||s)&&(a+=" "),o?a+="z":r&&(a+="ZZ")),wF(this,a,!0)},n.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},n.toString=function(){return this.isValid?this.toISO():dF},n[e]=function(){return this.isValid?"DateTime { ts: "+this.toISO()+", zone: "+this.zone.name+", locale: "+this.locale+" }":"DateTime { Invalid, reason: "+this.invalidReason+" }"},n.valueOf=function(){return this.toMillis()},n.toMillis=function(){return this.isValid?this.ts:NaN},n.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},n.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},n.toJSON=function(){return this.toISO()},n.toBSON=function(){return this.toJSDate()},n.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=gL({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},n.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},n.diff=function(e,t,n){if(void 0===t&&(t="milliseconds"),void 0===n&&(n={}),!this.isValid||!e.isValid)return Hz.invalid("created by diffing an invalid DateTime");var r,i=gL({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(Hz.normalizeUnit),s=e.valueOf()>this.valueOf(),a=Kz(s?this:e,s?e:this,o,i);return s?a.negate():a},n.diffNow=function(e,n){return void 0===e&&(e="milliseconds"),void 0===n&&(n={}),this.diff(t.now(),e,n)},n.until=function(e){return this.isValid?Gz.fromDateTimes(this,e):this},n.hasSame=function(e,t,n){if(!this.isValid)return!1;var r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)},n.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},n.toRelative=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],o=e.unit;return Array.isArray(e.unit)&&(i=e.unit,o=void 0),OF(n,this.plus(r),gL({},e,{numeric:"always",units:i,unit:o}))},n.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?OF(e.base||t.fromObject({},{zone:this.zone}),this,gL({},e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null},t.min=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.every(t.isDateTime))throw new kL("min requires all arguments be DateTimes");return sB(n,(function(e){return e.valueOf()}),Math.min)},t.max=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.every(t.isDateTime))throw new kL("max requires all arguments be DateTimes");return sB(n,(function(e){return e.valueOf()}),Math.max)},t.fromFormatExplain=function(e,t,n){void 0===n&&(n={});var r=n,i=r.locale,o=void 0===i?null:i,s=r.numberingSystem,a=void 0===s?null:s;return cF(MD.fromOpts({locale:o,numberingSystem:a,defaultToEN:!0}),e,t)},t.fromStringExplain=function(e,n,r){return void 0===r&&(r={}),t.fromFormatExplain(e,n,r)},mL(t,[{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function(){return this._zone}},{key:"zoneName",get:function(){return this.isValid?this.zone.name:null}},{key:"year",get:function(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function(){return this.isValid?this.c.month:NaN}},{key:"day",get:function(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function(){return this.isValid?fF(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?fF(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?fF(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?mF(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?mF(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?mF(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?YD(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?Wz.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?Wz.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?Wz.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?Wz.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return mB(this.year)}},{key:"daysInMonth",get:function(){return vB(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?gB(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?SB(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?SB(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return BL}},{key:"DATE_MED",get:function(){return zL}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return FL}},{key:"DATE_FULL",get:function(){return UL}},{key:"DATE_HUGE",get:function(){return jL}},{key:"TIME_SIMPLE",get:function(){return HL}},{key:"TIME_WITH_SECONDS",get:function(){return VL}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return GL}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return WL}},{key:"TIME_24_SIMPLE",get:function(){return qL}},{key:"TIME_24_WITH_SECONDS",get:function(){return KL}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return JL}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return QL}},{key:"DATETIME_SHORT",get:function(){return YL}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return XL}},{key:"DATETIME_MED",get:function(){return $L}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return ZL}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return eD}},{key:"DATETIME_FULL",get:function(){return tD}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return nD}},{key:"DATETIME_HUGE",get:function(){return rD}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return iD}}]),t}(Symbol.for("nodejs.util.inspect.custom"));function DF(e){if(LF.isDateTime(e))return e;if(e&&e.valueOf&&nB(e.valueOf()))return LF.fromJSDate(e);if(e&&"object"==typeof e)return LF.fromObject(e);throw new kL("Unknown datetime argument: "+e+", of type "+typeof e)}hL.DateTime=LF,hL.Duration=Hz,hL.FixedOffsetZone=TD,hL.IANAZone=dD,hL.Info=Wz,hL.Interval=Gz,hL.InvalidZone=ID,hL.Settings=FD,hL.SystemZone=aD,hL.VERSION="3.4.4",hL.Zone=oD;c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function BF(e,t){let[n,r]=(0,c.useState)(e),i=Ka(e);return qa((()=>r(i.current)),[i,r,...t]),n}var zF=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(zF||{}),FF=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(FF||{}),UF=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(UF||{}),jF=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(jF||{});function HF(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=Al(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let VF={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{value:n,mode:r,compare:i}=e.propsRef.current,o=e.options.findIndex((e=>{let t=e.dataRef.current.value;return La(r,{1:()=>n.some((e=>i(e,t))),0:()=>i(n,t)})}));return-1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){var n;if(e.disabled||1===e.listboxState)return e;let r=HF(e),i=Md(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=HF(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;La(o,{1:()=>i.some((e=>s(e,a))),0:()=>s(i,a)})&&(r.activeOptionIndex=r.options.indexOf(n))}return{...e,...r}},8:(e,t)=>{let n=HF(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},GF=(0,c.createContext)(null);function WF(e){let t=(0,c.useContext)(GF);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,WF),t}return t}function qF(e,t){return La(t.type,VF,e,t)}GF.displayName="ListboxContext";let KF=c.Fragment,JF=Ha((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,horizontal:u=!1,multiple:d=!1,...p}=e;const h=u?"horizontal":"vertical";let f=Xa(n),[m,g]=jf(r,s,i),v=(0,c.useReducer)(qF,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Ja("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a)}},labelRef:(0,c.createRef)(),buttonRef:(0,c.createRef)(),optionsRef:(0,c.createRef)(),disabled:l,orientation:h,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:y,propsRef:b,optionsRef:S,buttonRef:x},w]=v;b.current.value=m,b.current.mode=d?1:0,qa((()=>{b.current.onChange=e=>La(b.current.mode,{0:()=>g(e),1(){let t=b.current.value.slice(),{compare:n}=b.current,r=t.findIndex((t=>n(t,e)));return-1===r?t.push(e):t.splice(r,1),g(t)}})}),[g,b]),qa((()=>w({type:2,disabled:l})),[l]),qa((()=>w({type:3,orientation:h})),[h]),lc([x,S],((e,t)=>{var n;w({type:1}),Sl(t,bl.Loose)||(e.preventDefault(),null==(n=x.current)||n.focus())}),0===y);let C=(0,c.useMemo)((()=>({open:0===y,disabled:l,value:m})),[y,l,m]),A={ref:f};return t(c).createElement(GF.Provider,{value:v},t(c).createElement(rc,{value:La(y,{0:tc.Open,1:tc.Closed})},null!=o&&null!=m&&Bf({[o]:m}).map((([e,n])=>t(c).createElement(ll,{features:al.Hidden,...Va({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),Fa({ourProps:A,theirProps:p,slot:C,defaultTag:KF,name:"Listbox"})))})),QF=Ha((function(e,t){var n;let[r,i]=WF("Listbox.Button"),o=Xa(r.buttonRef,t),s=`headlessui-listbox-button-${sl()}`,a=Tc(),l=Ja((e=>{switch(e.key){case Za.Space:case Za.Enter:case Za.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Ed.First})}));break;case Za.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Ed.Last})}))}})),u=Ja((e=>{if(e.key===Za.Space)e.preventDefault()})),d=Ja((e=>{if(el(e.currentTarget))return e.preventDefault();0===r.listboxState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),i({type:0}))})),p=BF((()=>{if(r.labelRef.current)return[r.labelRef.current.id,s].join(" ")}),[r.labelRef.current,s]),h=(0,c.useMemo)((()=>({open:0===r.listboxState,disabled:r.disabled,value:r.propsRef.current.value})),[r]),f=e;return Fa({ourProps:{ref:o,id:s,type:Id(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.listboxState,"aria-labelledby":p,disabled:r.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:h,defaultTag:"button",name:"Listbox.Button"})})),YF=Ha((function(e,t){let[n]=WF("Listbox.Label"),r=`headlessui-listbox-label-${sl()}`;return Fa({ourProps:{ref:Xa(n.labelRef,t),id:r,onClick:Ja((()=>{var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n.listboxState,disabled:n.disabled})),[n]),defaultTag:"label",name:"Listbox.Label"})})),XF=Ba.RenderStrategy|Ba.Static,$F=Ha((function(e,t){var n;let[r,i]=WF("Listbox.Options"),o=Xa(r.optionsRef,t),s=`headlessui-listbox-options-${sl()}`,a=Tc(),l=Tc(),u=nc(),d=null!==u?u===tc.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=dl(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let p=Ja((e=>{switch(l.dispose(),e.key){case Za.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case Za.Enter:if(e.preventDefault(),e.stopPropagation(),null!==r.activeOptionIndex){let{dataRef:e}=r.options[r.activeOptionIndex];r.propsRef.current.onChange(e.current.value)}0===r.propsRef.current.mode&&(i({type:1}),ul().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case La(r.orientation,{vertical:Za.ArrowDown,horizontal:Za.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ed.Next});case La(r.orientation,{vertical:Za.ArrowUp,horizontal:Za.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ed.Previous});case Za.Home:case Za.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ed.First});case Za.End:case Za.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ed.Last});case Za.Escape:return e.preventDefault(),e.stopPropagation(),i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case Za.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),h=BF((()=>{var e,t,n;return null!=(n=null==(e=r.labelRef.current)?void 0:e.id)?n:null==(t=r.buttonRef.current)?void 0:t.id}),[r.labelRef.current,r.buttonRef.current]),f=(0,c.useMemo)((()=>({open:0===r.listboxState})),[r]),m=e;return Fa({ourProps:{"aria-activedescendant":null===r.activeOptionIndex||null==(n=r.options[r.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===r.propsRef.current.mode||void 0,"aria-labelledby":h,"aria-orientation":r.orientation,id:s,onKeyDown:p,role:"listbox",tabIndex:0,ref:o},theirProps:m,slot:f,defaultTag:"ul",features:XF,visible:d,name:"Listbox.Options"})})),ZF=Ha((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=WF("Listbox.Option"),a=`headlessui-listbox-option-${sl()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,p=La(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),h=(0,c.useRef)(null),f=Xa(t,h);qa((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=ul();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=h.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[h,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]);let m=(0,c.useRef)({disabled:n,value:r,domRef:h});qa((()=>{m.current.disabled=n}),[m,n]),qa((()=>{m.current.value=r}),[m,r]),qa((()=>{var e,t;m.current.textValue=null==(t=null==(e=h.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,h]);let g=Ja((()=>o.propsRef.current.onChange(r)));qa((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Ja((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),ul().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Ja((()=>{if(n)return s({type:4,focus:Ed.Nothing});s({type:4,focus:Ed.Specific,id:a})})),b=Ja((()=>{n||l||s({type:4,focus:Ed.Specific,id:a,trigger:0})})),S=Ja((()=>{n||!l||s({type:4,focus:Ed.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:p,disabled:n})),[l,p,n]);return Fa({ourProps:{id:a,ref:f,role:"option",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,"aria-selected":p,disabled:void 0,onClick:v,onFocus:y,onPointerMove:b,onMouseMove:b,onPointerLeave:S,onMouseLeave:S},theirProps:i,slot:x,defaultTag:"li",name:"Listbox.Option"})})),eU=Object.assign(JF,{Button:QF,Label:YF,Options:$F,Option:ZF});var tU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false",role:"img",className:e,fill:"currentColor","aria-label":t,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",clipRule:"evenodd"})});const nU={en:["January","February","March","April","May","June","July","August","September","October","November","December"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},rU=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=ge(),[o,a]=(0,c.useState)(e?"string"==typeof e?hL.DateTime.fromISO(e):hL.DateTime.fromJSDate(e):hL.DateTime.now());return(0,c.useEffect)((()=>{t(o)}),[o,t]),(0,s.jsxs)("div",{className:"memori--date-selector",children:[(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(eU,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(eU.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(eU.Button,{"aria-label":r("day"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.day}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(tU,{})})]}),(0,s.jsx)(Gc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(eU.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(eU.Option,{value:o.set({day:e+1}),className:"memori--date-selector__select-option",children:e+1},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(eU,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(eU.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(eU.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:nU["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(tU,{})})]}),(0,s.jsx)(Gc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(eU.Options,{className:"memori--date-selector__select-options",children:nU["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(eU.Option,{className:"memori--date-selector__select-option",value:o.set({month:nU["it"===i.language?"it":"en"].findIndex((t=>t===e))+1}),children:e},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(eU,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(eU.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(eU.Button,{"aria-label":r("year"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.year}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(tU,{})})]}),(0,s.jsx)(Gc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(eU.Options,{className:"memori--date-selector__select-options",children:[...Array(hL.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(eU.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));rU.displayName="DateSelector";var iU=rU;c=o("85Hg2");var oU=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=ge(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),[d,p]=(0,c.useState)(!1),h=(0,c.useCallback)((()=>{if(p(!0),!o)return t(bs).error(i("requiredField")),u(i("requiredField")||"Required field"),void p(!1);if(hL.DateTime.now().diff(o,"years").years<r)return t(bs).error(i("underageTwinSession",{age:r})),u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`),void p(!1);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(Kc,{open:e,title:i("ageVerification"),className:"age-verification-modal",closable:!0,onClose:()=>n(),children:[(0,s.jsx)("p",{children:i("ageVerificationText",{minAge:r})}),(0,s.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),h()},children:[(0,s.jsx)("div",{className:"form-item",children:(0,s.jsxs)("fieldset",{name:"birthDate",children:[(0,s.jsx)("legend",{className:"sr-only",children:i("birthDate")}),(0,s.jsx)(iU,{defaultDate:new Date(Date.now()),onChange:e=>{a(e)}}),(0,s.jsx)("p",{className:"form-item-help",children:i("birthDateHelper")}),l&&(0,s.jsx)("p",{className:"form-item-error",children:l})]})}),(0,s.jsx)("div",{className:"form-item form-submit",children:(0,s.jsx)(Na,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var sU=({open:e=!1,onClose:n,className:r,title:i,description:o,children:a,footer:l,loading:u=!1,side:d="right",closable:p=!0,width:h="100%",widthMd:f="80%",widthLg:m="60%"})=>(0,s.jsx)(Gc,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(wc,{open:e,onClose:n,className:t(vs)("memori-drawer",r),children:[(0,s.jsx)(Gc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"memori-drawer--backdrop"})}),(0,s.jsx)("div",{className:"memori-drawer--container",children:(0,s.jsx)("div",{className:"memori-drawer--container-scrollable",children:(0,s.jsx)(Gc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"max-w-0 opacity-0",enterTo:"max-w-100 opacity-100",leave:"ease-in duration-200",leaveFrom:"max-w-100 opacity-100",leaveTo:"max-w-0 opacity-0",children:(0,s.jsxs)(wc.Panel,{className:t(vs)("memori-drawer--panel",{"memori-drawer--panel-left":"left"===d,"memori-drawer--with-footer":!!l}),children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-drawer--panel {\n --memori-drawer--width: ${h};\n --memori-drawer--width-lg: ${m};\n --memori-drawer--width-md: ${f};\n }\n `}}),p&&(0,s.jsx)("div",{className:"memori-drawer--close",children:(0,s.jsx)(Na,{shape:"circle",outlined:!0,icon:(0,s.jsx)(qc,{}),onClick:()=>n(!1)})}),(0,s.jsxs)(Wc,{spinning:u,children:[i&&(0,s.jsx)(wc.Title,{className:"memori-drawer--title",children:i}),o&&(0,s.jsx)(wc.Description,{className:"memori-drawer--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-drawer--footer",children:l})]})]})})})})]})});c=o("85Hg2");var aU=({label:e,className:n,disabled:r=!1,indeterminate:i=!1,checked:o,children:a,onChange:l,name:u,...d})=>{const p=(0,c.useRef)(null);return(0,c.useEffect)((()=>{p.current&&(p.current.indeterminate=i)}),[p,i]),(0,s.jsxs)("label",{className:t(vs)("memori-checkbox",n,{"memori-checkbox--disabled":r,"memori-checkbox--indeterminate":i}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{ref:p,type:"checkbox",...d,name:u,disabled:r,checked:o||i,className:"memori-checkbox--input",onChange:l}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),!!(null==e?void 0:e.length)&&(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]})};c=o("85Hg2");var lU=({className:e,value:n,displayValue:r,options:i,onChange:o,disabled:a=!1,label:l,placeholder:u})=>(0,s.jsx)("div",{className:t(vs)("memori-select",e),children:(0,s.jsxs)(eU,{value:n,onChange:e=>{o(e)},disabled:a,name:"day",children:[l&&(0,s.jsxs)(eU.Label,{className:"memori-select--label",children:[l,":"]}),(0,s.jsxs)(eU.Button,{"aria-label":l,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(vs)("memori-select--value",{"memori-select--value-placeholder":!n}),children:n?r||n:u}),(0,s.jsx)("span",{className:"memori-select--icon",children:(0,s.jsx)(tU,{})})]}),(0,s.jsx)(Gc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(eU.Options,{className:"memori-select--options",children:i.map((e=>(0,s.jsx)(eU.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const cU={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions"},uU=(e,t)=>{var n;const r=window.localStorage.getItem(null!==(n=cU[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}},dU=(e,t)=>{var n;window.localStorage.setItem(null!==(n=cU[e])&&void 0!==n?n:e,t.toString())},pU=[2,3,5,10,15,20,30,60];var hU=({open:e,layout:t="DEFAULT",onClose:n,microphoneMode:r="HOLD_TO_TALK",continuousSpeechTimeout:i,setMicrophoneMode:o,setContinuousSpeechTimeout:a,controlsPosition:l,setControlsPosition:c,hideEmissions:u,setHideEmissions:d,additionalSettings:p})=>{const{t:h}=ge();return(0,s.jsxs)(sU,{className:"memori-settings-drawer",open:e,onClose:n,title:h("widget.settings")||"Settings",description:h("write_and_speak.settingsHeaderLabel"),children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#microphoneMode",children:[h("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,s.jsxs)(Xf,{id:"microphoneMode",name:"microphoneMode",value:r,defaultValue:r,className:"memori-settings-drawer--microphoneMode-radio",onChange:e=>{let t="CONTINUOUS"===e?"CONTINUOUS":"HOLD_TO_TALK";o(t),dU("microphoneMode",t)},children:[(0,s.jsx)(Xf.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Na,{primary:e,children:h("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)(Xf.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Na,{primary:e,children:h("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(lU,{label:h("write_and_speak.secondsLabel")||"Seconds",placeholder:h("write_and_speak.secondsLabel")||"Seconds",options:pU.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),dU("continuousSpeechTimeout",e)}})}),"TOTEM"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#controlsPosition",children:[h("write_and_speak.controlsPosition")||"Controls",":"]}),(0,s.jsxs)(Xf,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),dU("controlsPosition",e)},children:[(0,s.jsx)(Xf.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Na,{primary:e,children:h("center")||"Center"})}),(0,s.jsx)(Xf.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Na,{primary:e,children:h("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(aU,{label:h("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),dU("hideEmissions",e.target.checked)}})})]}),p&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:p})]})};c=o("85Hg2");const fU=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_CANT_EDIT_INTEGRATIONS:-37,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905}).map((([e,t])=>[t,e]))),mU=e=>{if(!e)return"error.generic";if(401===e||403===e)return"error.unauthorized";if(404===e)return"error.notFound";if(422===e)return"error.unprocessableEntity";if(500===e)return"internal server error";let t=fU.get(e);return t?`errors.${t}`:"error.generic"};var gU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})});var vU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M15 18L9 12 15 6"})});var yU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M9 18L15 12 9 6"})});var bU=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=ge(),d=W(e),{getKnownFactsPaginated:p,deleteKnownFact:h}=d.knownFacts,[f,m]=(0,c.useState)(o),[g,v]=(0,c.useState)(25),[y,b]=(0,c.useState)(0),[S,x]=(0,c.useState)(null!==(l=null==o?void 0:o.length)&&void 0!==l?l:0),[w,C]=(0,c.useState)(!1),A=async(e,r,i)=>{if(n||e){C(!0);try{const{knownFacts:o,count:s,...a}=await p(null!=e?e:n,null!=r?r:y,null!=i?i:g);m(null!=o?o:[]),x(null!=s?s:0),0!==a.resultCode&&(console.error(a),t(bs).error(u(mU(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}C(!1)}};(0,c.useEffect)((()=>{A()}),[]);const[E,M]=(0,c.useState)(!1),[_,T]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(sU,{open:i,width:"80%",className:"memori-known-facts-drawer",onClose:()=>a(),title:u("knownFacts.title"),children:[(0,s.jsx)("p",{children:u("knownFacts.description",{memoriName:r.name})}),(0,s.jsxs)(Wc,{spinning:w,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(Na,{primary:!0,danger:!0,onClick:()=>{M(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(gU,{}),loading:w,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Kc,{className:"memori-known-facts-modal",open:E,closable:!0,title:I.length>1?u("knownFacts.deleteSelectedConfirmTitle"):u("knownFacts.deleteConfirmTitle"),description:I.length>1?u("knownFacts.deleteSelectedConfirmMessage",{number:I.length}):u("knownFacts.deleteConfirmMessage"),onClose:()=>{M(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Na,{ghost:!0,onClick:()=>{M(!1)},children:u("cancel")}),(0,s.jsx)(Na,{primary:!0,danger:!0,onClick:async()=>{try{const e=I.map((e=>h(n,e)));Promise.all(e).then((e=>{if(e.every((e=>0===e.resultCode)))t(bs).success(u("knownFacts.deleteSuccess")),R([]),A(),M(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(bs).error(u(mU(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(bs).error(u("Error")+n.message)}},children:u("confirm")})]})})]}),S>25&&(0,s.jsxs)("nav",{className:"memori--table--pagination",children:[S>g&&(0,s.jsxs)("div",{className:"memori--table--pagination--pages",children:[(0,s.jsx)(Na,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(vU,{}),onClick:()=>{let e=(y/g-1)*g;b(e),A(void 0,e,g)}}),(0,s.jsxs)("span",{className:"memori--table--pagination--pages--current",children:[Math.ceil(y/g)+1," /"," ",Math.ceil(S/g)]}),(0,s.jsx)(Na,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(yU,{}),disabled:(y/g+1)*g>=S,onClick:()=>{let e=(y/g+1)*g;b(e),A(void 0,e,g)}})]}),(0,s.jsx)(lU,{options:[{label:`25 / ${u("page")||"page"}`,value:25},{label:`50 / ${u("page")||"page"}`,value:50},{label:`100 / ${u("page")||"page"}`,value:100}],value:g,displayValue:`${g} / ${u("page")||"page"}`,onChange:e=>{v(e),b(0),A(void 0,0,e)}})]}),(0,s.jsxs)("table",{className:"memori--table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(aU,{checked:!!(null==f?void 0:f.length)&&(null==I?void 0:I.length)===f.length,indeterminate:!!(null==f?void 0:f.length)&&!!(null==I?void 0:I.length)&&(null==I?void 0:I.length)!==(null==f?void 0:f.length),onChange:e=>{e.target.checked?R(f.map((e=>e.knownFactID))):R([])}})}),(0,s.jsx)("th",{children:u("knownFacts.text")}),(0,s.jsx)("th",{className:"mobile-hidden",children:u("createdAt")}),(0,s.jsx)("th",{className:"memori--table--column-right",children:u("actions")})]})}),(0,s.jsx)("tbody",{children:f.map((e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(aU,{checked:null==I?void 0:I.includes(e.knownFactID),onChange:t=>{t.target.checked?R((t=>[...new Set([...t,e.knownFactID])])):R((t=>t.filter((t=>t!==e.knownFactID))))}})}),(0,s.jsx)("td",{children:e.text}),(0,s.jsx)("td",{className:"mobile-hidden",children:(0,s.jsx)("span",{className:"memori--table--date",children:e.creationTimestamp?new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date(e.creationTimestamp)):"-"})}),(0,s.jsx)("td",{className:"memori--table--column-right",children:(0,s.jsxs)("div",{className:"memori--table--action-column",children:[(0,s.jsx)(Na,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(gU,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>T(e.knownFactID)}),(0,s.jsx)(Kc,{className:"memori-known-facts-modal",open:_===e.knownFactID,closable:!0,title:u("knownFacts.deleteConfirmTitle"),description:u("knownFacts.deleteConfirmMessage"),onClose:()=>{T(void 0)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Na,{ghost:!0,onClick:()=>{T(void 0)},children:u("cancel")}),(0,s.jsx)(Na,{primary:!0,danger:!0,onClick:async()=>{try{const r=await h(n,e.knownFactID);0===r.resultCode?(t(bs).success(u("knownFacts.deleteSuccess")),R([]),A(),T(void 0)):(console.error(r),t(bs).error(u(mU(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(bs).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var SU=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=ge();return(0,s.jsx)(sU,{open:e,onClose:o,className:"memori--experts-drawer",title:(0,s.jsx)("h2",{className:"memori--experts-drawer--title",children:a("widget.expertsInTheBoard")}),children:(0,s.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map((e=>(0,s.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,s.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,s.jsx)("img",{src:`${n}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=xd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,s.jsxs)("div",{className:"memori--experts-drawer--content",children:[(0,s.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name}),(0,s.jsx)("p",{className:"memori--experts-drawer--description",children:e.description})]})]},e.expertID)))})})};var xU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(Wc,{spinning:g,children:[m&&d&&p&&(0,s.jsx)(d,{...p}),e&&t&&(0,s.jsx)(e,{...t}),(0,s.jsxs)("div",{className:"memori--grid",children:[(0,s.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[n&&r&&(0,s.jsx)(n,{...r}),(0,s.jsx)("div",{id:"extension"})]}),(0,s.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null}),v]})]})]});var wU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(Wc,{spinning:g,className:"memori-totem-layout",children:[v,m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,s.jsx)(n,{...r})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-totem-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]});var CU=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:o,integrationStyle:a,integrationBackground:l,ChangeMode:c,changeModeProps:u,sessionId:d,hasUserActivatedSpeak:p,showInstruct:h=!1,loading:f=!1,poweredBy:m})=>(0,s.jsxs)(s.Fragment,{children:[a,l,(0,s.jsxs)(Wc,{spinning:f,className:"memori-chat-layout",children:[m,h&&c&&u&&(0,s.jsx)(c,{...u}),(0,s.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-chat-layout--controls",children:d&&p&&n&&r?(0,s.jsx)(n,{...r}):o?(0,s.jsx)(i,{...o}):null})]})]});c=o("85Hg2"),c=o("85Hg2");var AU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>{var y,b;const{t:S}=ge(),[x,w]=(0,c.useState)(!0),[C,A]=(0,c.useState)(),E=(0,c.useMemo)((()=>null==o?void 0:o.stopAudio),[null==o?void 0:o.stopAudio]),M=e=>{w(e),A(e?void 0:(new Date).toISOString());try{null==E||E()}catch(e){console.log(e)}};return(0,s.jsx)("div",{className:"memori-website_assistant--"+(x?"collapsed":"expanded"),children:x?(0,s.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,s.jsx)(Na,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>M(!1),title:S("expand")||"Expand",children:(0,s.jsx)(tN,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(Wc,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Na,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>M(!0),icon:(0,s.jsx)(qc,{}),title:S("close")||"Close"})}),m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--header",children:e&&t&&(0,s.jsx)(e,{...t,showSettings:!1,showReload:!1})}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,c.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null===(y=r.integrationConfig)||void 0===y?void 0:y.avatarURL)?`${null===(b=r.integrationConfig)||void 0===b?void 0:b.avatarURL.split("#")[0]}#${C}`:void 0}:{},key:C})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]})})};const{deleteSession:EU,getStatistics:MU,initSession:_U}=W(),TU=new Map([[0,"🆕"],[10,"🐹"],[20,"🐇"],[30,"🐰"],[40,"💡"],[50,"🏆"],[60,"🏅"],[70,"🥉"],[80,"🥈"],[90,"🥇"],[100,"🔥"],[110,"🎓"],[120,"🤖"],[130,"👾"],[150,"🌍"],[180,"💜"],[200,"💙"],[250,"🧡"],[300,"💚"],[350,"💛"],[400,"💖"],[450,"💝"],[500,"🖤"],[550,"❤️"],[600,"🧠"]]),IU=e=>{const t=Array.from(TU.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return TU.get(e)}return""},RU=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of TU){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},PU=e=>{let t=0;for(const[n,r]of TU)if(r===e){t=n;break}return t},kU=e=>{const t=Math.round(e),n=IU(t);return{points:t,badge:n,pointsForCurrentBadge:PU(n),nextBadge:RU(n)}},OU=(e,t=!0,n=!1,r,i=!1,o=!1)=>{const s=new CustomEvent("MemoriTextEntered",{detail:{text:e,waitForPrevious:t,hidden:n,typingText:r,useLoaderTextAsMsg:i,hasBatchQueued:o}});document.dispatchEvent(s);window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))}),300)};let NU,LU,DU,BU,zU,FU;window.getMemoriState=e=>{var t,n,r,i,o;let s=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(i=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector(".memori-widget"));if(!s)return null;let a=null===(o=s.dataset)||void 0===o?void 0:o.memoriEngineState;return a?JSON.parse(a):null},window.typeMessage=OU,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>OU(e,t,!0,n,r,i),window.typeBatchMessages=e=>{function t(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.setAttribute("disabled","");const i="opacity: 0.5; touch-action: none; pointer-events: none;";null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.setAttribute("style",i),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.setAttribute("style",i),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.setAttribute("style",i)}function n(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.removeAttribute("disabled"),null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.removeAttribute("style"),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.removeAttribute("style"),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.removeAttribute("style")}function r(){var e;return!!(null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e?void 0:e.hasAttribute("disabled"))}const i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),o=function*(){yield*e}();t();const s=()=>{const e=o.next(),a=e.value;if(a){r()||t();let o=a.waitForPrevious;i&&(o=!1),OU(a.message,o,a.hidden,a.typingText,a.useLoaderTextAsMsg,!e.done),i&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),n()}),3e3)}else r()&&n();if(e.done)return document.removeEventListener("MemoriEndSpeak",s),void(r()&&n())};document.addEventListener("MemoriEndSpeak",s),s()};let UU=!1,jU=!1;var HU=({memori:e,memoriConfigs:n,memoriLang:r,multilingual:i,integration:o,layout:a="DEFAULT",customLayout:l,showInstruct:u=!1,showShare:d,preview:p=!1,embed:h=!1,showInputs:f=!0,showDates:m=!1,showContextPerLine:g=!1,showSettings:v=!0,showTypingText:y=!1,showClear:b=!1,showOnlyLastMessages:S,height:x="100vh",secret:w,baseUrl:C="https://app.twincreator.com",apiUrl:A="https://backend.memori.ai",initialContextVars:E,initialQuestion:M,ogImage:_,sessionID:T,tenant:I,personification:R,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:k,onStateChange:O,additionalInfo:N,additionalSettings:L,customMediaRenderer:D,userAvatar:B})=>{var z,F,U,j,H,V,G,q,K,J,Q,Y,X,$,Z,ee,te,ne,re,ie,oe,se;const{t:ae,i18n:le}=ge(),[ce,ue]=(0,c.useState)(!1);(0,c.useEffect)((()=>{ue(!0)}),[]);const de=W(A),{initSession:pe,postTextEnteredEvent:he,postPlaceChangedEvent:fe,postTimeoutEvent:me,postTagChangedEvent:ve,getSession:ye,getContentQualityIndexes:be,getExpertReferences:Se}=de,[xe,we]=(0,c.useState)(!1),[Ce,Ae]=(0,c.useState)({avatarURL:"string"==typeof B?B:void 0}),[Ee,Me]=(0,c.useState)(!1),[_e,Te]=(0,c.useState)(!1),Ie=(null===(U=null===(F=null===(z=e.culture)||void 0===z?void 0:z.split("-"))||void 0===F?void 0:F[0])||void 0===U?void 0:U.toUpperCase())||(null===(G=null===(V=null===(H=null===(j=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===j?void 0:j.culture)||void 0===H?void 0:H.split("-"))||void 0===V?void 0:V[0])||void 0===G?void 0:G.toUpperCase()),Re=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,Pe=void 0!==i?i:!!(null==Re?void 0:Re.multilanguage),[ke,Oe]=(0,c.useState)(null!==(Q=null!==(J=null!==(K=null!==(q=null!=r?r:null==Re?void 0:Re.lang)&&void 0!==q?q:Ie)&&void 0!==K?K:null==Re?void 0:Re.uiLang)&&void 0!==J?J:le.language)&&void 0!==Q?Q:"IT"),[Ne,Le]=(0,c.useState)(!1),[De,Be]=(0,c.useState)(!1),[ze,Fe]=(0,c.useState)(),Ue=a||(null==Re?void 0:Re.layout)||"DEFAULT",[je,He]=(0,c.useState)(!1),[Ve,Ge]=(0,c.useState)(!1),[We,qe]=(0,c.useState)(!1),[Ke,Je]=(0,c.useState)(!1),[Qe,Ye]=(0,c.useState)(!1),[Xe,$e]=(0,c.useState)(!1),[Ze,et]=(0,c.useState)(!1),[tt,nt]=(0,c.useState)(!1),[rt,it]=(0,c.useState)(2),[ot,st]=(0,c.useState)(!1),[at,lt]=(0,c.useState)("center"),[ct,ut]=(0,c.useState)(!1);(0,c.useEffect)((()=>{st(!!DU),jU=!!DU}),[DU]),(0,c.useEffect)((()=>{let e="bottom",t=uU("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(e="bottom",t="HOLD_TO_TALK"):e=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",et(uU("muteSpeaker",!1)),UU=uU("muteSpeaker",!1),nt("CONTINUOUS"===t),it(uU("continuousSpeechTimeout",2)),lt(uU("controlsPosition",e)),ut(uU("hideEmissions",!1))}),[]);const[dt,pt]=(0,c.useState)(w),[ht,ft]=(0,c.useState)(),[mt,gt]=(0,c.useState)(null),[vt,yt]=(0,c.useState)(),bt=async(e,t)=>{var n;const r=null!=t?t:Nt;if(e&&r){const{currentState:t,...i}=await fe({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===i.resultCode&&zt({...Dt,...t})}},[St,xt]=(0,c.useState)(""),[wt,Ct]=(0,c.useState)(!1),[At,Et]=(0,c.useState)([]),Mt=e=>{Et((t=>{var n,r;return[...t,{...e,media:null!==(r=null===(n=e.media)||void 0===n?void 0:n.filter((e=>{var t;return!("text/javascript"===e.mimeType&&(null===(t=e.properties)||void 0===t?void 0:t.executable))})))&&void 0!==r?r:[]}]}))},_t=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,p,h,f;const m=i||Nt||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||Mt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Nt?!!i&&i!==Nt:!!i}),Be(!0),Fe(l);let g=n,v=!1;if(o&&!xe&&Pe&&ke.toUpperCase()!==Ie.toUpperCase()){g=(await ap(n,Ie,ke,C)).text}const{currentState:y,...b}=await he({sessionId:m,text:g});if(0===b.resultCode&&y){const n=c&&l?l:null!==(p=y.emission)&&void 0!==p?p:null==Dt?void 0:Dt.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await ve(m,e.giverTag);0===i.resultCode?(zt(r),n&&(Mt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),en(n))):(console.error(b,i),t(bs).error(ae(mU(i.resultCode))),v=!0)}else if("X2d"===y.state&&e.giverTag){const{currentState:r,...i}=await he({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await ve(m,e.giverTag);0===i.resultCode?(zt(r),n&&(Mt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),en(n))):(console.error(b,i),t(bs).error(ae(mU(i.resultCode))),v=!0)}else console.error(b,i),t(bs).error(ae(mU(i.resultCode))),v=!0}else ke.toLowerCase()!==Ie.toLowerCase()&&n&&!xe&&Pe?Tt(y,ke).then((e=>{e.emission&&en(e.emission)})):(zt({...y,emission:n}),n&&(Mt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,generatedByAI:!!y.completion}),en(n)))}else 404===b.resultCode&&(Et((e=>[...e.slice(0,e.length-1)])),Ut(!1,dt||e.secretToken,ht,xe&&e.giverTag?e.giverTag:void 0,xe&&e.giverPIN?e.giverPIN:void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(f=null===(h=window.location.pathname)||void 0===h?void 0:h.split("/"))||void 0===f?void 0:f.pop())||"",...E||{}},M).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{_t(n,r,null==e?void 0:e.sessionID)}),500)})));u||(Fe(void 0),Be(!1))},Tt=async(e,t)=>{var n,r,i;const o=null!==(n=e.emission)&&void 0!==n?n:null==Dt?void 0:Dt.emission;let s={...e},a=null;if(o&&!xe&&Ie.toUpperCase()!==t.toUpperCase()&&Pe){const n=await ap(o,t,Ie,C);if(e.hints&&e.hints.length>0){const i=await Promise.all((null!==(r=e.hints)&&void 0!==r?r:[]).map((async e=>{var n;const r=await ap(e,t,Ie,C);return{text:null!==(n=null==r?void 0:r.text)&&void 0!==n?n:e,originalText:e}})));s={...e,emission:n.text,translatedHints:i}}else s={...e,emission:n.text,hints:null!==(i=e.hints)&&void 0!==i?i:"G1"===e.state?null==Dt?void 0:Dt.hints:[]};n.text.length>0&&(a={text:n.text,emitter:e.emitter,media:e.media,fromUser:!1,generatedByAI:!!e.completion})}else s={...e,emission:o},o&&(a={text:o,emitter:e.emitter,media:e.media,fromUser:!1});return zt(s),a&&Mt(a),s},It=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[Rt,Pt]=(0,c.useState)(),[kt,Ot]=(0,c.useState)(!1),[Nt,Lt]=(0,c.useState)(T),[Dt,Bt]=(0,c.useState)(),zt=e=>{var t;Bt(e),O&&O(e);const n=null===(t=null==e?void 0:e.media)||void 0===t?void 0:t.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)}));null==n||n.forEach((e=>{try{setTimeout((()=>{var t;console.log("snippet",e),new Function(null!==(t=e.content)&&void 0!==t?t:"")(),setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),400)}),1e3)}catch(e){console.error(e)}}))},Ft=async n=>{var r,i,o,s,a;let l=uU("birthDate",void 0);if(Rt||l||!It)if("PUBLIC"===e.privacyType||e.secretToken||dt||ht){Le(!0);try{if(!e.giverTag&&(null===(r=e.receivedInvitations)||void 0===r?void 0:r.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}let l;try{l=window.location.href}catch(e){console.error(e)}const c=await pe({...n,tag:null!==(i=n.tag)&&void 0!==i?i:null==R?void 0:R.tag,pin:null!==(o=n.pin)&&void 0!==o?o:null==R?void 0:R.pin,additionalInfo:{...N||{},loginToken:null!==(a=null!==(s=null==N?void 0:N.loginToken)&&void 0!==s?s:kn)&&void 0!==a?a:P,language:Yt(ke),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Lt(c.sessionID),vt&&bt(vt,c.sessionID),Le(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(c),t(bs).error(ae("underageTwinSession",{age:It})),Te(!0)):403===(null==c?void 0:c.resultCode)?(pt(void 0),gt("password")):(console.error(c),t(bs).error(ae(mU(null==c?void 0:c.resultCode))),Te(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else gt("password");else Ot(!0)},Ut=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,p,h,f;Le(!0);try{let m,g=uU("birthDate",void 0);if(!c&&!g&&It)return void Ot(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||dt||i||ht))return void gt("password");try{m=window.location.href}catch(e){console.error(e)}const{sessionID:v,currentState:y,...b}=await pe({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||dt||e.secretToken,recoveryTokens:i||ht,tag:o,pin:s,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(p=null===(d=window.location.pathname)||void 0===d?void 0:d.split("/"))||void 0===p?void 0:p.pop())||"",...a||{}},initialQuestion:l,birthDate:c||g||void 0,additionalInfo:{...N||{},loginToken:null!==(f=null!==(h=null==N?void 0:N.loginToken)&&void 0!==h?h:kn)&&void 0!==f?f:P,language:Yt(ke),referral:m}});if(v&&y&&0===b.resultCode)return Lt(v),n&&(zt(y),y.emission&&(At.length<=1?Et([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}]):Mt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}))),vt&&bt(vt,v),Le(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(bs).error(ae("underageTwinSession",{age:It})),Te(!0)):403===(null==b?void 0:b.resultCode)?(pt(void 0),gt("password")):(console.error(b),t(bs).error(ae(mU(b.resultCode))),Te(!0))}catch(e){console.error(e)}return Le(!1),null},jt=async(t,n,r,i)=>{var o,s,a,l,c;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:u}=await ve(n,null!=r?r:cp);if(0===u){let d=0;if(r!==cp&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await he({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await ye(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(u)){console.warn("[APPCONTEXT/CHANGETAG]",u);let t,n=uU("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}Ft({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:w||dt||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...E||{}},initialQuestion:M,birthDate:Rt||n||void 0,additionalInfo:{...N||{},loginToken:null!==(c=null!==(l=null==N?void 0:N.loginToken)&&void 0!==l?l:kn)&&void 0!==c?c:P,language:Yt(ke),referral:t}})}else if(t)return{currentState:t,sessionId:n,resultCode:u}}}catch(e){let t=e;return console.error("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,c.useEffect)((()=>()=>{Dt&&(null==Dt?void 0:Dt.currentTag)===e.giverTag||(async()=>{Nt&&e.giverTag&&e.giverPIN&&(Et([]),await jt(e.engineMemoriID,Nt,e.giverTag,e.giverPIN))})()}),[]);const[Ht,Vt]=(0,c.useState)(),Gt=(0,c.useRef)(),Wt=()=>{Ht&&(clearTimeout(Ht),Vt(void 0)),(null==Gt?void 0:Gt.current)&&(clearTimeout(Gt.current),Gt.current=void 0)},qt=()=>{Wt(),!(null==Dt?void 0:Dt.acceptsTimeout)||DU||ot||St.length||De||wt||Jt()},Kt=async()=>{var e;if(DU||ot||St.length||De||wt)qt();else if(Nt&&je&&(null==Dt?void 0:Dt.acceptsTimeout)){const{currentState:t,...n}=await me(Nt);if(0===n.resultCode&&t){const n=t.emission;!xe&&Pe&&ke!==(null==le?void 0:le.language)&&n&&n.length>0?Tt({...t,emission:n},ke).then((e=>{e.emission&&en(e.emission)})):n&&n.length>0&&(Mt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion}),en(n),zt({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==Dt?void 0:Dt.hints:[]}))}}},Jt=()=>{let e=null==Dt?void 0:Dt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==Dt?void 0:Dt.emission){e+=Dt.emission.length/26.5}}let t=setTimeout(Kt,1e3*e);Vt(t),Gt.current=t};(0,c.useEffect)((()=>{(St.length||ot||De)&&Wt(),Nt&&!St.length&&qt()}),[null==Dt?void 0:Dt.acceptsTimeout,null==Dt?void 0:Dt.timeout,null==Dt?void 0:Dt.state,ot,Nt,At,St,De]),(0,c.useEffect)((()=>()=>{He(!1),Me(!1),Wt(),Gt.current=void 0}),[]);const Qt=(0,c.useCallback)((t=>{var n,r,i,o;let s="",a=(null!==(o=null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i?i:le.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==Dt?void 0:Dt.emitter)){null==Nn||Nn.find((e=>e.name===(null==Dt?void 0:Dt.emitter)))}switch(a){case"IT":s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":s=""+("MALE"===l?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":s=""+("MALE"===l?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":s=""+("MALE"===l?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":s=""+("MALE"===l?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":s=""+("MALE"===l?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":s=""+("MALE"===l?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":s=""+("MALE"===l?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;case"PL":s=""+("MALE"===l?"pl-PL-MarekNeural":"pl-PL-AgnieszkaNeural");break;case"FI":s=""+("MALE"===l?"fi-FI-HarriNeural":"fi-FI-SelmaNeural");break;default:s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return s}),[e.voiceType,e.enableBoardOfExperts,null==Dt?void 0:Dt.emitter,le.language,e.culture]),Yt=t=>{var n,r;let i="";switch((t||(null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])||le.language||"IT").toUpperCase()){case"IT":default:i="it-IT";break;case"DE":i="de-DE";break;case"EN":i="en-GB";break;case"ES":i="es-ES";break;case"FR":i="fr-FR";break;case"PT":i="pt-PT";break;case"UK":i="uk-UK";break;case"RU":i="ru-RU";break;case"PL":i="pl-PL";break;case"FI":i="fi-FI"}return i},[Xt,$t]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${C||"https://app.twincreator.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{$t(e)}))}),[]);const Zt=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},en=e=>{if(!k||p)return void Zt();if(dn(),p)return;if(Ze||UU)return jU=!1,Be(!1),Zt(),void(tt&&ln());BU&&BU.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===zU.state)return void zU.resume().then((()=>en(e)));if("closed"===zU.state){zU=new Go;let e=zU.createBuffer(1,1e4,22050),t=zU.createBufferSource();t.buffer=e,t.connect(zU.destination)}else if("suspended"===zU.state){tn(),zU=new Go;let e=zU.createBuffer(1,1e4,22050),t=zU.createBufferSource();t.buffer=e,t.connect(zU.destination)}if(!DU){n||(BU=new fs.SpeakerAudioDestination);let e=fs.AudioConfig.fromSpeakerOutput(BU);DU=new fs.SpeechSynthesizer(LU,e)}const r=zU.createBufferSource();r.addEventListener("ended",(()=>{st(!1),jU=!1})),BU.onAudioEnd=()=>{st(!1),jU=!1,r.disconnect(),Zt(),gn()},DU.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${Yt(ke)}"><voice name="${Qt(ke)}"><s>${((e,t)=>{var n;if(!Xt)return e;const r={...null!==(n=Xt.common)&&void 0!==n?n:{},...(null==I?void 0:I.id)&&Xt[I.id]?Xt[I.id]:{}},i=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t.toLowerCase()])&&void 0!==n?n:r[e].default,caseSensitive:r[e].caseSensitive}}));return i.reduce(((e,{word:t,phoneme:n,caseSensitive:r})=>e.replace(new RegExp(`\\b${t}\\b`,r?"g":"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})((e=>{const t=document.createElement("textarea");return t.textContent=e,t.innerHTML})(bd(e)),ke.toLowerCase())}</s></voice></speak>`,(i=>{if(i){st(!0),jU=!0;try{zU.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(zU.destination),(At.length<1||t&&n)&&r.start(0)})),zU.onstatechange=()=>{"suspended"===zU.state||"closed"===zU.state?(r.disconnect(),st(!1),jU=!1):"interrupted"===zU.state&&zU.resume()},zU.resume(),DU&&(DU.close(),DU=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),st(!1),jU=!1,DU&&(DU.close(),DU=null),Zt()}}else zU.resume(),st(!1),jU=!1,Zt()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),st(!1),jU=!1,Zt()})),Be(!1)},tn=()=>{st(!1),jU=!1;try{DU&&(DU.close(),DU=null),"closed"!==zU.state&&zU.close(),BU&&(BU.pause(),BU.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==Dt?void 0:Dt.emission]);const[nn,rn]=(0,c.useState)(""),on=()=>rn(""),[sn,an]=(0,c.useState)(null),ln=()=>{let e=setTimeout((async()=>{pn();const e=yd(nn);e.length>0&&wt?(_t(e),on(),xt("")):wt&&qt()}),1e3*rt);an(e)},cn=()=>{sn&&(clearTimeout(sn),an(null))};(0,c.useEffect)((()=>{cn(),tt&&ln(),qt()}),[nn]);const un=()=>{if(k){pn(),rn(""),on();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){Ge(!0),LU||(LU=fs.SpeechConfig.fromSubscription(k,"eastus"),LU.speechRecognitionLanguage=Yt(ke),LU.speechSynthesisLanguage=Yt(ke),LU.speechSynthesisVoiceName=Qt(ke));const t=fs.AudioConfig.fromDefaultMicrophoneInput();NU=new fs.SpeechRecognizer(LU,t),Ct(!0),NU.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===fs.ResultReason.RecognizedSpeech){let e=t.result.text;if(rn(e||""),(null==e?void 0:e.length)>0){const t=yd(e);t.length>0&&xt((e=>`${e} ${t}`))}}else t.result.reason===fs.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},NU.canceled=(e,t)=>{t.reason===fs.CancellationReason.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),dn()},NU.sessionStopped=(e,t)=>{dn()},on(),NU.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},dn=()=>{NU&&(NU.stopContinuousRecognitionAsync(),NU.close(),NU=null),Ct(!1)},pn=()=>{Ge(!1),dn(),cn()},hn=()=>{try{pn(),Wt(),Me(!1),Gt.current=void 0,tn()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{hn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",hn),()=>{document.removeEventListener("MemoriResetUIEffects",hn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==Dt?void 0:Dt.state)&&pn()}),[null==Dt?void 0:Dt.state]);const[fn,mn]=(0,c.useState)(!1),gn=(0,c.useCallback)((e=>{ot&&DU&&(DU.close(),DU=null),!tt||!Ve&&fn||(mn(!0),un())}),[tt,Ve]);(0,c.useEffect)((()=>{At.length>1&&!ot&&tt&&(Ve||!fn)?un():ot&&wt&&dn()}),[ot]),(0,c.useEffect)((()=>{wt&&(pn(),on(),xt(""),un())}),[Ie]);const[vn,yn]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=uU("sendOnEnter","keypress");window.innerWidth<=768?yn("click"):yn(e)}),[]),(0,c.useEffect)((()=>{dU("sendOnEnter",vn)}),[vn]);const[bn,Sn]=(0,c.useState)(),xn=null==Re?void 0:Re.globalBackground,wn=xn?`url(${xn})`:null,Cn=o?{"--memori-chat-bubble-bg":"#fff",...Re&&!u?{"--memori-text-color":null!==(Y=Re.textColor)&&void 0!==Y?Y:"#000"}:{},...(null==Re?void 0:Re.buttonBgColor)?{"--memori-button-bg":Re.buttonBgColor,"--memori-primary":Re.buttonBgColor}:{},...(null==Re?void 0:Re.buttonTextColor)?{"--memori-button-text":Re.buttonTextColor}:{},...(null==Re?void 0:Re.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==Re?void 0:Re.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===Re.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(X=Re.innerBgAlpha)&&void 0!==X?X:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===Re.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==($=null==Re?void 0:Re.innerBgAlpha)&&void 0!==$?$:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},An=`\n ${p?"#preview,":"WEBSITE_ASSISTANT"===Ue?"":":root,"} .memori-widget {\n ${Object.entries(Cn).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,En=void 0===(null==Re?void 0:Re.showAIicon)||(null==Re?void 0:Re.showAIicon),[Mn,_n]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===Ue||"FULLPAGE"!==Ue)&&_n(!0)}),[]);const[Tn,In]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await be(e);0===s.resultCode&&(t=r,n=o)}catch(e){let t=e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{In(kU(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==Re?void 0:Re.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",Re.seoTitle),document.head.append(e)}if(null==Re?void 0:Re.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",Re.seoDescription),document.head.append(e)}if(null==Re?void 0:Re.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",Re.seoUrl),document.head.append(e)}let t=_||e.avatarURL;if((null==Re?void 0:Re.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[Re,e.avatarURL,_]);const Rn=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!UU&&(jU||De)?setTimeout((()=>{Rn(e)}),1e3):(dn(),tn(),_t(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Nt,ot,De,ke]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",Rn),()=>{document.removeEventListener("MemoriTextEntered",Rn)})),[Nt,ke]);const Pn=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c;const u=(null==t?void 0:t.sessionID)||Nt,d=(null==t?void 0:t.dialogState)||Dt;Me(!0);let p=document.getElementById("memori-audio"),h=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");p&&h&&(p.muted=!1,p.play().catch((e=>{console.error("error playing intro audio",e)})));let f=uU("birthDate",void 0),m=Rt||f||void 0;if(u||!It||m){if(!u&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!dt&&!ht||!u&&_e)return gt("password"),void Me(!1);if(!u){Me(!1),Te(!1);const t=await Ft({memoriID:e.engineMemoriID,password:w||dt||e.secretToken,tag:null==R?void 0:R.tag,pin:null==R?void 0:R.pin,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},initialQuestion:M,birthDate:m});return void((null==t?void 0:t.dialogState)?(Et([]),Tt(t.dialogState,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}))):await Pn(t||void 0))}if(T){const{currentState:t,...n}=await ye(u);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Te(!0),Lt(void 0),Me(!1),void await Pn();if(Et([]),xe&&e.giverTag&&(null==Dt?void 0:Dt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await jt(e.engineMemoriID,u,"-");const t=await jt(e.engineMemoriID,u,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Tt(t.currentState,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #2",t),Ut(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,{PATHNAME:window.location.pathname,ROUTE:(null===(o=null===(i=window.location.pathname)||void 0===i?void 0:i.split("/"))||void 0===o?void 0:o.pop())||"",...E||{}},M,m).then((()=>{He(!0)}))}else if(!xe&&R&&(null==Dt?void 0:Dt.currentTag)!==R.tag)try{console.debug("change tag #3"),await jt(e.engineMemoriID,u,"-");const t=await jt(e.engineMemoriID,u,R.tag,R.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Tt(t.currentState,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #5",t),Ut(!0,null==e?void 0:e.secretToken,void 0,R.tag,R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...E||{}},M,m).then((()=>{He(!0)}))}else if(xe||R||(null==Dt?void 0:Dt.currentTag)===cp)Tt(t,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}));else try{console.debug("change tag #6"),await jt(e.engineMemoriID,u,"-");const t=await jt(e.engineMemoriID,u,cp);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Tt(t.currentState,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #8",t),Ut(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(c=null===(l=window.location.pathname)||void 0===l?void 0:l.split("/"))||void 0===c?void 0:c.pop())||"",...E||{}},M,m).then((()=>{He(!0)}))}}else Et([]),Tt(d,ke).then((e=>{e.emission&&en(e.emission)})).finally((()=>{He(!0)}))}else Ot(!0),Me(!1)}),[dt,e,ht,Rt,Nt,ke]),[kn,On]=(0,c.useState)(null!==(Z=null==N?void 0:N.loginToken)&&void 0!==Z?Z:P);(0,c.useEffect)((()=>{const t=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!t)return;const n=new MutationObserver(((e,t)=>{var n,r,i;for(const t of e)"attributes"===t.type&&"authtoken"===(null===(n=t.attributeName)||void 0===n?void 0:n.toLowerCase())&&("MEMORI-CLIENT"===t.target.nodeName?On(t.target.getAttribute("authtoken")||void 0):On((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[Nn,Ln]=(0,c.useState)(),Dn=(0,c.useCallback)((async()=>{if(Nt&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Se(Nt);0===n.resultCode?Ln(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Nt,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Dn()}),[Nt,Dn]);const Bn=void 0===S?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!S,zn={memori:e,tenant:I,history:At,showShare:null===(ee=null!=d?d:null==Re?void 0:Re.showShare)||void 0===ee||ee,position:vt,setShowPositionDrawer:qe,setShowSettingsDrawer:Je,setShowKnownFactsDrawer:Ye,setShowExpertsDrawer:$e,showSpeaker:!!k,speakerMuted:Ze||UU,setSpeakerMuted:e=>{if(UU=!!e,et(e),dU("muteSpeaker",!!e),e)tn();else{zU=new Go;let e=zU.createBuffer(1,1e4,22050),t=zU.createBufferSource();t.buffer=e,t.connect(zU.destination)}},showSettings:v,hasUserActivatedSpeak:je,showReload:"TOTEM"===Ue,showClear:b,clearHistory:()=>Et((e=>e.slice(-1))),loginToken:kn,sessionID:Nt},Fn={memori:e,integration:o,integrationConfig:Re,tenant:I,instruct:xe,avatar3dVisible:Mn,setAvatar3dVisible:_n,hasUserActivatedSpeak:je,isPlayingAudio:ot&&!Ze,loading:!!De,baseUrl:C,apiUrl:A},Un={memori:e,tenant:I,gamificationLevel:Tn,language:Ie,userLang:ke,setUserLang:Oe,baseUrl:C,apiUrl:A,position:vt,openPositionDrawer:()=>qe(!0),integrationConfig:Re,instruct:xe,sessionId:Nt,clickedStart:Ee,onClickStart:Pn,initializeTTS:()=>{if(!k)return;LU=fs.SpeechConfig.fromSubscription(k,"eastus"),LU.speechSynthesisLanguage=Yt(ke),LU.speechSynthesisVoiceName=Qt(ke),LU.speechRecognitionLanguage=Yt(ke),gd()&&(LU.speechSynthesisOutputFormat=fs.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),zU=new Go;let e=zU.createBuffer(1,1e4,22050),t=zU.createBufferSource();t.buffer=e,t.connect(zU.destination),BU=new fs.SpeakerAudioDestination;let n=fs.AudioConfig.fromSpeakerOutput(BU);DU=new fs.SpeechSynthesizer(LU,n)},isUserLoggedIn:!!kn},jn={memori:e,sessionID:Nt||"",tenant:I,translateTo:Pe&&ke.toUpperCase()!==(null===(oe=null!==(ie=null!==(re=null===(ne=null===(te=e.culture)||void 0===te?void 0:te.split("-"))||void 0===ne?void 0:ne[0])&&void 0!==re?re:le.language)&&void 0!==ie?ie:"IT")||void 0===oe?void 0:oe.toUpperCase())?ke:void 0,baseUrl:C,apiUrl:A,layout:a,memoriTyping:De,typingText:ze,showTypingText:y,history:Bn?At:At.slice(-2),authToken:kn,dialogState:Dt,setDialogState:zt,pushMessage:Mt,simulateUserPrompt:(e,t)=>{dn(),tn(),_t(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:En,client:de,selectReceiverTag:async n=>{var r;if(Nt)try{const{currentState:i,...o}=await ve(Nt,n);if(0===o.resultCode)if(Mt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await de.postTagChangedEvent(Nt,e.giverTag);0===r.resultCode?(zt(n),n.emission&&Mt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1})):(console.error(r),t(bs).error(ae(mU(r.resultCode))))}else zt(i),i.emission&&Mt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1});else console.error(o,n,null===(r=null==Dt?void 0:Dt.knownTags)||void 0===r?void 0:r[n]),t(bs).error(ae(mU(o.resultCode)))}catch(e){let n=e;console.error(n),t(bs).error(n.message)}},preview:p,sendOnEnter:vn,setSendOnEnter:yn,microphoneMode:tt?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:bn,setAttachmentsMenuOpen:Sn,instruct:xe,showInputs:f,showMicrophone:!!k,userMessage:St,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return xt(""),void qt();xt(e),Wt()},sendMessage:e=>{tn(),dn(),_t(e),xt(""),on()},stopListening:pn,startListening:un,stopAudio:tn,resetTranscript:on,listening:wt,isPlayingAudio:ot,customMediaRenderer:D,user:Ce,userAvatar:B,experts:Nn},Hn=o&&wn?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:wn}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Vn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:An}}):null,Gn={canInstruct:!!e.giverTag,instruct:!!xe,onChangeMode:e=>{we("instruct"===e),He(!1),Me(!1)}},Wn=(0,s.jsx)(pL,{tenant:I,userLang:ke}),qn=l||("TOTEM"===Ue?wU:"CHAT"===Ue?CU:"FULLPAGE"===Ue?xU:"WEBSITE_ASSISTANT"===Ue?AU:xU);return(0,s.jsxs)("div",{className:t(vs)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${at.toLowerCase()}`,`memori--avatar-${(null==Re?void 0:Re.avatar)||"default"}`,{"memori--preview":p,"memori--embed":h,"memori--with-integration":o,"memori--with-speechkey":!!k,"memori--active":je,"memori--hide-emissions":ct,"memori--has-active-session":!!Nt}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":Nt,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...Dt,sessionID:Nt}),style:{height:x},children:[(0,s.jsx)(qn,{Header:dL,headerProps:zn,Avatar:oN,avatarProps:Fn,Chat:cm,chatProps:jn,StartPanel:gm,startPanelProps:Un,integrationStyle:Vn,integrationBackground:Hn,ChangeMode:sN,changeModeProps:Gn,poweredBy:Wn,sessionId:Nt,hasUserActivatedSpeak:je,showInstruct:u,loading:Ne}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://app.twincreator.com/intro.mp3"}),ce&&(0,s.jsx)(md,{withModal:!0,pwdOrTokens:mt,openModal:!!mt,setPwdOrTokens:gt,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r;t.password&&pt(t.password),t.password&&(FU=t.password),t.tokens&&ft(t.tokens),Ut(!Nt,t.password,t.tokens,xe?e.giverTag:null==R?void 0:R.tag,xe?e.giverPIN:null==R?void 0:R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},M,Rt).then((e=>{gt(null),Pn(e||void 0)})).catch((()=>{gt(null),Te(!0)}))},minimumNumberOfRecoveryTokens:null!==(se=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==se?se:1}),ce&&(0,s.jsx)(oU,{visible:kt,minAge:It,onClose:t=>{var n,r;t?(Pt(t),dU("birthDate",t),Ut(!Nt,FU||dt||(null==e?void 0:e.secretToken),ht,xe?e.giverTag:null==R?void 0:R.tag,xe?e.giverPIN:null==R?void 0:R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},M,t).then((e=>{Ot(!1),gt(null),Pn(e||void 0)})).catch((()=>{Ot(!1),Te(!0)}))):(Ot(!1),Me(!1))}}),Ke&&(0,s.jsx)(hU,{layout:Ue,open:!!Ke,onClose:()=>Je(!1),microphoneMode:tt?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:rt,setMicrophoneMode:e=>nt("CONTINUOUS"===e),setContinuousSpeechTimeout:it,controlsPosition:at,setControlsPosition:lt,hideEmissions:ct,setHideEmissions:ut,additionalSettings:L}),Qe&&Nt&&(0,s.jsx)(bU,{apiURL:A,memori:e,sessionID:Nt,visible:Qe,closeDrawer:()=>Ye(!1)}),Xe&&!!Nn&&(0,s.jsx)(SU,{apiUrl:A,baseUrl:C,tenant:I,experts:Nn,open:Xe,onClose:()=>$e(!1)})]})};const VU={id:"app.twincreator.com",theme:"twincreator",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},GU=async(e,t)=>{const n=t?new URL(`${t.startsWith("http")?"":t.includes("localhost")?"http://":"https://"}${t}`).origin:"https://app.twincreator.com";try{const t=await fetch(`${n}/api/tenant/${e}`),{tenant:r}=await t.json();return r||{...VU,tenantID:e}}catch(t){return{...VU,tenantID:e}}};function WU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,GO(r.key),r)}}function KU(e,t,n){return t&&qU(e.prototype,t),n&&qU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function JU(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QU(e,t){return QU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},QU(e,t)}function YU(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QU(e,t)}function XU(e,t){if(t&&("object"===HO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return JU(e)}function $U(e){return $U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$U(e)}function ZU(e){if(Array.isArray(e))return e}function ej(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function tj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nj(e,t){if(e){if("string"==typeof e)return tj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tj(e,t):void 0}}function rj(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ij(e){return ZU(e)||ej(e)||nj(e)||rj()}function oj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var aj={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},lj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};WU(this,e),this.init(t,n)}return KU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||aj,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,sj(sj({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),cj=new lj,uj=function(){function e(){WU(this,e),this.observers={}}return KU(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function dj(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function pj(e){return null==e?"":""+e}function hj(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function fj(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function mj(e,t,n){var r=fj(e,t,Object);r.obj[r.k]=n}function gj(e,t){var n=fj(e,t),r=n.obj,i=n.k;if(r)return r[i]}function vj(e,t,n){var r=gj(e,n);return void 0!==r?r:gj(t,n)}function yj(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):yj(e[r],t[r],n):e[r]=t[r]);return e}function bj(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Sj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function xj(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Sj[e]})):e}var wj="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Cj=[" ",",","?","!",";"];function Aj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ej(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Aj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Aj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$U(e);if(t){var i=$U(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return XU(this,n)}}function _j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;o<r.length;++o){if(!i)return;if("string"==typeof i[r[o]]&&o+1<r.length)return;if(void 0===i[r[o]]){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];void 0===l&&r.length>o+s;)s++,l=i[a=r.slice(o,o+s).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}var c=r.slice(o+s).join(n);return c?_j(l,c,n):void 0}i=i[r[o]]}return i}}var Tj=function(e){YU(n,e);var t=Mj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return WU(this,n),r=t.call(this),wj&&uj.call(JU(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return KU(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."));var a=gj(this.data,s);return a||!o||"string"!=typeof n?a:_j(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),mj(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=gj(this.data,s)||{};r?yj(a,n,i):a=Ej(Ej({},a),n),mj(this.data,s,a),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Ej(Ej({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(uj),Ij={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}};function Rj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function kj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$U(e);if(t){var i=$U(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return XU(this,n)}}var Oj={},Nj=function(e){YU(n,e);var t=kj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return WU(this,n),r=t.call(this),wj&&uj.call(JU(r)),hj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,JU(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=cj.create("translator"),r}return KU(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=Cj.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,n,r));if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==HO(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),l=a.key,c=a.namespaces,u=c[c.length-1],d=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(u).concat(h).concat(l),f):"".concat(u).concat(h).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,v=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],S=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&w&&b.indexOf(y)<0&&("string"!=typeof S||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,Pj(Pj({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=C,f):C}if(s){var A="[object Array]"===y,E=A?[]:{},M=A?v:g;for(var _ in m)if(Object.prototype.hasOwnProperty.call(m,_)){var T="".concat(M).concat(s).concat(_);E[_]=this.translate(T,Pj(Pj({},t),{joinArrays:!1,ns:c})),E[_]===T&&(E[_]=m[_])}m=E}}else if(x&&"string"==typeof S&&"[object Array]"===y)(m=m.join(S))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,R=!1,P=void 0!==t.count&&"string"!=typeof t.count,k=n.hasDefaultValue(t),O=P?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(O)]||t.defaultValue;!this.isValidLookup(m)&&k&&(I=!0,m=N),this.isValidLookup(m)||(R=!0,m=l);var L=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=L&&R?void 0:m,B=k&&N!==m&&this.options.updateMissing;if(R||I||B){if(this.logger.log(B?"updateKey":"missingKey",d,u,l,B?N:m),s){var z=this.resolve(l,Pj(Pj({},t),{},{keySeparator:!1}));z&&z.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.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var j=0;j<U.length;j++)F.push(U[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r:D;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,o,B,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,o,B,t),i.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,f,r),R&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(R||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Pj(Pj({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Pj(Pj({},n),{interpolation:Pj(Pj({},this.options.interpolation),n.interpolation)}));var s,a="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var l=e.match(this.interpolator.nestingRegexp);s=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=Pj(Pj({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),a){var u=e.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,p="string"==typeof d?[d]:d;return null!=e&&p&&p.length&&!1!==n.applyPostProcessor&&(e=Ij.handle(p,e,t,this.options&&this.options.postProcessPassResolved?Pj({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var l=s.extractFromKey(e,a),c=l.key;n=c;var u=l.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,p=d&&!a.ordinal&&0===a.count&&s.pluralResolver.shouldUseIntlApi(),h=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,f=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(o=e,!Oj["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(Oj["".concat(f[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(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!!!")),f.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,l=[c];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(l,c,n,e,a);else{var u;d&&(u=s.pluralResolver.getSuffix(n,a.count,a));var f="".concat(s.options.pluralSeparator,"zero");if(d&&(l.push(c+u),p&&l.push(c+f)),h){var m="".concat(c).concat(s.options.contextSeparator).concat(a.context);l.push(m),d&&(l.push(m+u),p&&l.push(m+f))}}for(;o=l.pop();)s.isValidLookup(t)||(r=o,t=s.getResource(n,e,o,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(uj);function Lj(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Dj=function(){function e(t){WU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=cj.create("languageUtils")}return KU(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Lj(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Lj(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Lj(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var 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||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),Bj=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],zj={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},Fj=["v1","v2","v3"],Uj={zero:0,one:1,two:2,few:3,many:4,other:5};function jj(){var e={};return Bj.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:zj[t.fc]}}))})),e}var Hj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};WU(this,e),this.languageUtils=t,this.options=n,this.logger=cj.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=jj()}return KU(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return Uj[e]-Uj[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!Fj.includes(this.options.compatibilityJSON)}}]),e}();function Vj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Wj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};WU(this,e),this.logger=cj.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return KU(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:xj,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?bj(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?bj(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?bj(t.nestingPrefix):t.nestingPrefixEscaped||bj("$t("),this.nestingSuffix=t.nestingSuffix?bj(t.nestingSuffix):t.nestingSuffixEscaped||bj(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0){var i=vj(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,Gj(Gj(Gj({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(vj(t,l,s),c,n,Gj(Gj(Gj({},r),t),{},{interpolationkey:s}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,p=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof d){var l=d(e,i,r);o="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))o="";else{if(p){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=pj(o));var c=t.safeValue(o);if(e=e.replace(i[0],c),p?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Gj({},o);function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,s)).match(/'/g),a=i.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{s=JSON.parse(i),t&&(s=Gj(Gj({},t),s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=pj(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,o.lng,Gj(Gj({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function qj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jj(e){var t={};return function(n,r,i){var o=r+JSON.stringify(i),s=t[o];return s||(s=e(r,i),t[o]=s),s(n)}}var Qj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};WU(this,e),this.logger=cj.create("formatter"),this.options=t,this.formats={number:Jj((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:Jj((function(e,t){var n=new Intl.NumberFormat(e,Kj(Kj({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:Jj((function(e,t){var n=new Intl.DateTimeFormat(e,Kj({},t));return function(e){return n.format(e)}})),relativetime:Jj((function(e,t){var n=new Intl.RelativeTimeFormat(e,Kj({},t));return function(e){return n.format(e,t.range||"day")}})),list:Jj((function(e,t){var n=new Intl.ListFormat(e,Kj({},t));return function(e){return n.format(e)}}))},this.init(t)}return KU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=Jj(t)}},{key:"format",value:function(e,t,n,r){var i=this,o=t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=ij(e.split(":")),r=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=i),"false"===i&&(n[r.trim()]=!1),"true"===i&&(n[r.trim()]=!0),isNaN(i)||(n[r.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),s=o.formatName,a=o.formatOptions;if(i.formats[s]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[s](e,u,Kj(Kj(Kj({},a),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(s)),e}),e);return o}}]),e}();function Yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yj(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$U(e);if(t){var i=$U(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return XU(this,n)}}var Zj=function(e){YU(n,e);var t=$j(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return WU(this,n),o=t.call(this),wj&&uj.call(JU(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=cj.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,s.backend,s),o}return KU(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o={},s={},a={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===s[a]&&(s[a]=!0):(i.state[a]=1,r=!1,void 0===s[a]&&(s[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(a[e]=!0)})),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,l,c,u,d;r=n.loaded,a=o,c=fj(r,[i],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(a)),l||u[d].push(a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:o,callback:s}):(this.readingCalls++,this.backend[n](e,t,(function(a,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}a&&l&&i<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,l)}))):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(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!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,Xj(Xj({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(uj);function eH(){return{debug:!1,initImmediate:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===HO(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===HO(e[2])||"object"===HO(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function tH(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function nH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nH(Object(n),!0).forEach((function(t){WO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function iH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=$U(e);if(t){var i=$U(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return XU(this,n)}}function oH(){}function sH(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var aH=function(e){YU(n,e);var t=iH(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(WU(this,n),e=t.call(this),wj&&uj.call(JU(e)),e.options=tH(r),e.services={},e.logger=cj,e.modules={external:[]},sH(JU(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),XU(e,JU(e));setTimeout((function(){e.init(r,i)}),0)}return e}return KU(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=eH();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=rH(rH(rH({},r),this.options),tH(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=rH(rH({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?cj.init(i(this.modules.logger),this.options):cj.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Qj);var s=new Dj(this.options);this.store=new Tj(this.options.resources,this.options);var a=this.services;a.logger=cj,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new Hj(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=i(o),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new Wj(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new Zj(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new Nj(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=oH),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=dj(),p=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oH,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=dj();return e||(e=this.languages),t||(t=this.options.ns),n||(n=oH),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(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"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Ij.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=dj();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var s="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==HO(i)){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else o=rH({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return r.t(u,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(r,e)||i&&!s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=dj();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=dj();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["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"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oH,i=rH(rH(rH({},this.options),t),{isClone:!0}),o=new n(i);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var s=["store","services","language"];return s.forEach((function(t){o[t]=e[t]})),o.services=rH({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new Nj(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(uj);WO(aH,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new aH(e,t)}));var lH=aH.createInstance();lH.createInstance=aH.createInstance;var cH,uH=lH.createInstance;lH.init,lH.loadResources,lH.reloadResources,lH.use,lH.changeLanguage,lH.getFixedT,lH.t,lH.exists,lH.setDefaultNamespace,lH.hasLoadedNamespace,lH.loadNamespaces,lH.loadLanguages;cH=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","apply":"Applica","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","close":"Chiudi","edit":"Modifica","delete":"Elimina","loading":"Caricamento","expand":"Espandi","collapse":"Riduci","fullscreenEnter":"Passa a schermo intero","fullscreenExit":"Esci da schermo intero","center":"Centro","bottom":"In basso","hidden":"Nascosto","day":"Giorno","month":"Mese","year":"Anno","createdAt":"Data creazione","selected":"Selezionati","page":"pagina","actions":"Azioni","next":"Successivo","previous":"Precedente","copy":"Copia","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","generatedByAI":"Risposta generata da IA, può talvolta generare informazioni non corrette","completionsEnabled":"IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette","completionProviderDown":"Questo Twin è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.","completionProviderFallbackName":"un provider esterno","completionProviderCheckStatusPage":"Vedi pagina di stato","boardOfExperts":"Gruppo di esperti","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","underage":"Devi avere almeno {{age}} anni per registrarti.","underageTwinSession":"Devi avere almeno {{age}} anni per interagire con questo Twin.","ageVerification":"Verifica dell\'età","ageVerificationText":"Per interagire con questo Twin, devi aver almeno {{minAge}} anni.","nsfw":"NSFW: Questo Twin contiene contenuti per adulti","deepThought":"Pensiero profondo","deepThoughtHelper":"Permette di stabilire una relazione univoca tra l\'IA e la persona che la interroga, permettendo all\'IA memoria di questa relazione supportando quindi le persone con domande mirate alle loro esperienze. Una volta che le persone avvieranno le loro relazioni, il creatore delle AI vedrà la propria community crescere di Follower e potrà osservare i fatti noti raccolti durante le conversazioni.","deepThoughtDisclaimerTitle":"Pensiero profondo abilitato","deepThoughtDisclaimer":"Proseguendo nella conversazione autorizzo il trattamento dei miei dati personali così come specificato nell\'informativa di cui dichiaro di aver preso visione.","knownFacts":{"title":"Fatti noti","description":"Dettagli delle informazioni condivise tra te e {{memoriName}}","type":"Tipo","typeShortTerm":"Breve termine","typeLongTerm":"Lungo termine","typeHelper":"Tipi:\\n- Breve termine: questo fatto noto è sempre utilizzato durante le conversazioni\\n- Lungo termine: questo fatto noto è utilizzato durante le conversazioni solo se rilevante per la domanda corrente","text":"Testo","deleteSuccess":"Fatto noto eliminato","deleteConfirmTitle":"Elimina il fatto noto","deleteConfirmMessage":"Confermi di voler eliminare questo fatto noto?","deleteSelectedConfirmTitle":"Elimina i fatti noti selezionati","deleteSelectedConfirmMessage":"Confermi di voler eliminare i fatti noti selezionati?"},"auth":{"title":"Autenticazione","useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","boardOfExperts":"Gruppo di esperti","showExpertsInTheBoard":"Mostra gli esperti di questo gruppo","expertsInTheBoard":"Esperti di questo gruppo","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","holdToSpeak":"Tieni premuto per parlare","releaseToEndListening":"Rilascia per smettere di parlare","pressAndHoldToSpeak":"Premi e tieni premuto per parlare","microphoneMode":"Modalità microfono","hideEmissionsLabel":"Nascondi testo emesso dal Twin","secondsLabel":"Secondi","controlsPosition":"Posizione dei controlli","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePosition":"Inserisci la posizione prima di iniziare","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"media":{"title":"Titolo","editAttributes":"Modifica attributi media","uploadMimeTypeNotAllowed":"Il tipo di file non è permesso","uploadSizeLimitMessage":"Il file caricato è troppo grande (max {{size}}MB)","uploadWrongResolutionMessage":"La risoluzione deve essere {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"Hai già un Twin con questo nome","uploadHelperImages":"Caricare un file con estensione png, jpg, jpeg o gif e con dimensione massima di {{size}}MB","uploadHelper":"Caricare un file di dimensione massima di {{size}}MB","uploadError":"Errore nel caricamento","square":"quadrato","scaleRatio":"Proporzioni","addMediaLabel":"Aggiungi media","insertThisMediaMsg":"Inserisci questi media","mediaUploadMessage":"Clicca per caricare un nuovo media","addLinkLabel":"Aggiungi un link","linkKey":"URL","linkValue":"Titolo link","insertThisLink":"Inserisci un link a {{url}} con titolo {{title}}"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_CANT_EDIT_INTEGRATIONS":"Utente non abilitato a gestire integrazioni","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido"}}');const dH=uH({resources:{en:{translation:t(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","apply":"Apply","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","close":"Close","edit":"Edit","delete":"Delete","loading":"Loading","expand":"Expand","collapse":"Collapse","fullscreenEnter":"Enter fullscreen","fullscreenExit":"Exit fullscreen","center":"Center","bottom":"Bottom","hidden":"Hidden","day":"Day","month":"Month","year":"Year","createdAt":"Creation date","selected":"Selected","page":"page","actions":"Actions","next":"Next","previous":"Previous","copy":"Copy","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","generatedByAI":"Answer generated by AI, may occasionally generate incorrect informations","completionsEnabled":"Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information","completionProviderDown":"This Twin is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.","completionProviderFallbackName":"an external provider","completionProviderCheckStatusPage":"Check status page","boardOfExperts":"Board of experts","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","underage":"You must be at least {{age}} years old to sign up.","underageTwinSession":"You must be at least {{age}} years old to interact with this Twin.","ageVerification":"Age verification","ageVerificationText":"To interact with this Twin, you must be at least {{minAge}} years old.","nsfw":"NSFW: This Twin contains adult contents","deepThought":"Deep Thought","deepThoughtHelper":"Allows to establish a unique relationship between the AI and the person who interrogates it, allowing the AI to remember this relationship and therefore supporting people with questions targeted to their experiences. Once people start their relationships, the creator of the AI will see their community grow with Followers and will be able to observe the known facts collected during the conversations.","deepThoughtDisclaimerTitle":"Deep Thought enabled","deepThoughtDisclaimer":"By continuing the conversation I authorize the processing of my personal data as specified in the information notice which I declare to have read.","knownFacts":{"title":"Known facts","description":"Details of the information shared between you and {{memoriName}}","type":"Type","typeShortTerm":"Short term","typeLongTerm":"Long term","typeHelper":"Types:\\n- Short Term: this Known Fact is always used during conversations\\n- Long Term: this Known Fact is used during conversations only if relevant to the current question","text":"Text","deleteSuccess":"Known fact deleted","deleteConfirmTitle":"Delete known fact","deleteConfirmMessage":"Are you sure you want to delete this known fact?","deleteSelectedConfirmTitle":"Delete selected known facts","deleteSelectedConfirmMessage":"Are you sure you want to delete the selected known facts?"},"auth":{"title":"Authentication","useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","boardOfExperts":"Board of experts","showExpertsInTheBoard":"Show experts in this board","expertsInTheBoard":"Experts in this board","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","holdToSpeak":"Hold to speak","releaseToEndListening":"Release to end listening","pressAndHoldToSpeak":"Press and hold to speak","microphoneMode":"Microphone mode","hideEmissionsLabel":"Hide text emitted by the Twin","secondsLabel":"Set seconds","controlsPosition":"Controls position","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"media":{"title":"Title","editAttributes":"Edit media attributes","uploadMimeTypeNotAllowed":"The file type is not allowed","uploadSizeLimitMessage":"The uploaded size is too big (max {{size}}MB)","uploadWrongResolutionMessage":"The resolution must be {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"You already have a Twin with this name","uploadHelperImages":"Upload a file with extension png, jpg, jpeg or gif, and having at maximum a size of {{size}}MB","uploadHelper":"Upload a file having at maximum a size of {{size}}MB","uploadError":"Upload failed","square":"square","scaleRatio":"Scale ratio","addMediaLabel":"Add a media","insertThisMediaMsg":"Insert these media","mediaUploadMessage":"Click to load a new media","addLinkLabel":"Add a link","linkKey":"URL","linkValue":"Link title","insertThisLink":"Insert a link to {{url}} with title {{title}}"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_CANT_EDIT_INTEGRATIONS":"User not allowed to manage integrations","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID"}}'))},it:{translation:t(cH)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});dH.init();var pH=dH;c=o("85Hg2");function hH(e){var t=e.i18n,n=e.defaultNS,r=e.children,i=(0,c.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,c.createElement)(ne.Provider,{value:i},r)}const fH=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:r,integrationID:i,tenantID:o,secretToken:a,sessionID:l,layout:u="DEFAULT",customLayout:d,showShare:p=!0,showSettings:h=!0,showInstruct:f=!1,showTypingText:m=!1,showClear:g=!1,showOnlyLastMessages:v=!1,showInputs:y=!0,showDates:b=!1,showContextPerLine:S=!1,height:x="100%",baseURL:w,apiURL:C="https://backend.memori.ai",tag:A,pin:E,context:M,initialQuestion:_,uiLang:T,spokenLang:I,multilingual:R,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:k,onStateChange:O,additionalInfo:N,customMediaRenderer:L,additionalSettings:D,userAvatar:B})=>{var z,F,U;const[j,H]=(0,c.useState)(),[V,G]=(0,c.useState)(),[q,K]=(0,c.useState)(k),{t:J}=ge();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const Q=W(C),Y=(0,c.useCallback)((async()=>{const e=w||(o.startsWith("https://")?o:`https://${o}`),t=await fetch(`${e}/api/speechkey`),n=await t.json();n.AZURE_COGNITIVE_SERVICES_TTS_KEY&&K(n.AZURE_COGNITIVE_SERVICES_TTS_KEY)}),[]);(0,c.useEffect)((()=>{k||Y()}),[k]);const X=(0,c.useCallback)((async()=>{if(r&&t){const{memori:e,...n}=await Q.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?H(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await Q.backend.getMemori(o,e,n);0===r.resultCode&&t?H(t):console.error("[MEMORI]",r,t)}}),[r,t,n,e,o]);(0,c.useEffect)((()=>{X()}),[X,o]);const $=(0,c.useCallback)((async()=>{const e=await GU(o,w);e&&G(e)}),[o,C]);(0,c.useEffect)((()=>{$()}),[$]),(0,c.useEffect)((()=>{if(T)pH.changeLanguage(T.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();pH.changeLanguage(e).catch((()=>{pH.changeLanguage(t)}))}}),[T]);const Z=j?(0,s.jsx)(HU,{layout:u,customLayout:d,height:x,baseUrl:w||(o.startsWith("https://")?o:`https://${o}`),apiUrl:C,memori:{...j,secretToken:a},memoriLang:null!=I?I:null===(F=null===(z=j.culture)||void 0===z?void 0:z.split("-"))||void 0===F?void 0:F[0],multilingual:R,tenant:V,secret:a,sessionID:l,showShare:p,showSettings:h,showInstruct:f,showTypingText:m,showClear:g,showOnlyLastMessages:v,showInputs:y,showDates:b,showContextPerLine:S,integration:null===(U=null==j?void 0:j.integrations)||void 0===U?void 0:U.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:M,initialQuestion:_,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:q||k,onStateChange:O,additionalInfo:N,customMediaRenderer:L,additionalSettings:D,userAvatar:B,...A&&E?{personification:{tag:A,pin:E}}:{}}):(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)("p",{style:{textAlign:"center",margin:"2rem auto",textTransform:"capitalize"},children:[J("loading")||"Loading","..."]})});return(0,s.jsxs)(hH,{i18n:pH,children:[(0,s.jsx)(bs.Toaster,{position:"top-center",reverseOrder:!0}),Z]})};fH.propTypes={memoriName:t(l).string,memoriID:t(l).string,ownerUserName:t(l).string,ownerUserID:t(l).string,integrationID:t(l).string,tenantID:t(l).string.isRequired,secretToken:t(l).string,sessionID:t(l).string,layout:t(l).oneOf(["DEFAULT","FULLPAGE","TOTEM","WEBSITE_ASSISTANT","CHAT"]),customLayout:t(l).any,showShare:t(l).bool,showInstruct:t(l).bool,showInputs:t(l).bool,showDates:t(l).bool,showContextPerLine:t(l).bool,showSettings:t(l).bool,showClear:t(l).bool,showOnlyLastMessages:t(l).bool,showTypingText:t(l).bool,height:t(l).oneOfType([t(l).string,t(l).number]),baseURL:t(l).string,apiURL:t(l).string,tag:t(l).string,pin:t(l).string,context:t(l).objectOf(t(l).any),initialQuestion:t(l).string,uiLang:t(l).oneOf(["en","it","EN","IT"]),spokenLang:t(l).string,multilingual:t(l).bool,authToken:t(l).string,AZURE_COGNITIVE_SERVICES_TTS_KEY:t(l).string,onStateChange:t(l).func,additionalInfo:t(l).objectOf(t(l).any),customMediaRenderer:t(l).func,additionalSettings:t(l).any,userAvatar:t(l).oneOfType([t(l).string,t(l).any])};var mH=fH;class gH extends HTMLElement{connectedCallback(){const e=document.createElement("div"),n=document.createElement("div");n.setAttribute("id","memori-root"),e.appendChild(n),this.appendChild(e);const r=Object.keys(mH.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t)),e)),{}),i=this.getAttribute("tenantId"),o=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{}),l=(e=>{try{return JSON.parse(e)}catch(e){return null}})(this.getAttribute("additionalInfo")||"{}")||{};i?t(a).render((0,s.jsx)(mH,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",gH)})();
|