@memori.ai/memori-webcomponent 4.1.0 → 4.1.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.
@@ -243,4 +243,4 @@ const xm="144",wm={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Cm={ROTATE:0,
243
243
  * @license qrcode.react
244
244
  * Copyright (c) Paul O'Shannessy
245
245
  * SPDX-License-Identifier: ISC
246
- */function eL(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 tL(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 nL(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 rL=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function iL(e){const n=e,{value:r,size:i=QN,level:o=YN,bgColor:s=XN,fgColor:a=$N,includeMargin:l=ZN,style:u,imageSettings:d}=n,p=qN(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=KN.QrCode.encodeText(r,JN[o]).getModules();const c=l?4:0,u=n.length+2*c,p=nL(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=tL(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,rL?t.fill(new Path2D(eL(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=WN({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",WN({style:y,height:i,width:i,ref:f},p)),b)}var oL=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=me(),[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:PN},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${p}`,icon:kN},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${p}`,icon:ON},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${p}`,icon:NN},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${p}`,icon:FN},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${p}`,icon:LN}];return(0,s.jsxs)(Gd,{as:"div",className:t(gs)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(Gd.Button,{className:t(gs)("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)(DN,{})})}),(0,s.jsxs)(Gd.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(Gd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Oa,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(ep,{}),onClick:()=>{p&&navigator.clipboard.writeText(p)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(Gd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(gs)("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)(Gd.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(iL,{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)(Oa,{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)(BN,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var sL=({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 aL=({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 lL=({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 cL=({className:e,memori:n,tenant:r,history:i,position:o,setShowPositionDrawer:a,setShowSettingsDrawer:l,speakerMuted:u,setSpeakerMuted:d,hasUserActivatedSpeak:p=!1,showShare:h=!0,showSettings:f=!0,showSpeaker:m=!0,showReload:g=!1,showClear:v=!1,clearHistory:y})=>{const{t:b}=me(),[S,x]=(0,c.useState)(!1),[w,C]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&x(!0)}),[]),(0,s.jsxs)("div",{className:t(gs)("memori-header",e),children:[g&&(0,s.jsx)(Oa,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:b("reload")||"Reload",icon:(0,s.jsx)(aL,{}),onClick:()=>{window.location.reload()}}),v&&(0,s.jsx)(Oa,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:b("clearHistory")||"Clear chat",icon:(0,s.jsx)(lL,{}),onClick:y}),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)(Oa,{icon:(0,s.jsx)(oN,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>a(!0)})]}),S&&(0,s.jsx)(Oa,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:w?b("fullscreenExit")||"Exit fullscreen":b("fullscreenEnter")||"Enter fullscreen",icon:w?(0,s.jsx)($f,{}):(0,s.jsx)(sL,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),C(!1)):(document.documentElement.requestFullscreen(),C(!0))}}),m&&(0,s.jsx)(Oa,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:u?(0,s.jsx)(sN,{}):(0,s.jsx)(lN,{}),onClick:()=>d(!u),title:b("widget.sound")||"Sound"}),(0,s.jsx)(IN,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!p||0===i.length}),f&&(0,s.jsx)(Oa,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(RN,{}),onClick:()=>l(!0),title:b("widget.settings")||"Settings"}),h&&(0,s.jsx)(oL,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"})]})};var uL=({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"})]})]})};var dL=({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)(Gc,{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 pL=({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)(Gc,{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 hL=({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)(Gc,{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 fL=({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}=me(),[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)(Oa,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>M(!1),title:S("expand")||"Expand",children:(0,s.jsx)(ZO,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(Gc,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Oa,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>M(!0),icon:(0,s.jsx)(Wc,{}),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 mL={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions"},gL=(e,t)=>{var n;const r=window.localStorage.getItem(null!==(n=mL[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}},vL=(e,t)=>{var n;window.localStorage.setItem(null!==(n=mL[e])&&void 0!==n?n:e,t.toString())},yL=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]))),bL=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=yL.get(e);return t?`errors.${t}`:"error.generic"},{deleteSession:SL,getStatistics:xL,initSession:wL}=G(),CL=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,"🧠"]]),AL=e=>{const t=Array.from(CL.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return CL.get(e)}return""},EL=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of CL){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},ML=e=>{let t=0;for(const[n,r]of CL)if(r===e){t=n;break}return t},_L=e=>{const t=Math.round(e),n=AL(t);return{points:t,badge:n,pointsForCurrentBadge:ML(n),nextBadge:EL(n)}};var TL={};function IL(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 RL(e,t,n){return t&&IL(e.prototype,t),n&&IL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function PL(){return PL=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},PL.apply(this,arguments)}function kL(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,NL(e,t)}function OL(e){return OL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},OL(e)}function NL(e,t){return NL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},NL(e,t)}function LL(){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 DL(e,t,n){return DL=LL()?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&&NL(i,n.prototype),i},DL.apply(null,arguments)}function BL(e){var t="function"==typeof Map?new Map:void 0;return BL=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 DL(e,arguments,OL(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),NL(r,e)},BL(e)}function zL(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 FL(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 UL(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 FL(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)?FL(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(TL,"__esModule",{value:!0});var jL=function(e){function t(){return e.apply(this,arguments)||this}return kL(t,e),t}(BL(Error)),HL=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return kL(t,e),t}(jL),VL=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return kL(t,e),t}(jL),GL=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return kL(t,e),t}(jL),WL=function(e){function t(){return e.apply(this,arguments)||this}return kL(t,e),t}(jL),qL=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return kL(t,e),t}(jL),KL=function(e){function t(){return e.apply(this,arguments)||this}return kL(t,e),t}(jL),JL=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return kL(t,e),t}(jL),QL="numeric",YL="short",XL="long",$L={year:QL,month:QL,day:QL},ZL={year:QL,month:YL,day:QL},eD={year:QL,month:YL,day:QL,weekday:YL},tD={year:QL,month:XL,day:QL},nD={year:QL,month:XL,day:QL,weekday:XL},rD={hour:QL,minute:QL},iD={hour:QL,minute:QL,second:QL},oD={hour:QL,minute:QL,second:QL,timeZoneName:YL},sD={hour:QL,minute:QL,second:QL,timeZoneName:XL},aD={hour:QL,minute:QL,hourCycle:"h23"},lD={hour:QL,minute:QL,second:QL,hourCycle:"h23"},cD={hour:QL,minute:QL,second:QL,hourCycle:"h23",timeZoneName:YL},uD={hour:QL,minute:QL,second:QL,hourCycle:"h23",timeZoneName:XL},dD={year:QL,month:QL,day:QL,hour:QL,minute:QL},pD={year:QL,month:QL,day:QL,hour:QL,minute:QL,second:QL},hD={year:QL,month:YL,day:QL,hour:QL,minute:QL},fD={year:QL,month:YL,day:QL,hour:QL,minute:QL,second:QL},mD={year:QL,month:YL,day:QL,weekday:YL,hour:QL,minute:QL},gD={year:QL,month:XL,day:QL,hour:QL,minute:QL,timeZoneName:YL},vD={year:QL,month:XL,day:QL,hour:QL,minute:QL,second:QL,timeZoneName:YL},yD={year:QL,month:XL,day:QL,weekday:XL,hour:QL,minute:QL,timeZoneName:XL},bD={year:QL,month:XL,day:QL,weekday:XL,hour:QL,minute:QL,second:QL,timeZoneName:XL},SD=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new JL},t.formatOffset=function(e,t){throw new JL},t.offset=function(e){throw new JL},t.equals=function(e){throw new JL},RL(e,[{key:"type",get:function(){throw new JL}},{key:"name",get:function(){throw new JL}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new JL}},{key:"isValid",get:function(){throw new JL}}]),e}(),xD=null,wD=function(e){function t(){return e.apply(this,arguments)||this}kL(t,e);var n=t.prototype;return n.offsetName=function(e,t){return BB(e,t.format,t.locale)},n.formatOffset=function(e,t){return jB(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},RL(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===xD&&(xD=new t),xD}}]),t}(SD),CD={};var AD={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var ED={},MD=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}kL(t,e),t.create=function(e){return ED[e]||(ED[e]=new t(e)),ED[e]},t.resetCache=function(){ED={},CD={}},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 BB(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return jB(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,CD[n]||(CD[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"})),CD[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=AD[s];"era"===s?r[l]=a:gB(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(OB({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},RL(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}(SD),_D=["base"],TD=["padTo","floor"],ID={};var RD={};function PD(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=RD[n];return r||(r=new Intl.DateTimeFormat(e,t),RD[n]=r),r}var kD={};var OD={};var ND=null;var LD={};function DD(e,t,n,r){var i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}var BD=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=zL(n,TD);if(!t||Object.keys(r).length>0){var i=PL({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=kD[n];return r||(r=new Intl.NumberFormat(e,t),kD[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 EB(this.floor?Math.floor(e):IB(e,3),this.padTo)},e}(),zD=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&&MD.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=PL({},this.opts);s.timeZone=s.timeZone||r,this.dtf=PD(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?PL({},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}(),FD=function(){function e(e,t,n){this.opts=PL({style:"long"},n),!t&&bB()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=zL(n,_D),i=JSON.stringify([e,r]),o=OD[i];return o||(o=new Intl.RelativeTimeFormat(e,t),OD[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}(),UD={firstDay:1,minimalDays:4,weekend:[6,7]},jD=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=PD(e).resolvedOptions(),r=e}catch(t){var o=e.substring(0,i);n=PD(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||eB.defaultLocale;return new e(s||(o?"en-US":ND||(ND=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||eB.defaultNumberingSystem,r||eB.defaultOutputCalendar,CB(i)||eB.defaultWeekSettings,s)},e.resetCache=function(){ND=null,RD={},kD={},OD={}},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,CB(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(PL({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(PL({},e,{defaultToEN:!1}))},t.months=function(e,t){var n=this;return void 0===t&&(t=!1),DD(this,e,qB,(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=YF.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),DD(this,e,YB,(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=YF.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 DD(this,void 0,(function(){return XB}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[YF.utc(2016,11,13,9),YF.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 DD(this,e,tz,(function(){var n={era:e};return t.eraCache[e]||(t.eraCache[e]=[YF.utc(-40,1,1),YF.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 BD(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new zD(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new FD(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=ID[n];return r||(r=new Intl.ListFormat(e,t),ID[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:SB()?function(e){var t=LD[e];if(!t){var n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,LD[e]=t}return t}(this.locale):UD},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},RL(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}(),HD=null,VD=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}kL(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(zB(n[1],n[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return jB(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},RL(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+jB(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+jB(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===HD&&(HD=new t(0)),HD}}]),t}(SD),GD=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}kL(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},RL(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}(SD);function WD(e,t){if(gB(e)||null===e)return t;if(e instanceof SD)return e;if(function(e){return"string"==typeof e}(e)){var n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?wD.instance:"utc"===n||"gmt"===n?VD.utcInstance:VD.parseSpecifier(n)||MD.create(e)}return vB(e)?VD.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new GD(e)}var qD,KD=function(){return Date.now()},JD="system",QD=null,YD=null,XD=null,$D=60,ZD=null,eB=function(){function e(){}return e.resetCaches=function(){jD.resetCache(),MD.resetCache()},RL(e,null,[{key:"now",get:function(){return KD},set:function(e){KD=e}},{key:"defaultZone",get:function(){return WD(JD,wD.instance)},set:function(e){JD=e}},{key:"defaultLocale",get:function(){return QD},set:function(e){QD=e}},{key:"defaultNumberingSystem",get:function(){return YD},set:function(e){YD=e}},{key:"defaultOutputCalendar",get:function(){return XD},set:function(e){XD=e}},{key:"defaultWeekSettings",get:function(){return ZD},set:function(e){ZD=CB(e)}},{key:"twoDigitCutoffYear",get:function(){return $D},set:function(e){$D=e%100}},{key:"throwOnInvalid",get:function(){return qD},set:function(e){qD=e}}]),e}(),tB=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}(),nB=[0,31,59,90,120,151,181,212,243,273,304,334],rB=[0,31,60,91,121,152,182,213,244,274,305,335];function iB(e,t){return new tB("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function oB(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 sB(e,t,n){return n+(RB(e)?rB:nB)[t-1]}function aB(e,t){var n=RB(e)?rB:nB,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function lB(e,t){return(e-t+7)%7+1}function cB(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=sB(i,o,s),l=lB(oB(i,o,s),n),c=Math.floor((a-l+14-t)/7);return c<1?c=LB(r=i-1,t,n):c>LB(i,t,n)?(r=i+1,c=1):r=i,PL({weekYear:r,weekNumber:c,weekday:l},HB(e))}function uB(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=lB(oB(i,1,t),n),l=PB(i),c=7*o+s-a-7+t;c<1?c+=PB(r=i-1):c>l?(r=i+1,c-=PB(i)):r=i;var u=aB(r,c);return PL({year:r,month:u.month,day:u.day},HB(e))}function dB(e){var t=e.year;return PL({year:t,ordinal:sB(t,e.month,e.day)},HB(e))}function pB(e){var t=e.year,n=aB(t,e.ordinal);return PL({year:t,month:n.month,day:n.day},HB(e))}function hB(e,t){if(!gB(e.localWeekday)||!gB(e.localWeekNumber)||!gB(e.localWeekYear)){if(!gB(e.weekday)||!gB(e.weekNumber)||!gB(e.weekYear))throw new WL("Cannot mix locale-based week fields with ISO-based week fields");return gB(e.localWeekday)||(e.weekday=e.localWeekday),gB(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),gB(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 fB(e){var t=yB(e.year),n=AB(e.month,1,12),r=AB(e.day,1,kB(e.year,e.month));return t?n?!r&&iB("day",e.day):iB("month",e.month):iB("year",e.year)}function mB(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=AB(t,0,23)||24===t&&0===n&&0===r&&0===i,s=AB(n,0,59),a=AB(r,0,59),l=AB(i,0,999);return o?s?a?!l&&iB("millisecond",i):iB("second",r):iB("minute",n):iB("hour",t)}function gB(e){return void 0===e}function vB(e){return"number"==typeof e}function yB(e){return"number"==typeof e&&e%1==0}function bB(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function SB(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function xB(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 wB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function CB(e){if(null==e)return null;if("object"!=typeof e)throw new KL("Week settings must be an object");if(!AB(e.firstDay,1,7)||!AB(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!AB(e,1,7)})))throw new KL("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function AB(e,t,n){return yB(e)&&e>=t&&e<=n}function EB(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function MB(e){return gB(e)||null===e||""===e?void 0:parseInt(e,10)}function _B(e){return gB(e)||null===e||""===e?void 0:parseFloat(e)}function TB(e){if(!gB(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function IB(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function RB(e){return e%4==0&&(e%100!=0||e%400==0)}function PB(e){return RB(e)?366:365}function kB(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?RB(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function OB(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 NB(e,t,n){return-lB(oB(e,1,t),n)+t-1}function LB(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=NB(e,t,n),i=NB(e+1,t,n);return(PB(e)-r+i)/7}function DB(e){return e>99?e:e>eB.twoDigitCutoffYear?1900+e:2e3+e}function BB(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=PL({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 zB(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 FB(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new KL("Invalid unit value "+e);return t}function UB(e,t){var n={};for(var r in e)if(wB(e,r)){var i=e[r];if(null==i)continue;n[t(r)]=FB(i)}return n}function jB(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+EB(n,2)+":"+EB(r,2);case"narrow":return""+i+n+(r>0?":"+r:"");case"techie":return""+i+EB(n,2)+EB(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function HB(e){return function(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}(e,["hour","minute","second","millisecond"])}var VB=["January","February","March","April","May","June","July","August","September","October","November","December"],GB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],WB=["J","F","M","A","M","J","J","A","S","O","N","D"];function qB(e){switch(e){case"narrow":return[].concat(WB);case"short":return[].concat(GB);case"long":return[].concat(VB);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"],JB=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],QB=["M","T","W","T","F","S","S"];function YB(e){switch(e){case"narrow":return[].concat(QB);case"short":return[].concat(JB);case"long":return[].concat(KB);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var XB=["AM","PM"],$B=["Before Christ","Anno Domini"],ZB=["BC","AD"],ez=["B","A"];function tz(e){switch(e){case"narrow":return[].concat(ez);case"short":return[].concat(ZB);case"long":return[].concat($B);default:return null}}function nz(e,t){for(var n,r="",i=UL(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var rz={D:$L,DD:ZL,DDD:tD,DDDD:nD,t:rD,tt:iD,ttt:oD,tttt:sD,T:aD,TT:lD,TTT:cD,TTTT:uD,f:dD,ff:hD,fff:gD,ffff:yD,F:pD,FF:fD,FFF:vD,FFFF:bD},iz=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 rz[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,PL({},this.opts,t)).format()},t.dtFormatter=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,PL({},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 EB(e,t);var n=PL({},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 XB[e.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function(e,n){return i?function(e,t){return qB(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 YB(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 tz(t)[e.year<0?0:1]}(t,e):s({era:e},"era")};return nz(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 nz(s,(r=l,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),oz=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function sz(){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 az(){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[PL({},r,a),l||i,c]}),[{},null,1]).slice(0,2)}}function lz(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 cz(){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]]=MB(e[n+r]);return[i,null,n+r]}}var uz=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,dz=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,pz=RegExp(""+dz.source+("(?:"+uz.source+"?(?:\\[("+oz.source+")\\])?)?")),hz=RegExp("(?:T"+pz.source+")?"),fz=cz("weekYear","weekNumber","weekDay"),mz=cz("year","ordinal"),gz=RegExp(dz.source+" ?(?:"+uz.source+"|("+oz.source+"))?"),vz=RegExp("(?: "+gz.source+")?");function yz(e,t,n){var r=e[t];return gB(r)?n:MB(r)}function bz(e,t){return[{hours:yz(e,t,0),minutes:yz(e,t+1,0),seconds:yz(e,t+2,0),milliseconds:TB(e[t+3])},null,t+4]}function Sz(e,t){var n=!e[t]&&!e[t+1],r=zB(e[t+1],e[t+2]);return[{},n?null:VD.instance(r),t+3]}function xz(e,t){return[{},e[t]?MD.create(e[t]):null,t+1]}var wz=RegExp("^T?"+dz.source+"$"),Cz=/^-?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 Az(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(_B(n)),months:p(_B(r)),weeks:p(_B(i)),days:p(_B(o)),hours:p(_B(s)),minutes:p(_B(a)),seconds:p(_B(l),"-0"===l),milliseconds:p(TB(c),d)}]}var Ez={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Mz(e,t,n,r,i,o,s){var a={year:2===t.length?DB(MB(t)):MB(t),month:GB.indexOf(n)+1,day:MB(r),hour:MB(i),minute:MB(o)};return s&&(a.second=MB(s)),e&&(a.weekday=e.length>3?KB.indexOf(e)+1:JB.indexOf(e)+1),a}var _z=/^(?:(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 Tz(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=Mz(n,o,i,r,s,a,l);return t=c?Ez[c]:u?0:zB(d,p),[h,new VD(t)]}var Iz=/^(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$/,Rz=/^(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$/,Pz=/^(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 kz(e){var t=e[1],n=e[2],r=e[3];return[Mz(t,e[4],r,n,e[5],e[6],e[7]),VD.utcInstance]}function Oz(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],s=e[6];return[Mz(t,e[7],n,r,i,o,s),VD.utcInstance]}var Nz=sz(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,hz),Lz=sz(/(\d{4})-?W(\d\d)(?:-?(\d))?/,hz),Dz=sz(/(\d{4})-?(\d{3})/,hz),Bz=sz(pz),zz=az((function(e,t){return[{year:yz(e,t),month:yz(e,t+1,1),day:yz(e,t+2,1)},null,t+3]}),bz,Sz,xz),Fz=az(fz,bz,Sz,xz),Uz=az(mz,bz,Sz,xz),jz=az(bz,Sz,xz);var Hz=az(bz);var Vz=sz(/(\d{4})-(\d\d)-(\d\d)/,vz),Gz=sz(gz),Wz=az(bz,Sz,xz);var qz="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}},Jz=PL({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),Qz=365.2425,Yz=30.436875,Xz=PL({years:{quarters:4,months:12,weeks:52.1775,days:Qz,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:Yz,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Kz),$z=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Zz=$z.slice(0).reverse();function eF(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:PL({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new rF(r)}function tF(e,t){for(var n,r,i=null!=(n=t.milliseconds)?n:0,o=UL(Zz.slice(1));!(r=o()).done;){var s=r.value;t[s]&&(i+=t[s]*e[s].milliseconds)}return i}function nF(e,t){var n=tF(e,t)<0?-1:1;$z.reduceRight((function(r,i){if(gB(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),$z.reduce((function(n,r){if(gB(t[r]))return n;if(n){var i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r}),null)}var rF=function(e){function t(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Xz:Jz;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||jD.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:UB(e,t.normalizeUnit),loc:jD.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},t.fromDurationLike=function(e){if(vB(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 lz(e,[Cz,Az])}(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 lz(e,[wz,Hz])}(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 tB?e:new tB(e,n);if(eB.throwOnInvalid)throw new GL(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 qL(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=PL({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?iz.create(this.loc,n).formatDurationFromString(this,e):qz},n.toHuman=function(e){var t=this;if(void 0===e&&(e={}),!this.isValid)return qz;var n=$z.map((function(n){var r=t.values[n];return gB(r)?null:t.loc.numberFormatter(PL({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(PL({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},n.toObject=function(){return this.isValid?PL({},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+=IB(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=PL({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),YF.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?tF(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=$z;i<o.length;i++){var s=o[i];(wB(n.values,s)||wB(this.values,s))&&(r[s]=n.get(s)+this.get(s))}return eF(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]=FB(e(this.values[i],i))}return eF(this,{values:t},!0)},n.get=function(e){return this[t.normalizeUnit(e)]},n.set=function(e){return this.isValid?eF(this,{values:PL({},this.values,UB(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 eF(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 nF(this.matrix,e),eF(this,{values:e},!0)},n.rescale=function(){return this.isValid?eF(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=$z;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;vB(a[u])&&(d+=a[u]);var h=Math.trunc(d);o[u]=h,s[u]=(1e3*d-1e3*h)/1e3}else vB(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 nF(this.matrix,o),eF(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 eF(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=$z;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},RL(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")),iF="Invalid Interval";var oF=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 tB?e:new tB(e,n);if(eB.throwOnInvalid)throw new VL(r);return new t({invalid:r})},t.fromDateTimes=function(e,n){var r=XF(e),i=XF(n),o=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?oF.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:oF.invalid("missing or invalid end"):oF.invalid("missing or invalid start")}(r,i);return null==o?new t({start:r,end:i}):o},t.after=function(e,n){var r=rF.fromDurationLike(n),i=XF(e);return t.fromDateTimes(i,i.plus(r))},t.before=function(e,n){var r=rF.fromDurationLike(n),i=XF(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=YF.fromISO(i,n)).isValid}catch(e){a=!1}try{c=(l=YF.fromISO(o,n)).isValid}catch(e){c=!1}if(a&&c)return t.fromDateTimes(s,l);if(a){var u=rF.fromISO(o,n);if(u.isValid)return t.after(s,u)}else if(c){var d=rF.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(XF).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=rF.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=UL(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()+")":iF},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=$L),void 0===t&&(t={}),this.isValid?iz.create(this.s.loc.clone(t),e).formatInterval(this):iF},n.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):iF},n.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():iF},n.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):iF},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):iF},n.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):rF.invalid(this.invalidReason)},n.mapEndpoints=function(e){return t.fromDateTimes(e(this.s),e(this.e))},RL(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")),sF=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=eB.defaultZone);var t=YF.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return MD.isValidZone(e)},e.normalizeZone=function(e){return WD(e,eB.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)||jD.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)||jD.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)||jD.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||jD.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||jD.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)||jD.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)||jD.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 jD.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 jD.create(r,null,"gregory").eras(e)},e.features=function(){return{relative:bB(),localeWeek:SB()}},e}();function aF(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=n(t)-n(e);return Math.floor(rF.fromMillis(r).as("days"))}function lF(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=aF(e,t);return(n-n%7)/7}],["days",aF]],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=rF.fromObject(s,r);return u.length>0?(p=rF.fromMillis(c,r)).shiftTo.apply(p,u).plus(h):h}var cF={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},uF={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]},dF=cF.hanidec.replace(/[\[|\]]/g,"").split("");function pF(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+cF[n||"latn"]+t)}function hF(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(cF.hanidec))t+=dF.indexOf(e[n]);else for(var i in uF){var o=uF[i],s=o[0],a=o[1];r>=s&&r<=a&&(t+=r-s)}}return parseInt(t,10)}return t}(n))}}}var fF="[ "+String.fromCharCode(160)+"]",mF=new RegExp(fF,"g");function gF(e){return e.replace(/\./g,"\\.?").replace(mF,fF)}function vF(e){return e.replace(/\./g,"").replace(mF," ").toLowerCase()}function yF(e,t){return null===e?null:{regex:RegExp(e.map(gF).join("|")),deser:function(n){var r=n[0];return e.findIndex((function(e){return vF(r)===vF(e)}))+t}}}function bF(e,t){return{regex:e,deser:function(e){return zB(e[1],e[2])},groups:t}}function SF(e){return{regex:e,deser:function(e){return e[0]}}}var xF={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 wF=null;function CF(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=EF(iz.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function AF(e,t,n){var r=CF(iz.parseFormat(n),e),i=r.map((function(t){return n=t,i=pF(r=e),o=pF(r,"{2}"),s=pF(r,"{3}"),a=pF(r,"{4}"),l=pF(r,"{6}"),c=pF(r,"{1,2}"),u=pF(r,"{1,3}"),d=pF(r,"{1,6}"),p=pF(r,"{1,9}"),h=pF(r,"{2,4}"),f=pF(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 yF(r.eras("short"),0);case"GG":return yF(r.eras("long"),0);case"y":return hF(d);case"yy":case"kk":return hF(h,DB);case"yyyy":case"kkkk":return hF(a);case"yyyyy":return hF(f);case"yyyyyy":return hF(l);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return hF(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return hF(o);case"MMM":return yF(r.months("short",!0),1);case"MMMM":return yF(r.months("long",!0),1);case"LLL":return yF(r.months("short",!1),1);case"LLLL":return yF(r.months("long",!1),1);case"o":case"S":return hF(u);case"ooo":case"SSS":return hF(s);case"u":return SF(p);case"uu":return SF(c);case"uuu":case"E":case"c":return hF(i);case"a":return yF(r.meridiems(),0);case"EEE":return yF(r.weekdays("short",!1),1);case"EEEE":return yF(r.weekdays("long",!1),1);case"ccc":return yF(r.weekdays("short",!0),1);case"cccc":return yF(r.weekdays("long",!0),1);case"Z":case"ZZ":return bF(new RegExp("([+-]"+c.source+")(?::("+o.source+"))?"),2);case"ZZZ":return bF(new RegExp("([+-]"+c.source+")("+o.source+")?"),2);case"z":return SF(/[a-z_+-/]{1,256}?/i);case" ":return SF(/[^\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(wB(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;gB(e.z)||(n=MD.create(e.z)),gB(e.Z)||(n||(n=new VD(e.Z)),t=e.Z),gB(e.q)||(e.M=3*(e.q-1)+1),gB(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),gB(e.u)||(e.S=TB(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(wB(p,"a")&&wB(p,"H"))throw new WL("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 EF(e,t){if(!e)return null;var n=iz.create(t,e).dtFormatter((wF||(wF=YF.fromMillis(1555555555555)),wF)),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=xF[a];if("object"==typeof l&&(l=l[s]),l)return{literal:!1,val:l}}(t,e,i)}))}var MF="Invalid DateTime",_F=864e13;function TF(e){return new tB("unsupported zone",'the zone "'+e.name+'" is not supported')}function IF(e){return null===e.weekData&&(e.weekData=cB(e.c)),e.weekData}function RF(e){return null===e.localWeekData&&(e.localWeekData=cB(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function PF(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new YF(PL({},n,t,{old:n}))}function kF(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 OF(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 NF(e,t,n){return kF(OB(e),t,n)}function LF(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=PL({},e.c,{year:r,month:i,day:Math.min(e.c.day,kB(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=rF.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=kF(OB(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 DF(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=YF.fromObject(e,PL({},n,{zone:l,specificOffset:o}));return s?c:c.setZone(a)}return YF.invalid(new tB("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function BF(e,t,n){return void 0===n&&(n=!0),e.isValid?iz.create(jD.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function zF(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=EB(e.c.year,n?6:4),t?(r+="-",r+=EB(e.c.month),r+="-",r+=EB(e.c.day)):(r+=EB(e.c.month),r+=EB(e.c.day)),r}function FF(e,t,n,r,i,o){var s=EB(e.c.hour);return t?(s+=":",s+=EB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=":")):s+=EB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=EB(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=EB(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?s+="Z":e.o<0?(s+="-",s+=EB(Math.trunc(-e.o/60)),s+=":",s+=EB(Math.trunc(-e.o%60))):(s+="+",s+=EB(Math.trunc(e.o/60)),s+=":",s+=EB(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}var UF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},jF={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},HF={ordinal:1,hour:0,minute:0,second:0,millisecond:0},VF=["year","month","day","hour","minute","second","millisecond"],GF=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],WF=["year","ordinal","hour","minute","second","millisecond"];function qF(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 qL(e);return t}(e)}}function KF(e,t){var n,r,i=WD(t.zone,eB.defaultZone),o=jD.fromObject(t),s=eB.now();if(gB(e.year))n=s;else{for(var a=0,l=VF;a<l.length;a++){var c=l[a];gB(e[c])&&(e[c]=UF[c])}var u=fB(e)||mB(e);if(u)return YF.invalid(u);var d=NF(e,i.offset(s),i);n=d[0],r=d[1]}return new YF({ts:n,zone:i,loc:o,o:r})}function JF(e,t,n){var r=!!gB(n.round)||n.round,i=function(e,i){return e=IB(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=UL(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 QF(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 YF=function(e){function t(e){var t=e.zone||eB.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new tB("invalid input"):null)||(t.isValid?null:TF(t));this.ts=gB(e.ts)?eB.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=OF(this.ts,s),r=(n=Number.isNaN(r.year)?new tB("invalid input"):null)?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||jD.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=QF(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=QF(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=VD.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=WD(n.zone,eB.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:jD.fromObject(n)}):t.invalid(TF(i))},t.fromMillis=function(e,n){if(void 0===n&&(n={}),vB(e))return e<-864e13||e>_F?t.invalid("Timestamp out of range"):new t({ts:e,zone:WD(n.zone,eB.defaultZone),loc:jD.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={}),vB(e))return new t({ts:1e3*e,zone:WD(n.zone,eB.defaultZone),loc:jD.fromObject(n)});throw new KL("fromSeconds requires a numerical input")},t.fromObject=function(e,n){void 0===n&&(n={}),e=e||{};var r=WD(n.zone,eB.defaultZone);if(!r.isValid)return t.invalid(TF(r));var i=jD.fromObject(n),o=UB(e,qF),s=hB(o,i),a=s.minDaysInFirstWeek,l=s.startOfWeek,c=eB.now(),u=gB(n.specificOffset)?r.offset(c):n.specificOffset,d=!gB(o.ordinal),p=!gB(o.year),h=!gB(o.month)||!gB(o.day),f=p||h,m=o.weekYear||o.weekNumber;if((f||d)&&m)throw new WL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&d)throw new WL("Can't mix ordinal dates with month/day");var g,v,y=m||o.weekday&&!f,b=OF(c,u);y?(g=GF,v=jF,b=cB(b,a,l)):d?(g=WF,v=HF,b=dB(b)):(g=VF,v=UF);for(var S,x=!1,w=UL(g);!(S=w()).done;){var C=S.value;gB(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=yB(e.weekYear),i=AB(e.weekNumber,1,LB(e.weekYear,t,n)),o=AB(e.weekday,1,7);return r?i?!o&&iB("weekday",e.weekday):iB("week",e.weekNumber):iB("weekYear",e.weekYear)}(o,a,l):d?function(e){var t=yB(e.year),n=AB(e.ordinal,1,PB(e.year));return t?!n&&iB("ordinal",e.ordinal):iB("year",e.year)}(o):fB(o),E=A||mB(o);if(E)return t.invalid(E);var M=NF(y?uB(o,a,l):d?pB(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 lz(e,[Nz,zz],[Lz,Fz],[Dz,Uz],[Bz,jz])}(e);return DF(n[0],n[1],t,"ISO 8601",e)},t.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return lz(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[_z,Tz])}(e);return DF(n[0],n[1],t,"RFC 2822",e)},t.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return lz(e,[Iz,kz],[Rz,kz],[Pz,Oz])}(e);return DF(n[0],n[1],t,"HTTP",t)},t.fromFormat=function(e,n,r){if(void 0===r&&(r={}),gB(e)||gB(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=AF(e,t,n);return[r.result,r.zone,r.specificOffset,r.invalidReason]}(jD.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):DF(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 lz(e,[Vz,zz],[Gz,Wz])}(e);return DF(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 tB?e:new tB(e,n);if(eB.throwOnInvalid)throw new HL(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=EF(e,jD.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={}),CF(iz.parseFormat(e),jD.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=OB(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=OF(a,o),u=OF(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[PF(this,{ts:a}),PF(this,{ts:l})]:[this]},n.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=iz.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(VD.instance(e),t)},n.toLocal=function(){return this.setZone(eB.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=WD(e,eB.defaultZone)).equals(this.zone))return this;if(e.isValid){var l=this.ts;if(o||a){var c=e.offset(this.ts);l=NF(this.toObject(),c,e)[0]}return PF(this,{ts:l,zone:e})}return t.invalid(TF(e))},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return PF(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=UB(e,qF),r=hB(n,this.loc),i=r.minDaysInFirstWeek,o=r.startOfWeek,s=!gB(n.weekYear)||!gB(n.weekNumber)||!gB(n.weekday),a=!gB(n.ordinal),l=!gB(n.year),c=!gB(n.month)||!gB(n.day),u=l||c,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new WL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new WL("Can't mix ordinal dates with month/day");s?t=uB(PL({},cB(this.c,i,o),n),i,o):gB(n.ordinal)?(t=PL({},this.toObject(),n),gB(n.day)&&(t.day=Math.min(kB(t.year,t.month),t.day))):t=pB(PL({},dB(this.c),n));var p=NF(t,this.o,this.zone);return PF(this,{ts:p[0],o:p[1]})},n.plus=function(e){return this.isValid?PF(this,LF(this,rF.fromDurationLike(e))):this},n.minus=function(e){return this.isValid?PF(this,LF(this,rF.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=rF.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?iz.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):MF},n.toLocaleString=function(e,t){return void 0===e&&(e=$L),void 0===t&&(t={}),this.isValid?iz.create(this.loc.clone(t),e).formatDateTime(this):MF},n.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?iz.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=zF(this,p);return h+="T",h+=FF(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?zF(this,"extended"===n):null},n.toISOWeekDate=function(){return BF(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":"")+FF(this,"extended"===h,o,r,a,d):null},n.toRFC2822=function(){return BF(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},n.toHTTP=function(){return BF(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},n.toSQLDate=function(){return this.isValid?zF(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")),BF(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():MF},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=PL({},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 rF.invalid("created by diffing an invalid DateTime");var r,i=PL({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(rF.normalizeUnit),s=e.valueOf()>this.valueOf(),a=lF(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?oF.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),JF(n,this.plus(r),PL({},e,{numeric:"always",units:i,unit:o}))},n.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?JF(e.base||t.fromObject({},{zone:this.zone}),this,PL({},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 xB(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 xB(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 AF(jD.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)},RL(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?IF(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?IF(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?IF(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?RF(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?RF(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?RF(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?dB(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?sF.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?sF.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?sF.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?sF.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 RB(this.year)}},{key:"daysInMonth",get:function(){return kB(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?PB(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?LB(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?LB(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return $L}},{key:"DATE_MED",get:function(){return ZL}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return eD}},{key:"DATE_FULL",get:function(){return tD}},{key:"DATE_HUGE",get:function(){return nD}},{key:"TIME_SIMPLE",get:function(){return rD}},{key:"TIME_WITH_SECONDS",get:function(){return iD}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return oD}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return sD}},{key:"TIME_24_SIMPLE",get:function(){return aD}},{key:"TIME_24_WITH_SECONDS",get:function(){return lD}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return cD}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return uD}},{key:"DATETIME_SHORT",get:function(){return dD}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return pD}},{key:"DATETIME_MED",get:function(){return hD}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return fD}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return mD}},{key:"DATETIME_FULL",get:function(){return gD}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return vD}},{key:"DATETIME_HUGE",get:function(){return yD}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return bD}}]),t}(Symbol.for("nodejs.util.inspect.custom"));function XF(e){if(YF.isDateTime(e))return e;if(e&&e.valueOf&&vB(e.valueOf()))return YF.fromJSDate(e);if(e&&"object"==typeof e)return YF.fromObject(e);throw new KL("Unknown datetime argument: "+e+", of type "+typeof e)}TL.DateTime=YF,TL.Duration=rF,TL.FixedOffsetZone=VD,TL.IANAZone=MD,TL.Info=sF,TL.Interval=oF,TL.InvalidZone=GD,TL.Settings=eB,TL.SystemZone=wD,TL.VERSION="3.4.4",TL.Zone=SD;c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function $F(e,t){let[n,r]=(0,c.useState)(e),i=Xa(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||{}),eU=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(eU||{}),tU=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(tU||{}),nU=(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))(nU||{});function rU(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=Yl(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 iU={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 Na(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=rU(e),i=Ed(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=rU(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;Na(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=rU(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},oU=(0,c.createContext)(null);function sU(e){let t=(0,c.useContext)(oU);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,sU),t}return t}function aU(e,t){return Na(t.type,iU,e,t)}oU.displayName="ListboxContext";let lU=c.Fragment,cU=ja((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=rl(n),[m,g]=Ff(r,s,i),v=(0,c.useReducer)(aU,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:el("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=>Na(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]),Ic([x,S],((e,t)=>{var n;w({type:1}),ql(t,Wl.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(oU.Provider,{value:v},t(c).createElement(Ka,{value:Na(y,{0:Wa.Open,1:Wa.Closed})},null!=o&&null!=m&&Lf({[o]:m}).map((([e,n])=>t(c).createElement(Bl,{features:Dl.Hidden,...Ha({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),za({ourProps:A,theirProps:p,slot:C,defaultTag:lU,name:"Listbox"})))})),uU=ja((function(e,t){var n;let[r,i]=sU("Listbox.Button"),o=rl(r.buttonRef,t),s=`headlessui-listbox-button-${Ll()}`,a=pl(),l=el((e=>{switch(e.key){case Rl.Space:case Rl.Enter:case Rl.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Ad.First})}));break;case Rl.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Ad.Last})}))}})),u=el((e=>{if(e.key===Rl.Space)e.preventDefault()})),d=el((e=>{if(Pl(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=$F((()=>{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 za({ourProps:{ref:o,id:s,type:Td(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"})})),dU=ja((function(e,t){let[n]=sU("Listbox.Label"),r=`headlessui-listbox-label-${Ll()}`;return za({ourProps:{ref:rl(n.labelRef,t),id:r,onClick:el((()=>{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"})})),pU=Da.RenderStrategy|Da.Static,hU=ja((function(e,t){var n;let[r,i]=sU("Listbox.Options"),o=rl(r.optionsRef,t),s=`headlessui-listbox-options-${Ll()}`,a=pl(),l=pl(),u=qa(),d=null!==u?u===Wa.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=zl(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let p=el((e=>{switch(l.dispose(),e.key){case Rl.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case Rl.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}),sl().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case Na(r.orientation,{vertical:Rl.ArrowDown,horizontal:Rl.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ad.Next});case Na(r.orientation,{vertical:Rl.ArrowUp,horizontal:Rl.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ad.Previous});case Rl.Home:case Rl.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ad.First});case Rl.End:case Rl.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ad.Last});case Rl.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 Rl.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),h=$F((()=>{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 za({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:pU,visible:d,name:"Listbox.Options"})})),fU=ja((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=sU("Listbox.Option"),a=`headlessui-listbox-option-${Ll()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,p=Na(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),h=(0,c.useRef)(null),f=rl(t,h);Qa((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=sl();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=el((()=>o.propsRef.current.onChange(r)));Qa((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=el((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),sl().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=el((()=>{if(n)return s({type:4,focus:Ad.Nothing});s({type:4,focus:Ad.Specific,id:a})})),b=el((()=>{n||l||s({type:4,focus:Ad.Specific,id:a,trigger:0})})),S=el((()=>{n||!l||s({type:4,focus:Ad.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:p,disabled:n})),[l,p,n]);return za({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"})})),mU=Object.assign(cU,{Button:uU,Label:dU,Options:hU,Option:fU});var gU=({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 vU={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"]},yU=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=me(),[o,a]=(0,c.useState)(e?"string"==typeof e?TL.DateTime.fromISO(e):TL.DateTime.fromJSDate(e):TL.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)(mU,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(mU.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(mU.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)(gU,{})})]}),(0,s.jsx)(Tl,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(mU.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(mU.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)(mU,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(mU.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(mU.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:vU["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(gU,{})})]}),(0,s.jsx)(Tl,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(mU.Options,{className:"memori--date-selector__select-options",children:vU["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(mU.Option,{className:"memori--date-selector__select-option",value:o.set({month:vU["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)(mU,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(mU.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(mU.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)(gU,{})})]}),(0,s.jsx)(Tl,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(mU.Options,{className:"memori--date-selector__select-options",children:[...Array(TL.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(mU.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));yU.displayName="DateSelector";var bU=yU;c=o("85Hg2");var SU=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=me(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),d=(0,c.useCallback)((()=>{if(!o)return t(ys).error(i("requiredField")),void u(i("requiredField")||"Required field");if(TL.DateTime.now().diff(o,"years").years<r)return t(ys).error(i("underageTwinSession",{age:r})),void u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(qc,{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(),d()},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)(bU,{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)(Oa,{primary:!0,htmlType:"submit",className:"age-verification-submit",disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var xU=({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)(Tl,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(Vc,{open:e,onClose:n,className:t(gs)("memori-drawer",r),children:[(0,s.jsx)(Tl.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)(Tl.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)(Vc.Panel,{className:t(gs)("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)(Oa,{shape:"circle",outlined:!0,icon:(0,s.jsx)(Wc,{}),onClick:()=>n(!1)})}),(0,s.jsxs)(Gc,{spinning:u,children:[i&&(0,s.jsx)(Vc.Title,{className:"memori-drawer--title",children:i}),o&&(0,s.jsx)(Vc.Description,{className:"memori-drawer--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-drawer--footer",children:l})]})]})})})})]})});var wU=({label:e,className:n,disabled:r=!1,checked:i,children:o,onChange:a,name:l,...c})=>(0,s.jsxs)("label",{className:t(gs)("memori-checkbox",n,{"memori-checkbox--disabled":r}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",...c,name:l,disabled:r,defaultChecked:i,className:"memori-checkbox--input",onChange:a}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]});c=o("85Hg2");var CU=({className:e,value:n,displayValue:r,options:i,onChange:o,disabled:a=!1,label:l,placeholder:u})=>(0,s.jsx)("div",{className:t(gs)("memori-select",e),children:(0,s.jsxs)(mU,{value:n,onChange:e=>{o(e)},disabled:a,name:"day",children:[(0,s.jsxs)(mU.Label,{className:"memori-select--label",children:[l,":"]}),(0,s.jsxs)(mU.Button,{"aria-label":l,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(gs)("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)(gU,{})})]}),(0,s.jsx)(Tl,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(mU.Options,{className:"memori-select--options",children:i.map((e=>(0,s.jsx)(mU.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const AU=[2,3,5,10,15,20,30,60];var EU=({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}=me();return(0,s.jsxs)(xU,{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)(Qf,{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),vL("microphoneMode",t)},children:[(0,s.jsx)(Qf.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Oa,{primary:e,children:h("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)(Qf.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Oa,{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)(CU,{label:h("write_and_speak.secondsLabel")||"Seconds",placeholder:h("write_and_speak.secondsLabel")||"Seconds",options:AU.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),vL("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)(Qf,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),vL("controlsPosition",e)},children:[(0,s.jsx)(Qf.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Oa,{primary:e,children:h("center")||"Center"})}),(0,s.jsx)(Qf.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Oa,{primary:e,children:h("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(wU,{label:h("write_and_speak.hideEmissionsLabel"),name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),vL("hideEmissions",e.target.checked)}})})]}),p&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:p})]})};const MU=(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 _U,TU,IU,RU,PU,kU;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=MU,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>MU(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),MU(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 OU=!1,NU=!1;var LU=({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,W,q,K,J,Q,Y,X,$,Z,ee,te,ne,re,ie,oe,se;const{t:ae,i18n:le}=me(),[ce,ue]=(0,c.useState)(!1);(0,c.useEffect)((()=>{ue(!0)}),[]);const de=G(A),{initSession:pe,postTextEnteredEvent:he,postPlaceChangedEvent:fe,postTimeoutEvent:ge,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===(W=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===W?void 0:W.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)(2),[tt,nt]=(0,c.useState)(!1),[rt,it]=(0,c.useState)("center"),[ot,st]=(0,c.useState)(!1);(0,c.useEffect)((()=>{nt(!!IU),NU=!!IU}),[IU]),(0,c.useEffect)((()=>{let e="bottom",t=gL("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",Ye(gL("muteSpeaker",!1)),OU=gL("muteSpeaker",!1),$e("CONTINUOUS"===t),et(gL("continuousSpeechTimeout",2)),it(gL("controlsPosition",e)),st(gL("hideEmissions",!1))}),[]);const[at,lt]=(0,c.useState)(w),[ct,ut]=(0,c.useState)(),[dt,pt]=(0,c.useState)(null),[ht,ft]=(0,c.useState)(),mt=async(e,t)=>{var n;const r=null!=t?t:Rt;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&&Nt({...kt,...t})}},[gt,vt]=(0,c.useState)(""),[yt,bt]=(0,c.useState)(!1),[St,xt]=(0,c.useState)([]),wt=e=>{xt((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:[]}]}))},Ct=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,p,h,f;const m=i||Rt||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||wt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Rt?!!i&&i!==Rt:!!i}),Be(!0),Fe(l);let g=n,v=!1;if(o&&!xe&&Pe&&ke.toUpperCase()!==Ie.toUpperCase()){g=(await sp(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==kt?void 0:kt.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await ve(m,e.giverTag);0===i.resultCode?(Nt(r),n&&(wt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),Yt(n))):(console.error(b,i),t(ys).error(ae(bL(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?(Nt(r),n&&(wt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),Yt(n))):(console.error(b,i),t(ys).error(ae(bL(i.resultCode))),v=!0)}else console.error(b,i),t(ys).error(ae(bL(i.resultCode))),v=!0}else ke.toLowerCase()!==Ie.toLowerCase()&&n&&!xe&&Pe?At(y,ke).then((e=>{e.emission&&Yt(e.emission)})):(Nt({...y,emission:n}),n&&(wt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,generatedByAI:!!y.completion}),Yt(n)))}else 404===b.resultCode&&(xt((e=>[...e.slice(0,e.length-1)])),Dt(!1,at||e.secretToken,ct,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((()=>{Ct(n,r,null==e?void 0:e.sessionID)}),500)})));u||(Fe(void 0),Be(!1))},At=async(e,t)=>{var n,r,i;const o=null!==(n=e.emission)&&void 0!==n?n:null==kt?void 0:kt.emission;let s={...e},a=null;if(o&&!xe&&Ie.toUpperCase()!==t.toUpperCase()&&Pe){const n=await sp(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 sp(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==kt?void 0:kt.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 Nt(s),a&&wt(a),s},Et=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[Mt,_t]=(0,c.useState)(),[Tt,It]=(0,c.useState)(!1),[Rt,Pt]=(0,c.useState)(T),[kt,Ot]=(0,c.useState)(),Nt=e=>{var t;Ot(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)}}))},Lt=async n=>{var r,i,o,s,a;let l=gL("birthDate",void 0);if(Mt||l||!Et)if("PUBLIC"===e.privacyType||e.secretToken||at||ct){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:Tn)&&void 0!==a?a:P,language:qt(ke),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Pt(c.sessionID),ht&&mt(ht,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(ys).error(ae("underageTwinSession",{age:Et})),Te(!0)):403===(null==c?void 0:c.resultCode)?(lt(void 0),pt("password")):(console.error(c),t(ys).error(ae(bL(null==c?void 0:c.resultCode))),Te(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else pt("password");else It(!0)},Dt=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,p,h,f;Le(!0);try{let m,g=gL("birthDate",void 0);if(!c&&!g&&Et)return void It(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||at||i||ct))return void pt("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||at||e.secretToken,recoveryTokens:i||ct,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:Tn)&&void 0!==f?f:P,language:qt(ke),referral:m}});if(v&&y&&0===b.resultCode)return Pt(v),n&&(Nt(y),y.emission&&(St.length<=1?xt([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}]):wt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}))),ht&&mt(ht,v),Le(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(ys).error(ae("underageTwinSession",{age:Et})),Te(!0)):403===(null==b?void 0:b.resultCode)?(lt(void 0),pt("password")):(console.error(b),t(ys).error(ae(bL(b.resultCode))),Te(!0))}catch(e){console.error(e)}return Le(!1),null},Bt=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:lp);if(0===u){let d=0;if(r!==lp&&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=gL("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}Lt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:w||at||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:Mt||n||void 0,additionalInfo:{...N||{},loginToken:null!==(c=null!==(l=null==N?void 0:N.loginToken)&&void 0!==l?l:Tn)&&void 0!==c?c:P,language:qt(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)((()=>()=>{kt&&(null==kt?void 0:kt.currentTag)===e.giverTag||(async()=>{Rt&&e.giverTag&&e.giverPIN&&(xt([]),await Bt(e.engineMemoriID,Rt,e.giverTag,e.giverPIN))})()}),[]);const[zt,Ft]=(0,c.useState)(),Ut=(0,c.useRef)(),jt=()=>{zt&&(clearTimeout(zt),Ft(void 0)),(null==Ut?void 0:Ut.current)&&(clearTimeout(Ut.current),Ut.current=void 0)},Ht=()=>{jt(),!(null==kt?void 0:kt.acceptsTimeout)||IU||tt||gt.length||De||yt||Gt()},Vt=async()=>{var e;if(IU||tt||gt.length||De||yt)Ht();else if(Rt&&je&&(null==kt?void 0:kt.acceptsTimeout)){const{currentState:t,...n}=await ge(Rt);if(0===n.resultCode&&t){const n=t.emission;!xe&&Pe&&ke!==(null==le?void 0:le.language)&&n&&n.length>0?At({...t,emission:n},ke).then((e=>{e.emission&&Yt(e.emission)})):n&&n.length>0&&(wt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion}),Yt(n),Nt({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==kt?void 0:kt.hints:[]}))}}},Gt=()=>{let e=null==kt?void 0:kt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==kt?void 0:kt.emission){e+=kt.emission.length/26.5}}let t=setTimeout(Vt,1e3*e);Ft(t),Ut.current=t};(0,c.useEffect)((()=>{(gt.length||tt||De)&&jt(),Rt&&!gt.length&&Ht()}),[null==kt?void 0:kt.acceptsTimeout,null==kt?void 0:kt.timeout,null==kt?void 0:kt.state,tt,Rt,St,gt,De]),(0,c.useEffect)((()=>()=>{He(!1),Me(!1),jt(),Ut.current=void 0}),[]);const Wt=(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]),qt=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},[Kt,Jt]=(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=>{Jt(e)}))}),[]);const Qt=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},Yt=e=>{if(!k||p)return void Qt();if(an(),p)return;if(Qe||OU)return NU=!1,Be(!1),Qt(),void(Xe&&rn());RU&&RU.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===PU.state)return void PU.resume().then((()=>Yt(e)));if("closed"===PU.state){PU=new Vo;let e=PU.createBuffer(1,1e4,22050),t=PU.createBufferSource();t.buffer=e,t.connect(PU.destination)}else if("suspended"===PU.state){Xt(),PU=new Vo;let e=PU.createBuffer(1,1e4,22050),t=PU.createBufferSource();t.buffer=e,t.connect(PU.destination)}if(!IU){n||(RU=new hs.SpeakerAudioDestination);let e=hs.AudioConfig.fromSpeakerOutput(RU);IU=new hs.SpeechSynthesizer(TU,e)}const r=PU.createBufferSource();r.addEventListener("ended",(()=>{nt(!1),NU=!1})),RU.onAudioEnd=()=>{nt(!1),NU=!1,r.disconnect(),Qt(),pn()},IU.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="${qt(ke)}"><voice name="${Wt(ke)}"><s>${((e,t)=>{var n;if(!Kt)return e;const r={...null!==(n=Kt.common)&&void 0!==n?n:{},...(null==I?void 0:I.id)&&Kt[I.id]?Kt[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})(yd(e)),ke.toLowerCase())}</s></voice></speak>`,(i=>{if(i){nt(!0),NU=!0;try{PU.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(PU.destination),(St.length<1||t&&n)&&r.start(0)})),PU.onstatechange=()=>{"suspended"===PU.state||"closed"===PU.state?(r.disconnect(),nt(!1),NU=!1):"interrupted"===PU.state&&PU.resume()},PU.resume(),IU&&(IU.close(),IU=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),nt(!1),NU=!1,IU&&(IU.close(),IU=null),Qt()}}else PU.resume(),nt(!1),NU=!1,Qt()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),nt(!1),NU=!1,Qt()})),Be(!1)},Xt=()=>{nt(!1),NU=!1;try{IU&&(IU.close(),IU=null),"closed"!==PU.state&&PU.close(),RU&&(RU.pause(),RU.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==kt?void 0:kt.emission]);const[$t,Zt]=(0,c.useState)(""),en=()=>Zt(""),[tn,nn]=(0,c.useState)(null),rn=()=>{let e=setTimeout((async()=>{ln();const e=vd($t);e.length>0&&yt?(Ct(e),en(),vt("")):yt&&Ht()}),1e3*Ze);nn(e)},on=()=>{tn&&(clearTimeout(tn),nn(null))};(0,c.useEffect)((()=>{on(),Xe&&rn(),Ht()}),[$t]);const sn=()=>{if(k){ln(),Zt(""),en();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){Ge(!0),TU||(TU=hs.SpeechConfig.fromSubscription(k,"eastus"),TU.speechRecognitionLanguage=qt(ke),TU.speechSynthesisLanguage=qt(ke),TU.speechSynthesisVoiceName=Wt(ke));const t=hs.AudioConfig.fromDefaultMicrophoneInput();_U=new hs.SpeechRecognizer(TU,t),bt(!0),_U.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===hs.ResultReason.RecognizedSpeech){let e=t.result.text;if(Zt(e||""),(null==e?void 0:e.length)>0){const t=vd(e);t.length>0&&vt((e=>`${e} ${t}`))}}else t.result.reason===hs.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},_U.canceled=(e,t)=>{t.reason===hs.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?")),an()},_U.sessionStopped=(e,t)=>{an()},en(),_U.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},an=()=>{_U&&(_U.stopContinuousRecognitionAsync(),_U.close(),_U=null),bt(!1)},ln=()=>{Ge(!1),an(),on()},cn=()=>{try{ln(),jt(),Me(!1),Ut.current=void 0,Xt()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{cn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",cn),()=>{document.removeEventListener("MemoriResetUIEffects",cn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==kt?void 0:kt.state)&&ln()}),[null==kt?void 0:kt.state]);const[un,dn]=(0,c.useState)(!1),pn=(0,c.useCallback)((e=>{tt&&IU&&(IU.close(),IU=null),!Xe||!Ve&&un||(dn(!0),sn())}),[Xe,Ve]);(0,c.useEffect)((()=>{St.length>1&&!tt&&Xe&&(Ve||!un)?sn():tt&&yt&&an()}),[tt]),(0,c.useEffect)((()=>{yt&&(ln(),en(),vt(""),sn())}),[Ie]);const[hn,fn]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=gL("sendOnEnter","keypress");window.innerWidth<=768?fn("click"):fn(e)}),[]),(0,c.useEffect)((()=>{vL("sendOnEnter",hn)}),[hn]);const[mn,gn]=(0,c.useState)(),vn=null==Re?void 0:Re.globalBackground,yn=vn?`url(${vn})`:null,bn=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"}}:{},Sn=`\n ${p?"#preview,":"WEBSITE_ASSISTANT"===Ue?"":":root,"} .memori-widget {\n ${Object.entries(bn).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,xn=void 0===(null==Re?void 0:Re.showAIicon)||(null==Re?void 0:Re.showAIicon),[wn,Cn]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===Ue||"FULLPAGE"!==Ue)&&Cn(!0)}),[]);const[An,En]=(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=>{En(_L(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 Mn=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!OU&&(NU||De)?setTimeout((()=>{Mn(e)}),1e3):(an(),Xt(),Ct(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Rt,tt,De,ke]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",Mn),()=>{document.removeEventListener("MemoriTextEntered",Mn)})),[Rt,ke]);const _n=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c;const u=(null==t?void 0:t.sessionID)||Rt,d=(null==t?void 0:t.dialogState)||kt;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=gL("birthDate",void 0),m=Mt||f||void 0;if(u||!Et||m){if(!u&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!at&&!ct||!u&&_e)return pt("password"),void Me(!1);if(!u){Me(!1),Te(!1);const t=await Lt({memoriID:e.engineMemoriID,password:w||at||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)?(xt([]),At(t.dialogState,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}))):await _n(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),Pt(void 0),Me(!1),void await _n();if(xt([]),xe&&e.giverTag&&(null==kt?void 0:kt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await Bt(e.engineMemoriID,u,"-");const t=await Bt(e.engineMemoriID,u,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");At(t.currentState,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #2",t),Dt(!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==kt?void 0:kt.currentTag)!==R.tag)try{console.debug("change tag #3"),await Bt(e.engineMemoriID,u,"-");const t=await Bt(e.engineMemoriID,u,R.tag,R.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");At(t.currentState,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #5",t),Dt(!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==kt?void 0:kt.currentTag)===lp)At(t,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}));else try{console.debug("change tag #6"),await Bt(e.engineMemoriID,u,"-");const t=await Bt(e.engineMemoriID,u,lp);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");At(t.currentState,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #8",t),Dt(!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 xt([]),At(d,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}))}else It(!0),Me(!1)}),[at,e,ct,Mt,Rt,ke]),[Tn,In]=(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?In(t.target.getAttribute("authtoken")||void 0):In((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[Rn,Pn]=(0,c.useState)(),kn=(0,c.useCallback)((async()=>{if(Rt&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Se(Rt);0===n.resultCode?Pn(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Rt,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{kn()}),[Rt,kn]);const On=void 0===S?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!S,Nn={memori:e,tenant:I,history:St,showShare:null===(ee=null!=d?d:null==Re?void 0:Re.showShare)||void 0===ee||ee,position:ht,setShowPositionDrawer:qe,setShowSettingsDrawer:Je,showSpeaker:!!k,speakerMuted:Qe||OU,setSpeakerMuted:e=>{if(OU=!!e,Ye(e),vL("muteSpeaker",!!e),e)Xt();else{PU=new Vo;let e=PU.createBuffer(1,1e4,22050),t=PU.createBufferSource();t.buffer=e,t.connect(PU.destination)}},showSettings:v,hasUserActivatedSpeak:je,showReload:"TOTEM"===Ue,showClear:b,clearHistory:()=>xt((e=>e.slice(-1)))},Ln={memori:e,integration:o,integrationConfig:Re,tenant:I,instruct:xe,avatar3dVisible:wn,setAvatar3dVisible:Cn,hasUserActivatedSpeak:je,isPlayingAudio:tt&&!Qe,loading:!!De,baseUrl:C,apiUrl:A},Dn={memori:e,tenant:I,gamificationLevel:An,language:Ie,userLang:ke,setUserLang:Oe,baseUrl:C,apiUrl:A,position:ht,openPositionDrawer:()=>qe(!0),integrationConfig:Re,instruct:xe,sessionId:Rt,clickedStart:Ee,onClickStart:_n,initializeTTS:()=>{if(!k)return;TU=hs.SpeechConfig.fromSubscription(k,"eastus"),TU.speechSynthesisLanguage=qt(ke),TU.speechSynthesisVoiceName=Wt(ke),TU.speechRecognitionLanguage=qt(ke),md()&&(TU.speechSynthesisOutputFormat=hs.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),PU=new Vo;let e=PU.createBuffer(1,1e4,22050),t=PU.createBufferSource();t.buffer=e,t.connect(PU.destination),RU=new hs.SpeakerAudioDestination;let n=hs.AudioConfig.fromSpeakerOutput(RU);IU=new hs.SpeechSynthesizer(TU,n)},isUserLoggedIn:!!Tn},Bn={memori:e,sessionID:Rt||"",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:On?St:St.slice(-2),authToken:Tn,dialogState:kt,setDialogState:Nt,pushMessage:wt,simulateUserPrompt:(e,t)=>{an(),Xt(),Ct(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:xn,client:de,selectReceiverTag:async n=>{var r;if(Rt)try{const{currentState:i,...o}=await ve(Rt,n);if(0===o.resultCode)if(wt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await de.postTagChangedEvent(Rt,e.giverTag);0===r.resultCode?(Nt(n),n.emission&&wt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1})):(console.error(r),t(ys).error(ae(bL(r.resultCode))))}else Nt(i),i.emission&&wt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1});else console.error(o,n,null===(r=null==kt?void 0:kt.knownTags)||void 0===r?void 0:r[n]),t(ys).error(ae(bL(o.resultCode)))}catch(e){let n=e;console.error(n),t(ys).error(n.message)}},preview:p,sendOnEnter:hn,setSendOnEnter:fn,microphoneMode:Xe?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:mn,setAttachmentsMenuOpen:gn,instruct:xe,showInputs:f,showMicrophone:!!k,userMessage:gt,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return vt(""),void Ht();vt(e),jt()},sendMessage:e=>{Xt(),an(),Ct(e),vt(""),en()},stopListening:ln,startListening:sn,stopAudio:Xt,resetTranscript:en,listening:yt,isPlayingAudio:tt,customMediaRenderer:D,user:Ce,userAvatar:B,experts:Rn},zn=o&&yn?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:yn}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Fn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:Sn}}):null,Un={canInstruct:!!e.giverTag,instruct:!!xe,onChangeMode:e=>{we("instruct"===e),He(!1),Me(!1)}},jn=(0,s.jsx)(uL,{tenant:I,userLang:ke}),Hn=l||("TOTEM"===Ue?pL:"CHAT"===Ue?hL:"FULLPAGE"===Ue?dL:"WEBSITE_ASSISTANT"===Ue?fL:dL);return(0,s.jsxs)("div",{className:t(gs)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${rt.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":ot,"memori--has-active-session":!!Rt}),"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":Rt,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...kt,sessionID:Rt}),style:{height:x},children:[(0,s.jsx)(Hn,{Header:cL,headerProps:Nn,Avatar:rN,avatarProps:Ln,Chat:am,chatProps:Bn,StartPanel:fm,startPanelProps:Dn,integrationStyle:Fn,integrationBackground:zn,ChangeMode:iN,changeModeProps:Un,poweredBy:jn,sessionId:Rt,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)(fd,{withModal:!0,pwdOrTokens:dt,openModal:!!dt,setPwdOrTokens:pt,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r;t.password&&lt(t.password),t.password&&(kU=t.password),t.tokens&&ut(t.tokens),Dt(!Rt,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,Mt).then((e=>{pt(null),_n(e||void 0)})).catch((()=>{pt(null),Te(!0)}))},minimumNumberOfRecoveryTokens:null!==(se=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==se?se:1}),ce&&(0,s.jsx)(SU,{visible:Tt,minAge:Et,onClose:t=>{var n,r;t?(_t(t),vL("birthDate",t),Dt(!Rt,kU||at||(null==e?void 0:e.secretToken),ct,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=>{It(!1),pt(null),_n(e||void 0)})).catch((()=>{It(!1),Te(!0)}))):(It(!1),Me(!1))}}),Ke&&(0,s.jsx)(EU,{layout:Ue,open:!!Ke,onClose:()=>Je(!1),microphoneMode:Xe?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:Ze,setMicrophoneMode:e=>$e("CONTINUOUS"===e),setContinuousSpeechTimeout:et,controlsPosition:rt,setControlsPosition:it,hideEmissions:ot,setHideEmissions:st,additionalSettings:L})]})};const DU={id:"app.twincreator.com",theme:"twincreator",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},BU=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||{...DU,tenantID:e}}catch(t){return{...DU,tenantID:e}}};function zU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FU(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,WO(r.key),r)}}function UU(e,t,n){return t&&FU(e.prototype,t),n&&FU(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 HU(e,t){return HU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},HU(e,t)}function VU(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&&HU(e,t)}function GU(e,t){if(t&&("object"===VO(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 WU(e){return WU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WU(e)}function qU(e){if(Array.isArray(e))return e}function KU(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function JU(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 QU(e,t){if(e){if("string"==typeof e)return JU(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)?JU(e,t):void 0}}function YU(){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 XU(e){return qU(e)||KU(e)||QU(e)||YU()}function $U(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 ZU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$U(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$U(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ej={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)}},tj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};zU(this,e),this.init(t,n)}return UU(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||ej,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,ZU(ZU({},{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}(),nj=new tj,rj=function(){function e(){zU(this,e),this.observers={}}return UU(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 ij(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function oj(e){return null==e?"":""+e}function sj(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function aj(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 lj(e,t,n){var r=aj(e,t,Object);r.obj[r.k]=n}function cj(e,t){var n=aj(e,t),r=n.obj,i=n.k;if(r)return r[i]}function uj(e,t,n){var r=cj(e,n);return void 0!==r?r:cj(t,n)}function dj(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]):dj(e[r],t[r],n):e[r]=t[r]);return e}function pj(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var hj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function fj(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return hj[e]})):e}var mj="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,gj=[" ",",","?","!",";"];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 yj(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){qO(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}function bj(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=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GU(this,n)}}function Sj(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?Sj(l,c,n):void 0}i=i[r[o]]}return i}}var xj=function(e){VU(n,e);var t=bj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return zU(this,n),r=t.call(this),mj&&rj.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 UU(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=cj(this.data,s);return a||!o||"string"!=typeof n?a:Sj(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),lj(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=cj(this.data,s)||{};r?dj(a,n,i):a=yj(yj({},a),n),lj(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?yj(yj({},{}),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}(rj),wj={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 Cj(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 Aj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ej(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=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GU(this,n)}}var Mj={},_j=function(e){VU(n,e);var t=Ej(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return zU(this,n),r=t.call(this),mj&&rj.call(jU(r)),sj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,jU(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=nj.create("translator"),r}return UU(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=gj.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"!==VO(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,Aj(Aj({},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,Aj(Aj({},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,Aj(Aj({},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,Aj(Aj({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Aj(Aj({},n),{interpolation:Aj(Aj({},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=Aj(Aj({},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=wj.handle(p,e,t,this.options&&this.options.postProcessPassResolved?Aj({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,!Mj["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(Mj["".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}(rj);function Tj(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ij=function(){function e(t){zU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nj.create("languageUtils")}return UU(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]=Tj(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]=Tj(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Tj(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}(),Rj=[{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}],Pj={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)}},kj=["v1","v2","v3"],Oj={zero:0,one:1,two:2,few:3,many:4,other:5};function Nj(){var e={};return Rj.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:Pj[t.fc]}}))})),e}var Lj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};zU(this,e),this.languageUtils=t,this.options=n,this.logger=nj.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=Nj()}return UU(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 Oj[e]-Oj[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!kj.includes(this.options.compatibilityJSON)}}]),e}();function Dj(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 Bj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var zj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};zU(this,e),this.logger=nj.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return UU(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:fj,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?pj(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?pj(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?pj(t.nestingPrefix):t.nestingPrefixEscaped||pj("$t("),this.nestingSuffix=t.nestingSuffix?pj(t.nestingSuffix):t.nestingSuffixEscaped||pj(")"),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=uj(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,Bj(Bj(Bj({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(uj(t,l,s),c,n,Bj(Bj(Bj({},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=oj(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=Bj({},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=Bj(Bj({},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=oj(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,Bj(Bj({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function Fj(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 Uj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fj(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 Hj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};zU(this,e),this.logger=nj.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,Uj(Uj({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:jj((function(e,t){var n=new Intl.DateTimeFormat(e,Uj({},t));return function(e){return n.format(e)}})),relativetime:jj((function(e,t){var n=new Intl.RelativeTimeFormat(e,Uj({},t));return function(e){return n.format(e,t.range||"day")}})),list:jj((function(e,t){var n=new Intl.ListFormat(e,Uj({},t));return function(e){return n.format(e)}}))},this.init(t)}return UU(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=XU(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,Uj(Uj(Uj({},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 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){qO(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}function Wj(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=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GU(this,n)}}var qj=function(e){VU(n,e);var t=Wj(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return zU(this,n),o=t.call(this),mj&&rj.call(jU(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=nj.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 UU(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=aj(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,Gj(Gj({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(rj);function Kj(){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"===VO(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===VO(e[2])||"object"===VO(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 Jj(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 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 Yj(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){qO(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 Xj(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=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GU(this,n)}}function $j(){}function Zj(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var eH=function(e){VU(n,e);var t=Xj(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(zU(this,n),e=t.call(this),mj&&rj.call(jU(e)),e.options=Jj(r),e.services={},e.logger=nj,e.modules={external:[]},Zj(jU(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),GU(e,jU(e));setTimeout((function(){e.init(r,i)}),0)}return e}return UU(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=Kj();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=Yj(Yj(Yj({},r),this.options),Jj(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Yj(Yj({},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?nj.init(i(this.modules.logger),this.options):nj.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Hj);var s=new Ij(this.options);this.store=new xj(this.options.resources,this.options);var a=this.services;a.logger=nj,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new Lj(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 zj(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new qj(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 _j(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=$j),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=ij(),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]:$j,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=ij();return e||(e=this.languages),t||(t=this.options.ns),n||(n=$j),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&&wj.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=ij();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"!==VO(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=Yj({},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=ij();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=ij();"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]:$j,i=Yj(Yj(Yj({},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=Yj({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new _j(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}(rj);qO(eH,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new eH(e,t)}));var tH=eH.createInstance();tH.createInstance=eH.createInstance;var nH,rH=tH.createInstance;tH.init,tH.loadResources,tH.reloadResources,tH.use,tH.changeLanguage,tH.getFixedT,tH.t,tH.exists,tH.setDefaultNamespace,tH.hasLoadedNamespace,tH.loadNamespaces,tH.loadLanguages;nH=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","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.","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","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 iH=rH({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","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.","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","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(nH)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});iH.init();var oH=iH;c=o("85Hg2");function sH(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)(te.Provider,{value:i},r)}const aH=({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,W]=(0,c.useState)(),[q,K]=(0,c.useState)(k),{t:J}=me();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const Q=G(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 BU(o,w);e&&W(e)}),[o,C]);(0,c.useEffect)((()=>{$()}),[$]),(0,c.useEffect)((()=>{if(T)oH.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"}})();oH.changeLanguage(e).catch((()=>{oH.changeLanguage(t)}))}}),[T]);const Z=j?(0,s.jsx)(LU,{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)(sH,{i18n:oH,children:[(0,s.jsx)(ys.Toaster,{position:"top-center",reverseOrder:!0}),Z]})};aH.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 lH=aH;class cH 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(lH.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)(lH,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",cH)})();
246
+ */function eL(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 tL(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 nL(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 rL=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function iL(e){const n=e,{value:r,size:i=QN,level:o=YN,bgColor:s=XN,fgColor:a=$N,includeMargin:l=ZN,style:u,imageSettings:d}=n,p=qN(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=KN.QrCode.encodeText(r,JN[o]).getModules();const c=l?4:0,u=n.length+2*c,p=nL(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=tL(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,rL?t.fill(new Path2D(eL(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=WN({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",WN({style:y,height:i,width:i,ref:f},p)),b)}var oL=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=me(),[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:PN},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${p}`,icon:kN},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${p}`,icon:ON},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${p}`,icon:NN},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${p}`,icon:FN},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${p}`,icon:LN}];return(0,s.jsxs)(Gd,{as:"div",className:t(gs)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(Gd.Button,{className:t(gs)("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)(DN,{})})}),(0,s.jsxs)(Gd.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(Gd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Oa,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(ep,{}),onClick:()=>{p&&navigator.clipboard.writeText(p)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(Gd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(gs)("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)(Gd.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(iL,{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)(Oa,{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)(BN,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var sL=({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 aL=({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 lL=({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 cL=({className:e,memori:n,tenant:r,history:i,position:o,setShowPositionDrawer:a,setShowSettingsDrawer:l,speakerMuted:u,setSpeakerMuted:d,hasUserActivatedSpeak:p=!1,showShare:h=!0,showSettings:f=!0,showSpeaker:m=!0,showReload:g=!1,showClear:v=!1,clearHistory:y})=>{const{t:b}=me(),[S,x]=(0,c.useState)(!1),[w,C]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&x(!0)}),[]),(0,s.jsxs)("div",{className:t(gs)("memori-header",e),children:[g&&(0,s.jsx)(Oa,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:b("reload")||"Reload",icon:(0,s.jsx)(aL,{}),onClick:()=>{window.location.reload()}}),v&&(0,s.jsx)(Oa,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:b("clearHistory")||"Clear chat",icon:(0,s.jsx)(lL,{}),onClick:y}),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)(Oa,{icon:(0,s.jsx)(oN,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>a(!0)})]}),S&&(0,s.jsx)(Oa,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:w?b("fullscreenExit")||"Exit fullscreen":b("fullscreenEnter")||"Enter fullscreen",icon:w?(0,s.jsx)($f,{}):(0,s.jsx)(sL,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),C(!1)):(document.documentElement.requestFullscreen(),C(!0))}}),m&&(0,s.jsx)(Oa,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:u?(0,s.jsx)(sN,{}):(0,s.jsx)(lN,{}),onClick:()=>d(!u),title:b("widget.sound")||"Sound"}),(0,s.jsx)(IN,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!p||0===i.length}),f&&(0,s.jsx)(Oa,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(RN,{}),onClick:()=>l(!0),title:b("widget.settings")||"Settings"}),h&&(0,s.jsx)(oL,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"})]})};var uL=({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"})]})]})};var dL=({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)(Gc,{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 pL=({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)(Gc,{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 hL=({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)(Gc,{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 fL=({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}=me(),[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)(Oa,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>M(!1),title:S("expand")||"Expand",children:(0,s.jsx)(ZO,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(Gc,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Oa,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>M(!0),icon:(0,s.jsx)(Wc,{}),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 mL={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions"},gL=(e,t)=>{var n;const r=window.localStorage.getItem(null!==(n=mL[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}},vL=(e,t)=>{var n;window.localStorage.setItem(null!==(n=mL[e])&&void 0!==n?n:e,t.toString())},yL=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]))),bL=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=yL.get(e);return t?`errors.${t}`:"error.generic"},{deleteSession:SL,getStatistics:xL,initSession:wL}=G(),CL=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,"🧠"]]),AL=e=>{const t=Array.from(CL.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return CL.get(e)}return""},EL=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of CL){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},ML=e=>{let t=0;for(const[n,r]of CL)if(r===e){t=n;break}return t},_L=e=>{const t=Math.round(e),n=AL(t);return{points:t,badge:n,pointsForCurrentBadge:ML(n),nextBadge:EL(n)}};var TL={};function IL(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 RL(e,t,n){return t&&IL(e.prototype,t),n&&IL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function PL(){return PL=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},PL.apply(this,arguments)}function kL(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,NL(e,t)}function OL(e){return OL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},OL(e)}function NL(e,t){return NL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},NL(e,t)}function LL(){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 DL(e,t,n){return DL=LL()?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&&NL(i,n.prototype),i},DL.apply(null,arguments)}function BL(e){var t="function"==typeof Map?new Map:void 0;return BL=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 DL(e,arguments,OL(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),NL(r,e)},BL(e)}function zL(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 FL(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 UL(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 FL(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)?FL(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(TL,"__esModule",{value:!0});var jL=function(e){function t(){return e.apply(this,arguments)||this}return kL(t,e),t}(BL(Error)),HL=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return kL(t,e),t}(jL),VL=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return kL(t,e),t}(jL),GL=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return kL(t,e),t}(jL),WL=function(e){function t(){return e.apply(this,arguments)||this}return kL(t,e),t}(jL),qL=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return kL(t,e),t}(jL),KL=function(e){function t(){return e.apply(this,arguments)||this}return kL(t,e),t}(jL),JL=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return kL(t,e),t}(jL),QL="numeric",YL="short",XL="long",$L={year:QL,month:QL,day:QL},ZL={year:QL,month:YL,day:QL},eD={year:QL,month:YL,day:QL,weekday:YL},tD={year:QL,month:XL,day:QL},nD={year:QL,month:XL,day:QL,weekday:XL},rD={hour:QL,minute:QL},iD={hour:QL,minute:QL,second:QL},oD={hour:QL,minute:QL,second:QL,timeZoneName:YL},sD={hour:QL,minute:QL,second:QL,timeZoneName:XL},aD={hour:QL,minute:QL,hourCycle:"h23"},lD={hour:QL,minute:QL,second:QL,hourCycle:"h23"},cD={hour:QL,minute:QL,second:QL,hourCycle:"h23",timeZoneName:YL},uD={hour:QL,minute:QL,second:QL,hourCycle:"h23",timeZoneName:XL},dD={year:QL,month:QL,day:QL,hour:QL,minute:QL},pD={year:QL,month:QL,day:QL,hour:QL,minute:QL,second:QL},hD={year:QL,month:YL,day:QL,hour:QL,minute:QL},fD={year:QL,month:YL,day:QL,hour:QL,minute:QL,second:QL},mD={year:QL,month:YL,day:QL,weekday:YL,hour:QL,minute:QL},gD={year:QL,month:XL,day:QL,hour:QL,minute:QL,timeZoneName:YL},vD={year:QL,month:XL,day:QL,hour:QL,minute:QL,second:QL,timeZoneName:YL},yD={year:QL,month:XL,day:QL,weekday:XL,hour:QL,minute:QL,timeZoneName:XL},bD={year:QL,month:XL,day:QL,weekday:XL,hour:QL,minute:QL,second:QL,timeZoneName:XL},SD=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new JL},t.formatOffset=function(e,t){throw new JL},t.offset=function(e){throw new JL},t.equals=function(e){throw new JL},RL(e,[{key:"type",get:function(){throw new JL}},{key:"name",get:function(){throw new JL}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new JL}},{key:"isValid",get:function(){throw new JL}}]),e}(),xD=null,wD=function(e){function t(){return e.apply(this,arguments)||this}kL(t,e);var n=t.prototype;return n.offsetName=function(e,t){return BB(e,t.format,t.locale)},n.formatOffset=function(e,t){return jB(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},RL(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===xD&&(xD=new t),xD}}]),t}(SD),CD={};var AD={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var ED={},MD=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}kL(t,e),t.create=function(e){return ED[e]||(ED[e]=new t(e)),ED[e]},t.resetCache=function(){ED={},CD={}},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 BB(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return jB(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,CD[n]||(CD[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"})),CD[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=AD[s];"era"===s?r[l]=a:gB(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(OB({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},RL(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}(SD),_D=["base"],TD=["padTo","floor"],ID={};var RD={};function PD(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=RD[n];return r||(r=new Intl.DateTimeFormat(e,t),RD[n]=r),r}var kD={};var OD={};var ND=null;var LD={};function DD(e,t,n,r){var i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}var BD=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=zL(n,TD);if(!t||Object.keys(r).length>0){var i=PL({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=kD[n];return r||(r=new Intl.NumberFormat(e,t),kD[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 EB(this.floor?Math.floor(e):IB(e,3),this.padTo)},e}(),zD=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&&MD.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=PL({},this.opts);s.timeZone=s.timeZone||r,this.dtf=PD(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?PL({},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}(),FD=function(){function e(e,t,n){this.opts=PL({style:"long"},n),!t&&bB()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=zL(n,_D),i=JSON.stringify([e,r]),o=OD[i];return o||(o=new Intl.RelativeTimeFormat(e,t),OD[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}(),UD={firstDay:1,minimalDays:4,weekend:[6,7]},jD=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=PD(e).resolvedOptions(),r=e}catch(t){var o=e.substring(0,i);n=PD(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||eB.defaultLocale;return new e(s||(o?"en-US":ND||(ND=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||eB.defaultNumberingSystem,r||eB.defaultOutputCalendar,CB(i)||eB.defaultWeekSettings,s)},e.resetCache=function(){ND=null,RD={},kD={},OD={}},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,CB(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(PL({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(PL({},e,{defaultToEN:!1}))},t.months=function(e,t){var n=this;return void 0===t&&(t=!1),DD(this,e,qB,(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=YF.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),DD(this,e,YB,(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=YF.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 DD(this,void 0,(function(){return XB}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[YF.utc(2016,11,13,9),YF.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 DD(this,e,tz,(function(){var n={era:e};return t.eraCache[e]||(t.eraCache[e]=[YF.utc(-40,1,1),YF.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 BD(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new zD(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new FD(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=ID[n];return r||(r=new Intl.ListFormat(e,t),ID[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:SB()?function(e){var t=LD[e];if(!t){var n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,LD[e]=t}return t}(this.locale):UD},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},RL(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}(),HD=null,VD=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}kL(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(zB(n[1],n[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return jB(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},RL(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+jB(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+jB(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===HD&&(HD=new t(0)),HD}}]),t}(SD),GD=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}kL(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},RL(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}(SD);function WD(e,t){if(gB(e)||null===e)return t;if(e instanceof SD)return e;if(function(e){return"string"==typeof e}(e)){var n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?wD.instance:"utc"===n||"gmt"===n?VD.utcInstance:VD.parseSpecifier(n)||MD.create(e)}return vB(e)?VD.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new GD(e)}var qD,KD=function(){return Date.now()},JD="system",QD=null,YD=null,XD=null,$D=60,ZD=null,eB=function(){function e(){}return e.resetCaches=function(){jD.resetCache(),MD.resetCache()},RL(e,null,[{key:"now",get:function(){return KD},set:function(e){KD=e}},{key:"defaultZone",get:function(){return WD(JD,wD.instance)},set:function(e){JD=e}},{key:"defaultLocale",get:function(){return QD},set:function(e){QD=e}},{key:"defaultNumberingSystem",get:function(){return YD},set:function(e){YD=e}},{key:"defaultOutputCalendar",get:function(){return XD},set:function(e){XD=e}},{key:"defaultWeekSettings",get:function(){return ZD},set:function(e){ZD=CB(e)}},{key:"twoDigitCutoffYear",get:function(){return $D},set:function(e){$D=e%100}},{key:"throwOnInvalid",get:function(){return qD},set:function(e){qD=e}}]),e}(),tB=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}(),nB=[0,31,59,90,120,151,181,212,243,273,304,334],rB=[0,31,60,91,121,152,182,213,244,274,305,335];function iB(e,t){return new tB("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function oB(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 sB(e,t,n){return n+(RB(e)?rB:nB)[t-1]}function aB(e,t){var n=RB(e)?rB:nB,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function lB(e,t){return(e-t+7)%7+1}function cB(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=sB(i,o,s),l=lB(oB(i,o,s),n),c=Math.floor((a-l+14-t)/7);return c<1?c=LB(r=i-1,t,n):c>LB(i,t,n)?(r=i+1,c=1):r=i,PL({weekYear:r,weekNumber:c,weekday:l},HB(e))}function uB(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=lB(oB(i,1,t),n),l=PB(i),c=7*o+s-a-7+t;c<1?c+=PB(r=i-1):c>l?(r=i+1,c-=PB(i)):r=i;var u=aB(r,c);return PL({year:r,month:u.month,day:u.day},HB(e))}function dB(e){var t=e.year;return PL({year:t,ordinal:sB(t,e.month,e.day)},HB(e))}function pB(e){var t=e.year,n=aB(t,e.ordinal);return PL({year:t,month:n.month,day:n.day},HB(e))}function hB(e,t){if(!gB(e.localWeekday)||!gB(e.localWeekNumber)||!gB(e.localWeekYear)){if(!gB(e.weekday)||!gB(e.weekNumber)||!gB(e.weekYear))throw new WL("Cannot mix locale-based week fields with ISO-based week fields");return gB(e.localWeekday)||(e.weekday=e.localWeekday),gB(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),gB(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 fB(e){var t=yB(e.year),n=AB(e.month,1,12),r=AB(e.day,1,kB(e.year,e.month));return t?n?!r&&iB("day",e.day):iB("month",e.month):iB("year",e.year)}function mB(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=AB(t,0,23)||24===t&&0===n&&0===r&&0===i,s=AB(n,0,59),a=AB(r,0,59),l=AB(i,0,999);return o?s?a?!l&&iB("millisecond",i):iB("second",r):iB("minute",n):iB("hour",t)}function gB(e){return void 0===e}function vB(e){return"number"==typeof e}function yB(e){return"number"==typeof e&&e%1==0}function bB(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function SB(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function xB(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 wB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function CB(e){if(null==e)return null;if("object"!=typeof e)throw new KL("Week settings must be an object");if(!AB(e.firstDay,1,7)||!AB(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!AB(e,1,7)})))throw new KL("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function AB(e,t,n){return yB(e)&&e>=t&&e<=n}function EB(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function MB(e){return gB(e)||null===e||""===e?void 0:parseInt(e,10)}function _B(e){return gB(e)||null===e||""===e?void 0:parseFloat(e)}function TB(e){if(!gB(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function IB(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function RB(e){return e%4==0&&(e%100!=0||e%400==0)}function PB(e){return RB(e)?366:365}function kB(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?RB(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function OB(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 NB(e,t,n){return-lB(oB(e,1,t),n)+t-1}function LB(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=NB(e,t,n),i=NB(e+1,t,n);return(PB(e)-r+i)/7}function DB(e){return e>99?e:e>eB.twoDigitCutoffYear?1900+e:2e3+e}function BB(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=PL({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 zB(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 FB(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new KL("Invalid unit value "+e);return t}function UB(e,t){var n={};for(var r in e)if(wB(e,r)){var i=e[r];if(null==i)continue;n[t(r)]=FB(i)}return n}function jB(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+EB(n,2)+":"+EB(r,2);case"narrow":return""+i+n+(r>0?":"+r:"");case"techie":return""+i+EB(n,2)+EB(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function HB(e){return function(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}(e,["hour","minute","second","millisecond"])}var VB=["January","February","March","April","May","June","July","August","September","October","November","December"],GB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],WB=["J","F","M","A","M","J","J","A","S","O","N","D"];function qB(e){switch(e){case"narrow":return[].concat(WB);case"short":return[].concat(GB);case"long":return[].concat(VB);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"],JB=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],QB=["M","T","W","T","F","S","S"];function YB(e){switch(e){case"narrow":return[].concat(QB);case"short":return[].concat(JB);case"long":return[].concat(KB);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var XB=["AM","PM"],$B=["Before Christ","Anno Domini"],ZB=["BC","AD"],ez=["B","A"];function tz(e){switch(e){case"narrow":return[].concat(ez);case"short":return[].concat(ZB);case"long":return[].concat($B);default:return null}}function nz(e,t){for(var n,r="",i=UL(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var rz={D:$L,DD:ZL,DDD:tD,DDDD:nD,t:rD,tt:iD,ttt:oD,tttt:sD,T:aD,TT:lD,TTT:cD,TTTT:uD,f:dD,ff:hD,fff:gD,ffff:yD,F:pD,FF:fD,FFF:vD,FFFF:bD},iz=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 rz[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,PL({},this.opts,t)).format()},t.dtFormatter=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,PL({},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 EB(e,t);var n=PL({},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 XB[e.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function(e,n){return i?function(e,t){return qB(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 YB(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 tz(t)[e.year<0?0:1]}(t,e):s({era:e},"era")};return nz(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 nz(s,(r=l,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),oz=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function sz(){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 az(){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[PL({},r,a),l||i,c]}),[{},null,1]).slice(0,2)}}function lz(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 cz(){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]]=MB(e[n+r]);return[i,null,n+r]}}var uz=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,dz=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,pz=RegExp(""+dz.source+("(?:"+uz.source+"?(?:\\[("+oz.source+")\\])?)?")),hz=RegExp("(?:T"+pz.source+")?"),fz=cz("weekYear","weekNumber","weekDay"),mz=cz("year","ordinal"),gz=RegExp(dz.source+" ?(?:"+uz.source+"|("+oz.source+"))?"),vz=RegExp("(?: "+gz.source+")?");function yz(e,t,n){var r=e[t];return gB(r)?n:MB(r)}function bz(e,t){return[{hours:yz(e,t,0),minutes:yz(e,t+1,0),seconds:yz(e,t+2,0),milliseconds:TB(e[t+3])},null,t+4]}function Sz(e,t){var n=!e[t]&&!e[t+1],r=zB(e[t+1],e[t+2]);return[{},n?null:VD.instance(r),t+3]}function xz(e,t){return[{},e[t]?MD.create(e[t]):null,t+1]}var wz=RegExp("^T?"+dz.source+"$"),Cz=/^-?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 Az(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(_B(n)),months:p(_B(r)),weeks:p(_B(i)),days:p(_B(o)),hours:p(_B(s)),minutes:p(_B(a)),seconds:p(_B(l),"-0"===l),milliseconds:p(TB(c),d)}]}var Ez={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Mz(e,t,n,r,i,o,s){var a={year:2===t.length?DB(MB(t)):MB(t),month:GB.indexOf(n)+1,day:MB(r),hour:MB(i),minute:MB(o)};return s&&(a.second=MB(s)),e&&(a.weekday=e.length>3?KB.indexOf(e)+1:JB.indexOf(e)+1),a}var _z=/^(?:(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 Tz(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=Mz(n,o,i,r,s,a,l);return t=c?Ez[c]:u?0:zB(d,p),[h,new VD(t)]}var Iz=/^(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$/,Rz=/^(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$/,Pz=/^(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 kz(e){var t=e[1],n=e[2],r=e[3];return[Mz(t,e[4],r,n,e[5],e[6],e[7]),VD.utcInstance]}function Oz(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],s=e[6];return[Mz(t,e[7],n,r,i,o,s),VD.utcInstance]}var Nz=sz(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,hz),Lz=sz(/(\d{4})-?W(\d\d)(?:-?(\d))?/,hz),Dz=sz(/(\d{4})-?(\d{3})/,hz),Bz=sz(pz),zz=az((function(e,t){return[{year:yz(e,t),month:yz(e,t+1,1),day:yz(e,t+2,1)},null,t+3]}),bz,Sz,xz),Fz=az(fz,bz,Sz,xz),Uz=az(mz,bz,Sz,xz),jz=az(bz,Sz,xz);var Hz=az(bz);var Vz=sz(/(\d{4})-(\d\d)-(\d\d)/,vz),Gz=sz(gz),Wz=az(bz,Sz,xz);var qz="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}},Jz=PL({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),Qz=365.2425,Yz=30.436875,Xz=PL({years:{quarters:4,months:12,weeks:52.1775,days:Qz,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:Yz,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Kz),$z=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Zz=$z.slice(0).reverse();function eF(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:PL({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new rF(r)}function tF(e,t){for(var n,r,i=null!=(n=t.milliseconds)?n:0,o=UL(Zz.slice(1));!(r=o()).done;){var s=r.value;t[s]&&(i+=t[s]*e[s].milliseconds)}return i}function nF(e,t){var n=tF(e,t)<0?-1:1;$z.reduceRight((function(r,i){if(gB(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),$z.reduce((function(n,r){if(gB(t[r]))return n;if(n){var i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r}),null)}var rF=function(e){function t(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Xz:Jz;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||jD.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:UB(e,t.normalizeUnit),loc:jD.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},t.fromDurationLike=function(e){if(vB(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 lz(e,[Cz,Az])}(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 lz(e,[wz,Hz])}(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 tB?e:new tB(e,n);if(eB.throwOnInvalid)throw new GL(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 qL(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=PL({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?iz.create(this.loc,n).formatDurationFromString(this,e):qz},n.toHuman=function(e){var t=this;if(void 0===e&&(e={}),!this.isValid)return qz;var n=$z.map((function(n){var r=t.values[n];return gB(r)?null:t.loc.numberFormatter(PL({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(PL({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},n.toObject=function(){return this.isValid?PL({},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+=IB(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=PL({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),YF.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?tF(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=$z;i<o.length;i++){var s=o[i];(wB(n.values,s)||wB(this.values,s))&&(r[s]=n.get(s)+this.get(s))}return eF(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]=FB(e(this.values[i],i))}return eF(this,{values:t},!0)},n.get=function(e){return this[t.normalizeUnit(e)]},n.set=function(e){return this.isValid?eF(this,{values:PL({},this.values,UB(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 eF(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 nF(this.matrix,e),eF(this,{values:e},!0)},n.rescale=function(){return this.isValid?eF(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=$z;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;vB(a[u])&&(d+=a[u]);var h=Math.trunc(d);o[u]=h,s[u]=(1e3*d-1e3*h)/1e3}else vB(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 nF(this.matrix,o),eF(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 eF(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=$z;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},RL(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")),iF="Invalid Interval";var oF=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 tB?e:new tB(e,n);if(eB.throwOnInvalid)throw new VL(r);return new t({invalid:r})},t.fromDateTimes=function(e,n){var r=XF(e),i=XF(n),o=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?oF.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:oF.invalid("missing or invalid end"):oF.invalid("missing or invalid start")}(r,i);return null==o?new t({start:r,end:i}):o},t.after=function(e,n){var r=rF.fromDurationLike(n),i=XF(e);return t.fromDateTimes(i,i.plus(r))},t.before=function(e,n){var r=rF.fromDurationLike(n),i=XF(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=YF.fromISO(i,n)).isValid}catch(e){a=!1}try{c=(l=YF.fromISO(o,n)).isValid}catch(e){c=!1}if(a&&c)return t.fromDateTimes(s,l);if(a){var u=rF.fromISO(o,n);if(u.isValid)return t.after(s,u)}else if(c){var d=rF.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(XF).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=rF.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=UL(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()+")":iF},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=$L),void 0===t&&(t={}),this.isValid?iz.create(this.s.loc.clone(t),e).formatInterval(this):iF},n.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):iF},n.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():iF},n.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):iF},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):iF},n.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):rF.invalid(this.invalidReason)},n.mapEndpoints=function(e){return t.fromDateTimes(e(this.s),e(this.e))},RL(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")),sF=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=eB.defaultZone);var t=YF.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return MD.isValidZone(e)},e.normalizeZone=function(e){return WD(e,eB.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)||jD.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)||jD.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)||jD.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||jD.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||jD.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)||jD.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)||jD.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 jD.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 jD.create(r,null,"gregory").eras(e)},e.features=function(){return{relative:bB(),localeWeek:SB()}},e}();function aF(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=n(t)-n(e);return Math.floor(rF.fromMillis(r).as("days"))}function lF(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=aF(e,t);return(n-n%7)/7}],["days",aF]],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=rF.fromObject(s,r);return u.length>0?(p=rF.fromMillis(c,r)).shiftTo.apply(p,u).plus(h):h}var cF={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},uF={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]},dF=cF.hanidec.replace(/[\[|\]]/g,"").split("");function pF(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+cF[n||"latn"]+t)}function hF(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(cF.hanidec))t+=dF.indexOf(e[n]);else for(var i in uF){var o=uF[i],s=o[0],a=o[1];r>=s&&r<=a&&(t+=r-s)}}return parseInt(t,10)}return t}(n))}}}var fF="[ "+String.fromCharCode(160)+"]",mF=new RegExp(fF,"g");function gF(e){return e.replace(/\./g,"\\.?").replace(mF,fF)}function vF(e){return e.replace(/\./g,"").replace(mF," ").toLowerCase()}function yF(e,t){return null===e?null:{regex:RegExp(e.map(gF).join("|")),deser:function(n){var r=n[0];return e.findIndex((function(e){return vF(r)===vF(e)}))+t}}}function bF(e,t){return{regex:e,deser:function(e){return zB(e[1],e[2])},groups:t}}function SF(e){return{regex:e,deser:function(e){return e[0]}}}var xF={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 wF=null;function CF(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=EF(iz.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function AF(e,t,n){var r=CF(iz.parseFormat(n),e),i=r.map((function(t){return n=t,i=pF(r=e),o=pF(r,"{2}"),s=pF(r,"{3}"),a=pF(r,"{4}"),l=pF(r,"{6}"),c=pF(r,"{1,2}"),u=pF(r,"{1,3}"),d=pF(r,"{1,6}"),p=pF(r,"{1,9}"),h=pF(r,"{2,4}"),f=pF(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 yF(r.eras("short"),0);case"GG":return yF(r.eras("long"),0);case"y":return hF(d);case"yy":case"kk":return hF(h,DB);case"yyyy":case"kkkk":return hF(a);case"yyyyy":return hF(f);case"yyyyyy":return hF(l);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return hF(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return hF(o);case"MMM":return yF(r.months("short",!0),1);case"MMMM":return yF(r.months("long",!0),1);case"LLL":return yF(r.months("short",!1),1);case"LLLL":return yF(r.months("long",!1),1);case"o":case"S":return hF(u);case"ooo":case"SSS":return hF(s);case"u":return SF(p);case"uu":return SF(c);case"uuu":case"E":case"c":return hF(i);case"a":return yF(r.meridiems(),0);case"EEE":return yF(r.weekdays("short",!1),1);case"EEEE":return yF(r.weekdays("long",!1),1);case"ccc":return yF(r.weekdays("short",!0),1);case"cccc":return yF(r.weekdays("long",!0),1);case"Z":case"ZZ":return bF(new RegExp("([+-]"+c.source+")(?::("+o.source+"))?"),2);case"ZZZ":return bF(new RegExp("([+-]"+c.source+")("+o.source+")?"),2);case"z":return SF(/[a-z_+-/]{1,256}?/i);case" ":return SF(/[^\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(wB(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;gB(e.z)||(n=MD.create(e.z)),gB(e.Z)||(n||(n=new VD(e.Z)),t=e.Z),gB(e.q)||(e.M=3*(e.q-1)+1),gB(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),gB(e.u)||(e.S=TB(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(wB(p,"a")&&wB(p,"H"))throw new WL("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 EF(e,t){if(!e)return null;var n=iz.create(t,e).dtFormatter((wF||(wF=YF.fromMillis(1555555555555)),wF)),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=xF[a];if("object"==typeof l&&(l=l[s]),l)return{literal:!1,val:l}}(t,e,i)}))}var MF="Invalid DateTime",_F=864e13;function TF(e){return new tB("unsupported zone",'the zone "'+e.name+'" is not supported')}function IF(e){return null===e.weekData&&(e.weekData=cB(e.c)),e.weekData}function RF(e){return null===e.localWeekData&&(e.localWeekData=cB(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function PF(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new YF(PL({},n,t,{old:n}))}function kF(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 OF(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 NF(e,t,n){return kF(OB(e),t,n)}function LF(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=PL({},e.c,{year:r,month:i,day:Math.min(e.c.day,kB(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=rF.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=kF(OB(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 DF(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=YF.fromObject(e,PL({},n,{zone:l,specificOffset:o}));return s?c:c.setZone(a)}return YF.invalid(new tB("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function BF(e,t,n){return void 0===n&&(n=!0),e.isValid?iz.create(jD.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function zF(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=EB(e.c.year,n?6:4),t?(r+="-",r+=EB(e.c.month),r+="-",r+=EB(e.c.day)):(r+=EB(e.c.month),r+=EB(e.c.day)),r}function FF(e,t,n,r,i,o){var s=EB(e.c.hour);return t?(s+=":",s+=EB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=":")):s+=EB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=EB(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=EB(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?s+="Z":e.o<0?(s+="-",s+=EB(Math.trunc(-e.o/60)),s+=":",s+=EB(Math.trunc(-e.o%60))):(s+="+",s+=EB(Math.trunc(e.o/60)),s+=":",s+=EB(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}var UF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},jF={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},HF={ordinal:1,hour:0,minute:0,second:0,millisecond:0},VF=["year","month","day","hour","minute","second","millisecond"],GF=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],WF=["year","ordinal","hour","minute","second","millisecond"];function qF(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 qL(e);return t}(e)}}function KF(e,t){var n,r,i=WD(t.zone,eB.defaultZone),o=jD.fromObject(t),s=eB.now();if(gB(e.year))n=s;else{for(var a=0,l=VF;a<l.length;a++){var c=l[a];gB(e[c])&&(e[c]=UF[c])}var u=fB(e)||mB(e);if(u)return YF.invalid(u);var d=NF(e,i.offset(s),i);n=d[0],r=d[1]}return new YF({ts:n,zone:i,loc:o,o:r})}function JF(e,t,n){var r=!!gB(n.round)||n.round,i=function(e,i){return e=IB(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=UL(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 QF(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 YF=function(e){function t(e){var t=e.zone||eB.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new tB("invalid input"):null)||(t.isValid?null:TF(t));this.ts=gB(e.ts)?eB.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=OF(this.ts,s),r=(n=Number.isNaN(r.year)?new tB("invalid input"):null)?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||jD.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=QF(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=QF(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=VD.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=WD(n.zone,eB.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:jD.fromObject(n)}):t.invalid(TF(i))},t.fromMillis=function(e,n){if(void 0===n&&(n={}),vB(e))return e<-864e13||e>_F?t.invalid("Timestamp out of range"):new t({ts:e,zone:WD(n.zone,eB.defaultZone),loc:jD.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={}),vB(e))return new t({ts:1e3*e,zone:WD(n.zone,eB.defaultZone),loc:jD.fromObject(n)});throw new KL("fromSeconds requires a numerical input")},t.fromObject=function(e,n){void 0===n&&(n={}),e=e||{};var r=WD(n.zone,eB.defaultZone);if(!r.isValid)return t.invalid(TF(r));var i=jD.fromObject(n),o=UB(e,qF),s=hB(o,i),a=s.minDaysInFirstWeek,l=s.startOfWeek,c=eB.now(),u=gB(n.specificOffset)?r.offset(c):n.specificOffset,d=!gB(o.ordinal),p=!gB(o.year),h=!gB(o.month)||!gB(o.day),f=p||h,m=o.weekYear||o.weekNumber;if((f||d)&&m)throw new WL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&d)throw new WL("Can't mix ordinal dates with month/day");var g,v,y=m||o.weekday&&!f,b=OF(c,u);y?(g=GF,v=jF,b=cB(b,a,l)):d?(g=WF,v=HF,b=dB(b)):(g=VF,v=UF);for(var S,x=!1,w=UL(g);!(S=w()).done;){var C=S.value;gB(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=yB(e.weekYear),i=AB(e.weekNumber,1,LB(e.weekYear,t,n)),o=AB(e.weekday,1,7);return r?i?!o&&iB("weekday",e.weekday):iB("week",e.weekNumber):iB("weekYear",e.weekYear)}(o,a,l):d?function(e){var t=yB(e.year),n=AB(e.ordinal,1,PB(e.year));return t?!n&&iB("ordinal",e.ordinal):iB("year",e.year)}(o):fB(o),E=A||mB(o);if(E)return t.invalid(E);var M=NF(y?uB(o,a,l):d?pB(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 lz(e,[Nz,zz],[Lz,Fz],[Dz,Uz],[Bz,jz])}(e);return DF(n[0],n[1],t,"ISO 8601",e)},t.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return lz(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[_z,Tz])}(e);return DF(n[0],n[1],t,"RFC 2822",e)},t.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return lz(e,[Iz,kz],[Rz,kz],[Pz,Oz])}(e);return DF(n[0],n[1],t,"HTTP",t)},t.fromFormat=function(e,n,r){if(void 0===r&&(r={}),gB(e)||gB(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=AF(e,t,n);return[r.result,r.zone,r.specificOffset,r.invalidReason]}(jD.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):DF(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 lz(e,[Vz,zz],[Gz,Wz])}(e);return DF(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 tB?e:new tB(e,n);if(eB.throwOnInvalid)throw new HL(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=EF(e,jD.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={}),CF(iz.parseFormat(e),jD.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=OB(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=OF(a,o),u=OF(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[PF(this,{ts:a}),PF(this,{ts:l})]:[this]},n.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=iz.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(VD.instance(e),t)},n.toLocal=function(){return this.setZone(eB.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=WD(e,eB.defaultZone)).equals(this.zone))return this;if(e.isValid){var l=this.ts;if(o||a){var c=e.offset(this.ts);l=NF(this.toObject(),c,e)[0]}return PF(this,{ts:l,zone:e})}return t.invalid(TF(e))},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return PF(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=UB(e,qF),r=hB(n,this.loc),i=r.minDaysInFirstWeek,o=r.startOfWeek,s=!gB(n.weekYear)||!gB(n.weekNumber)||!gB(n.weekday),a=!gB(n.ordinal),l=!gB(n.year),c=!gB(n.month)||!gB(n.day),u=l||c,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new WL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new WL("Can't mix ordinal dates with month/day");s?t=uB(PL({},cB(this.c,i,o),n),i,o):gB(n.ordinal)?(t=PL({},this.toObject(),n),gB(n.day)&&(t.day=Math.min(kB(t.year,t.month),t.day))):t=pB(PL({},dB(this.c),n));var p=NF(t,this.o,this.zone);return PF(this,{ts:p[0],o:p[1]})},n.plus=function(e){return this.isValid?PF(this,LF(this,rF.fromDurationLike(e))):this},n.minus=function(e){return this.isValid?PF(this,LF(this,rF.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=rF.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?iz.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):MF},n.toLocaleString=function(e,t){return void 0===e&&(e=$L),void 0===t&&(t={}),this.isValid?iz.create(this.loc.clone(t),e).formatDateTime(this):MF},n.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?iz.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=zF(this,p);return h+="T",h+=FF(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?zF(this,"extended"===n):null},n.toISOWeekDate=function(){return BF(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":"")+FF(this,"extended"===h,o,r,a,d):null},n.toRFC2822=function(){return BF(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},n.toHTTP=function(){return BF(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},n.toSQLDate=function(){return this.isValid?zF(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")),BF(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():MF},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=PL({},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 rF.invalid("created by diffing an invalid DateTime");var r,i=PL({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(rF.normalizeUnit),s=e.valueOf()>this.valueOf(),a=lF(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?oF.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),JF(n,this.plus(r),PL({},e,{numeric:"always",units:i,unit:o}))},n.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?JF(e.base||t.fromObject({},{zone:this.zone}),this,PL({},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 xB(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 xB(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 AF(jD.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)},RL(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?IF(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?IF(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?IF(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?RF(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?RF(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?RF(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?dB(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?sF.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?sF.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?sF.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?sF.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 RB(this.year)}},{key:"daysInMonth",get:function(){return kB(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?PB(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?LB(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?LB(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return $L}},{key:"DATE_MED",get:function(){return ZL}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return eD}},{key:"DATE_FULL",get:function(){return tD}},{key:"DATE_HUGE",get:function(){return nD}},{key:"TIME_SIMPLE",get:function(){return rD}},{key:"TIME_WITH_SECONDS",get:function(){return iD}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return oD}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return sD}},{key:"TIME_24_SIMPLE",get:function(){return aD}},{key:"TIME_24_WITH_SECONDS",get:function(){return lD}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return cD}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return uD}},{key:"DATETIME_SHORT",get:function(){return dD}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return pD}},{key:"DATETIME_MED",get:function(){return hD}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return fD}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return mD}},{key:"DATETIME_FULL",get:function(){return gD}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return vD}},{key:"DATETIME_HUGE",get:function(){return yD}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return bD}}]),t}(Symbol.for("nodejs.util.inspect.custom"));function XF(e){if(YF.isDateTime(e))return e;if(e&&e.valueOf&&vB(e.valueOf()))return YF.fromJSDate(e);if(e&&"object"==typeof e)return YF.fromObject(e);throw new KL("Unknown datetime argument: "+e+", of type "+typeof e)}TL.DateTime=YF,TL.Duration=rF,TL.FixedOffsetZone=VD,TL.IANAZone=MD,TL.Info=sF,TL.Interval=oF,TL.InvalidZone=GD,TL.Settings=eB,TL.SystemZone=wD,TL.VERSION="3.4.4",TL.Zone=SD;c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function $F(e,t){let[n,r]=(0,c.useState)(e),i=Xa(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||{}),eU=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(eU||{}),tU=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(tU||{}),nU=(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))(nU||{});function rU(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=Yl(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 iU={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 Na(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=rU(e),i=Ed(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=rU(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;Na(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=rU(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},oU=(0,c.createContext)(null);function sU(e){let t=(0,c.useContext)(oU);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,sU),t}return t}function aU(e,t){return Na(t.type,iU,e,t)}oU.displayName="ListboxContext";let lU=c.Fragment,cU=ja((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=rl(n),[m,g]=Ff(r,s,i),v=(0,c.useReducer)(aU,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:el("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=>Na(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]),Ic([x,S],((e,t)=>{var n;w({type:1}),ql(t,Wl.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(oU.Provider,{value:v},t(c).createElement(Ka,{value:Na(y,{0:Wa.Open,1:Wa.Closed})},null!=o&&null!=m&&Lf({[o]:m}).map((([e,n])=>t(c).createElement(Bl,{features:Dl.Hidden,...Ha({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),za({ourProps:A,theirProps:p,slot:C,defaultTag:lU,name:"Listbox"})))})),uU=ja((function(e,t){var n;let[r,i]=sU("Listbox.Button"),o=rl(r.buttonRef,t),s=`headlessui-listbox-button-${Ll()}`,a=pl(),l=el((e=>{switch(e.key){case Rl.Space:case Rl.Enter:case Rl.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Ad.First})}));break;case Rl.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Ad.Last})}))}})),u=el((e=>{if(e.key===Rl.Space)e.preventDefault()})),d=el((e=>{if(Pl(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=$F((()=>{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 za({ourProps:{ref:o,id:s,type:Td(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"})})),dU=ja((function(e,t){let[n]=sU("Listbox.Label"),r=`headlessui-listbox-label-${Ll()}`;return za({ourProps:{ref:rl(n.labelRef,t),id:r,onClick:el((()=>{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"})})),pU=Da.RenderStrategy|Da.Static,hU=ja((function(e,t){var n;let[r,i]=sU("Listbox.Options"),o=rl(r.optionsRef,t),s=`headlessui-listbox-options-${Ll()}`,a=pl(),l=pl(),u=qa(),d=null!==u?u===Wa.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=zl(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let p=el((e=>{switch(l.dispose(),e.key){case Rl.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case Rl.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}),sl().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case Na(r.orientation,{vertical:Rl.ArrowDown,horizontal:Rl.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ad.Next});case Na(r.orientation,{vertical:Rl.ArrowUp,horizontal:Rl.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ad.Previous});case Rl.Home:case Rl.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ad.First});case Rl.End:case Rl.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Ad.Last});case Rl.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 Rl.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),h=$F((()=>{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 za({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:pU,visible:d,name:"Listbox.Options"})})),fU=ja((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=sU("Listbox.Option"),a=`headlessui-listbox-option-${Ll()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,p=Na(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),h=(0,c.useRef)(null),f=rl(t,h);Qa((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=sl();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=el((()=>o.propsRef.current.onChange(r)));Qa((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=el((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),sl().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=el((()=>{if(n)return s({type:4,focus:Ad.Nothing});s({type:4,focus:Ad.Specific,id:a})})),b=el((()=>{n||l||s({type:4,focus:Ad.Specific,id:a,trigger:0})})),S=el((()=>{n||!l||s({type:4,focus:Ad.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:p,disabled:n})),[l,p,n]);return za({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"})})),mU=Object.assign(cU,{Button:uU,Label:dU,Options:hU,Option:fU});var gU=({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 vU={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"]},yU=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=me(),[o,a]=(0,c.useState)(e?"string"==typeof e?TL.DateTime.fromISO(e):TL.DateTime.fromJSDate(e):TL.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)(mU,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(mU.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(mU.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)(gU,{})})]}),(0,s.jsx)(Tl,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(mU.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(mU.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)(mU,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(mU.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(mU.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:vU["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(gU,{})})]}),(0,s.jsx)(Tl,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(mU.Options,{className:"memori--date-selector__select-options",children:vU["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(mU.Option,{className:"memori--date-selector__select-option",value:o.set({month:vU["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)(mU,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(mU.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(mU.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)(gU,{})})]}),(0,s.jsx)(Tl,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(mU.Options,{className:"memori--date-selector__select-options",children:[...Array(TL.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(mU.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));yU.displayName="DateSelector";var bU=yU;c=o("85Hg2");var SU=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=me(),[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(ys).error(i("requiredField")),u(i("requiredField")||"Required field"),void p(!1);if(TL.DateTime.now().diff(o,"years").years<r)return t(ys).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)(qc,{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)(bU,{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)(Oa,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var xU=({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)(Tl,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(Vc,{open:e,onClose:n,className:t(gs)("memori-drawer",r),children:[(0,s.jsx)(Tl.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)(Tl.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)(Vc.Panel,{className:t(gs)("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)(Oa,{shape:"circle",outlined:!0,icon:(0,s.jsx)(Wc,{}),onClick:()=>n(!1)})}),(0,s.jsxs)(Gc,{spinning:u,children:[i&&(0,s.jsx)(Vc.Title,{className:"memori-drawer--title",children:i}),o&&(0,s.jsx)(Vc.Description,{className:"memori-drawer--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-drawer--footer",children:l})]})]})})})})]})});var wU=({label:e,className:n,disabled:r=!1,checked:i,children:o,onChange:a,name:l,...c})=>(0,s.jsxs)("label",{className:t(gs)("memori-checkbox",n,{"memori-checkbox--disabled":r}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",...c,name:l,disabled:r,defaultChecked:i,className:"memori-checkbox--input",onChange:a}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]});c=o("85Hg2");var CU=({className:e,value:n,displayValue:r,options:i,onChange:o,disabled:a=!1,label:l,placeholder:u})=>(0,s.jsx)("div",{className:t(gs)("memori-select",e),children:(0,s.jsxs)(mU,{value:n,onChange:e=>{o(e)},disabled:a,name:"day",children:[(0,s.jsxs)(mU.Label,{className:"memori-select--label",children:[l,":"]}),(0,s.jsxs)(mU.Button,{"aria-label":l,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(gs)("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)(gU,{})})]}),(0,s.jsx)(Tl,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(mU.Options,{className:"memori-select--options",children:i.map((e=>(0,s.jsx)(mU.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const AU=[2,3,5,10,15,20,30,60];var EU=({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}=me();return(0,s.jsxs)(xU,{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)(Qf,{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),vL("microphoneMode",t)},children:[(0,s.jsx)(Qf.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Oa,{primary:e,children:h("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)(Qf.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Oa,{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)(CU,{label:h("write_and_speak.secondsLabel")||"Seconds",placeholder:h("write_and_speak.secondsLabel")||"Seconds",options:AU.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),vL("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)(Qf,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),vL("controlsPosition",e)},children:[(0,s.jsx)(Qf.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Oa,{primary:e,children:h("center")||"Center"})}),(0,s.jsx)(Qf.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Oa,{primary:e,children:h("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(wU,{label:h("write_and_speak.hideEmissionsLabel"),name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),vL("hideEmissions",e.target.checked)}})})]}),p&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:p})]})};const MU=(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 _U,TU,IU,RU,PU,kU;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=MU,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>MU(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),MU(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 OU=!1,NU=!1;var LU=({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,W,q,K,J,Q,Y,X,$,Z,ee,te,ne,re,ie,oe,se;const{t:ae,i18n:le}=me(),[ce,ue]=(0,c.useState)(!1);(0,c.useEffect)((()=>{ue(!0)}),[]);const de=G(A),{initSession:pe,postTextEnteredEvent:he,postPlaceChangedEvent:fe,postTimeoutEvent:ge,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===(W=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===W?void 0:W.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)(2),[tt,nt]=(0,c.useState)(!1),[rt,it]=(0,c.useState)("center"),[ot,st]=(0,c.useState)(!1);(0,c.useEffect)((()=>{nt(!!IU),NU=!!IU}),[IU]),(0,c.useEffect)((()=>{let e="bottom",t=gL("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",Ye(gL("muteSpeaker",!1)),OU=gL("muteSpeaker",!1),$e("CONTINUOUS"===t),et(gL("continuousSpeechTimeout",2)),it(gL("controlsPosition",e)),st(gL("hideEmissions",!1))}),[]);const[at,lt]=(0,c.useState)(w),[ct,ut]=(0,c.useState)(),[dt,pt]=(0,c.useState)(null),[ht,ft]=(0,c.useState)(),mt=async(e,t)=>{var n;const r=null!=t?t:Rt;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&&Nt({...kt,...t})}},[gt,vt]=(0,c.useState)(""),[yt,bt]=(0,c.useState)(!1),[St,xt]=(0,c.useState)([]),wt=e=>{xt((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:[]}]}))},Ct=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,p,h,f;const m=i||Rt||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||wt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Rt?!!i&&i!==Rt:!!i}),Be(!0),Fe(l);let g=n,v=!1;if(o&&!xe&&Pe&&ke.toUpperCase()!==Ie.toUpperCase()){g=(await sp(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==kt?void 0:kt.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await ve(m,e.giverTag);0===i.resultCode?(Nt(r),n&&(wt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),Yt(n))):(console.error(b,i),t(ys).error(ae(bL(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?(Nt(r),n&&(wt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),Yt(n))):(console.error(b,i),t(ys).error(ae(bL(i.resultCode))),v=!0)}else console.error(b,i),t(ys).error(ae(bL(i.resultCode))),v=!0}else ke.toLowerCase()!==Ie.toLowerCase()&&n&&!xe&&Pe?At(y,ke).then((e=>{e.emission&&Yt(e.emission)})):(Nt({...y,emission:n}),n&&(wt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,generatedByAI:!!y.completion}),Yt(n)))}else 404===b.resultCode&&(xt((e=>[...e.slice(0,e.length-1)])),Dt(!1,at||e.secretToken,ct,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((()=>{Ct(n,r,null==e?void 0:e.sessionID)}),500)})));u||(Fe(void 0),Be(!1))},At=async(e,t)=>{var n,r,i;const o=null!==(n=e.emission)&&void 0!==n?n:null==kt?void 0:kt.emission;let s={...e},a=null;if(o&&!xe&&Ie.toUpperCase()!==t.toUpperCase()&&Pe){const n=await sp(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 sp(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==kt?void 0:kt.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 Nt(s),a&&wt(a),s},Et=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[Mt,_t]=(0,c.useState)(),[Tt,It]=(0,c.useState)(!1),[Rt,Pt]=(0,c.useState)(T),[kt,Ot]=(0,c.useState)(),Nt=e=>{var t;Ot(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)}}))},Lt=async n=>{var r,i,o,s,a;let l=gL("birthDate",void 0);if(Mt||l||!Et)if("PUBLIC"===e.privacyType||e.secretToken||at||ct){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:Tn)&&void 0!==a?a:P,language:qt(ke),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Pt(c.sessionID),ht&&mt(ht,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(ys).error(ae("underageTwinSession",{age:Et})),Te(!0)):403===(null==c?void 0:c.resultCode)?(lt(void 0),pt("password")):(console.error(c),t(ys).error(ae(bL(null==c?void 0:c.resultCode))),Te(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else pt("password");else It(!0)},Dt=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,p,h,f;Le(!0);try{let m,g=gL("birthDate",void 0);if(!c&&!g&&Et)return void It(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||at||i||ct))return void pt("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||at||e.secretToken,recoveryTokens:i||ct,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:Tn)&&void 0!==f?f:P,language:qt(ke),referral:m}});if(v&&y&&0===b.resultCode)return Pt(v),n&&(Nt(y),y.emission&&(St.length<=1?xt([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}]):wt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}))),ht&&mt(ht,v),Le(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(ys).error(ae("underageTwinSession",{age:Et})),Te(!0)):403===(null==b?void 0:b.resultCode)?(lt(void 0),pt("password")):(console.error(b),t(ys).error(ae(bL(b.resultCode))),Te(!0))}catch(e){console.error(e)}return Le(!1),null},Bt=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:lp);if(0===u){let d=0;if(r!==lp&&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=gL("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}Lt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:w||at||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:Mt||n||void 0,additionalInfo:{...N||{},loginToken:null!==(c=null!==(l=null==N?void 0:N.loginToken)&&void 0!==l?l:Tn)&&void 0!==c?c:P,language:qt(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)((()=>()=>{kt&&(null==kt?void 0:kt.currentTag)===e.giverTag||(async()=>{Rt&&e.giverTag&&e.giverPIN&&(xt([]),await Bt(e.engineMemoriID,Rt,e.giverTag,e.giverPIN))})()}),[]);const[zt,Ft]=(0,c.useState)(),Ut=(0,c.useRef)(),jt=()=>{zt&&(clearTimeout(zt),Ft(void 0)),(null==Ut?void 0:Ut.current)&&(clearTimeout(Ut.current),Ut.current=void 0)},Ht=()=>{jt(),!(null==kt?void 0:kt.acceptsTimeout)||IU||tt||gt.length||De||yt||Gt()},Vt=async()=>{var e;if(IU||tt||gt.length||De||yt)Ht();else if(Rt&&je&&(null==kt?void 0:kt.acceptsTimeout)){const{currentState:t,...n}=await ge(Rt);if(0===n.resultCode&&t){const n=t.emission;!xe&&Pe&&ke!==(null==le?void 0:le.language)&&n&&n.length>0?At({...t,emission:n},ke).then((e=>{e.emission&&Yt(e.emission)})):n&&n.length>0&&(wt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion}),Yt(n),Nt({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==kt?void 0:kt.hints:[]}))}}},Gt=()=>{let e=null==kt?void 0:kt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==kt?void 0:kt.emission){e+=kt.emission.length/26.5}}let t=setTimeout(Vt,1e3*e);Ft(t),Ut.current=t};(0,c.useEffect)((()=>{(gt.length||tt||De)&&jt(),Rt&&!gt.length&&Ht()}),[null==kt?void 0:kt.acceptsTimeout,null==kt?void 0:kt.timeout,null==kt?void 0:kt.state,tt,Rt,St,gt,De]),(0,c.useEffect)((()=>()=>{He(!1),Me(!1),jt(),Ut.current=void 0}),[]);const Wt=(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]),qt=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},[Kt,Jt]=(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=>{Jt(e)}))}),[]);const Qt=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},Yt=e=>{if(!k||p)return void Qt();if(an(),p)return;if(Qe||OU)return NU=!1,Be(!1),Qt(),void(Xe&&rn());RU&&RU.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===PU.state)return void PU.resume().then((()=>Yt(e)));if("closed"===PU.state){PU=new Vo;let e=PU.createBuffer(1,1e4,22050),t=PU.createBufferSource();t.buffer=e,t.connect(PU.destination)}else if("suspended"===PU.state){Xt(),PU=new Vo;let e=PU.createBuffer(1,1e4,22050),t=PU.createBufferSource();t.buffer=e,t.connect(PU.destination)}if(!IU){n||(RU=new hs.SpeakerAudioDestination);let e=hs.AudioConfig.fromSpeakerOutput(RU);IU=new hs.SpeechSynthesizer(TU,e)}const r=PU.createBufferSource();r.addEventListener("ended",(()=>{nt(!1),NU=!1})),RU.onAudioEnd=()=>{nt(!1),NU=!1,r.disconnect(),Qt(),pn()},IU.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="${qt(ke)}"><voice name="${Wt(ke)}"><s>${((e,t)=>{var n;if(!Kt)return e;const r={...null!==(n=Kt.common)&&void 0!==n?n:{},...(null==I?void 0:I.id)&&Kt[I.id]?Kt[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})(yd(e)),ke.toLowerCase())}</s></voice></speak>`,(i=>{if(i){nt(!0),NU=!0;try{PU.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(PU.destination),(St.length<1||t&&n)&&r.start(0)})),PU.onstatechange=()=>{"suspended"===PU.state||"closed"===PU.state?(r.disconnect(),nt(!1),NU=!1):"interrupted"===PU.state&&PU.resume()},PU.resume(),IU&&(IU.close(),IU=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),nt(!1),NU=!1,IU&&(IU.close(),IU=null),Qt()}}else PU.resume(),nt(!1),NU=!1,Qt()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),nt(!1),NU=!1,Qt()})),Be(!1)},Xt=()=>{nt(!1),NU=!1;try{IU&&(IU.close(),IU=null),"closed"!==PU.state&&PU.close(),RU&&(RU.pause(),RU.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==kt?void 0:kt.emission]);const[$t,Zt]=(0,c.useState)(""),en=()=>Zt(""),[tn,nn]=(0,c.useState)(null),rn=()=>{let e=setTimeout((async()=>{ln();const e=vd($t);e.length>0&&yt?(Ct(e),en(),vt("")):yt&&Ht()}),1e3*Ze);nn(e)},on=()=>{tn&&(clearTimeout(tn),nn(null))};(0,c.useEffect)((()=>{on(),Xe&&rn(),Ht()}),[$t]);const sn=()=>{if(k){ln(),Zt(""),en();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){Ge(!0),TU||(TU=hs.SpeechConfig.fromSubscription(k,"eastus"),TU.speechRecognitionLanguage=qt(ke),TU.speechSynthesisLanguage=qt(ke),TU.speechSynthesisVoiceName=Wt(ke));const t=hs.AudioConfig.fromDefaultMicrophoneInput();_U=new hs.SpeechRecognizer(TU,t),bt(!0),_U.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===hs.ResultReason.RecognizedSpeech){let e=t.result.text;if(Zt(e||""),(null==e?void 0:e.length)>0){const t=vd(e);t.length>0&&vt((e=>`${e} ${t}`))}}else t.result.reason===hs.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},_U.canceled=(e,t)=>{t.reason===hs.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?")),an()},_U.sessionStopped=(e,t)=>{an()},en(),_U.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},an=()=>{_U&&(_U.stopContinuousRecognitionAsync(),_U.close(),_U=null),bt(!1)},ln=()=>{Ge(!1),an(),on()},cn=()=>{try{ln(),jt(),Me(!1),Ut.current=void 0,Xt()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{cn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",cn),()=>{document.removeEventListener("MemoriResetUIEffects",cn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==kt?void 0:kt.state)&&ln()}),[null==kt?void 0:kt.state]);const[un,dn]=(0,c.useState)(!1),pn=(0,c.useCallback)((e=>{tt&&IU&&(IU.close(),IU=null),!Xe||!Ve&&un||(dn(!0),sn())}),[Xe,Ve]);(0,c.useEffect)((()=>{St.length>1&&!tt&&Xe&&(Ve||!un)?sn():tt&&yt&&an()}),[tt]),(0,c.useEffect)((()=>{yt&&(ln(),en(),vt(""),sn())}),[Ie]);const[hn,fn]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=gL("sendOnEnter","keypress");window.innerWidth<=768?fn("click"):fn(e)}),[]),(0,c.useEffect)((()=>{vL("sendOnEnter",hn)}),[hn]);const[mn,gn]=(0,c.useState)(),vn=null==Re?void 0:Re.globalBackground,yn=vn?`url(${vn})`:null,bn=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"}}:{},Sn=`\n ${p?"#preview,":"WEBSITE_ASSISTANT"===Ue?"":":root,"} .memori-widget {\n ${Object.entries(bn).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,xn=void 0===(null==Re?void 0:Re.showAIicon)||(null==Re?void 0:Re.showAIicon),[wn,Cn]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===Ue||"FULLPAGE"!==Ue)&&Cn(!0)}),[]);const[An,En]=(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=>{En(_L(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 Mn=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!OU&&(NU||De)?setTimeout((()=>{Mn(e)}),1e3):(an(),Xt(),Ct(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Rt,tt,De,ke]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",Mn),()=>{document.removeEventListener("MemoriTextEntered",Mn)})),[Rt,ke]);const _n=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c;const u=(null==t?void 0:t.sessionID)||Rt,d=(null==t?void 0:t.dialogState)||kt;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=gL("birthDate",void 0),m=Mt||f||void 0;if(u||!Et||m){if(!u&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!at&&!ct||!u&&_e)return pt("password"),void Me(!1);if(!u){Me(!1),Te(!1);const t=await Lt({memoriID:e.engineMemoriID,password:w||at||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)?(xt([]),At(t.dialogState,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}))):await _n(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),Pt(void 0),Me(!1),void await _n();if(xt([]),xe&&e.giverTag&&(null==kt?void 0:kt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await Bt(e.engineMemoriID,u,"-");const t=await Bt(e.engineMemoriID,u,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");At(t.currentState,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #2",t),Dt(!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==kt?void 0:kt.currentTag)!==R.tag)try{console.debug("change tag #3"),await Bt(e.engineMemoriID,u,"-");const t=await Bt(e.engineMemoriID,u,R.tag,R.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");At(t.currentState,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #5",t),Dt(!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==kt?void 0:kt.currentTag)===lp)At(t,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}));else try{console.debug("change tag #6"),await Bt(e.engineMemoriID,u,"-");const t=await Bt(e.engineMemoriID,u,lp);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");At(t.currentState,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}))}catch(t){console.error("session #8",t),Dt(!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 xt([]),At(d,ke).then((e=>{e.emission&&Yt(e.emission)})).finally((()=>{He(!0)}))}else It(!0),Me(!1)}),[at,e,ct,Mt,Rt,ke]),[Tn,In]=(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?In(t.target.getAttribute("authtoken")||void 0):In((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[Rn,Pn]=(0,c.useState)(),kn=(0,c.useCallback)((async()=>{if(Rt&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Se(Rt);0===n.resultCode?Pn(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Rt,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{kn()}),[Rt,kn]);const On=void 0===S?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!S,Nn={memori:e,tenant:I,history:St,showShare:null===(ee=null!=d?d:null==Re?void 0:Re.showShare)||void 0===ee||ee,position:ht,setShowPositionDrawer:qe,setShowSettingsDrawer:Je,showSpeaker:!!k,speakerMuted:Qe||OU,setSpeakerMuted:e=>{if(OU=!!e,Ye(e),vL("muteSpeaker",!!e),e)Xt();else{PU=new Vo;let e=PU.createBuffer(1,1e4,22050),t=PU.createBufferSource();t.buffer=e,t.connect(PU.destination)}},showSettings:v,hasUserActivatedSpeak:je,showReload:"TOTEM"===Ue,showClear:b,clearHistory:()=>xt((e=>e.slice(-1)))},Ln={memori:e,integration:o,integrationConfig:Re,tenant:I,instruct:xe,avatar3dVisible:wn,setAvatar3dVisible:Cn,hasUserActivatedSpeak:je,isPlayingAudio:tt&&!Qe,loading:!!De,baseUrl:C,apiUrl:A},Dn={memori:e,tenant:I,gamificationLevel:An,language:Ie,userLang:ke,setUserLang:Oe,baseUrl:C,apiUrl:A,position:ht,openPositionDrawer:()=>qe(!0),integrationConfig:Re,instruct:xe,sessionId:Rt,clickedStart:Ee,onClickStart:_n,initializeTTS:()=>{if(!k)return;TU=hs.SpeechConfig.fromSubscription(k,"eastus"),TU.speechSynthesisLanguage=qt(ke),TU.speechSynthesisVoiceName=Wt(ke),TU.speechRecognitionLanguage=qt(ke),md()&&(TU.speechSynthesisOutputFormat=hs.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),PU=new Vo;let e=PU.createBuffer(1,1e4,22050),t=PU.createBufferSource();t.buffer=e,t.connect(PU.destination),RU=new hs.SpeakerAudioDestination;let n=hs.AudioConfig.fromSpeakerOutput(RU);IU=new hs.SpeechSynthesizer(TU,n)},isUserLoggedIn:!!Tn},Bn={memori:e,sessionID:Rt||"",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:On?St:St.slice(-2),authToken:Tn,dialogState:kt,setDialogState:Nt,pushMessage:wt,simulateUserPrompt:(e,t)=>{an(),Xt(),Ct(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:xn,client:de,selectReceiverTag:async n=>{var r;if(Rt)try{const{currentState:i,...o}=await ve(Rt,n);if(0===o.resultCode)if(wt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await de.postTagChangedEvent(Rt,e.giverTag);0===r.resultCode?(Nt(n),n.emission&&wt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1})):(console.error(r),t(ys).error(ae(bL(r.resultCode))))}else Nt(i),i.emission&&wt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1});else console.error(o,n,null===(r=null==kt?void 0:kt.knownTags)||void 0===r?void 0:r[n]),t(ys).error(ae(bL(o.resultCode)))}catch(e){let n=e;console.error(n),t(ys).error(n.message)}},preview:p,sendOnEnter:hn,setSendOnEnter:fn,microphoneMode:Xe?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:mn,setAttachmentsMenuOpen:gn,instruct:xe,showInputs:f,showMicrophone:!!k,userMessage:gt,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return vt(""),void Ht();vt(e),jt()},sendMessage:e=>{Xt(),an(),Ct(e),vt(""),en()},stopListening:ln,startListening:sn,stopAudio:Xt,resetTranscript:en,listening:yt,isPlayingAudio:tt,customMediaRenderer:D,user:Ce,userAvatar:B,experts:Rn},zn=o&&yn?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:yn}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Fn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:Sn}}):null,Un={canInstruct:!!e.giverTag,instruct:!!xe,onChangeMode:e=>{we("instruct"===e),He(!1),Me(!1)}},jn=(0,s.jsx)(uL,{tenant:I,userLang:ke}),Hn=l||("TOTEM"===Ue?pL:"CHAT"===Ue?hL:"FULLPAGE"===Ue?dL:"WEBSITE_ASSISTANT"===Ue?fL:dL);return(0,s.jsxs)("div",{className:t(gs)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${rt.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":ot,"memori--has-active-session":!!Rt}),"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":Rt,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...kt,sessionID:Rt}),style:{height:x},children:[(0,s.jsx)(Hn,{Header:cL,headerProps:Nn,Avatar:rN,avatarProps:Ln,Chat:am,chatProps:Bn,StartPanel:fm,startPanelProps:Dn,integrationStyle:Fn,integrationBackground:zn,ChangeMode:iN,changeModeProps:Un,poweredBy:jn,sessionId:Rt,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)(fd,{withModal:!0,pwdOrTokens:dt,openModal:!!dt,setPwdOrTokens:pt,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r;t.password&&lt(t.password),t.password&&(kU=t.password),t.tokens&&ut(t.tokens),Dt(!Rt,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,Mt).then((e=>{pt(null),_n(e||void 0)})).catch((()=>{pt(null),Te(!0)}))},minimumNumberOfRecoveryTokens:null!==(se=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==se?se:1}),ce&&(0,s.jsx)(SU,{visible:Tt,minAge:Et,onClose:t=>{var n,r;t?(_t(t),vL("birthDate",t),Dt(!Rt,kU||at||(null==e?void 0:e.secretToken),ct,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=>{It(!1),pt(null),_n(e||void 0)})).catch((()=>{It(!1),Te(!0)}))):(It(!1),Me(!1))}}),Ke&&(0,s.jsx)(EU,{layout:Ue,open:!!Ke,onClose:()=>Je(!1),microphoneMode:Xe?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:Ze,setMicrophoneMode:e=>$e("CONTINUOUS"===e),setContinuousSpeechTimeout:et,controlsPosition:rt,setControlsPosition:it,hideEmissions:ot,setHideEmissions:st,additionalSettings:L})]})};const DU={id:"app.twincreator.com",theme:"twincreator",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},BU=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||{...DU,tenantID:e}}catch(t){return{...DU,tenantID:e}}};function zU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FU(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,WO(r.key),r)}}function UU(e,t,n){return t&&FU(e.prototype,t),n&&FU(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 HU(e,t){return HU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},HU(e,t)}function VU(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&&HU(e,t)}function GU(e,t){if(t&&("object"===VO(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 WU(e){return WU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WU(e)}function qU(e){if(Array.isArray(e))return e}function KU(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function JU(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 QU(e,t){if(e){if("string"==typeof e)return JU(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)?JU(e,t):void 0}}function YU(){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 XU(e){return qU(e)||KU(e)||QU(e)||YU()}function $U(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 ZU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$U(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$U(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ej={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)}},tj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};zU(this,e),this.init(t,n)}return UU(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||ej,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,ZU(ZU({},{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}(),nj=new tj,rj=function(){function e(){zU(this,e),this.observers={}}return UU(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 ij(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function oj(e){return null==e?"":""+e}function sj(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function aj(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 lj(e,t,n){var r=aj(e,t,Object);r.obj[r.k]=n}function cj(e,t){var n=aj(e,t),r=n.obj,i=n.k;if(r)return r[i]}function uj(e,t,n){var r=cj(e,n);return void 0!==r?r:cj(t,n)}function dj(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]):dj(e[r],t[r],n):e[r]=t[r]);return e}function pj(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var hj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function fj(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return hj[e]})):e}var mj="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,gj=[" ",",","?","!",";"];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 yj(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){qO(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}function bj(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=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GU(this,n)}}function Sj(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?Sj(l,c,n):void 0}i=i[r[o]]}return i}}var xj=function(e){VU(n,e);var t=bj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return zU(this,n),r=t.call(this),mj&&rj.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 UU(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=cj(this.data,s);return a||!o||"string"!=typeof n?a:Sj(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),lj(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=cj(this.data,s)||{};r?dj(a,n,i):a=yj(yj({},a),n),lj(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?yj(yj({},{}),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}(rj),wj={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 Cj(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 Aj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ej(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=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GU(this,n)}}var Mj={},_j=function(e){VU(n,e);var t=Ej(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return zU(this,n),r=t.call(this),mj&&rj.call(jU(r)),sj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,jU(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=nj.create("translator"),r}return UU(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=gj.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"!==VO(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,Aj(Aj({},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,Aj(Aj({},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,Aj(Aj({},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,Aj(Aj({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Aj(Aj({},n),{interpolation:Aj(Aj({},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=Aj(Aj({},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=wj.handle(p,e,t,this.options&&this.options.postProcessPassResolved?Aj({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,!Mj["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(Mj["".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}(rj);function Tj(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ij=function(){function e(t){zU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nj.create("languageUtils")}return UU(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]=Tj(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]=Tj(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Tj(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}(),Rj=[{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}],Pj={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)}},kj=["v1","v2","v3"],Oj={zero:0,one:1,two:2,few:3,many:4,other:5};function Nj(){var e={};return Rj.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:Pj[t.fc]}}))})),e}var Lj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};zU(this,e),this.languageUtils=t,this.options=n,this.logger=nj.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=Nj()}return UU(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 Oj[e]-Oj[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!kj.includes(this.options.compatibilityJSON)}}]),e}();function Dj(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 Bj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var zj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};zU(this,e),this.logger=nj.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return UU(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:fj,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?pj(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?pj(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?pj(t.nestingPrefix):t.nestingPrefixEscaped||pj("$t("),this.nestingSuffix=t.nestingSuffix?pj(t.nestingSuffix):t.nestingSuffixEscaped||pj(")"),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=uj(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,Bj(Bj(Bj({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(uj(t,l,s),c,n,Bj(Bj(Bj({},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=oj(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=Bj({},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=Bj(Bj({},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=oj(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,Bj(Bj({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function Fj(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 Uj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fj(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 Hj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};zU(this,e),this.logger=nj.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,Uj(Uj({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:jj((function(e,t){var n=new Intl.DateTimeFormat(e,Uj({},t));return function(e){return n.format(e)}})),relativetime:jj((function(e,t){var n=new Intl.RelativeTimeFormat(e,Uj({},t));return function(e){return n.format(e,t.range||"day")}})),list:jj((function(e,t){var n=new Intl.ListFormat(e,Uj({},t));return function(e){return n.format(e)}}))},this.init(t)}return UU(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=XU(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,Uj(Uj(Uj({},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 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){qO(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}function Wj(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=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GU(this,n)}}var qj=function(e){VU(n,e);var t=Wj(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return zU(this,n),o=t.call(this),mj&&rj.call(jU(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=nj.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 UU(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=aj(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,Gj(Gj({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(rj);function Kj(){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"===VO(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===VO(e[2])||"object"===VO(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 Jj(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 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 Yj(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){qO(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 Xj(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=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GU(this,n)}}function $j(){}function Zj(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var eH=function(e){VU(n,e);var t=Xj(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(zU(this,n),e=t.call(this),mj&&rj.call(jU(e)),e.options=Jj(r),e.services={},e.logger=nj,e.modules={external:[]},Zj(jU(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),GU(e,jU(e));setTimeout((function(){e.init(r,i)}),0)}return e}return UU(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=Kj();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=Yj(Yj(Yj({},r),this.options),Jj(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Yj(Yj({},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?nj.init(i(this.modules.logger),this.options):nj.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Hj);var s=new Ij(this.options);this.store=new xj(this.options.resources,this.options);var a=this.services;a.logger=nj,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new Lj(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 zj(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new qj(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 _j(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=$j),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=ij(),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]:$j,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=ij();return e||(e=this.languages),t||(t=this.options.ns),n||(n=$j),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&&wj.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=ij();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"!==VO(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=Yj({},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=ij();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=ij();"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]:$j,i=Yj(Yj(Yj({},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=Yj({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new _j(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}(rj);qO(eH,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new eH(e,t)}));var tH=eH.createInstance();tH.createInstance=eH.createInstance;var nH,rH=tH.createInstance;tH.init,tH.loadResources,tH.reloadResources,tH.use,tH.changeLanguage,tH.getFixedT,tH.t,tH.exists,tH.setDefaultNamespace,tH.hasLoadedNamespace,tH.loadNamespaces,tH.loadLanguages;nH=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","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.","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","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 iH=rH({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","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.","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","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(nH)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});iH.init();var oH=iH;c=o("85Hg2");function sH(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)(te.Provider,{value:i},r)}const aH=({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,W]=(0,c.useState)(),[q,K]=(0,c.useState)(k),{t:J}=me();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const Q=G(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 BU(o,w);e&&W(e)}),[o,C]);(0,c.useEffect)((()=>{$()}),[$]),(0,c.useEffect)((()=>{if(T)oH.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"}})();oH.changeLanguage(e).catch((()=>{oH.changeLanguage(t)}))}}),[T]);const Z=j?(0,s.jsx)(LU,{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)(sH,{i18n:oH,children:[(0,s.jsx)(ys.Toaster,{position:"top-center",reverseOrder:!0}),Z]})};aH.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 lH=aH;class cH 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(lH.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)(lH,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",cH)})();