From 7bd51b49e7fc49fb2a2f4b82205e540f8ff4e757 Mon Sep 17 00:00:00 2001 From: nzambello Date: Tue, 5 Dec 2023 12:02:02 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=2042cf2?= =?UTF-8?q?8f4befa30c3d0079ce8e4725f94965a55de=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d6c50b1.iframe.bundle.js => 4795.9e8a00d5.iframe.bundle.js | 2 +- 6866.27e8e1e6.iframe.bundle.js | 1 + 6866.2f62415b.iframe.bundle.js | 1 - ...components-Avatar-Avatar-stories.8fe40e8d.iframe.bundle.js | 2 +- ... => components-Chat-Chat-stories.a1e87aac.iframe.bundle.js | 2 +- ...ts-ChatBubble-ChatBubble-stories.679cc267.iframe.bundle.js | 2 +- ...ts-ChatInputs-ChatInputs-stories.0e6684c7.iframe.bundle.js | 2 +- ...tton-ExportHistoryButton-stories.cfb189b7.iframe.bundle.js | 4 ++-- ...istoryButton-stories.cfb189b7.iframe.bundle.js.LICENSE.txt | 0 ...kButtons-FeedbackButtons-stories.9a058457.iframe.bundle.js | 4 ++-- ...dbackButtons-stories.9a058457.iframe.bundle.js.LICENSE.txt | 0 ...components-Header-Header-stories.b5def1a5.iframe.bundle.js | 2 +- ...emoriWidget-MemoriWidget-stories.fec9fcc5.iframe.bundle.js | 2 +- ...-ShareButton-ShareButton-stories.82885de2.iframe.bundle.js | 1 + ...-ShareButton-ShareButton-stories.be621fc5.iframe.bundle.js | 1 - ...ts-StartPanel-StartPanel-stories.e9aa0184.iframe.bundle.js | 2 +- ...mponents-layouts-layouts-stories.e562c6d5.iframe.bundle.js | 2 +- iframe.html | 2 +- index-stories.035ff743.iframe.bundle.js | 1 + index-stories.59c628f7.iframe.bundle.js | 1 - index.json | 2 +- project.json | 2 +- ...iframe.bundle.js => runtime~main.7f408fcd.iframe.bundle.js | 2 +- stories.json | 2 +- 24 files changed, 21 insertions(+), 21 deletions(-) rename 4795.3d6c50b1.iframe.bundle.js => 4795.9e8a00d5.iframe.bundle.js (68%) create mode 100644 6866.27e8e1e6.iframe.bundle.js delete mode 100644 6866.2f62415b.iframe.bundle.js rename components-Avatar-Avatar-stories.ac75b6a9.iframe.bundle.js => components-Avatar-Avatar-stories.8fe40e8d.iframe.bundle.js (81%) rename components-Chat-Chat-stories.bce5b0c1.iframe.bundle.js => components-Chat-Chat-stories.a1e87aac.iframe.bundle.js (75%) rename components-ChatBubble-ChatBubble-stories.bb739e8e.iframe.bundle.js => components-ChatBubble-ChatBubble-stories.679cc267.iframe.bundle.js (87%) rename components-ChatInputs-ChatInputs-stories.abd65798.iframe.bundle.js => components-ChatInputs-ChatInputs-stories.0e6684c7.iframe.bundle.js (91%) rename components-ExportHistoryButton-ExportHistoryButton-stories.7dccbd22.iframe.bundle.js => components-ExportHistoryButton-ExportHistoryButton-stories.cfb189b7.iframe.bundle.js (77%) rename components-ExportHistoryButton-ExportHistoryButton-stories.7dccbd22.iframe.bundle.js.LICENSE.txt => components-ExportHistoryButton-ExportHistoryButton-stories.cfb189b7.iframe.bundle.js.LICENSE.txt (100%) rename components-FeedbackButtons-FeedbackButtons-stories.d8b63a2d.iframe.bundle.js => components-FeedbackButtons-FeedbackButtons-stories.9a058457.iframe.bundle.js (89%) rename components-FeedbackButtons-FeedbackButtons-stories.d8b63a2d.iframe.bundle.js.LICENSE.txt => components-FeedbackButtons-FeedbackButtons-stories.9a058457.iframe.bundle.js.LICENSE.txt (100%) rename components-Header-Header-stories.43ac48e7.iframe.bundle.js => components-Header-Header-stories.b5def1a5.iframe.bundle.js (80%) rename components-MemoriWidget-MemoriWidget-stories.dccd807e.iframe.bundle.js => components-MemoriWidget-MemoriWidget-stories.fec9fcc5.iframe.bundle.js (65%) create mode 100644 components-ShareButton-ShareButton-stories.82885de2.iframe.bundle.js delete mode 100644 components-ShareButton-ShareButton-stories.be621fc5.iframe.bundle.js rename components-StartPanel-StartPanel-stories.dede71ea.iframe.bundle.js => components-StartPanel-StartPanel-stories.e9aa0184.iframe.bundle.js (89%) rename components-layouts-layouts-stories.5384fe92.iframe.bundle.js => components-layouts-layouts-stories.e562c6d5.iframe.bundle.js (77%) create mode 100644 index-stories.035ff743.iframe.bundle.js delete mode 100644 index-stories.59c628f7.iframe.bundle.js rename runtime~main.36964cf7.iframe.bundle.js => runtime~main.7f408fcd.iframe.bundle.js (97%) diff --git a/4795.3d6c50b1.iframe.bundle.js b/4795.9e8a00d5.iframe.bundle.js similarity index 68% rename from 4795.3d6c50b1.iframe.bundle.js rename to 4795.9e8a00d5.iframe.bundle.js index 4ce361e1..c7a628e1 100644 --- a/4795.3d6c50b1.iframe.bundle.js +++ b/4795.9e8a00d5.iframe.bundle.js @@ -1 +1 @@ -(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[4795],{"./src/components/AgeVerificationModal/AgeVerificationModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react_i18next__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Message__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/components/ui/Message.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Modal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Modal.tsx"),moment__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/moment/moment.js"),moment__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_3__),_DateSelector_DateSelector__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/DateSelector/DateSelector.tsx"),react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/index.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AgeVerificationModal=({visible=!1,onClose,minAge})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_7__.$)(),[birthDate,setBirthDate]=(0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(),[error,setError]=(0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(),onSubmit=(0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)((()=>{if(!birthDate)return _ui_Message__WEBPACK_IMPORTED_MODULE_0__.Z.error(t("requiredField")),void setError(t("requiredField")||"Required field");if(moment__WEBPACK_IMPORTED_MODULE_3___default()().diff(birthDate,"years")onClose(),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p",{children:t("ageVerificationText",{minAge})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),onSubmit()},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div",{className:"form-item",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("fieldset",{name:"birthDate",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("legend",{className:"sr-only",children:t("birthDate")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_DateSelector_DateSelector__WEBPACK_IMPORTED_MODULE_4__.Z,{defaultDate:new Date(Date.now()),onChange:date=>{setBirthDate(date)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p",{className:"form-item-help",children:t("birthDateHelper")}),error&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p",{className:"form-item-error",children:error})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div",{className:"form-item form-submit",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{primary:!0,htmlType:"submit",className:"age-verification-submit",disabled:!birthDate,children:t("confirm")})})]})]})};AgeVerificationModal.displayName="AgeVerificationModal";const __WEBPACK_DEFAULT_EXPORT__=AgeVerificationModal;try{AgeVerificationModal.displayName="AgeVerificationModal",AgeVerificationModal.__docgenInfo={description:"",displayName:"AgeVerificationModal",props:{visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!0,type:{name:"(birthDate?: string | undefined) => void"}},minAge:{defaultValue:null,description:"",name:"minAge",required:!0,type:{name:"number"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/AgeVerificationModal/AgeVerificationModal.tsx#AgeVerificationModal"]={docgenInfo:AgeVerificationModal.__docgenInfo,name:"AgeVerificationModal",path:"src/components/AgeVerificationModal/AgeVerificationModal.tsx#AgeVerificationModal"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/AttachmentLinkModal/AttachmentLinkModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_i18next__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_MediaWidget_LinkItemWidget__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/MediaWidget/LinkItemWidget.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Modal__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Modal.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AttachmentLinkModal=({visible,onCancel,onOk})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_5__.$)(),[newLink,setNewLink]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({url:"",title:""}),onKeyPress=e=>{if("Enter"===e.key){if(0===newLink?.url.length||0===newLink?.title.length)return;let saveButton=document.getElementById("save-link-button");saveButton&&saveButton.click()}};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Modal__WEBPACK_IMPORTED_MODULE_3__.Z,{open:visible,title:t("media.addLinkLabel"),className:"attachment-link-modal",closable:!0,width:"100%",widthMd:"80%",onClose:()=>{onCancel&&onCancel()},footer:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{onClick:onCancel,children:t("cancel")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{id:"save-link-button",primary:!0,onClick:()=>{0!==newLink?.url.length&&0!==newLink?.title.length&&(onOk(newLink),setNewLink({url:"",title:""}))},disabled:0===newLink?.url.length||0===newLink?.title.length,children:t("confirm")})]}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"attachment-link-modal--row",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"attachment-link-modal--column",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("label",{htmlFor:"new-link-url",className:"attachment-link-modal--label",children:[t("media.linkKey"),":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input",{type:"url",className:"attachment-link-modal--input ",onChange:e=>{let value=e.target.value.startsWith("http")||0===e.target.value.length?e.target.value:`https://${e.target.value}`;setNewLink((l=>({title:l?.title??"",url:value})))},placeholder:"https://memori.ai/...",value:newLink?.url,name:"url",onKeyDown:onKeyPress}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("label",{htmlFor:"new-link-title",className:"attachment-link-modal--label",children:[t("media.linkValue"),":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input",{type:"text",className:"attachment-link-modal--input ",onChange:e=>setNewLink((l=>({url:l?.url??"",title:e.target.value}))),value:newLink?.title,name:"title",onKeyDown:onKeyPress})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"attachment-link-modal--column",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"attachment-link-modal--centered",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_MediaWidget_LinkItemWidget__WEBPACK_IMPORTED_MODULE_1__.$,{item:{title:newLink?.title??"",url:newLink?.url??"",mediumID:"",mimeType:"text/html"},onLinkPreviewInfo:data=>{newLink?.title?.length||setNewLink((l=>({...l,title:data?.title??""})))}},newLink?.url??"")})})]})})};AttachmentLinkModal.displayName="AttachmentLinkModal";const __WEBPACK_DEFAULT_EXPORT__=AttachmentLinkModal;try{AttachmentLinkModal.displayName="AttachmentLinkModal",AttachmentLinkModal.__docgenInfo={description:"",displayName:"AttachmentLinkModal",props:{visible:{defaultValue:null,description:"",name:"visible",required:!0,type:{name:"boolean"}},onCancel:{defaultValue:null,description:"",name:"onCancel",required:!1,type:{name:"(() => void)"}},onOk:{defaultValue:null,description:"",name:"onOk",required:!0,type:{name:"({ url, title }: { url: string; title: string; }) => void"}},apiURL:{defaultValue:null,description:"",name:"apiURL",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/AttachmentLinkModal/AttachmentLinkModal.tsx#AttachmentLinkModal"]={docgenInfo:AttachmentLinkModal.__docgenInfo,name:"AttachmentLinkModal",path:"src/components/AttachmentLinkModal/AttachmentLinkModal.tsx#AttachmentLinkModal"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/AttachmentMediaModal/AttachmentMediaModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_i18next__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_helpers_error__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/helpers/error.ts"),_helpers_constants__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/helpers/constants.ts"),_helpers_media__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/helpers/media.ts"),_ui_Modal__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Modal.tsx"),_ui_Message__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Message.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/ui/Button.tsx"),_ImageUpload_ImageUpload__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/ImageUpload/ImageUpload.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AttachmentMediaModal=({visible,authToken,sessionID,tenantID,uploadAssetURL,deleteAsset,onCancel,onOk,apiURL})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_8__.$)(),[asset,setAsset]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ui_Modal__WEBPACK_IMPORTED_MODULE_3__.Z,{open:visible,title:t("media.addMediaLabel"),className:"attachment-media-modal",closable:!0,width:"100%",widthMd:"100%",onClose:()=>{onCancel&&onCancel()},footer:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_5__.Z,{onClick:onCancel,children:t("cancel")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_5__.Z,{primary:!0,onClick:()=>{asset&&onOk(asset),setAsset(void 0)},disabled:!asset,children:t("confirm")})]}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ImageUpload_ImageUpload__WEBPACK_IMPORTED_MODULE_6__.Z,{tenantID,apiUrl:apiURL,uploadMultipleImages:!1,maxNumberOfVisualizedUploads:1,maxFileSizeInMB:100,uploadUrl:uploadAssetURL,useImageCrop:!1,allowedMimeTypes:_helpers_constants__WEBPACK_IMPORTED_MODULE_2__.go,fileList:asset?[{uid:"-1",name:asset.assetID,status:"done",thumbUrl:(0,_helpers_media__WEBPACK_IMPORTED_MODULE_9__.v)({resourceURI:asset.assetURL,tenantID,apiURL,sessionID})}]:[],uploadMessage:t("media.mediaUploadMessage"),imageProportions:1,onUploadFinished:file=>{let newAsset=file.response.asset,response=file.response;0===response.resultCode?setAsset(newAsset):(console.error(response,file),_ui_Message__WEBPACK_IMPORTED_MODULE_4__.Z.error(t((0,_helpers_error__WEBPACK_IMPORTED_MODULE_1__.r)(response.resultCode))))},onFileChanged:(_assetID,asset)=>{setAsset((a=>({...a||{},...asset})))},onRemove:async file=>{const resp=await deleteAsset(authToken,file.thumbUrl);return 0===resp.resultCode?setAsset(void 0):(console.error(resp,file),_ui_Message__WEBPACK_IMPORTED_MODULE_4__.Z.error(t((0,_helpers_error__WEBPACK_IMPORTED_MODULE_1__.r)(resp.resultCode)))),0===resp.resultCode}})})};AttachmentMediaModal.displayName="AttachmentMediaModal";const __WEBPACK_DEFAULT_EXPORT__=AttachmentMediaModal;try{AttachmentMediaModal.displayName="AttachmentMediaModal",AttachmentMediaModal.__docgenInfo={description:"",displayName:"AttachmentMediaModal",props:{visible:{defaultValue:null,description:"",name:"visible",required:!0,type:{name:"boolean"}},authToken:{defaultValue:null,description:"",name:"authToken",required:!0,type:{name:"string"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!0,type:{name:"string"}},tenantID:{defaultValue:null,description:"",name:"tenantID",required:!0,type:{name:"string"}},uploadAssetURL:{defaultValue:null,description:"",name:"uploadAssetURL",required:!0,type:{name:"string"}},deleteAsset:{defaultValue:null,description:"",name:"deleteAsset",required:!0,type:{name:"(token: string, assetURL: string) => Promise"}},onCancel:{defaultValue:null,description:"",name:"onCancel",required:!1,type:{name:"(() => void)"}},onOk:{defaultValue:null,description:"",name:"onOk",required:!0,type:{name:"(asset: Asset) => Promise"}},apiURL:{defaultValue:null,description:"",name:"apiURL",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/AttachmentMediaModal/AttachmentMediaModal.tsx#AttachmentMediaModal"]={docgenInfo:AttachmentMediaModal.__docgenInfo,name:"AttachmentMediaModal",path:"src/components/AttachmentMediaModal/AttachmentMediaModal.tsx#AttachmentMediaModal"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/Auth/Auth.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_i18next__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Modal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Modal.tsx"),react_hook_form__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-hook-form/dist/index.esm.mjs"),_icons_Plus__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Plus.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AuthWidget=({pwdOrTokens,setPwdOrTokens,onFinish,minimumNumberOfRecoveryTokens=1,showTokens=!0,openModal=!1,withModal=!1})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_5__.$)(),{register,handleSubmit,formState:{errors},setError}=(0,react_hook_form__WEBPACK_IMPORTED_MODULE_6__.cI)(),[numTokens,setNumTokens]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),[showModal,setShowModal]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!!pwdOrTokens),form=(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("form",{name:"memoriAuth",onSubmit:handleSubmit((data=>{"password"===pwdOrTokens&&!data.password?.length||"tokens"===pwdOrTokens&&((data?.tokens?.length||0)t.length)))?setError("tokens",{type:"minLength",message:"Tokens"}):onFinish&&onFinish(data).then((()=>{setShowModal(!1)}))})),className:"memori-auth-widget--form",children:[("password"===pwdOrTokens||!showTokens)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("fieldset",{className:"memori-auth-widget--password-fieldset",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("label",{children:["Password:"," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input",{className:"memori-auth-widget--input",required:!0,type:"password",placeholder:"Password",...register("password",{required:!0})})]}),showTokens&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("hr",{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{outlined:!0,onClick:()=>setPwdOrTokens("tokens"),children:t("auth.useRecoveryTokens")||"Recovery tokens"})]})]}),"tokens"===pwdOrTokens&&showTokens&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("fieldset",{className:"memori-auth-widget--tokens-fieldset",name:"tokens",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("legend",{children:[t("auth.tokens"),": "]}),(length=numTokens,Array.from({length},((_,i)=>i))).map((idx=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("label",{className:"memori-auth-widget--token",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input",{type:"password",className:"memori-auth-widget--input",placeholder:"Recovery token",required:!0,autoComplete:"off",...register(`tokens.${idx}`,{required:!0})})},idx))),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{onClick:()=>setNumTokens((t=>t+1)),className:"memori-auth-widget--token-add",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Plus__WEBPACK_IMPORTED_MODULE_3__.default,{}),children:t("auth.addToken")||"Add token"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("hr",{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{outlined:!0,onClick:()=>setPwdOrTokens("password"),children:t("auth.usePassword")||"Password"})]}),"minLength"===errors.tokens?.type&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-auth-widget--error",children:[t("auth.atLeast")||"At least"," ",minimumNumberOfRecoveryTokens]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{htmlType:"submit",primary:!0,className:"memori-auth-widget--submit",children:t("confirm")||"Submit"})]});var length;return withModal?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Modal__WEBPACK_IMPORTED_MODULE_2__.Z,{open:openModal||showModal,title:t("auth.title")||"Authentication",onClose:()=>setPwdOrTokens(null),closable:!1,children:form}):form},__WEBPACK_DEFAULT_EXPORT__=AuthWidget;try{AuthWidget.displayName="AuthWidget",AuthWidget.__docgenInfo={description:"",displayName:"AuthWidget",props:{pwdOrTokens:{defaultValue:null,description:"",name:"pwdOrTokens",required:!0,type:{name:'"password" | "tokens" | null'}},setPwdOrTokens:{defaultValue:null,description:"",name:"setPwdOrTokens",required:!0,type:{name:'(state: "password" | "tokens" | null) => void'}},onFinish:{defaultValue:null,description:"",name:"onFinish",required:!1,type:{name:"((values: AuthInputs) => Promise)"}},minimumNumberOfRecoveryTokens:{defaultValue:{value:"1"},description:"",name:"minimumNumberOfRecoveryTokens",required:!1,type:{name:"number"}},showTokens:{defaultValue:{value:"true"},description:"",name:"showTokens",required:!1,type:{name:"boolean"}},withModal:{defaultValue:{value:"false"},description:"",name:"withModal",required:!1,type:{name:"boolean"}},openModal:{defaultValue:{value:"false"},description:"",name:"openModal",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Auth/Auth.tsx#AuthWidget"]={docgenInfo:AuthWidget.__docgenInfo,name:"AuthWidget",path:"src/components/Auth/Auth.tsx#AuthWidget"})}catch(__react_docgen_typescript_loader_error){}try{Auth.displayName="Auth",Auth.__docgenInfo={description:"",displayName:"Auth",props:{pwdOrTokens:{defaultValue:null,description:"",name:"pwdOrTokens",required:!0,type:{name:'"password" | "tokens" | null'}},setPwdOrTokens:{defaultValue:null,description:"",name:"setPwdOrTokens",required:!0,type:{name:'(state: "password" | "tokens" | null) => void'}},onFinish:{defaultValue:null,description:"",name:"onFinish",required:!1,type:{name:"((values: AuthInputs) => Promise)"}},minimumNumberOfRecoveryTokens:{defaultValue:{value:"1"},description:"",name:"minimumNumberOfRecoveryTokens",required:!1,type:{name:"number"}},showTokens:{defaultValue:{value:"true"},description:"",name:"showTokens",required:!1,type:{name:"boolean"}},withModal:{defaultValue:{value:"false"},description:"",name:"withModal",required:!1,type:{name:"boolean"}},openModal:{defaultValue:{value:"false"},description:"",name:"openModal",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Auth/Auth.tsx#Auth"]={docgenInfo:Auth.__docgenInfo,name:"Auth",path:"src/components/Auth/Auth.tsx#Auth"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_icons_Warning__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Warning.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const BlockedMemoriBadge=({memoriName,blockedUntil,showGiverInfo=!1,showTitle=!1,marginLeft=!1})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.$)(),blockedUntilDate=new Date(blockedUntil);return blockedUntilDate>new Date?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{className:"blocked-memori-badge--tooltip",content:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.Fragment,{children:[!showGiverInfo&&t("memoriBlockedAnon",{name:memoriName,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(blockedUntilDate)}),showGiverInfo&&t("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(blockedUntilDate)}),showGiverInfo&&` ${t("memoriBlockedReasonExceedChats")}`,showGiverInfo&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("br",{}),showGiverInfo&&`\n${t("memoriBlockedGiverHelper")}`]}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:"blocked-memori-badge--wrapper",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"blocked-memori-badge "+(marginLeft?" margin-left":""),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Warning__WEBPACK_IMPORTED_MODULE_2__.default,{className:"blocked-memori-badge--icon"})}),showTitle&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"blocked-memori-badge--title",children:t("memoriBlockedTitle")})]})}):null},__WEBPACK_DEFAULT_EXPORT__=BlockedMemoriBadge;try{BlockedMemoriBadge.displayName="BlockedMemoriBadge",BlockedMemoriBadge.__docgenInfo={description:"",displayName:"BlockedMemoriBadge",props:{memoriName:{defaultValue:null,description:"",name:"memoriName",required:!0,type:{name:"string"}},blockedUntil:{defaultValue:null,description:"",name:"blockedUntil",required:!0,type:{name:"string"}},showGiverInfo:{defaultValue:{value:"false"},description:"",name:"showGiverInfo",required:!1,type:{name:"boolean"}},showTitle:{defaultValue:{value:"false"},description:"",name:"showTitle",required:!1,type:{name:"boolean"}},marginLeft:{defaultValue:{value:"false"},description:"",name:"marginLeft",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx#BlockedMemoriBadge"]={docgenInfo:BlockedMemoriBadge.__docgenInfo,name:"BlockedMemoriBadge",path:"src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx#BlockedMemoriBadge"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ChangeMode/ChangeMode.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _headlessui_react__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@headlessui/react/dist/components/radio-group/radio-group.js"),react_i18next__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChangeMode=({instruct,canInstruct,onChangeMode})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.$)();return canInstruct?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori--changeMode-instruct",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.E,{name:"instruct",value:instruct?"instruct":"test",defaultValue:instruct?"instruct":"test",className:"memori--changeMode-instruct-radio",onChange:onChangeMode,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.E.Option,{value:"instruct",className:"memori--changeMode-instruct-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{primary:checked,children:t("widget.instruct")||"Instruct"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.E.Option,{value:"test",className:"memori--changeMode-instruct-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{primary:checked,children:t("widget.test")||"Test"})})]})}):null},__WEBPACK_DEFAULT_EXPORT__=ChangeMode;try{ChangeMode.displayName="ChangeMode",ChangeMode.__docgenInfo={description:"",displayName:"ChangeMode",props:{instruct:{defaultValue:null,description:"",name:"instruct",required:!1,type:{name:"boolean"}},onChangeMode:{defaultValue:null,description:"",name:"onChangeMode",required:!0,type:{name:'(mode: "instruct" | "test") => void'}},canInstruct:{defaultValue:null,description:"",name:"canInstruct",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChangeMode/ChangeMode.tsx#ChangeMode"]={docgenInfo:ChangeMode.__docgenInfo,name:"ChangeMode",path:"src/components/ChangeMode/ChangeMode.tsx#ChangeMode"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/CompletionProviderStatus/CompletionProviderStatus.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_icons_Warning__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Warning.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const CompletionProviderStatus=({forceStatus,provider})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.$)(),[status,setStatus]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(forceStatus??"none"),providerStatus=(provider=>{switch(provider){case"DEFAULT":case"OpenAI":return{getStatus:async()=>{const res=await fetch("https://status.openai.com/api/v2/summary.json");return(await res.json()).status.indicator??"none"},statusPage:"https://status.openai.com/"};default:return{getStatus:async()=>"none",statusPage:""}}})(provider);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{forceStatus||providerStatus.getStatus().then((status=>setStatus(status)))}),[forceStatus,provider]),"none"!==status?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{className:"memori--completion-provider-status--tooltip",align:"topLeft",content:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p",{children:t("completionProviderDown",{provider:provider??t("completionProviderFallbackName")})}),!!providerStatus.statusPage?.length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("a",{href:providerStatus.statusPage,rel:"noopener noreferrer",target:"_blank",children:t("completionProviderCheckStatusPage")})})]}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Warning__WEBPACK_IMPORTED_MODULE_2__.default,{className:"memori--completion-provider-status--icon"})}):null},__WEBPACK_DEFAULT_EXPORT__=CompletionProviderStatus;try{CompletionProviderStatus.displayName="CompletionProviderStatus",CompletionProviderStatus.__docgenInfo={description:"",displayName:"CompletionProviderStatus",props:{forceStatus:{defaultValue:null,description:"",name:"forceStatus",required:!1,type:{name:"string"}},provider:{defaultValue:null,description:"",name:"provider",required:!1,type:{name:"string | null"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/CompletionProviderStatus/CompletionProviderStatus.tsx#CompletionProviderStatus"]={docgenInfo:CompletionProviderStatus.__docgenInfo,name:"CompletionProviderStatus",path:"src/components/CompletionProviderStatus/CompletionProviderStatus.tsx#CompletionProviderStatus"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/DateSelector/DateSelector.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/listbox/listbox.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),moment__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/moment/moment.js"),moment__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_1__),react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/SelectIcon.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const months={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"]},DateSelector=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)((({defaultDate,onChange,disabled=!1})=>{const{t,i18n}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.$)(),[date,setDate]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(moment__WEBPACK_IMPORTED_MODULE_1___default()(defaultDate||Date.now()));return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{onChange(date)}),[date,onChange]),moment__WEBPACK_IMPORTED_MODULE_1___default().locale(i18n.language),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:"memori--date-selector",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori--date-selector__select",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R,{value:date,onChange:value=>{setDate(value)},disabled,name:"day",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Label,{className:"memori--date-selector__select-label",children:[t("day"),":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Button,{"aria-label":t("day"),className:"memori--date-selector__select-button",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--value",children:date.date()}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__.default,{})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((day=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Option,{value:date.clone().date(day+1),className:"memori--date-selector__select-option",children:day+1},day)))})})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori--date-selector__select",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R,{value:date,onChange:value=>{setDate(value)},disabled,name:"month",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Label,{className:"memori--date-selector__select-label",children:[t("month"),":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Button,{"aria-label":t("month"),className:"memori--date-selector__select-button",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--value",children:months["it"===i18n.language?"it":"en"][date.month()]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__.default,{})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Options,{className:"memori--date-selector__select-options",children:months["it"===i18n.language?"it":"en"].map((month=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Option,{className:"memori--date-selector__select-option",value:date.clone().month(months["it"===i18n.language?"it":"en"].findIndex((m=>m===month))),children:month},month)))})})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori--date-selector__select",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R,{value:date,onChange:value=>{setDate(value)},disabled,name:"year",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Label,{className:"memori--date-selector__select-label",children:[t("year"),":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Button,{"aria-label":t("year"),className:"memori--date-selector__select-button",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--value",children:date.year()}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__.default,{})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Options,{className:"memori--date-selector__select-options",children:[...Array(moment__WEBPACK_IMPORTED_MODULE_1___default()().year()-1899).keys()].sort(((a,b)=>b-a)).map((year=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Option,{value:date.clone().year(year+1900),className:"memori--date-selector__select-option",children:year+1900},year)))})})]})})]})}));DateSelector.displayName="DateSelector";const __WEBPACK_DEFAULT_EXPORT__=DateSelector},"./src/components/ImageUpload/ImageUpload.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_ui_Message__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Message.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_ui_Modal__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Modal.tsx"),_ui_Spin__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/ui/Spin.tsx"),antd_lib_upload_Upload__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/antd/lib/upload/Upload.js"),antd_img_crop__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/antd-img-crop/dist/antd-img-crop.esm.js"),react_i18next__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_Edit__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/Edit.tsx"),_icons_Delete__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/icons/Delete.tsx"),_MediaWidget_MediaItemWidget__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/components/MediaWidget/MediaItemWidget.tsx"),_helpers_media__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./src/helpers/media.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react/jsx-runtime.js");const imgMimeTypes=["image/jpeg","image/png","image/jpg","image/gif"],UploadListItem=({originNode,file,tenantID,apiUrl,actions,resourceType})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_11__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"memori--list-item-wrapper"+("uploading"===file.status?" listItemUploading":""),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Spin__WEBPACK_IMPORTED_MODULE_5__.Z,{spinning:"uploading"===file.status,children:"error"===file.status?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__.Z,{content:t("media.uploadError"),children:originNode.props.children}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_MediaWidget_MediaItemWidget__WEBPACK_IMPORTED_MODULE_9__.e,{item:{mediumID:file.uid,mimeType:"uploading"===file.status?"image/png":file.name?.endsWith(".glb")?"model/gltf-binary":file.type||"image/png",title:file.name??"",url:"uploading"===file.status?"":file.response?.asset?.assetURL?file.response.asset.assetURL:(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({type:resourceType,resourceURI:file.thumbUrl,tenantID,apiURL:apiUrl}),content:`${(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({resourceURI:file.thumbUrl,type:resourceType,apiURL:apiUrl})}`},preview:!1})}),("success"===file.status||"done"===file.status)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"list-item-actions",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{outlined:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_Edit__WEBPACK_IMPORTED_MODULE_7__.default,{}),className:"action-button",title:t("edit")||"Edit",onClick:()=>actions?.download(file)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{outlined:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_Delete__WEBPACK_IMPORTED_MODULE_8__.default,{}),className:"action-button",title:t("delete")||"Delete",onClick:()=>actions?.remove(file)})]})]})};UploadListItem.displayName="UploadListItem";const ImageUpload=({uploadMultipleImages,maxNumberOfVisualizedUploads,uploadUrl,apiUrl,tenantID,fileList,maxFileSizeInMB=2,fileResolution,useImageCrop,uploadMessage,imageProportions=1,imageProportionsHelper,allowedMimeTypes,onRemove,onFileChanged,onUploadFinished,onFileNotValid,disabled,showHelper,additionalHelper,resourceType})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_11__.$)(),[internalFileList,setInternalFileList]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(fileList??[]),[fileTitleModal,setFileTitleModal]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),upload=(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd_lib_upload_Upload__WEBPACK_IMPORTED_MODULE_13__.default,{className:"memori--upload",disabled:disabled??!1,accept:(allowedMimeTypes??imgMimeTypes)?.join(",")+";capture=camera,camcorder",action:uploadUrl,listType:"picture-card",showUploadList:{showPreviewIcon:!0,showRemoveIcon:!0,showDownloadIcon:!0,downloadIcon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_Edit__WEBPACK_IMPORTED_MODULE_7__.default,{title:t("edit")||"Edit"})},beforeUpload:file=>{if(!(allowedMimeTypes??imgMimeTypes).find((x=>x===file.type))&&file.type)return console.debug("File not allowed",file,allowedMimeTypes??imgMimeTypes),_ui_Message__WEBPACK_IMPORTED_MODULE_1__.Z.error(t("media.uploadMimeTypeNotAllowed")),onFileNotValid&&onFileNotValid(),Promise.reject(t("media.uploadMimeTypeNotAllowed"));if(!(file.size/1024/1024<(maxFileSizeInMB??2)))return _ui_Message__WEBPACK_IMPORTED_MODULE_1__.Z.error(t("media.uploadSizeLimitMessage",{size:maxFileSizeInMB})),onFileNotValid&&onFileNotValid(),Promise.reject(t("media.uploadSizeLimitMessage",{size:maxFileSizeInMB}));if(fileResolution&&fileResolution.length){const reader=new FileReader;return reader.readAsDataURL(file),new Promise(((resolve,reject)=>{reader.addEventListener("load",(event=>{var newImg=new Image;newImg.style.padding="0px",newImg.style.margin="0px",newImg.onload=()=>{newImg.width===fileResolution[0]&&newImg.height===fileResolution[1]?resolve(file):(_ui_Message__WEBPACK_IMPORTED_MODULE_1__.Z.error(t("media.uploadWrongResolutionMessage",{width:fileResolution[0],height:fileResolution[1]})),reject(),onFileNotValid&&onFileNotValid())},newImg.src=event.target?.result?.toString()??""}))}))}return Promise.resolve(file)},supportServerRender:!0,fileList:internalFileList,multiple:uploadMultipleImages,maxCount:maxNumberOfVisualizedUploads||(uploadMultipleImages?100:1),onChange:info=>{setInternalFileList(info.fileList.map((f=>({...f,status:f.status??"error"})))),"done"===info.file.status&&onUploadFinished&&onUploadFinished(info.file)},onRemove,onDownload:file=>{let asset=file.response?.asset;if(asset){let title=asset.originalFileName&&file.name.includes(asset.originalFileName)?asset.originalFileName:file.name;setFileTitleModal({...asset,title:title??asset.title})}else setFileTitleModal({assetID:file.uid,title:file.name??file.fileName})},itemRender:(originNode,file,currFileList,actions)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(UploadListItem,{resourceType,originNode,file,fileList:internalFileList||currFileList,actions,tenantID,apiUrl}),children:uploadMessage});return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{"aria-live":"polite",children:[useImageCrop?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd_img_crop__WEBPACK_IMPORTED_MODULE_6__.Z,{rotate:!0,aspect:imageProportions,fillColor:"transparent",modalCancel:t("cancel")||"Cancel",modalMaskTransitionName:"none",modalTransitionName:"none",children:upload}):upload,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_ui_Modal__WEBPACK_IMPORTED_MODULE_4__.Z,{open:!!fileTitleModal,title:t("media.editAttributes"),onClose:()=>{setFileTitleModal(void 0)},footer:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment,{}),width:"100%",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("label",{htmlFor:"media-title-input",className:"media-title-label",children:t("media.title")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("input",{id:"media-title-input",className:"media-title-input",type:"text",name:"title",defaultValue:fileTitleModal?.title||"",onChange:e=>{setFileTitleModal({...fileTitleModal,title:e.target.value})}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"memori-modal--footer",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{onClick:()=>{setFileTitleModal(void 0)},children:t("cancel")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,onClick:()=>{onFileChanged&&fileTitleModal?.assetID&&onFileChanged(fileTitleModal.assetID,{...fileTitleModal}),setInternalFileList((fl=>fl.map((f=>f.uid===fileTitleModal?.assetID||f.response?.asset?.assetID===fileTitleModal?.assetID?{...f,title:fileTitleModal?.title,name:fileTitleModal?.title}:f)))),setFileTitleModal(void 0)},children:t("confirm")})]})]}),showHelper&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("legend",{className:"helper",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p",{children:t(allowedMimeTypes?"media.uploadHelper":"media.uploadHelperImages").replace("@size@",(maxFileSizeInMB??2).toString())}),imageProportionsHelper&&useImageCrop&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("p",{children:[t("media.scaleRatio"),": ",imageProportionsHelper]}),additionalHelper&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p",{children:additionalHelper})]})]})};ImageUpload.displayName="ImageUpload";const __WEBPACK_DEFAULT_EXPORT__=ImageUpload;try{ImageUpload.displayName="ImageUpload",ImageUpload.__docgenInfo={description:"",displayName:"ImageUpload",props:{uploadMultipleImages:{defaultValue:null,description:"",name:"uploadMultipleImages",required:!0,type:{name:"boolean"}},maxNumberOfVisualizedUploads:{defaultValue:null,description:"",name:"maxNumberOfVisualizedUploads",required:!1,type:{name:"number"}},fileList:{defaultValue:null,description:"",name:"fileList",required:!1,type:{name:"any[]"}},uploadUrl:{defaultValue:null,description:"",name:"uploadUrl",required:!0,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},tenantID:{defaultValue:null,description:"",name:"tenantID",required:!0,type:{name:"string"}},maxFileSizeInMB:{defaultValue:{value:"2"},description:"",name:"maxFileSizeInMB",required:!1,type:{name:"number"}},fileResolution:{defaultValue:null,description:"",name:"fileResolution",required:!1,type:{name:"number[]"}},useImageCrop:{defaultValue:null,description:"",name:"useImageCrop",required:!1,type:{name:"boolean"}},uploadMessage:{defaultValue:null,description:"",name:"uploadMessage",required:!0,type:{name:"string"}},imageProportions:{defaultValue:{value:"1"},description:"",name:"imageProportions",required:!1,type:{name:"number"}},imageProportionsHelper:{defaultValue:null,description:"",name:"imageProportionsHelper",required:!1,type:{name:"string"}},allowedMimeTypes:{defaultValue:null,description:"",name:"allowedMimeTypes",required:!1,type:{name:"string[]"}},onRemove:{defaultValue:null,description:"",name:"onRemove",required:!1,type:{name:"((file: UploadFile) => Promise)"}},onUploadFinished:{defaultValue:null,description:"",name:"onUploadFinished",required:!1,type:{name:"((file: UploadFile) => void)"}},onFileChanged:{defaultValue:null,description:"",name:"onFileChanged",required:!1,type:{name:"((assetID: string, asset: Partial) => void)"}},onFileNotValid:{defaultValue:null,description:"",name:"onFileNotValid",required:!1,type:{name:"(() => void)"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},showHelper:{defaultValue:null,description:"",name:"showHelper",required:!1,type:{name:"boolean"}},additionalHelper:{defaultValue:null,description:"",name:"additionalHelper",required:!1,type:{name:"string"}},resourceType:{defaultValue:null,description:"",name:"resourceType",required:!1,type:{name:"enum",value:[{value:'"cover"'},{value:'"avatar"'}]}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ImageUpload/ImageUpload.tsx#ImageUpload"]={docgenInfo:ImageUpload.__docgenInfo,name:"ImageUpload",path:"src/components/ImageUpload/ImageUpload.tsx#ImageUpload"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MemoriWidget/MemoriWidget.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>MemoriWidget_MemoriWidget});var react=__webpack_require__("./node_modules/react/index.js"),useTranslation=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),esm=__webpack_require__("./node_modules/@memori.ai/memori-api-client/esm/index.js"),es2019_module=__webpack_require__("./node_modules/standardized-audio-context/build/es2019/module.js"),SpeechConfig=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/SpeechConfig.js"),SpeechSynthesisOutputFormat=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/SpeechSynthesisOutputFormat.js"),SpeakerAudioDestination=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/Audio/SpeakerAudioDestination.js"),AudioConfig=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/Audio/AudioConfig.js"),SpeechSynthesizer=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/SpeechSynthesizer.js"),SpeechRecognizer=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/SpeechRecognizer.js"),ResultReason=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/ResultReason.js"),CancellationReason=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/CancellationReason.js"),classnames=__webpack_require__("./node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),Message=__webpack_require__("./src/components/ui/Message.tsx"),Auth=__webpack_require__("./src/components/Auth/Auth.tsx"),Chat_Chat=__webpack_require__("./src/components/Chat/Chat.tsx"),StartPanel=__webpack_require__("./src/components/StartPanel/StartPanel.tsx"),Avatar=__webpack_require__("./src/components/Avatar/Avatar.tsx"),ChangeMode=__webpack_require__("./src/components/ChangeMode/ChangeMode.tsx"),Header=__webpack_require__("./src/components/Header/Header.tsx"),AttachmentMediaModal=__webpack_require__("./src/components/AttachmentMediaModal/AttachmentMediaModal.tsx"),AttachmentLinkModal=__webpack_require__("./src/components/AttachmentLinkModal/AttachmentLinkModal.tsx"),PoweredBy=__webpack_require__("./src/components/PoweredBy/PoweredBy.tsx"),Spin=__webpack_require__("./src/components/ui/Spin.tsx"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const layouts_FullPage=({Header,headerProps,Avatar,avatarProps,Chat,chatProps,StartPanel,startPanelProps,integrationStyle,integrationBackground,ChangeMode,changeModeProps,sessionId,hasUserActivatedSpeak,showInstruct=!1,loading=!1,poweredBy})=>(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[integrationStyle,integrationBackground,(0,jsx_runtime.jsxs)(Spin.Z,{spinning:loading,children:[showInstruct&&ChangeMode&&changeModeProps&&(0,jsx_runtime.jsx)(ChangeMode,{...changeModeProps}),Header&&headerProps&&(0,jsx_runtime.jsx)(Header,{...headerProps}),(0,jsx_runtime.jsxs)("div",{className:"memori--grid",children:[(0,jsx_runtime.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[Avatar&&avatarProps&&(0,jsx_runtime.jsx)(Avatar,{...avatarProps}),(0,jsx_runtime.jsx)("div",{id:"extension"})]}),(0,jsx_runtime.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:sessionId&&hasUserActivatedSpeak&&Chat&&chatProps?(0,jsx_runtime.jsx)(Chat,{...chatProps}):startPanelProps?(0,jsx_runtime.jsx)(StartPanel,{...startPanelProps}):null}),poweredBy]})]})]});try{FullPage.displayName="FullPage",FullPage.__docgenInfo={description:"",displayName:"FullPage",props:{Header:{defaultValue:null,description:"",name:"Header",required:!1,type:{name:"FC"}},headerProps:{defaultValue:null,description:"",name:"headerProps",required:!1,type:{name:"Props"}},Avatar:{defaultValue:null,description:"",name:"Avatar",required:!0,type:{name:"NamedExoticComponent"}},avatarProps:{defaultValue:null,description:"",name:"avatarProps",required:!1,type:{name:"Props"}},Chat:{defaultValue:null,description:"",name:"Chat",required:!1,type:{name:"NamedExoticComponent"}},chatProps:{defaultValue:null,description:"",name:"chatProps",required:!1,type:{name:"Props"}},StartPanel:{defaultValue:null,description:"",name:"StartPanel",required:!0,type:{name:"FC"}},startPanelProps:{defaultValue:null,description:"",name:"startPanelProps",required:!1,type:{name:"Props"}},integrationStyle:{defaultValue:null,description:"",name:"integrationStyle",required:!1,type:{name:"Element | null"}},integrationBackground:{defaultValue:null,description:"",name:"integrationBackground",required:!1,type:{name:"Element | null"}},ChangeMode:{defaultValue:null,description:"",name:"ChangeMode",required:!1,type:{name:"FC"}},changeModeProps:{defaultValue:null,description:"",name:"changeModeProps",required:!1,type:{name:"Props"}},poweredBy:{defaultValue:null,description:"",name:"poweredBy",required:!1,type:{name:"Element | null"}},sessionId:{defaultValue:null,description:"",name:"sessionId",required:!1,type:{name:"string"}},hasUserActivatedSpeak:{defaultValue:null,description:"",name:"hasUserActivatedSpeak",required:!1,type:{name:"boolean"}},showInstruct:{defaultValue:{value:"false"},description:"",name:"showInstruct",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/layouts/FullPage.tsx#FullPage"]={docgenInfo:FullPage.__docgenInfo,name:"FullPage",path:"src/components/layouts/FullPage.tsx#FullPage"})}catch(__react_docgen_typescript_loader_error){}const layouts_Totem=({Header,headerProps,Avatar,avatarProps,Chat,chatProps,StartPanel,startPanelProps,integrationStyle,integrationBackground,ChangeMode,changeModeProps,sessionId,hasUserActivatedSpeak,showInstruct=!1,loading=!1,poweredBy})=>(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[integrationStyle,integrationBackground,(0,jsx_runtime.jsxs)(Spin.Z,{spinning:loading,className:"memori-totem-layout",children:[poweredBy,showInstruct&&ChangeMode&&changeModeProps&&(0,jsx_runtime.jsx)(ChangeMode,{...changeModeProps}),(0,jsx_runtime.jsx)("div",{className:"memori-totem-layout--header",children:Header&&headerProps&&(0,jsx_runtime.jsx)(Header,{...headerProps})}),(0,jsx_runtime.jsx)("div",{className:"memori-totem-layout--avatar",children:Avatar&&avatarProps&&(0,jsx_runtime.jsx)(Avatar,{...avatarProps})}),(0,jsx_runtime.jsx)("div",{id:"extension"}),(0,jsx_runtime.jsx)("div",{className:"memori-totem-layout--controls",children:sessionId&&hasUserActivatedSpeak&&Chat&&chatProps?(0,jsx_runtime.jsx)(Chat,{...chatProps}):startPanelProps?(0,jsx_runtime.jsx)(StartPanel,{...startPanelProps}):null})]})]});try{Totem.displayName="Totem",Totem.__docgenInfo={description:"",displayName:"Totem",props:{Header:{defaultValue:null,description:"",name:"Header",required:!1,type:{name:"FC"}},headerProps:{defaultValue:null,description:"",name:"headerProps",required:!1,type:{name:"Props"}},Avatar:{defaultValue:null,description:"",name:"Avatar",required:!0,type:{name:"NamedExoticComponent"}},avatarProps:{defaultValue:null,description:"",name:"avatarProps",required:!1,type:{name:"Props"}},Chat:{defaultValue:null,description:"",name:"Chat",required:!1,type:{name:"NamedExoticComponent"}},chatProps:{defaultValue:null,description:"",name:"chatProps",required:!1,type:{name:"Props"}},StartPanel:{defaultValue:null,description:"",name:"StartPanel",required:!0,type:{name:"FC"}},startPanelProps:{defaultValue:null,description:"",name:"startPanelProps",required:!1,type:{name:"Props"}},integrationStyle:{defaultValue:null,description:"",name:"integrationStyle",required:!1,type:{name:"Element | null"}},integrationBackground:{defaultValue:null,description:"",name:"integrationBackground",required:!1,type:{name:"Element | null"}},ChangeMode:{defaultValue:null,description:"",name:"ChangeMode",required:!1,type:{name:"FC"}},changeModeProps:{defaultValue:null,description:"",name:"changeModeProps",required:!1,type:{name:"Props"}},poweredBy:{defaultValue:null,description:"",name:"poweredBy",required:!1,type:{name:"Element | null"}},sessionId:{defaultValue:null,description:"",name:"sessionId",required:!1,type:{name:"string"}},hasUserActivatedSpeak:{defaultValue:null,description:"",name:"hasUserActivatedSpeak",required:!1,type:{name:"boolean"}},showInstruct:{defaultValue:{value:"false"},description:"",name:"showInstruct",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/layouts/Totem.tsx#Totem"]={docgenInfo:Totem.__docgenInfo,name:"Totem",path:"src/components/layouts/Totem.tsx#Totem"})}catch(__react_docgen_typescript_loader_error){}const layouts_Chat=({Header,headerProps,Chat,chatProps,StartPanel,startPanelProps,integrationStyle,integrationBackground,ChangeMode,changeModeProps,sessionId,hasUserActivatedSpeak,showInstruct=!1,loading=!1,poweredBy})=>(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[integrationStyle,integrationBackground,(0,jsx_runtime.jsxs)(Spin.Z,{spinning:loading,className:"memori-chat-layout",children:[poweredBy,showInstruct&&ChangeMode&&changeModeProps&&(0,jsx_runtime.jsx)(ChangeMode,{...changeModeProps}),(0,jsx_runtime.jsx)("div",{className:"memori-chat-layout--header",children:Header&&headerProps&&(0,jsx_runtime.jsx)(Header,{...headerProps})}),(0,jsx_runtime.jsx)("div",{id:"extension"}),(0,jsx_runtime.jsx)("div",{className:"memori-chat-layout--controls",children:sessionId&&hasUserActivatedSpeak&&Chat&&chatProps?(0,jsx_runtime.jsx)(Chat,{...chatProps}):startPanelProps?(0,jsx_runtime.jsx)(StartPanel,{...startPanelProps}):null})]})]});try{Chat.displayName="Chat",Chat.__docgenInfo={description:"",displayName:"Chat",props:{Header:{defaultValue:null,description:"",name:"Header",required:!1,type:{name:"FC"}},headerProps:{defaultValue:null,description:"",name:"headerProps",required:!1,type:{name:"Props"}},Avatar:{defaultValue:null,description:"",name:"Avatar",required:!0,type:{name:"NamedExoticComponent"}},avatarProps:{defaultValue:null,description:"",name:"avatarProps",required:!1,type:{name:"Props"}},Chat:{defaultValue:null,description:"",name:"Chat",required:!1,type:{name:"NamedExoticComponent"}},chatProps:{defaultValue:null,description:"",name:"chatProps",required:!1,type:{name:"Props"}},StartPanel:{defaultValue:null,description:"",name:"StartPanel",required:!0,type:{name:"FC"}},startPanelProps:{defaultValue:null,description:"",name:"startPanelProps",required:!1,type:{name:"Props"}},integrationStyle:{defaultValue:null,description:"",name:"integrationStyle",required:!1,type:{name:"Element | null"}},integrationBackground:{defaultValue:null,description:"",name:"integrationBackground",required:!1,type:{name:"Element | null"}},ChangeMode:{defaultValue:null,description:"",name:"ChangeMode",required:!1,type:{name:"FC"}},changeModeProps:{defaultValue:null,description:"",name:"changeModeProps",required:!1,type:{name:"Props"}},poweredBy:{defaultValue:null,description:"",name:"poweredBy",required:!1,type:{name:"Element | null"}},sessionId:{defaultValue:null,description:"",name:"sessionId",required:!1,type:{name:"string"}},hasUserActivatedSpeak:{defaultValue:null,description:"",name:"hasUserActivatedSpeak",required:!1,type:{name:"boolean"}},showInstruct:{defaultValue:{value:"false"},description:"",name:"showInstruct",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/layouts/Chat.tsx#Chat"]={docgenInfo:Chat.__docgenInfo,name:"Chat",path:"src/components/layouts/Chat.tsx#Chat"})}catch(__react_docgen_typescript_loader_error){}var Button=__webpack_require__("./src/components/ui/Button.tsx"),Blob=__webpack_require__("./src/components/Blob/Blob.tsx"),Close=__webpack_require__("./src/components/icons/Close.tsx");const WebsiteAssistantLayout=({Header,headerProps,Avatar,avatarProps,Chat,chatProps,StartPanel,startPanelProps,integrationStyle,ChangeMode,changeModeProps,sessionId,hasUserActivatedSpeak,showInstruct=!1,loading=!1,poweredBy})=>{const{t}=(0,useTranslation.$)(),[collapsed,_setCollapsed]=(0,react.useState)(!0),[expandedKey,setExpandedKey]=(0,react.useState)(),stopAudio=(0,react.useMemo)((()=>chatProps?.stopAudio),[chatProps?.stopAudio]),setCollapsed=collapsed=>{_setCollapsed(collapsed),setExpandedKey(collapsed?void 0:(new Date).toISOString());try{stopAudio?.()}catch(e){console.log(e)}};return(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant--"+(collapsed?"collapsed":"expanded"),children:collapsed?(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,jsx_runtime.jsx)(Button.Z,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>setCollapsed(!1),title:t("expand")||"Expand",children:(0,jsx_runtime.jsx)(Blob.Z,{avatar:avatarProps?.memori.avatarURL})})}):(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[integrationStyle,(0,jsx_runtime.jsxs)(Spin.Z,{spinning:loading,className:"memori-website_assistant-layout",children:[poweredBy,(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,jsx_runtime.jsx)(Button.Z,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>setCollapsed(!0),icon:(0,jsx_runtime.jsx)(Close.default,{}),title:t("close")||"Close"})}),showInstruct&&ChangeMode&&changeModeProps&&(0,jsx_runtime.jsx)(ChangeMode,{...changeModeProps}),(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant-layout--header",children:Header&&headerProps&&(0,jsx_runtime.jsx)(Header,{...headerProps,showSettings:!1,showReload:!1})}),(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:Avatar&&avatarProps&&(0,react.createElement)(Avatar,{...avatarProps,integrationConfig:avatarProps.integrationConfig?{...avatarProps.integrationConfig,avatarURL:avatarProps.integrationConfig?.avatarURL?`${avatarProps.integrationConfig?.avatarURL.split("#")[0]}#${expandedKey}`:void 0}:{},key:expandedKey})}),(0,jsx_runtime.jsx)("div",{id:"extension"}),(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant-layout--controls",children:sessionId&&hasUserActivatedSpeak&&Chat&&chatProps?(0,jsx_runtime.jsx)(Chat,{...chatProps}):startPanelProps?(0,jsx_runtime.jsx)(StartPanel,{...startPanelProps}):null})]})]})})};WebsiteAssistantLayout.displayName="WebsiteAssistantLayout";const layouts_WebsiteAssistant=WebsiteAssistantLayout;try{WebsiteAssistant.displayName="WebsiteAssistant",WebsiteAssistant.__docgenInfo={description:"",displayName:"WebsiteAssistant",props:{Header:{defaultValue:null,description:"",name:"Header",required:!1,type:{name:"FC"}},headerProps:{defaultValue:null,description:"",name:"headerProps",required:!1,type:{name:"Props"}},Avatar:{defaultValue:null,description:"",name:"Avatar",required:!0,type:{name:"NamedExoticComponent"}},avatarProps:{defaultValue:null,description:"",name:"avatarProps",required:!1,type:{name:"Props"}},Chat:{defaultValue:null,description:"",name:"Chat",required:!1,type:{name:"NamedExoticComponent"}},chatProps:{defaultValue:null,description:"",name:"chatProps",required:!1,type:{name:"Props"}},StartPanel:{defaultValue:null,description:"",name:"StartPanel",required:!0,type:{name:"FC"}},startPanelProps:{defaultValue:null,description:"",name:"startPanelProps",required:!1,type:{name:"Props"}},integrationStyle:{defaultValue:null,description:"",name:"integrationStyle",required:!1,type:{name:"Element | null"}},integrationBackground:{defaultValue:null,description:"",name:"integrationBackground",required:!1,type:{name:"Element | null"}},ChangeMode:{defaultValue:null,description:"",name:"ChangeMode",required:!1,type:{name:"FC"}},changeModeProps:{defaultValue:null,description:"",name:"changeModeProps",required:!1,type:{name:"Props"}},poweredBy:{defaultValue:null,description:"",name:"poweredBy",required:!1,type:{name:"Element | null"}},sessionId:{defaultValue:null,description:"",name:"sessionId",required:!1,type:{name:"string"}},hasUserActivatedSpeak:{defaultValue:null,description:"",name:"hasUserActivatedSpeak",required:!1,type:{name:"boolean"}},showInstruct:{defaultValue:{value:"false"},description:"",name:"showInstruct",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/layouts/WebsiteAssistant.tsx#WebsiteAssistant"]={docgenInfo:WebsiteAssistant.__docgenInfo,name:"WebsiteAssistant",path:"src/components/layouts/WebsiteAssistant.tsx#WebsiteAssistant"})}catch(__react_docgen_typescript_loader_error){}var translations=__webpack_require__("./src/helpers/translations.ts"),configuration=__webpack_require__("./src/helpers/configuration.ts"),utils=__webpack_require__("./src/helpers/utils.ts"),constants=__webpack_require__("./src/helpers/constants.ts"),error=__webpack_require__("./src/helpers/error.ts");const{deleteSession,getStatistics,initSession}=(0,esm.Z)(),BADGES_MAP=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,"🧠"]]),getBadge=points=>{const unlockedBadges=Array.from(BADGES_MAP.keys()).filter((k=>k<=points));if(unlockedBadges.length>0){const lastBadge=unlockedBadges[unlockedBadges.length-1];return BADGES_MAP.get(lastBadge)}return""},getNextBadge=badge=>{if("🆕"===badge)return{points:10,badge:"🐹"};let nextBadgePoints,nextBadge,currentSeen=!1;for(const[key,value]of BADGES_MAP){if(currentSeen){nextBadgePoints=key,nextBadge=value;break}value===badge&&(currentSeen=!0)}return nextBadge&&nextBadgePoints?{points:nextBadgePoints,badge:nextBadge}:void 0},getPointsForBadge=badge=>{let points=0;for(const[key,value]of BADGES_MAP)if(value===badge){points=key;break}return points};var AgeVerificationModal=__webpack_require__("./src/components/AgeVerificationModal/AgeVerificationModal.tsx"),SettingsDrawer=__webpack_require__("./src/components/SettingsDrawer/SettingsDrawer.tsx");const typeMessage=(message,waitForPrevious=!0,hidden=!1,typingText,useLoaderTextAsMsg=!1,hasBatchQueued=!1)=>{const e=new CustomEvent("MemoriTextEntered",{detail:{text:message,waitForPrevious,hidden,typingText,useLoaderTextAsMsg,hasBatchQueued}});document.dispatchEvent(e);window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))}),300)};let recognizer,speechConfig,speechSynthesizer,audioDestination,audioContext,memoriPassword;window.getMemoriState=integrationId=>{let widget=integrationId?document.querySelector(`.memori-widget[data-memori-integration="${integrationId}"]`)||document.querySelector("memori-client")?.shadowRoot?.querySelector(".memori-widget[data-memori-integration]"):document.querySelector(".memori-widget")||document.querySelector("memori-client")?.shadowRoot?.querySelector(".memori-widget");if(!widget)return null;let engineState=widget.dataset?.memoriEngineState;return engineState?JSON.parse(engineState):null},window.typeMessage=typeMessage,window.typeMessageHidden=(message,waitForPrevious=!0,typingText,useLoaderTextAsMsg=!1,hasBatchQueued=!1)=>typeMessage(message,waitForPrevious,!0,typingText,useLoaderTextAsMsg,hasBatchQueued),window.typeBatchMessages=messages=>{function disableInputs(){document.querySelector("fieldset#chat-fieldset")?.setAttribute("disabled","");const styles="opacity: 0.5; touch-action: none; pointer-events: none;";document.querySelector("textarea.memori-chat-textarea--input")?.setAttribute("style",styles),document.querySelector("button.memori-chat-inputs--send")?.setAttribute("style",styles),document.querySelector("button.memori-chat-inputs--mic")?.setAttribute("style",styles)}function reEnableInputs(){document.querySelector("fieldset#chat-fieldset")?.removeAttribute("disabled"),document.querySelector("textarea.memori-chat-textarea--input")?.removeAttribute("style"),document.querySelector("button.memori-chat-inputs--send")?.removeAttribute("style"),document.querySelector("button.memori-chat-inputs--mic")?.removeAttribute("style")}function areInputsDisabled(){return!!document.querySelector("fieldset#chat-fieldset")?.hasAttribute("disabled")}const isSafariIOS=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),stepsGenerator=function*(){yield*messages}();disableInputs();const submitNewMessage=()=>{const next=stepsGenerator.next(),step=next.value;if(step){areInputsDisabled()||disableInputs();let waitForPrevious=step.waitForPrevious;isSafariIOS&&(waitForPrevious=!1),typeMessage(step.message,waitForPrevious,step.hidden,step.typingText,step.useLoaderTextAsMsg,!next.done),isSafariIOS&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),reEnableInputs()}),3e3)}else areInputsDisabled()&&reEnableInputs();if(next.done)return document.removeEventListener("MemoriEndSpeak",submitNewMessage),void(areInputsDisabled()&&reEnableInputs())};document.addEventListener("MemoriEndSpeak",submitNewMessage),submitNewMessage()};let speakerMuted=!1,memoriSpeaking=!1;const MemoriWidget=({memori,memoriConfigs,memoriLang,multilingual,integration,layout="DEFAULT",customLayout,showInstruct=!1,showShare,preview=!1,embed=!1,showInputs=!0,showDates=!1,showContextPerLine=!1,showSettings=!0,showTypingText=!1,showClear=!1,showOnlyLastMessages,height="100vh",secret,baseUrl="https://app.twincreator.com",apiUrl="https://backend.memori.ai",initialContextVars,initialQuestion,ogImage,sessionID:initialSessionID,tenant,personification,authToken,AZURE_COGNITIVE_SERVICES_TTS_KEY,onStateChange,additionalInfo,additionalSettings,customMediaRenderer,userAvatar})=>{const{t,i18n}=(0,useTranslation.$)(),[isClient,setIsClient]=(0,react.useState)(!1);(0,react.useEffect)((()=>{setIsClient(!0)}),[]);const client=(0,esm.Z)(apiUrl),{initSession,postTextEnteredEvent,postPlaceChangedEvent,postTimeoutEvent,postTagChangedEvent,getSession,getContentQualityIndexes}=client,[instruct,setInstruct]=(0,react.useState)(!1),[user,setUser]=(0,react.useState)({avatarURL:"string"==typeof userAvatar?userAvatar:void 0}),[clickedStart,setClickedStart]=(0,react.useState)(!1),[gotErrorInOpening,setGotErrorInOpening]=(0,react.useState)(!1),language=memori.culture?.split("-")?.[0]?.toUpperCase()||memoriConfigs?.find((c=>c.memoriConfigID===memori.memoriConfigurationID))?.culture?.split("-")?.[0]?.toUpperCase(),integrationConfig=integration?.customData?JSON.parse(integration.customData):null,isMultilanguageEnabled=void 0!==multilingual?multilingual:!!integrationConfig?.multilanguage,[userLang,setUserLang]=(0,react.useState)(memoriLang??integrationConfig?.lang??language??integrationConfig?.uiLang??i18n.language??"IT"),[loading,setLoading]=(0,react.useState)(!1),[memoriTyping,setMemoriTyping]=(0,react.useState)(!1),[typingText,setTypingText]=(0,react.useState)(),selectedLayout=layout||integrationConfig?.layout||"DEFAULT",[hasUserActivatedSpeak,setHasUserActivatedSpeak]=(0,react.useState)(!1),[hasUserActivatedListening,setHasUserActivatedListening]=(0,react.useState)(!1),[showPositionDrawer,setShowPositionDrawer]=(0,react.useState)(!1),[showSettingsDrawer,setShowSettingsDrawer]=(0,react.useState)(!1),[muteSpeaker,setMuteSpeaker]=(0,react.useState)(!1),[continuousSpeech,setContinuousSpeech]=(0,react.useState)(!1),[continuousSpeechTimeout,setContinuousSpeechTimeout]=(0,react.useState)(2),[isPlayingAudio,setIsPlayingAudio]=(0,react.useState)(!1),[controlsPosition,setControlsPosition]=(0,react.useState)("center"),[hideEmissions,setHideEmissions]=(0,react.useState)(!1);(0,react.useEffect)((()=>{setIsPlayingAudio(!!speechSynthesizer),memoriSpeaking=!!speechSynthesizer}),[speechSynthesizer]),(0,react.useEffect)((()=>{let defaultControlsPosition="bottom",microphoneMode=(0,configuration.wm)("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(defaultControlsPosition="bottom",microphoneMode="HOLD_TO_TALK"):defaultControlsPosition=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",setMuteSpeaker((0,configuration.wm)("muteSpeaker",!1)),speakerMuted=(0,configuration.wm)("muteSpeaker",!1),setContinuousSpeech("CONTINUOUS"===microphoneMode),setContinuousSpeechTimeout((0,configuration.wm)("continuousSpeechTimeout",2)),setControlsPosition((0,configuration.wm)("controlsPosition",defaultControlsPosition)),setHideEmissions((0,configuration.wm)("hideEmissions",!1))}),[]);const[memoriPwd,setMemoriPwd]=(0,react.useState)(secret),[memoriTokens,setMemoriTokens]=(0,react.useState)(),[authModalState,setAuthModalState]=(0,react.useState)(null),[position,_setPosition]=(0,react.useState)(),applyPosition=async(venue,sessionID)=>{const session=sessionID??sessionId;if(venue&&session){const{currentState,...response}=await postPlaceChangedEvent({sessionId:session,placeName:venue.placeName,latitude:venue.latitude,longitude:venue.longitude,uncertaintyKm:venue.uncertainty??0});currentState&&0===response.resultCode&&setCurrentDialogState({...currentDialogState,...currentState})}},[userMessage,setUserMessage]=(0,react.useState)(""),[listening,setListening]=(0,react.useState)(!1),[history,setHistory]=(0,react.useState)([]),pushMessage=message=>{setHistory((history=>[...history,{...message,media:message.media?.filter((m=>!("text/javascript"===m.mimeType&&m.properties?.executable)))??[]}]))},sendMessage=async(text,media,newSessionId,translate=!0,translatedText,hidden=!1,typingText,useLoaderTextAsMsg=!1,hasBatchQueued=!1)=>{const sessionID=newSessionId||sessionId||window.getMemoriState()?.sessionID;if(!sessionID||!text?.length)return;hidden||pushMessage({text,translatedText,fromUser:!0,media:media??[],initial:sessionId?!!newSessionId&&newSessionId!==sessionId:!!newSessionId}),setMemoriTyping(!0),setTypingText(typingText);let msg=text,gotError=!1;if(translate&&!instruct&&isMultilanguageEnabled&&userLang.toUpperCase()!==language.toUpperCase()){msg=(await(0,translations.i)(text,language,userLang,baseUrl)).text}const{currentState,...response}=await postTextEnteredEvent({sessionId:sessionID,text:msg});if(0===response.resultCode&¤tState){const emission=useLoaderTextAsMsg&&typingText?typingText:currentState.emission??currentDialogState?.emission;if("X4"===currentState.state&&memori.giverTag){const{currentState,...resp}=await postTagChangedEvent(sessionID,memori.giverTag);0===resp.resultCode?(setCurrentDialogState(currentState),emission&&(pushMessage({text:emission,media:currentState.media,fromUser:!1}),speak(emission))):(console.error(response,resp),Message.Z.error(t((0,error.r)(resp.resultCode))),gotError=!0)}else if("X2d"===currentState.state&&memori.giverTag){const{currentState,...resp}=await postTextEnteredEvent({sessionId:sessionID,text:Math.random().toString().substring(2,8)});if(0===resp.resultCode){const{currentState,...resp}=await postTagChangedEvent(sessionID,memori.giverTag);0===resp.resultCode?(setCurrentDialogState(currentState),emission&&(pushMessage({text:emission,media:currentState.media,fromUser:!1}),speak(emission))):(console.error(response,resp),Message.Z.error(t((0,error.r)(resp.resultCode))),gotError=!0)}else console.error(response,resp),Message.Z.error(t((0,error.r)(resp.resultCode))),gotError=!0}else userLang.toLowerCase()!==language.toLowerCase()&&emission&&!instruct&&isMultilanguageEnabled?translateDialogState(currentState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})):(setCurrentDialogState({...currentState,emission}),emission&&(pushMessage({text:emission,media:currentState.media,fromUser:!1,generatedByAI:!!currentState.completion}),speak(emission)))}else 404===response.resultCode&&(setHistory((h=>[...h.slice(0,h.length-1)])),reopenSession(!1,memoriPwd||memori.secretToken,memoriTokens,instruct&&memori.giverTag?memori.giverTag:void 0,instruct&&memori.giverPIN?memori.giverPIN:void 0,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion).then((state=>{console.info("session timeout"),state?.sessionID&&setTimeout((()=>{sendMessage(text,media,state?.sessionID)}),500)})));hasBatchQueued||(setTypingText(void 0),setMemoriTyping(!1))},translateDialogState=async(state,userLang)=>{const emission=state.emission??currentDialogState?.emission;let translatedState={...state},translatedMsg=null;if(emission&&!instruct&&language.toUpperCase()!==userLang.toUpperCase()&&isMultilanguageEnabled){const t=await(0,translations.i)(emission,userLang,language,baseUrl);if(state.hints&&state.hints.length>0){const translatedHints=await Promise.all((state.hints??[]).map((async hint=>{const tHint=await(0,translations.i)(hint,userLang,language,baseUrl);return{text:tHint?.text??hint,originalText:hint}})));translatedState={...state,emission:t.text,translatedHints}}else translatedState={...state,emission:t.text,hints:state.hints??("G1"===state.state?currentDialogState?.hints:[])};t.text.length>0&&(translatedMsg={text:t.text,media:state.media,fromUser:!1,generatedByAI:!!state.completion})}else translatedState={...state,emission},emission&&(translatedMsg={text:emission,media:state.media,fromUser:!1});return setCurrentDialogState(translatedState),translatedMsg&&pushMessage(translatedMsg),translatedState},minAge=void 0!==memori.ageRestriction?memori.ageRestriction:memori.nsfw?18:memori.enableCompletions?14:0,[birthDate,setBirthDate]=(0,react.useState)(),[showAgeVerification,setShowAgeVerification]=(0,react.useState)(!1),[sessionId,setSessionId]=(0,react.useState)(initialSessionID),[currentDialogState,_setCurrentDialogState]=(0,react.useState)(),setCurrentDialogState=state=>{_setCurrentDialogState(state),onStateChange&&onStateChange(state);const executableSnippets=state?.media?.filter((m=>"text/javascript"===m.mimeType&&!!m.properties?.executable));executableSnippets?.forEach((s=>{try{setTimeout((()=>{console.log("snippet",s),new Function(s.content??"")(),setTimeout((()=>{document.querySelector(".memori-chat--content")?.scrollTo(0,document.querySelector(".memori-chat--content")?.scrollHeight??0)}),400)}),1e3)}catch(e){console.error(e)}}))},fetchSession=async params=>{let storageBirthDate=(0,configuration.wm)("birthDate",void 0);if(birthDate||storageBirthDate||!minAge)if("PUBLIC"===memori.privacyType||memori.secretToken||memoriPwd||memoriTokens){setLoading(!0);try{if(!memori.giverTag&&memori.receivedInvitations?.length){let giverInvitation=memori.receivedInvitations.find((i=>"GIVER"===i.type&&"ACCEPTED"===i.state));giverInvitation&&(memori.giverTag=giverInvitation.tag,memori.giverPIN=giverInvitation.pin)}let referral;try{referral=window.location.href}catch(err){console.error(err)}const session=await initSession({...params,tag:params.tag??personification?.tag,pin:params.pin??personification?.pin,additionalInfo:{...additionalInfo||{},loginToken:additionalInfo?.loginToken??loginToken??authToken,language:getCultureCodeByLanguage(userLang),referral}});if(session?.sessionID&&session?.currentState&&0===session.resultCode)return setSessionId(session.sessionID),position&&applyPosition(position,session.sessionID),setLoading(!1),{dialogState:session.currentState,sessionID:session.sessionID};session?.resultMessage.startsWith("This Memori is aged restricted")?(console.error(session),Message.Z.error(t("underageTwinSession",{age:minAge})),setGotErrorInOpening(!0)):403===session?.resultCode?(setMemoriPwd(void 0),setAuthModalState("password")):(console.error(session),Message.Z.error(t((0,error.r)(session?.resultCode))),setGotErrorInOpening(!0))}catch(err){console.error(err),new Error("Error fetching session")}}else setAuthModalState("password");else setShowAgeVerification(!0)},reopenSession=async(updateDialogState=!1,password,recoveryTokens,tag,pin,initialContextVars,initialQuestion,birthDate)=>{setLoading(!0);try{let referral,storageBirthDate=(0,configuration.wm)("birthDate",void 0);if(!birthDate&&!storageBirthDate&&minAge)return void setShowAgeVerification(!0);if(!("PUBLIC"===memori.privacyType||password||memori.secretToken||memoriPwd||recoveryTokens||memoriTokens))return void setAuthModalState("password");try{referral=window.location.href}catch(err){console.error(err)}const{sessionID,currentState,...response}=await initSession({memoriID:memori.engineMemoriID??"",password:password||memoriPwd||memori.secretToken,recoveryTokens:recoveryTokens||memoriTokens,tag,pin,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birthDate:birthDate||storageBirthDate||void 0,additionalInfo:{...additionalInfo||{},loginToken:additionalInfo?.loginToken??loginToken??authToken,language:getCultureCodeByLanguage(userLang),referral}});if(sessionID&¤tState&&0===response.resultCode)return setSessionId(sessionID),updateDialogState&&(setCurrentDialogState(currentState),currentState.emission&&(history.length<=1?setHistory([{text:currentState.emission,media:currentState.media,fromUser:!1,initial:!0}]):pushMessage({text:currentState.emission,media:currentState.media,fromUser:!1,initial:!0}))),position&&applyPosition(position,sessionID),setLoading(!1),{dialogState:currentState,sessionID};response?.resultMessage.startsWith("This Memori is aged restricted")?(console.error(response),Message.Z.error(t("underageTwinSession",{age:minAge})),setGotErrorInOpening(!0)):403===response?.resultCode?(setMemoriPwd(void 0),setAuthModalState("password")):(console.error(response),Message.Z.error(t((0,error.r)(response.resultCode))),setGotErrorInOpening(!0))}catch(err){console.error(err)}return setLoading(!1),null},changeTag=async(memoriId,sessionId,tag,pin)=>{if(!memoriId||!sessionId)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState,resultCode}=await postTagChangedEvent(sessionId,tag??constants.QV);if(0===resultCode){let textResult=0;if(tag!==constants.QV&&pin&&("X1a"===currentState.state||"X1b"===currentState.state)){const{resultCode:textResultCode}=await postTextEnteredEvent({sessionId,text:pin??""});textResult=textResultCode}if(0===textResult){const{currentState,...response}=await getSession(sessionId);if(0===response.resultCode&¤tState)return{currentState,sessionId,...response}}else if([400,401,403,404,500].includes(resultCode)){console.warn("[APPCONTEXT/CHANGETAG]",resultCode);let referral,storageBirthDate=(0,configuration.wm)("birthDate",void 0);try{referral=window.location.href}catch(err){console.error(err)}fetchSession({memoriID:memori.engineMemoriID??"",password:secret||memoriPwd||memori.secretToken,tag:memori.giverTag,pin:memori.giverPIN,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birthDate:birthDate||storageBirthDate||void 0,additionalInfo:{...additionalInfo||{},loginToken:additionalInfo?.loginToken??loginToken??authToken,language:getCultureCodeByLanguage(userLang),referral}})}else if(currentState)return{currentState,sessionId,resultCode}}}catch(_e){let err=_e;return console.error("[APPCONTEXT/CHANGETAG]",err),Promise.reject(err)}return null};(0,react.useEffect)((()=>()=>{currentDialogState&¤tDialogState?.currentTag===memori.giverTag||(async()=>{sessionId&&memori.giverTag&&memori.giverPIN&&(setHistory([]),await changeTag(memori.engineMemoriID,sessionId,memori.giverTag,memori.giverPIN))})()}),[]);const[userInteractionTimeout,setUserInteractionTimeout]=(0,react.useState)(),timeoutRef=(0,react.useRef)(),clearInteractionTimeout=()=>{userInteractionTimeout&&(clearTimeout(userInteractionTimeout),setUserInteractionTimeout(void 0)),timeoutRef?.current&&(clearTimeout(timeoutRef.current),timeoutRef.current=void 0)},resetInteractionTimeout=()=>{clearInteractionTimeout(),!currentDialogState?.acceptsTimeout||speechSynthesizer||isPlayingAudio||userMessage.length||memoriTyping||listening||setInteractionTimeout()},handleTimeout=async()=>{if(speechSynthesizer||isPlayingAudio||userMessage.length||memoriTyping||listening)resetInteractionTimeout();else if(sessionId&&hasUserActivatedSpeak&¤tDialogState?.acceptsTimeout){const{currentState,...response}=await postTimeoutEvent(sessionId);if(0===response.resultCode&¤tState){const emission=currentState.emission;!instruct&&isMultilanguageEnabled&&userLang!==i18n?.language&&emission&&emission.length>0?translateDialogState({...currentState,emission},userLang).then((ts=>{ts.emission&&speak(ts.emission)})):emission&&emission.length>0&&(pushMessage({text:emission,media:currentState.media,fromUser:!1,generatedByAI:!!currentState.completion}),speak(emission),setCurrentDialogState({...currentState,hints:currentState.hints??("G1"===currentState.state?currentDialogState?.hints:[])}))}}},setInteractionTimeout=()=>{let timeout=currentDialogState?.timeout;if(!timeout){let timeoutLimit=40,timeoutMinLimit=25;if(timeout=Math.floor(Math.random()*(timeoutLimit-timeoutMinLimit))+timeoutMinLimit,currentDialogState?.emission){timeout+=currentDialogState.emission.length/26.5}}let uiTimeout=setTimeout(handleTimeout,1e3*timeout);setUserInteractionTimeout(uiTimeout),timeoutRef.current=uiTimeout};(0,react.useEffect)((()=>{(userMessage.length||isPlayingAudio||memoriTyping)&&clearInteractionTimeout(),sessionId&&!userMessage.length&&resetInteractionTimeout()}),[currentDialogState?.acceptsTimeout,currentDialogState?.timeout,currentDialogState?.state,isPlayingAudio,sessionId,history,userMessage,memoriTyping]),(0,react.useEffect)((()=>()=>{setHasUserActivatedSpeak(!1),setClickedStart(!1),clearInteractionTimeout(),timeoutRef.current=void 0}),[]);const getTTSVoice=(0,react.useCallback)((lang=>{let voice="";switch((lang??memori.culture?.split("-")?.[0]??i18n.language??"IT").toUpperCase()){case"IT":voice=""+("MALE"===memori.voiceType?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":voice=""+("MALE"===memori.voiceType?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":voice=""+("MALE"===memori.voiceType?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":voice=""+("MALE"===memori.voiceType?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":voice=""+("MALE"===memori.voiceType?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":voice=""+("MALE"===memori.voiceType?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":voice=""+("MALE"===memori.voiceType?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":voice=""+("MALE"===memori.voiceType?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;case"PL":voice=""+("MALE"===memori.voiceType?"pl-PL-MarekNeural":"pl-PL-AgnieszkaNeural");break;case"FI":voice=""+("MALE"===memori.voiceType?"fi-FI-HarriNeural":"fi-FI-SelmaNeural");break;default:voice=""+("MALE"===memori.voiceType?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return voice}),[memori.voiceType,i18n.language,memori.culture]),getCultureCodeByLanguage=lang=>{let voice="";switch((lang||memori.culture?.split("-")?.[0]||i18n.language||"IT").toUpperCase()){case"IT":default:voice="it-IT";break;case"DE":voice="de-DE";break;case"EN":voice="en-GB";break;case"ES":voice="es-ES";break;case"FR":voice="fr-FR";break;case"PT":voice="pt-PT";break;case"UK":voice="uk-UK";break;case"RU":voice="ru-RU";break;case"PL":voice="pl-PL";break;case"FI":voice="fi-FI"}return voice},[phonemesMap,setPhonemesMap]=(0,react.useState)();(0,react.useEffect)((()=>{(async()=>{try{const lexiconReq=await fetch(`${baseUrl||"https://app.twincreator.com"}/api/lexiconmap`);return await lexiconReq.json()}catch(err){console.error(err)}})().then((lexicon=>{setPhonemesMap(lexicon)}))}),[]);const emitEndSpeakEvent=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},speak=text=>{if(!AZURE_COGNITIVE_SERVICES_TTS_KEY||preview)return void emitEndSpeakEvent();if(stopListening(),preview)return;if(muteSpeaker||speakerMuted)return memoriSpeaking=!1,setMemoriTyping(!1),emitEndSpeakEvent(),void(continuousSpeech&&setListeningTimeout());audioDestination&&audioDestination.pause();let isSafari=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),isIOS=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===audioContext.state)return void audioContext.resume().then((()=>speak(text)));if("closed"===audioContext.state){audioContext=new es2019_module.Hm;let buffer=audioContext.createBuffer(1,1e4,22050),source=audioContext.createBufferSource();source.buffer=buffer,source.connect(audioContext.destination)}else if("suspended"===audioContext.state){stopAudio(),audioContext=new es2019_module.Hm;let buffer=audioContext.createBuffer(1,1e4,22050),source=audioContext.createBufferSource();source.buffer=buffer,source.connect(audioContext.destination)}if(!speechSynthesizer){isIOS||(audioDestination=new SpeakerAudioDestination.K);let audioConfig=AudioConfig.rU.fromSpeakerOutput(audioDestination);speechSynthesizer=new SpeechSynthesizer.a(speechConfig,audioConfig)}const source=audioContext.createBufferSource();source.addEventListener("ended",(()=>{setIsPlayingAudio(!1),memoriSpeaking=!1})),audioDestination.onAudioEnd=()=>{setIsPlayingAudio(!1),memoriSpeaking=!1,source.disconnect(),emitEndSpeakEvent(),onEndSpeakStartListen()},speechSynthesizer.speakSsmlAsync(`${((text,lang)=>{if(!phonemesMap)return text;const phonemes={...phonemesMap.common??{},...tenant?.id&&phonemesMap[tenant.id]?phonemesMap[tenant.id]:{}};return Object.keys(phonemes).map((word=>({word,phoneme:phonemes[word][lang.toLowerCase()]??phonemes[word].default,caseSensitive:phonemes[word].caseSensitive}))).reduce(((acc,{word,phoneme,caseSensitive})=>acc.replace(new RegExp(`\\b${word}\\b`,caseSensitive?"g":"gi"),`${word}`)),text)})((text=>{const el=document.createElement("textarea");return el.textContent=text,el.innerHTML})((0,utils.h)(text)),userLang.toLowerCase())}`,(result=>{if(result){setIsPlayingAudio(!0),memoriSpeaking=!0;try{audioContext.decodeAudioData(result.audioData,(function(buffer){source.buffer=buffer,source.connect(audioContext.destination),(history.length<1||isSafari&&isIOS)&&source.start(0)})),audioContext.onstatechange=()=>{"suspended"===audioContext.state||"closed"===audioContext.state?(source.disconnect(),setIsPlayingAudio(!1),memoriSpeaking=!1):"interrupted"===audioContext.state&&audioContext.resume()},audioContext.resume(),speechSynthesizer&&(speechSynthesizer.close(),speechSynthesizer=null)}catch(e){console.error("speak error: ",e),window.speechSynthesis.speak(new SpeechSynthesisUtterance(text)),setIsPlayingAudio(!1),memoriSpeaking=!1,speechSynthesizer&&(speechSynthesizer.close(),speechSynthesizer=null),emitEndSpeakEvent()}}else audioContext.resume(),setIsPlayingAudio(!1),memoriSpeaking=!1,emitEndSpeakEvent()}),(error=>{console.error("speak:",error),window.speechSynthesis.speak(new SpeechSynthesisUtterance(text)),setIsPlayingAudio(!1),memoriSpeaking=!1,emitEndSpeakEvent()})),setMemoriTyping(!1)},stopAudio=()=>{setIsPlayingAudio(!1),memoriSpeaking=!1;try{speechSynthesizer&&(speechSynthesizer.close(),speechSynthesizer=null),"closed"!==audioContext.state&&audioContext.close(),audioDestination&&(audioDestination.pause(),audioDestination.close())}catch(e){console.error("stopAudio error: ",e)}};(0,react.useEffect)((()=>{let textarea=document.querySelector("#chat-fieldset textarea");textarea&&textarea.focus()}),[currentDialogState?.emission]);const[transcript,setTranscript]=(0,react.useState)(""),resetTranscript=()=>setTranscript(""),[transcriptTimeout,setTranscriptTimeout]=(0,react.useState)(null),setListeningTimeout=()=>{let timeout=setTimeout((async()=>{clearListening();const message=(0,utils.vw)(transcript);message.length>0&&listening?(sendMessage(message),resetTranscript(),setUserMessage("")):listening&&resetInteractionTimeout()}),1e3*continuousSpeechTimeout);setTranscriptTimeout(timeout)},clearListeningTimeout=()=>{transcriptTimeout&&(clearTimeout(transcriptTimeout),setTranscriptTimeout(null))};(0,react.useEffect)((()=>{clearListeningTimeout(),continuousSpeech&&setListeningTimeout(),resetInteractionTimeout()}),[transcript]);const startListening=()=>{if(AZURE_COGNITIVE_SERVICES_TTS_KEY){clearListening(),setTranscript(""),resetTranscript();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(_stream){setHasUserActivatedListening(!0),speechConfig||(speechConfig=SpeechConfig.c.fromSubscription(AZURE_COGNITIVE_SERVICES_TTS_KEY,"eastus"),speechConfig.speechRecognitionLanguage=getCultureCodeByLanguage(userLang),speechConfig.speechSynthesisLanguage=getCultureCodeByLanguage(userLang),speechConfig.speechSynthesisVoiceName=getTTSVoice(userLang));const audioConfig=AudioConfig.rU.fromDefaultMicrophoneInput();recognizer=new SpeechRecognizer.F(speechConfig,audioConfig),setListening(!0),recognizer.recognized=(_s,e)=>{if(e.result.text)if(e.result.reason===ResultReason.s.RecognizedSpeech){let transcript=e.result.text;if(setTranscript(transcript||""),transcript?.length>0){const transcriptMessage=(0,utils.vw)(transcript);transcriptMessage.length>0&&setUserMessage((msg=>`${msg} ${transcriptMessage}`))}}else e.result.reason===ResultReason.s.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},recognizer.canceled=(_s,e)=>{e.reason===CancellationReason._.Error&&(console.debug(`"CANCELED: ErrorCode=${e.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${e.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),stopListening()},recognizer.sessionStopped=(_s,_e)=>{stopListening()},resetTranscript(),recognizer.startContinuousRecognitionAsync()})).catch(console.error)}catch(error){console.error(error)}}},stopListening=()=>{recognizer&&(recognizer.stopContinuousRecognitionAsync(),recognizer.close(),recognizer=null),setListening(!1)},clearListening=()=>{setHasUserActivatedListening(!1),stopListening(),clearListeningTimeout()},resetUIEffects=()=>{try{clearListening(),clearInteractionTimeout(),setClickedStart(!1),timeoutRef.current=void 0,stopAudio()}catch(e){console.log("Error: resetUIEffects",e)}};(0,react.useEffect)((()=>()=>{resetUIEffects()}),[]),(0,react.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",resetUIEffects),()=>{document.removeEventListener("MemoriResetUIEffects",resetUIEffects)})),[]),(0,react.useEffect)((()=>{"Z0"===currentDialogState?.state&&clearListening()}),[currentDialogState?.state]);const[requestedListening,setRequestedListening]=(0,react.useState)(!1),onEndSpeakStartListen=(0,react.useCallback)((_e=>{isPlayingAudio&&speechSynthesizer&&(speechSynthesizer.close(),speechSynthesizer=null),!continuousSpeech||!hasUserActivatedListening&&requestedListening||(setRequestedListening(!0),startListening())}),[continuousSpeech,hasUserActivatedListening]);(0,react.useEffect)((()=>{history.length>1&&!isPlayingAudio&&continuousSpeech&&(hasUserActivatedListening||!requestedListening)?startListening():isPlayingAudio&&listening&&stopListening()}),[isPlayingAudio]),(0,react.useEffect)((()=>{listening&&(clearListening(),resetTranscript(),setUserMessage(""),startListening())}),[language]);const[sendOnEnter,setSendOnEnter]=(0,react.useState)("keypress");(0,react.useEffect)((()=>{const stored=(0,configuration.wm)("sendOnEnter","keypress");window.innerWidth<=768?setSendOnEnter("click"):setSendOnEnter(stored)}),[]),(0,react.useEffect)((()=>{(0,configuration.A2)("sendOnEnter",sendOnEnter)}),[sendOnEnter]);const[attachmentsMenuOpen,setAttachmentsMenuOpen]=(0,react.useState)(),globalBackground=integrationConfig?.globalBackground,globalBackgroundUrl=globalBackground?`url(${globalBackground})`:null,integrationProperties=integration?{"--memori-chat-bubble-bg":"#fff",...integrationConfig&&!showInstruct?{"--memori-text-color":integrationConfig.textColor??"#000"}:{},...integrationConfig?.buttonBgColor?{"--memori-button-bg":integrationConfig.buttonBgColor,"--memori-primary":integrationConfig.buttonBgColor}:{},...integrationConfig?.buttonTextColor?{"--memori-button-text":integrationConfig.buttonTextColor}:{},...integrationConfig?.blurBackground?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...integrationConfig?.innerBgColor?{"--memori-inner-bg":`rgba(${"dark"===integrationConfig.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${integrationConfig.innerBgAlpha??.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===integrationConfig.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${integrationConfig?.innerBgAlpha??.4})`}:{"--memori-inner-content-pad":"0px"}}:{},integrationStylesheet=`\n ${preview?"#preview,":"WEBSITE_ASSISTANT"===selectedLayout?"":":root,"} .memori-widget {\n ${Object.entries(integrationProperties).map((([key,value])=>`${key}: ${value};`)).join("\n")}\n }\n `,showAIicon=void 0===integrationConfig?.showAIicon||integrationConfig?.showAIicon,[avatar3dVisible,setAvatar3dVisible]=(0,react.useState)(!1);(0,react.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===selectedLayout||"FULLPAGE"!==selectedLayout)&&setAvatar3dVisible(!0)}),[]);const[gamificationLevel,setGamificationLevel]=(0,react.useState)();(0,react.useEffect)((()=>{memori.engineMemoriID&&(async memoriID=>{let gamificationPoints,unansQuestions;try{const{contentQualityIndex,answerQualityIndex,unansweredQuestions,...cqResp}=await getContentQualityIndexes(memoriID);0===cqResp.resultCode&&(gamificationPoints=contentQualityIndex,unansQuestions=unansweredQuestions)}catch(_e){let err=_e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",err)}return{points:gamificationPoints??0,unansweredQuestions:unansQuestions??0}})(memori.engineMemoriID).then((value=>{setGamificationLevel((points=>{const roundedPoints=Math.round(points),badge=getBadge(roundedPoints);return{points:roundedPoints,badge,pointsForCurrentBadge:getPointsForBadge(badge),nextBadge:getNextBadge(badge)}})(value.points))})).catch(console.error)}),[memori.engineMemoriID]),(0,react.useEffect)((()=>{if(integrationConfig?.seoTitle){let meta=document.createElement("meta");meta.setAttribute("property","og:title"),meta.setAttribute("content",integrationConfig.seoTitle),document.head.append(meta)}if(integrationConfig?.seoDescription){let meta=document.createElement("meta");meta.setAttribute("property","og:description"),meta.setAttribute("content",integrationConfig.seoDescription),document.head.append(meta)}if(integrationConfig?.seoUrl){let meta=document.createElement("meta");meta.setAttribute("property","og:url"),meta.setAttribute("content",integrationConfig.seoUrl),document.head.append(meta)}let image=ogImage||memori.avatarURL;if(integrationConfig?.seoImageShowAvatar&&image){let meta=document.createElement("meta");meta.setAttribute("property","og:image"),meta.setAttribute("content",image),document.head.append(meta)}}),[integrationConfig,memori.avatarURL,ogImage]);const memoriTextEnteredHandler=(0,react.useCallback)((e=>{const{text,waitForPrevious,hidden,typingText,useLoaderTextAsMsg,hasBatchQueued}=e.detail;text&&(waitForPrevious&&!speakerMuted&&(memoriSpeaking||memoriTyping)?setTimeout((()=>{memoriTextEnteredHandler(e)}),1e3):(stopListening(),stopAudio(),sendMessage(text,void 0,void 0,void 0,void 0,hidden,typingText,useLoaderTextAsMsg,hasBatchQueued)))}),[sessionId,isPlayingAudio,memoriTyping,userLang]);(0,react.useEffect)((()=>(document.addEventListener("MemoriTextEntered",memoriTextEnteredHandler),()=>{document.removeEventListener("MemoriTextEntered",memoriTextEnteredHandler)})),[sessionId,userLang]);const onClickStart=(0,react.useCallback)((async session=>{const sessionID=session?.sessionID||sessionId,dialogState=session?.dialogState||currentDialogState;setClickedStart(!0);let memoriAudioElement=document.getElementById("memori-audio"),isSafari=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");memoriAudioElement&&isSafari&&(memoriAudioElement.muted=!1,memoriAudioElement.play().catch((e=>{console.error("error playing intro audio",e)})));let storageBirthDate=(0,configuration.wm)("birthDate",void 0),birth=birthDate||storageBirthDate||void 0;if(sessionID||!minAge||birth){if(!sessionID&&"PUBLIC"!==memori.privacyType&&!memori.secretToken&&!memoriPwd&&!memoriTokens||!sessionID&&gotErrorInOpening)return setAuthModalState("password"),void setClickedStart(!1);if(!sessionID){setClickedStart(!1),setGotErrorInOpening(!1);const session=await fetchSession({memoriID:memori.engineMemoriID,password:secret||memoriPwd||memori.secretToken,tag:personification?.tag,pin:personification?.pin,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birthDate:birth});return void(session?.dialogState?(setHistory([]),translateDialogState(session.dialogState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}))):await onClickStart(session||void 0))}if(initialSessionID){const{currentState,...response}=await getSession(sessionID);if(0!==response.resultCode||!currentState)return console.debug("session expired, opening new session"),setGotErrorInOpening(!0),setSessionId(void 0),setClickedStart(!1),void await onClickStart();if(setHistory([]),instruct&&memori.giverTag&¤tDialogState?.currentTag!==memori.giverTag)try{console.debug("change tag #0"),await changeTag(memori.engineMemoriID,sessionID,"-");const session=await changeTag(memori.engineMemoriID,sessionID,memori.giverTag,memori.giverPIN);if(!session||0!==session.resultCode)throw console.error("session #1",session),new Error("No session");translateDialogState(session.currentState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}))}catch(e){console.error("session #2",e),reopenSession(!0,memori?.secretToken,void 0,memori?.giverTag,memori?.giverPIN,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birth).then((()=>{setHasUserActivatedSpeak(!0)}))}else if(!instruct&&personification&¤tDialogState?.currentTag!==personification.tag)try{console.debug("change tag #3"),await changeTag(memori.engineMemoriID,sessionID,"-");const session=await changeTag(memori.engineMemoriID,sessionID,personification.tag,personification.pin);if(!session||0!==session.resultCode)throw console.error("session #4",session),new Error("No session");translateDialogState(session.currentState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}))}catch(e){console.error("session #5",e),reopenSession(!0,memori?.secretToken,void 0,personification.tag,personification.pin,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birth).then((()=>{setHasUserActivatedSpeak(!0)}))}else if(instruct||personification||currentDialogState?.currentTag===constants.QV)translateDialogState(currentState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}));else try{console.debug("change tag #6"),await changeTag(memori.engineMemoriID,sessionID,"-");const session=await changeTag(memori.engineMemoriID,sessionID,constants.QV);if(!session||0!==session.resultCode)throw console.error("session #7",session),new Error("No session");translateDialogState(session.currentState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}))}catch(e){console.error("session #8",e),reopenSession(!0,memori?.secretToken,void 0,void 0,void 0,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birth).then((()=>{setHasUserActivatedSpeak(!0)}))}}else setHistory([]),translateDialogState(dialogState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}))}else setShowAgeVerification(!0),setClickedStart(!1)}),[memoriPwd,memori,memoriTokens,birthDate,sessionId,userLang]),[loginToken,setLoginToken]=(0,react.useState)(additionalInfo?.loginToken??authToken);(0,react.useEffect)((()=>{const targetNode=document.querySelector(`memori-client[memoriname="${memori.name}"]`)||document.querySelector(`memori-client[memoriid="${memori.memoriID}"]`)||document.querySelector("memori-client");if(!targetNode)return;const observer=new MutationObserver(((mutationList,_observer)=>{for(const mutation of mutationList)"attributes"===mutation.type&&"authtoken"===mutation.attributeName?.toLowerCase()&&("MEMORI-CLIENT"===mutation.target.nodeName?setLoginToken(mutation.target.getAttribute("authtoken")||void 0):setLoginToken(mutation.target?.parentElement?.getAttribute("authtoken")||void 0))}));return observer.observe(targetNode,{attributes:!0,childList:!1,subtree:!1}),()=>{observer.disconnect()}}),[]);const showFullHistory=void 0===showOnlyLastMessages?"TOTEM"!==layout&&"WEBSITE_ASSISTANT"!==layout:!showOnlyLastMessages,headerProps={memori,history,showShare:showShare??integrationConfig?.showShare??!0,position,setShowPositionDrawer,setShowSettingsDrawer,showSpeaker:!!AZURE_COGNITIVE_SERVICES_TTS_KEY,speakerMuted:muteSpeaker||speakerMuted,setSpeakerMuted:mute=>{if(speakerMuted=!!mute,setMuteSpeaker(mute),(0,configuration.A2)("muteSpeaker",!!mute),mute)stopAudio();else{audioContext=new es2019_module.Hm;let buffer=audioContext.createBuffer(1,1e4,22050),source=audioContext.createBufferSource();source.buffer=buffer,source.connect(audioContext.destination)}},showSettings,hasUserActivatedSpeak,showReload:"TOTEM"===selectedLayout,showClear,clearHistory:()=>setHistory((h=>h.slice(-1)))},avatarProps={memori,integration,integrationConfig,tenant,instruct,avatar3dVisible,setAvatar3dVisible,hasUserActivatedSpeak,isPlayingAudio:isPlayingAudio&&!muteSpeaker,loading:!!memoriTyping,baseUrl,apiUrl},startPanelProps={memori,tenant,gamificationLevel,language,userLang,setUserLang,baseUrl,apiUrl,position,openPositionDrawer:()=>setShowPositionDrawer(!0),integrationConfig,instruct,sessionId,clickedStart,onClickStart,initializeTTS:()=>{if(!AZURE_COGNITIVE_SERVICES_TTS_KEY)return;speechConfig=SpeechConfig.c.fromSubscription(AZURE_COGNITIVE_SERVICES_TTS_KEY,"eastus"),speechConfig.speechSynthesisLanguage=getCultureCodeByLanguage(userLang),speechConfig.speechSynthesisVoiceName=getTTSVoice(userLang),speechConfig.speechRecognitionLanguage=getCultureCodeByLanguage(userLang),(0,utils.xZ)()&&(speechConfig.speechSynthesisOutputFormat=SpeechSynthesisOutputFormat.Y.Audio16Khz32KBitRateMonoMp3),audioContext=new es2019_module.Hm;let buffer=audioContext.createBuffer(1,1e4,22050),source=audioContext.createBufferSource();source.buffer=buffer,source.connect(audioContext.destination),audioDestination=new SpeakerAudioDestination.K;let audioConfig=AudioConfig.rU.fromSpeakerOutput(audioDestination);speechSynthesizer=new SpeechSynthesizer.a(speechConfig,audioConfig)}},chatProps={memori,sessionID:sessionId||"",tenant,translateTo:isMultilanguageEnabled&&userLang.toUpperCase()!==(memori.culture?.split("-")?.[0]??i18n.language??"IT")?.toUpperCase()?userLang:void 0,baseUrl,apiUrl,layout,memoriTyping,typingText,showTypingText,history:showFullHistory?history:history.slice(-2),authToken:loginToken,dialogState:currentDialogState,setDialogState:setCurrentDialogState,pushMessage,simulateUserPrompt:(text,translatedText)=>{stopListening(),stopAudio(),sendMessage(text,void 0,void 0,!1,translatedText)},showDates,showContextPerLine,showAIicon,client,selectReceiverTag:async tag=>{if(sessionId)try{const{currentState,...resp}=await postTagChangedEvent(sessionId,tag);if(0===resp.resultCode)if(pushMessage({text:tag,fromUser:!0}),"X4"===currentState.state&&memori.giverTag){const{currentState,...resp}=await client.postTagChangedEvent(sessionId,memori.giverTag);0===resp.resultCode?(setCurrentDialogState(currentState),currentState.emission&&pushMessage({text:currentState.emission,media:currentState.media,fromUser:!1})):(console.error(resp),Message.Z.error(t((0,error.r)(resp.resultCode))))}else setCurrentDialogState(currentState),currentState.emission&&pushMessage({text:currentState.emission,media:currentState.media,fromUser:!1});else console.error(resp,tag,currentDialogState?.knownTags?.[tag]),Message.Z.error(t((0,error.r)(resp.resultCode)))}catch(e){let err=e;console.error(err),Message.Z.error(err.message)}},preview,sendOnEnter,setSendOnEnter,microphoneMode:continuousSpeech?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen,setAttachmentsMenuOpen,instruct,showInputs,showMicrophone:!!AZURE_COGNITIVE_SERVICES_TTS_KEY,userMessage,onChangeUserMessage:value=>{if(!value||"\n"===value||""===value.trim())return setUserMessage(""),void resetInteractionTimeout();setUserMessage(value),clearInteractionTimeout()},sendMessage:msg=>{stopAudio(),stopListening(),sendMessage(msg),setUserMessage(""),resetTranscript()},stopListening:clearListening,startListening,stopAudio,resetTranscript,listening,isPlayingAudio,customMediaRenderer,user,userAvatar},integrationBackground=integration&&globalBackgroundUrl?(0,jsx_runtime.jsx)("div",{className:"memori--global-background",children:(0,jsx_runtime.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:globalBackgroundUrl}})}):(0,jsx_runtime.jsx)("div",{className:"memori--global-background no-background-image"}),integrationStyle=integration?(0,jsx_runtime.jsx)("style",{dangerouslySetInnerHTML:{__html:integrationStylesheet}}):null,changeModeProps={canInstruct:!!memori.giverTag,instruct:!!instruct,onChangeMode:mode=>{setInstruct("instruct"===mode),setHasUserActivatedSpeak(!1),setClickedStart(!1)}},poweredBy=(0,jsx_runtime.jsx)(PoweredBy.Z,{tenant,userLang}),Layout=customLayout||("TOTEM"===selectedLayout?layouts_Totem:"CHAT"===selectedLayout?layouts_Chat:"FULLPAGE"===selectedLayout?layouts_FullPage:"WEBSITE_ASSISTANT"===selectedLayout?layouts_WebsiteAssistant:layouts_FullPage);return(0,jsx_runtime.jsxs)("div",{className:classnames_default()("memori","memori-widget",`memori-layout-${layout.toLowerCase()}`,`memori-controls-${controlsPosition.toLowerCase()}`,`memori--avatar-${integrationConfig?.avatar||"default"}`,{"memori--preview":preview,"memori--embed":embed,"memori--with-integration":integration,"memori--with-speechkey":!!AZURE_COGNITIVE_SERVICES_TTS_KEY,"memori--active":hasUserActivatedSpeak,"memori--hide-emissions":hideEmissions,"memori--has-active-session":!!sessionId}),"data-memori-name":memori?.name,"data-memori-id":memori?.engineMemoriID,"data-memori-secondary-id":memori?.memoriID,"data-memori-session-id":sessionId,"data-memori-integration":integration?.integrationID,"data-memori-engine-state":JSON.stringify({...currentDialogState,sessionID:sessionId}),style:{height},children:[(0,jsx_runtime.jsx)(Layout,{Header:Header.Z,headerProps,Avatar:Avatar.Z,avatarProps,Chat:Chat_Chat.Z,chatProps,StartPanel:StartPanel.Z,startPanelProps,integrationStyle,integrationBackground,ChangeMode:ChangeMode.Z,changeModeProps,poweredBy,sessionId,hasUserActivatedSpeak,showInstruct,loading}),(0,jsx_runtime.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://app.twincreator.com/intro.mp3"}),isClient&&(0,jsx_runtime.jsx)(Auth.Z,{withModal:!0,pwdOrTokens:authModalState,openModal:!!authModalState,setPwdOrTokens:setAuthModalState,showTokens:"SECRET"===memori.privacyType,onFinish:async values=>{values.password&&setMemoriPwd(values.password),values.password&&(memoriPassword=values.password),values.tokens&&setMemoriTokens(values.tokens),reopenSession(!sessionId,values.password,values.tokens,instruct?memori.giverTag:personification?.tag,instruct?memori.giverPIN:personification?.pin,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birthDate).then((state=>{setAuthModalState(null),onClickStart(state||void 0)})).catch((()=>{setAuthModalState(null),setGotErrorInOpening(!0)}))},minimumNumberOfRecoveryTokens:memori?.minimumNumberOfRecoveryTokens??1}),isClient&&(0,jsx_runtime.jsx)(AgeVerificationModal.Z,{visible:showAgeVerification,minAge,onClose:birthDate=>{birthDate?(setBirthDate(birthDate),(0,configuration.A2)("birthDate",birthDate),reopenSession(!sessionId,memoriPassword||memoriPwd||memori?.secretToken,memoriTokens,instruct?memori.giverTag:personification?.tag,instruct?memori.giverPIN:personification?.pin,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birthDate).then((state=>{setShowAgeVerification(!1),setAuthModalState(null),onClickStart(state||void 0)})).catch((()=>{setShowAgeVerification(!1),setGotErrorInOpening(!0)}))):(setShowAgeVerification(!1),setClickedStart(!1))}}),showSettingsDrawer&&(0,jsx_runtime.jsx)(SettingsDrawer.Z,{layout:selectedLayout,open:!!showSettingsDrawer,onClose:()=>setShowSettingsDrawer(!1),microphoneMode:continuousSpeech?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout,setMicrophoneMode:mode=>setContinuousSpeech("CONTINUOUS"===mode),setContinuousSpeechTimeout,controlsPosition,setControlsPosition,hideEmissions,setHideEmissions,additionalSettings}),sessionId&&(0,jsx_runtime.jsx)(AttachmentLinkModal.Z,{apiURL:apiUrl,visible:"link"===attachmentsMenuOpen,onCancel:()=>setAttachmentsMenuOpen(void 0),onOk:async link=>{if(!sessionId)return;let medium={mediumID:"",mimeType:"text/html",url:link.url,title:link.title};pushMessage({text:t("media.insertThisLink",{url:medium.url,title:medium.title}),fromUser:!0,media:[medium]});try{const{currentState,...resp}=await client.postMediumSelectedEvent(sessionId,medium);currentState&&0===resp.resultCode?(setCurrentDialogState(currentState),currentState.emission&&(pushMessage({text:currentState.emission,media:currentState.media,fromUser:!1}),speak(currentState.emission))):(console.error(resp,currentState,medium),Message.Z.error(t((0,error.r)(resp.resultCode),{ns:"common"})))}catch(e){let err=e;console.error(err),Message.Z.error(err.message)}setAttachmentsMenuOpen(void 0)}}),loginToken&&sessionId&&tenant?.id&&(0,jsx_runtime.jsx)(AttachmentMediaModal.Z,{apiURL:apiUrl,visible:"media"===attachmentsMenuOpen,authToken:loginToken,tenantID:tenant?.id,sessionID:sessionId,uploadAssetURL:client.backend.getUploadAssetURL(loginToken,memori.memoriID),deleteAsset:client.backend.deleteAsset,onCancel:()=>setAttachmentsMenuOpen(void 0),onOk:async asset=>{if(!sessionId)return;let medium={mediumID:"",mimeType:asset.mimeType,url:asset.assetURL,title:asset.title||asset.assetID};pushMessage({text:t("media.insertThisMediaMsg"),fromUser:!0,media:[medium]});try{const{currentState,...resp}=await client.postMediumSelectedEvent(sessionId,medium);currentState&&0===resp.resultCode?(setCurrentDialogState(currentState),currentState.emission&&(pushMessage({text:currentState.emission,media:currentState.media,fromUser:!1}),speak(currentState.emission))):(console.error(resp,currentState,medium),Message.Z.error(t((0,error.r)(resp.resultCode),{ns:"common"})))}catch(e){let err=e;console.error(err),Message.Z.error(err.message)}setAttachmentsMenuOpen(void 0)}})]})};MemoriWidget.displayName="MemoriWidget";const MemoriWidget_MemoriWidget=MemoriWidget;try{MemoriWidget.displayName="MemoriWidget",MemoriWidget.__docgenInfo={description:"",displayName:"MemoriWidget",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},memoriConfigs:{defaultValue:null,description:"",name:"memoriConfigs",required:!1,type:{name:"MemoriConfig[]"}},memoriLang:{defaultValue:null,description:"",name:"memoriLang",required:!1,type:{name:"string"}},multilingual:{defaultValue:null,description:"",name:"multilingual",required:!1,type:{name:"boolean"}},integration:{defaultValue:null,description:"",name:"integration",required:!1,type:{name:"Integration"}},layout:{defaultValue:{value:"DEFAULT"},description:"",name:"layout",required:!1,type:{name:"enum",value:[{value:'"DEFAULT"'},{value:'"FULLPAGE"'},{value:'"TOTEM"'},{value:'"CHAT"'},{value:'"WEBSITE_ASSISTANT"'}]}},customLayout:{defaultValue:null,description:"",name:"customLayout",required:!1,type:{name:"FC"}},showShare:{defaultValue:null,description:"",name:"showShare",required:!1,type:{name:"boolean"}},showInstruct:{defaultValue:{value:"false"},description:"",name:"showInstruct",required:!1,type:{name:"boolean"}},showInputs:{defaultValue:{value:"true"},description:"",name:"showInputs",required:!1,type:{name:"boolean"}},showDates:{defaultValue:{value:"false"},description:"",name:"showDates",required:!1,type:{name:"boolean"}},showContextPerLine:{defaultValue:{value:"false"},description:"",name:"showContextPerLine",required:!1,type:{name:"boolean"}},showSettings:{defaultValue:{value:"true"},description:"",name:"showSettings",required:!1,type:{name:"boolean"}},showClear:{defaultValue:{value:"false"},description:"",name:"showClear",required:!1,type:{name:"boolean"}},showOnlyLastMessages:{defaultValue:null,description:"",name:"showOnlyLastMessages",required:!1,type:{name:"boolean"}},showTypingText:{defaultValue:{value:"false"},description:"",name:"showTypingText",required:!1,type:{name:"boolean"}},preview:{defaultValue:{value:"false"},description:"",name:"preview",required:!1,type:{name:"boolean"}},embed:{defaultValue:{value:"false"},description:"",name:"embed",required:!1,type:{name:"boolean"}},height:{defaultValue:{value:"100vh"},description:"",name:"height",required:!1,type:{name:"string | number"}},secret:{defaultValue:null,description:"",name:"secret",required:!1,type:{name:"string"}},baseUrl:{defaultValue:{value:"https://app.twincreator.com"},description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:{value:"https://backend.memori.ai"},description:"",name:"apiUrl",required:!1,type:{name:"string"}},initialContextVars:{defaultValue:null,description:"",name:"initialContextVars",required:!1,type:{name:"{ [key: string]: string; }"}},initialQuestion:{defaultValue:null,description:"",name:"initialQuestion",required:!1,type:{name:"string"}},ogImage:{defaultValue:null,description:"",name:"ogImage",required:!1,type:{name:"string"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!1,type:{name:"string"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},personification:{defaultValue:null,description:"",name:"personification",required:!1,type:{name:"{ name?: string; tag: string; pin: string; }"}},authToken:{defaultValue:null,description:"",name:"authToken",required:!1,type:{name:"string"}},AZURE_COGNITIVE_SERVICES_TTS_KEY:{defaultValue:null,description:"",name:"AZURE_COGNITIVE_SERVICES_TTS_KEY",required:!1,type:{name:"string"}},onStateChange:{defaultValue:null,description:"",name:"onStateChange",required:!1,type:{name:"((state?: DialogState) => void)"}},additionalInfo:{defaultValue:null,description:"",name:"additionalInfo",required:!1,type:{name:"({ loginToken?: string; language?: string; referral?: string | undefined; } & { [key: string]: string; }) | undefined"}},customMediaRenderer:{defaultValue:null,description:"",name:"customMediaRenderer",required:!1,type:{name:"((mimeType: string) => Element | null)"}},additionalSettings:{defaultValue:null,description:"",name:"additionalSettings",required:!1,type:{name:"Element | null"}},userAvatar:{defaultValue:null,description:"",name:"userAvatar",required:!1,type:{name:"string | Element"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MemoriWidget/MemoriWidget.tsx#MemoriWidget"]={docgenInfo:MemoriWidget.__docgenInfo,name:"MemoriWidget",path:"src/components/MemoriWidget/MemoriWidget.tsx#MemoriWidget"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/PoweredBy/PoweredBy.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/jsx-runtime.js");const PoweredBy=({tenant,userLang="en"})=>{const tenantId="memorytwin"===tenant?.theme?"memorytwin":"twincreator";return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:"memori--powered-by",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img",{src:`https://app.twincreator.com/images/${tenantId}/logo.png`,alt:""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p",{children:["Powered by"," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a",{href:`https://app.${tenantId}.com/${userLang?userLang.toLowerCase():""}`,target:"_blank",rel:"noopener noreferrer",children:"memorytwin"===tenantId?"MemoryTwin":"TwinCreator"})]})]})};PoweredBy.displayName="PoweredBy";const __WEBPACK_DEFAULT_EXPORT__=PoweredBy;try{PoweredBy.displayName="PoweredBy",PoweredBy.__docgenInfo={description:"",displayName:"PoweredBy",props:{tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},userLang:{defaultValue:{value:"en"},description:"",name:"userLang",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/PoweredBy/PoweredBy.tsx#PoweredBy"]={docgenInfo:PoweredBy.__docgenInfo,name:"PoweredBy",path:"src/components/PoweredBy/PoweredBy.tsx#PoweredBy"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/StartPanel/StartPanel.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_helpers_media__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./src/helpers/media.ts"),react_i18next__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_helpers_translations__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./src/helpers/translations.ts"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Translation__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Translation.tsx"),_helpers_constants__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/helpers/constants.ts"),_BlockedMemoriBadge_BlockedMemoriBadge__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx"),_icons_AI__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/icons/AI.tsx"),_CompletionProviderStatus_CompletionProviderStatus__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/CompletionProviderStatus/CompletionProviderStatus.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/react/jsx-runtime.js");const StartPanel=({memori,tenant,gamificationLevel,language,userLang,setUserLang,baseUrl,apiUrl,position,openPositionDrawer,integrationConfig,instruct=!1,clickedStart,onClickStart,initializeTTS,_TEST_forceProviderStatus})=>{const{t,i18n}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_9__.$)(),[translatedDescription,setTranslatedDescription]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(memori.description),[showTranslation,setShowTranslation]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!0);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{(i18n.language?.toUpperCase()??"IT")!==(language?.toUpperCase()??"IT")&&memori.description?.length&&(0,_helpers_translations__WEBPACK_IMPORTED_MODULE_10__.i)(memori.description,i18n.language?.toUpperCase()??"IT",language,baseUrl).then((value=>{setTranslatedDescription(value.text)})).catch(console.error)}),[i18n.language,language,memori.description,baseUrl]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div",{className:"memori--start-panel",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div",{className:"memori--cover",style:{backgroundImage:`url("${(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({type:"cover",tenantID:tenant?.id,resourceURI:memori.coverURL,baseURL:baseUrl,apiURL:apiUrl})}"), url("${(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({type:"cover",tenantID:tenant?.id,baseURL:baseUrl,apiURL:apiUrl})}")`},children:[!!gamificationLevel?.badge?.length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div",{className:"memori--gamification-badge",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:`${t("gamification.level")} ${gamificationLevel.badge}, ${gamificationLevel.points} ${t("gamification.points")}`,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span",{"aria-label":`${t("gamification.level")} ${gamificationLevel.badge}, ${gamificationLevel.points} ${t("gamification.points")}`,children:gamificationLevel.badge})})}),!!memori.enableCompletions&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div",{className:"memori--completions-enabled",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:t("completionsEnabled"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span",{"aria-label":t("completionsEnabled")||"Completions",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_icons_AI__WEBPACK_IMPORTED_MODULE_6__.default,{})})})}),!!memori.nsfw&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div",{className:"memori--nsfw",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:t("nsfw"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span",{title:t("nsfw")||"NSFW",children:"🔞"})})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("picture",{className:"memori--avatar",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("source",{src:memori.avatarURL??(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl,apiURL:apiUrl})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("img",{alt:memori.name,src:memori.avatarURL&&memori.avatarURL.length>0?(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl,apiURL:apiUrl}):(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({type:"avatar",tenantID:tenant?.id,baseURL:baseUrl,apiURL:apiUrl})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("h2",{className:"memori--title",children:memori.name}),memori.needsPosition&&!position&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div",{className:"memori--needsPosition",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("p",{children:t("write_and_speak.requirePosition")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,onClick:()=>openPositionDrawer(),className:"memori--start-button",children:t("widget.position")})]}),(memori.needsPosition&&position||!memori.needsPosition)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div",{className:"memori--description",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span",{className:"memori--description-text",children:translatedDescription&&showTranslation?translatedDescription:memori.description}),translatedDescription!==memori.description&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{ghost:!0,className:"memori--translation-toggle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_icons_Translation__WEBPACK_IMPORTED_MODULE_3__.default,{}),onClick:()=>{setShowTranslation((show=>!show))},children:t(showTranslation?"showOriginalText":"showTranslatedText")})]}),integrationConfig?.multilanguage&&!instruct&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div",{className:"memori--language-chooser",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref",children:t("write_and_speak.iWantToTalkToIn",{name:memori.name})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("select",{id:"user-lang-pref",className:"memori-select--button",value:(userLang??i18n.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{setUserLang(e.target.value)},children:_helpers_constants__WEBPACK_IMPORTED_MODULE_4__.cG.map((lang=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("option",{value:lang.value,"aria-label":lang.label,children:lang.label},lang.value)))})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,disabled:!!memori.blockedUntil&&!memori.isGiver,loading:clickedStart,onClick:_e=>{try{window.speechSynthesis.speak(new SpeechSynthesisUtterance(""))}catch(e){console.error(e)}initializeTTS&&initializeTTS(),onClickStart&&onClickStart()},className:"memori--start-button",children:t("write_and_speak."+(instruct?"instructButton":"tryMeButton"))}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_CompletionProviderStatus_CompletionProviderStatus__WEBPACK_IMPORTED_MODULE_7__.Z,{provider:memori.completionProvider,forceStatus:_TEST_forceProviderStatus}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("p",{className:"memori--start-description",children:t(instruct?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")}),!!memori.blockedUntil&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_BlockedMemoriBadge_BlockedMemoriBadge__WEBPACK_IMPORTED_MODULE_5__.Z,{memoriName:memori.name,blockedUntil:memori.blockedUntil,showGiverInfo:memori.isGiver,showTitle:!0,marginLeft:!0})]})]})};StartPanel.displayName="StartPanel";const __WEBPACK_DEFAULT_EXPORT__=StartPanel;try{StartPanel.displayName="StartPanel",StartPanel.__docgenInfo={description:"",displayName:"StartPanel",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},gamificationLevel:{defaultValue:null,description:"",name:"gamificationLevel",required:!1,type:{name:"GamificationLevel"}},language:{defaultValue:null,description:"",name:"language",required:!1,type:{name:"string"}},userLang:{defaultValue:null,description:"",name:"userLang",required:!1,type:{name:"string"}},setUserLang:{defaultValue:null,description:"",name:"setUserLang",required:!0,type:{name:"(lang: string) => void"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},position:{defaultValue:null,description:"",name:"position",required:!1,type:{name:"Venue"}},openPositionDrawer:{defaultValue:null,description:"",name:"openPositionDrawer",required:!0,type:{name:"() => void"}},integrationConfig:{defaultValue:null,description:"",name:"integrationConfig",required:!1,type:{name:"{ [key: string]: any; }"}},instruct:{defaultValue:{value:"false"},description:"",name:"instruct",required:!1,type:{name:"boolean"}},sessionId:{defaultValue:null,description:"",name:"sessionId",required:!1,type:{name:"string"}},clickedStart:{defaultValue:null,description:"",name:"clickedStart",required:!1,type:{name:"boolean"}},onClickStart:{defaultValue:null,description:"",name:"onClickStart",required:!1,type:{name:"(() => void)"}},initializeTTS:{defaultValue:null,description:"",name:"initializeTTS",required:!1,type:{name:"(() => void)"}},_TEST_forceProviderStatus:{defaultValue:null,description:"",name:"_TEST_forceProviderStatus",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/StartPanel/StartPanel.tsx#StartPanel"]={docgenInfo:StartPanel.__docgenInfo,name:"StartPanel",path:"src/components/StartPanel/StartPanel.tsx#StartPanel"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Delete.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Delete=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})});Delete.displayName="Delete";const __WEBPACK_DEFAULT_EXPORT__=Delete;try{Delete.displayName="Delete",Delete.__docgenInfo={description:"",displayName:"Delete",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Delete.tsx#Delete"]={docgenInfo:Delete.__docgenInfo,name:"Delete",path:"src/components/icons/Delete.tsx#Delete"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Plus.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Plus=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"})]});Plus.displayName="Plus";const __WEBPACK_DEFAULT_EXPORT__=Plus;try{Plus.displayName="Plus",Plus.__docgenInfo={description:"",displayName:"Plus",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Plus.tsx#Plus"]={docgenInfo:Plus.__docgenInfo,name:"Plus",path:"src/components/icons/Plus.tsx#Plus"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Translation.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Translation=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"})]});Translation.displayName="Translation";const __WEBPACK_DEFAULT_EXPORT__=Translation;try{Translation.displayName="Translation",Translation.__docgenInfo={description:"",displayName:"Translation",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Translation.tsx#Translation"]={docgenInfo:Translation.__docgenInfo,name:"Translation",path:"src/components/icons/Translation.tsx#Translation"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Warning.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Warning=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"})});Warning.displayName="Warning";const __WEBPACK_DEFAULT_EXPORT__=Warning;try{Warning.displayName="Warning",Warning.__docgenInfo={description:"",displayName:"Warning",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Warning.tsx#Warning"]={docgenInfo:Warning.__docgenInfo,name:"Warning",path:"src/components/icons/Warning.tsx#Warning"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Message.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js"),__webpack_require__("./node_modules/react/jsx-runtime.js");const __WEBPACK_DEFAULT_EXPORT__={error:console.error,info:console.info,success:console.log}},"./src/helpers/error.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{r:()=>getErrori18nKey});const BACKEND_ERRORS=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((([key,value])=>[value,key]))),getErrori18nKey=errorCode=>{if(!errorCode)return"error.generic";if(401===errorCode||403===errorCode)return"error.unauthorized";if(404===errorCode)return"error.notFound";if(422===errorCode)return"error.unprocessableEntity";if(500===errorCode)return"internal server error";let error=BACKEND_ERRORS.get(errorCode);return error?`errors.${error}`:"error.generic"}},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(module,__unused_webpack_exports,__webpack_require__)=>{var map={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){if(!__webpack_require__.o(map,req)){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}return map[req]}webpackContext.keys=function webpackContextKeys(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"?2454":()=>{},"?6483":()=>{},"?bed2":()=>{},"?72ad":()=>{},"?a1bf":()=>{},"?14d6":()=>{},"?e42a":()=>{},"?9463":()=>{}}]); \ No newline at end of file +(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[4795],{"./src/components/AgeVerificationModal/AgeVerificationModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react_i18next__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Message__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/components/ui/Message.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Modal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Modal.tsx"),moment__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/moment/moment.js"),moment__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_3__),_DateSelector_DateSelector__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/DateSelector/DateSelector.tsx"),react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/index.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AgeVerificationModal=({visible=!1,onClose,minAge})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_7__.$)(),[birthDate,setBirthDate]=(0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(),[error,setError]=(0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(),onSubmit=(0,react__WEBPACK_IMPORTED_MODULE_5__.useCallback)((()=>{if(!birthDate)return _ui_Message__WEBPACK_IMPORTED_MODULE_0__.Z.error(t("requiredField")),void setError(t("requiredField")||"Required field");if(moment__WEBPACK_IMPORTED_MODULE_3___default()().diff(birthDate,"years")onClose(),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p",{children:t("ageVerificationText",{minAge})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),onSubmit()},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div",{className:"form-item",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("fieldset",{name:"birthDate",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("legend",{className:"sr-only",children:t("birthDate")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_DateSelector_DateSelector__WEBPACK_IMPORTED_MODULE_4__.Z,{defaultDate:new Date(Date.now()),onChange:date=>{setBirthDate(date)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p",{className:"form-item-help",children:t("birthDateHelper")}),error&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p",{className:"form-item-error",children:error})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div",{className:"form-item form-submit",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{primary:!0,htmlType:"submit",className:"age-verification-submit",disabled:!birthDate,children:t("confirm")})})]})]})};AgeVerificationModal.displayName="AgeVerificationModal";const __WEBPACK_DEFAULT_EXPORT__=AgeVerificationModal;try{AgeVerificationModal.displayName="AgeVerificationModal",AgeVerificationModal.__docgenInfo={description:"",displayName:"AgeVerificationModal",props:{visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!0,type:{name:"(birthDate?: string | undefined) => void"}},minAge:{defaultValue:null,description:"",name:"minAge",required:!0,type:{name:"number"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/AgeVerificationModal/AgeVerificationModal.tsx#AgeVerificationModal"]={docgenInfo:AgeVerificationModal.__docgenInfo,name:"AgeVerificationModal",path:"src/components/AgeVerificationModal/AgeVerificationModal.tsx#AgeVerificationModal"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/AttachmentLinkModal/AttachmentLinkModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_i18next__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_MediaWidget_LinkItemWidget__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/MediaWidget/LinkItemWidget.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Modal__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Modal.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AttachmentLinkModal=({visible,onCancel,onOk})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_5__.$)(),[newLink,setNewLink]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({url:"",title:""}),onKeyPress=e=>{if("Enter"===e.key){if(0===newLink?.url.length||0===newLink?.title.length)return;let saveButton=document.getElementById("save-link-button");saveButton&&saveButton.click()}};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Modal__WEBPACK_IMPORTED_MODULE_3__.Z,{open:visible,title:t("media.addLinkLabel"),className:"attachment-link-modal",closable:!0,width:"100%",widthMd:"80%",onClose:()=>{onCancel&&onCancel()},footer:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{onClick:onCancel,children:t("cancel")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{id:"save-link-button",primary:!0,onClick:()=>{0!==newLink?.url.length&&0!==newLink?.title.length&&(onOk(newLink),setNewLink({url:"",title:""}))},disabled:0===newLink?.url.length||0===newLink?.title.length,children:t("confirm")})]}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"attachment-link-modal--row",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"attachment-link-modal--column",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("label",{htmlFor:"new-link-url",className:"attachment-link-modal--label",children:[t("media.linkKey"),":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input",{type:"url",className:"attachment-link-modal--input ",onChange:e=>{let value=e.target.value.startsWith("http")||0===e.target.value.length?e.target.value:`https://${e.target.value}`;setNewLink((l=>({title:l?.title??"",url:value})))},placeholder:"https://memori.ai/...",value:newLink?.url,name:"url",onKeyDown:onKeyPress}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("label",{htmlFor:"new-link-title",className:"attachment-link-modal--label",children:[t("media.linkValue"),":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input",{type:"text",className:"attachment-link-modal--input ",onChange:e=>setNewLink((l=>({url:l?.url??"",title:e.target.value}))),value:newLink?.title,name:"title",onKeyDown:onKeyPress})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"attachment-link-modal--column",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"attachment-link-modal--centered",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_MediaWidget_LinkItemWidget__WEBPACK_IMPORTED_MODULE_1__.$,{item:{title:newLink?.title??"",url:newLink?.url??"",mediumID:"",mimeType:"text/html"},onLinkPreviewInfo:data=>{newLink?.title?.length||setNewLink((l=>({...l,title:data?.title??""})))}},newLink?.url??"")})})]})})};AttachmentLinkModal.displayName="AttachmentLinkModal";const __WEBPACK_DEFAULT_EXPORT__=AttachmentLinkModal;try{AttachmentLinkModal.displayName="AttachmentLinkModal",AttachmentLinkModal.__docgenInfo={description:"",displayName:"AttachmentLinkModal",props:{visible:{defaultValue:null,description:"",name:"visible",required:!0,type:{name:"boolean"}},onCancel:{defaultValue:null,description:"",name:"onCancel",required:!1,type:{name:"(() => void)"}},onOk:{defaultValue:null,description:"",name:"onOk",required:!0,type:{name:"({ url, title }: { url: string; title: string; }) => void"}},apiURL:{defaultValue:null,description:"",name:"apiURL",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/AttachmentLinkModal/AttachmentLinkModal.tsx#AttachmentLinkModal"]={docgenInfo:AttachmentLinkModal.__docgenInfo,name:"AttachmentLinkModal",path:"src/components/AttachmentLinkModal/AttachmentLinkModal.tsx#AttachmentLinkModal"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/AttachmentMediaModal/AttachmentMediaModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_i18next__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_helpers_error__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/helpers/error.ts"),_helpers_constants__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/helpers/constants.ts"),_helpers_media__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/helpers/media.ts"),_ui_Modal__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Modal.tsx"),_ui_Message__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Message.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/ui/Button.tsx"),_ImageUpload_ImageUpload__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/ImageUpload/ImageUpload.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AttachmentMediaModal=({visible,authToken,sessionID,tenantID,uploadAssetURL,deleteAsset,onCancel,onOk,apiURL})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_8__.$)(),[asset,setAsset]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ui_Modal__WEBPACK_IMPORTED_MODULE_3__.Z,{open:visible,title:t("media.addMediaLabel"),className:"attachment-media-modal",closable:!0,width:"100%",widthMd:"100%",onClose:()=>{onCancel&&onCancel()},footer:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_5__.Z,{onClick:onCancel,children:t("cancel")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_5__.Z,{primary:!0,onClick:()=>{asset&&onOk(asset),setAsset(void 0)},disabled:!asset,children:t("confirm")})]}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ImageUpload_ImageUpload__WEBPACK_IMPORTED_MODULE_6__.Z,{tenantID,apiUrl:apiURL,uploadMultipleImages:!1,maxNumberOfVisualizedUploads:1,maxFileSizeInMB:100,uploadUrl:uploadAssetURL,useImageCrop:!1,allowedMimeTypes:_helpers_constants__WEBPACK_IMPORTED_MODULE_2__.go,fileList:asset?[{uid:"-1",name:asset.assetID,status:"done",thumbUrl:(0,_helpers_media__WEBPACK_IMPORTED_MODULE_9__.v)({resourceURI:asset.assetURL,tenantID,apiURL,sessionID})}]:[],uploadMessage:t("media.mediaUploadMessage"),imageProportions:1,onUploadFinished:file=>{let newAsset=file.response.asset,response=file.response;0===response.resultCode?setAsset(newAsset):(console.error(response,file),_ui_Message__WEBPACK_IMPORTED_MODULE_4__.Z.error(t((0,_helpers_error__WEBPACK_IMPORTED_MODULE_1__.r)(response.resultCode))))},onFileChanged:(_assetID,asset)=>{setAsset((a=>({...a||{},...asset})))},onRemove:async file=>{const resp=await deleteAsset(authToken,file.thumbUrl);return 0===resp.resultCode?setAsset(void 0):(console.error(resp,file),_ui_Message__WEBPACK_IMPORTED_MODULE_4__.Z.error(t((0,_helpers_error__WEBPACK_IMPORTED_MODULE_1__.r)(resp.resultCode)))),0===resp.resultCode}})})};AttachmentMediaModal.displayName="AttachmentMediaModal";const __WEBPACK_DEFAULT_EXPORT__=AttachmentMediaModal;try{AttachmentMediaModal.displayName="AttachmentMediaModal",AttachmentMediaModal.__docgenInfo={description:"",displayName:"AttachmentMediaModal",props:{visible:{defaultValue:null,description:"",name:"visible",required:!0,type:{name:"boolean"}},authToken:{defaultValue:null,description:"",name:"authToken",required:!0,type:{name:"string"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!0,type:{name:"string"}},tenantID:{defaultValue:null,description:"",name:"tenantID",required:!0,type:{name:"string"}},uploadAssetURL:{defaultValue:null,description:"",name:"uploadAssetURL",required:!0,type:{name:"string"}},deleteAsset:{defaultValue:null,description:"",name:"deleteAsset",required:!0,type:{name:"(token: string, assetURL: string) => Promise"}},onCancel:{defaultValue:null,description:"",name:"onCancel",required:!1,type:{name:"(() => void)"}},onOk:{defaultValue:null,description:"",name:"onOk",required:!0,type:{name:"(asset: Asset) => Promise"}},apiURL:{defaultValue:null,description:"",name:"apiURL",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/AttachmentMediaModal/AttachmentMediaModal.tsx#AttachmentMediaModal"]={docgenInfo:AttachmentMediaModal.__docgenInfo,name:"AttachmentMediaModal",path:"src/components/AttachmentMediaModal/AttachmentMediaModal.tsx#AttachmentMediaModal"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/Auth/Auth.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_i18next__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Modal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Modal.tsx"),react_hook_form__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-hook-form/dist/index.esm.mjs"),_icons_Plus__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Plus.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AuthWidget=({pwdOrTokens,setPwdOrTokens,onFinish,minimumNumberOfRecoveryTokens=1,showTokens=!0,openModal=!1,withModal=!1})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_5__.$)(),{register,handleSubmit,formState:{errors},setError}=(0,react_hook_form__WEBPACK_IMPORTED_MODULE_6__.cI)(),[numTokens,setNumTokens]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1),[showModal,setShowModal]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!!pwdOrTokens),form=(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("form",{name:"memoriAuth",onSubmit:handleSubmit((data=>{"password"===pwdOrTokens&&!data.password?.length||"tokens"===pwdOrTokens&&((data?.tokens?.length||0)t.length)))?setError("tokens",{type:"minLength",message:"Tokens"}):onFinish&&onFinish(data).then((()=>{setShowModal(!1)}))})),className:"memori-auth-widget--form",children:[("password"===pwdOrTokens||!showTokens)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("fieldset",{className:"memori-auth-widget--password-fieldset",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("label",{children:["Password:"," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input",{className:"memori-auth-widget--input",required:!0,type:"password",placeholder:"Password",...register("password",{required:!0})})]}),showTokens&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("hr",{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{outlined:!0,onClick:()=>setPwdOrTokens("tokens"),children:t("auth.useRecoveryTokens")||"Recovery tokens"})]})]}),"tokens"===pwdOrTokens&&showTokens&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("fieldset",{className:"memori-auth-widget--tokens-fieldset",name:"tokens",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("legend",{children:[t("auth.tokens"),": "]}),(length=numTokens,Array.from({length},((_,i)=>i))).map((idx=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("label",{className:"memori-auth-widget--token",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input",{type:"password",className:"memori-auth-widget--input",placeholder:"Recovery token",required:!0,autoComplete:"off",...register(`tokens.${idx}`,{required:!0})})},idx))),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{onClick:()=>setNumTokens((t=>t+1)),className:"memori-auth-widget--token-add",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Plus__WEBPACK_IMPORTED_MODULE_3__.default,{}),children:t("auth.addToken")||"Add token"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("hr",{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{outlined:!0,onClick:()=>setPwdOrTokens("password"),children:t("auth.usePassword")||"Password"})]}),"minLength"===errors.tokens?.type&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-auth-widget--error",children:[t("auth.atLeast")||"At least"," ",minimumNumberOfRecoveryTokens]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{htmlType:"submit",primary:!0,className:"memori-auth-widget--submit",children:t("confirm")||"Submit"})]});var length;return withModal?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Modal__WEBPACK_IMPORTED_MODULE_2__.Z,{open:openModal||showModal,title:t("auth.title")||"Authentication",onClose:()=>setPwdOrTokens(null),closable:!1,children:form}):form},__WEBPACK_DEFAULT_EXPORT__=AuthWidget;try{AuthWidget.displayName="AuthWidget",AuthWidget.__docgenInfo={description:"",displayName:"AuthWidget",props:{pwdOrTokens:{defaultValue:null,description:"",name:"pwdOrTokens",required:!0,type:{name:'"password" | "tokens" | null'}},setPwdOrTokens:{defaultValue:null,description:"",name:"setPwdOrTokens",required:!0,type:{name:'(state: "password" | "tokens" | null) => void'}},onFinish:{defaultValue:null,description:"",name:"onFinish",required:!1,type:{name:"((values: AuthInputs) => Promise)"}},minimumNumberOfRecoveryTokens:{defaultValue:{value:"1"},description:"",name:"minimumNumberOfRecoveryTokens",required:!1,type:{name:"number"}},showTokens:{defaultValue:{value:"true"},description:"",name:"showTokens",required:!1,type:{name:"boolean"}},withModal:{defaultValue:{value:"false"},description:"",name:"withModal",required:!1,type:{name:"boolean"}},openModal:{defaultValue:{value:"false"},description:"",name:"openModal",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Auth/Auth.tsx#AuthWidget"]={docgenInfo:AuthWidget.__docgenInfo,name:"AuthWidget",path:"src/components/Auth/Auth.tsx#AuthWidget"})}catch(__react_docgen_typescript_loader_error){}try{Auth.displayName="Auth",Auth.__docgenInfo={description:"",displayName:"Auth",props:{pwdOrTokens:{defaultValue:null,description:"",name:"pwdOrTokens",required:!0,type:{name:'"password" | "tokens" | null'}},setPwdOrTokens:{defaultValue:null,description:"",name:"setPwdOrTokens",required:!0,type:{name:'(state: "password" | "tokens" | null) => void'}},onFinish:{defaultValue:null,description:"",name:"onFinish",required:!1,type:{name:"((values: AuthInputs) => Promise)"}},minimumNumberOfRecoveryTokens:{defaultValue:{value:"1"},description:"",name:"minimumNumberOfRecoveryTokens",required:!1,type:{name:"number"}},showTokens:{defaultValue:{value:"true"},description:"",name:"showTokens",required:!1,type:{name:"boolean"}},withModal:{defaultValue:{value:"false"},description:"",name:"withModal",required:!1,type:{name:"boolean"}},openModal:{defaultValue:{value:"false"},description:"",name:"openModal",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Auth/Auth.tsx#Auth"]={docgenInfo:Auth.__docgenInfo,name:"Auth",path:"src/components/Auth/Auth.tsx#Auth"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_icons_Warning__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Warning.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const BlockedMemoriBadge=({memoriName,blockedUntil,showGiverInfo=!1,showTitle=!1,marginLeft=!1})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.$)(),blockedUntilDate=new Date(blockedUntil);return blockedUntilDate>new Date?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{className:"blocked-memori-badge--tooltip",content:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.Fragment,{children:[!showGiverInfo&&t("memoriBlockedAnon",{name:memoriName,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(blockedUntilDate)}),showGiverInfo&&t("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(blockedUntilDate)}),showGiverInfo&&` ${t("memoriBlockedReasonExceedChats")}`,showGiverInfo&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("br",{}),showGiverInfo&&`\n${t("memoriBlockedGiverHelper")}`]}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:"blocked-memori-badge--wrapper",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"blocked-memori-badge "+(marginLeft?" margin-left":""),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Warning__WEBPACK_IMPORTED_MODULE_2__.default,{className:"blocked-memori-badge--icon"})}),showTitle&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"blocked-memori-badge--title",children:t("memoriBlockedTitle")})]})}):null},__WEBPACK_DEFAULT_EXPORT__=BlockedMemoriBadge;try{BlockedMemoriBadge.displayName="BlockedMemoriBadge",BlockedMemoriBadge.__docgenInfo={description:"",displayName:"BlockedMemoriBadge",props:{memoriName:{defaultValue:null,description:"",name:"memoriName",required:!0,type:{name:"string"}},blockedUntil:{defaultValue:null,description:"",name:"blockedUntil",required:!0,type:{name:"string"}},showGiverInfo:{defaultValue:{value:"false"},description:"",name:"showGiverInfo",required:!1,type:{name:"boolean"}},showTitle:{defaultValue:{value:"false"},description:"",name:"showTitle",required:!1,type:{name:"boolean"}},marginLeft:{defaultValue:{value:"false"},description:"",name:"marginLeft",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx#BlockedMemoriBadge"]={docgenInfo:BlockedMemoriBadge.__docgenInfo,name:"BlockedMemoriBadge",path:"src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx#BlockedMemoriBadge"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ChangeMode/ChangeMode.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _headlessui_react__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@headlessui/react/dist/components/radio-group/radio-group.js"),react_i18next__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChangeMode=({instruct,canInstruct,onChangeMode})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_3__.$)();return canInstruct?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori--changeMode-instruct",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.E,{name:"instruct",value:instruct?"instruct":"test",defaultValue:instruct?"instruct":"test",className:"memori--changeMode-instruct-radio",onChange:onChangeMode,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.E.Option,{value:"instruct",className:"memori--changeMode-instruct-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{primary:checked,children:t("widget.instruct")||"Instruct"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.E.Option,{value:"test",className:"memori--changeMode-instruct-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{primary:checked,children:t("widget.test")||"Test"})})]})}):null},__WEBPACK_DEFAULT_EXPORT__=ChangeMode;try{ChangeMode.displayName="ChangeMode",ChangeMode.__docgenInfo={description:"",displayName:"ChangeMode",props:{instruct:{defaultValue:null,description:"",name:"instruct",required:!1,type:{name:"boolean"}},onChangeMode:{defaultValue:null,description:"",name:"onChangeMode",required:!0,type:{name:'(mode: "instruct" | "test") => void'}},canInstruct:{defaultValue:null,description:"",name:"canInstruct",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChangeMode/ChangeMode.tsx#ChangeMode"]={docgenInfo:ChangeMode.__docgenInfo,name:"ChangeMode",path:"src/components/ChangeMode/ChangeMode.tsx#ChangeMode"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/CompletionProviderStatus/CompletionProviderStatus.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_icons_Warning__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Warning.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const CompletionProviderStatus=({forceStatus,provider})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.$)(),[status,setStatus]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(forceStatus??"none"),providerStatus=(provider=>{switch(provider){case"DEFAULT":case"OpenAI":return{getStatus:async()=>{const res=await fetch("https://status.openai.com/api/v2/summary.json");return(await res.json()).status.indicator??"none"},statusPage:"https://status.openai.com/"};default:return{getStatus:async()=>"none",statusPage:""}}})(provider);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{forceStatus||providerStatus.getStatus().then((status=>setStatus(status)))}),[forceStatus,provider]),"none"!==status?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{className:"memori--completion-provider-status--tooltip",align:"topLeft",content:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p",{children:t("completionProviderDown",{provider:provider??t("completionProviderFallbackName")})}),!!providerStatus.statusPage?.length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("a",{href:providerStatus.statusPage,rel:"noopener noreferrer",target:"_blank",children:t("completionProviderCheckStatusPage")})})]}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Warning__WEBPACK_IMPORTED_MODULE_2__.default,{className:"memori--completion-provider-status--icon"})}):null},__WEBPACK_DEFAULT_EXPORT__=CompletionProviderStatus;try{CompletionProviderStatus.displayName="CompletionProviderStatus",CompletionProviderStatus.__docgenInfo={description:"",displayName:"CompletionProviderStatus",props:{forceStatus:{defaultValue:null,description:"",name:"forceStatus",required:!1,type:{name:"string"}},provider:{defaultValue:null,description:"",name:"provider",required:!1,type:{name:"string | null"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/CompletionProviderStatus/CompletionProviderStatus.tsx#CompletionProviderStatus"]={docgenInfo:CompletionProviderStatus.__docgenInfo,name:"CompletionProviderStatus",path:"src/components/CompletionProviderStatus/CompletionProviderStatus.tsx#CompletionProviderStatus"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/DateSelector/DateSelector.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/listbox/listbox.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),moment__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/moment/moment.js"),moment__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_1__),react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/SelectIcon.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const months={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"]},DateSelector=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)((({defaultDate,onChange,disabled=!1})=>{const{t,i18n}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.$)(),[date,setDate]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(moment__WEBPACK_IMPORTED_MODULE_1___default()(defaultDate||Date.now()));return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{onChange(date)}),[date,onChange]),moment__WEBPACK_IMPORTED_MODULE_1___default().locale(i18n.language),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:"memori--date-selector",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori--date-selector__select",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R,{value:date,onChange:value=>{setDate(value)},disabled,name:"day",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Label,{className:"memori--date-selector__select-label",children:[t("day"),":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Button,{"aria-label":t("day"),className:"memori--date-selector__select-button",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--value",children:date.date()}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__.default,{})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((day=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Option,{value:date.clone().date(day+1),className:"memori--date-selector__select-option",children:day+1},day)))})})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori--date-selector__select",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R,{value:date,onChange:value=>{setDate(value)},disabled,name:"month",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Label,{className:"memori--date-selector__select-label",children:[t("month"),":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Button,{"aria-label":t("month"),className:"memori--date-selector__select-button",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--value",children:months["it"===i18n.language?"it":"en"][date.month()]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__.default,{})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Options,{className:"memori--date-selector__select-options",children:months["it"===i18n.language?"it":"en"].map((month=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Option,{className:"memori--date-selector__select-option",value:date.clone().month(months["it"===i18n.language?"it":"en"].findIndex((m=>m===month))),children:month},month)))})})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori--date-selector__select",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R,{value:date,onChange:value=>{setDate(value)},disabled,name:"year",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Label,{className:"memori--date-selector__select-label",children:[t("year"),":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Button,{"aria-label":t("year"),className:"memori--date-selector__select-button",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--value",children:date.year()}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__.default,{})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Options,{className:"memori--date-selector__select-options",children:[...Array(moment__WEBPACK_IMPORTED_MODULE_1___default()().year()-1899).keys()].sort(((a,b)=>b-a)).map((year=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.R.Option,{value:date.clone().year(year+1900),className:"memori--date-selector__select-option",children:year+1900},year)))})})]})})]})}));DateSelector.displayName="DateSelector";const __WEBPACK_DEFAULT_EXPORT__=DateSelector},"./src/components/ImageUpload/ImageUpload.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_ui_Message__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Message.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_ui_Modal__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Modal.tsx"),_ui_Spin__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/ui/Spin.tsx"),antd_lib_upload_Upload__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/antd/lib/upload/Upload.js"),antd_img_crop__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/antd-img-crop/dist/antd-img-crop.esm.js"),react_i18next__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_Edit__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/Edit.tsx"),_icons_Delete__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/icons/Delete.tsx"),_MediaWidget_MediaItemWidget__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/components/MediaWidget/MediaItemWidget.tsx"),_helpers_media__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./src/helpers/media.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react/jsx-runtime.js");const imgMimeTypes=["image/jpeg","image/png","image/jpg","image/gif"],UploadListItem=({originNode,file,tenantID,apiUrl,actions,resourceType})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_11__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"memori--list-item-wrapper"+("uploading"===file.status?" listItemUploading":""),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Spin__WEBPACK_IMPORTED_MODULE_5__.Z,{spinning:"uploading"===file.status,children:"error"===file.status?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__.Z,{content:t("media.uploadError"),children:originNode.props.children}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_MediaWidget_MediaItemWidget__WEBPACK_IMPORTED_MODULE_9__.e,{item:{mediumID:file.uid,mimeType:"uploading"===file.status?"image/png":file.name?.endsWith(".glb")?"model/gltf-binary":file.type||"image/png",title:file.name??"",url:"uploading"===file.status?"":file.response?.asset?.assetURL?file.response.asset.assetURL:(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({type:resourceType,resourceURI:file.thumbUrl,tenantID,apiURL:apiUrl}),content:`${(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({resourceURI:file.thumbUrl,type:resourceType,apiURL:apiUrl})}`},preview:!1})}),("success"===file.status||"done"===file.status)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"list-item-actions",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{outlined:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_Edit__WEBPACK_IMPORTED_MODULE_7__.default,{}),className:"action-button",title:t("edit")||"Edit",onClick:()=>actions?.download(file)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{outlined:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_Delete__WEBPACK_IMPORTED_MODULE_8__.default,{}),className:"action-button",title:t("delete")||"Delete",onClick:()=>actions?.remove(file)})]})]})};UploadListItem.displayName="UploadListItem";const ImageUpload=({uploadMultipleImages,maxNumberOfVisualizedUploads,uploadUrl,apiUrl,tenantID,fileList,maxFileSizeInMB=2,fileResolution,useImageCrop,uploadMessage,imageProportions=1,imageProportionsHelper,allowedMimeTypes,onRemove,onFileChanged,onUploadFinished,onFileNotValid,disabled,showHelper,additionalHelper,resourceType})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_11__.$)(),[internalFileList,setInternalFileList]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(fileList??[]),[fileTitleModal,setFileTitleModal]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),upload=(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd_lib_upload_Upload__WEBPACK_IMPORTED_MODULE_13__.default,{className:"memori--upload",disabled:disabled??!1,accept:(allowedMimeTypes??imgMimeTypes)?.join(",")+";capture=camera,camcorder",action:uploadUrl,listType:"picture-card",showUploadList:{showPreviewIcon:!0,showRemoveIcon:!0,showDownloadIcon:!0,downloadIcon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_Edit__WEBPACK_IMPORTED_MODULE_7__.default,{title:t("edit")||"Edit"})},beforeUpload:file=>{if(!(allowedMimeTypes??imgMimeTypes).find((x=>x===file.type))&&file.type)return console.debug("File not allowed",file,allowedMimeTypes??imgMimeTypes),_ui_Message__WEBPACK_IMPORTED_MODULE_1__.Z.error(t("media.uploadMimeTypeNotAllowed")),onFileNotValid&&onFileNotValid(),Promise.reject(t("media.uploadMimeTypeNotAllowed"));if(!(file.size/1024/1024<(maxFileSizeInMB??2)))return _ui_Message__WEBPACK_IMPORTED_MODULE_1__.Z.error(t("media.uploadSizeLimitMessage",{size:maxFileSizeInMB})),onFileNotValid&&onFileNotValid(),Promise.reject(t("media.uploadSizeLimitMessage",{size:maxFileSizeInMB}));if(fileResolution&&fileResolution.length){const reader=new FileReader;return reader.readAsDataURL(file),new Promise(((resolve,reject)=>{reader.addEventListener("load",(event=>{var newImg=new Image;newImg.style.padding="0px",newImg.style.margin="0px",newImg.onload=()=>{newImg.width===fileResolution[0]&&newImg.height===fileResolution[1]?resolve(file):(_ui_Message__WEBPACK_IMPORTED_MODULE_1__.Z.error(t("media.uploadWrongResolutionMessage",{width:fileResolution[0],height:fileResolution[1]})),reject(),onFileNotValid&&onFileNotValid())},newImg.src=event.target?.result?.toString()??""}))}))}return Promise.resolve(file)},supportServerRender:!0,fileList:internalFileList,multiple:uploadMultipleImages,maxCount:maxNumberOfVisualizedUploads||(uploadMultipleImages?100:1),onChange:info=>{setInternalFileList(info.fileList.map((f=>({...f,status:f.status??"error"})))),"done"===info.file.status&&onUploadFinished&&onUploadFinished(info.file)},onRemove,onDownload:file=>{let asset=file.response?.asset;if(asset){let title=asset.originalFileName&&file.name.includes(asset.originalFileName)?asset.originalFileName:file.name;setFileTitleModal({...asset,title:title??asset.title})}else setFileTitleModal({assetID:file.uid,title:file.name??file.fileName})},itemRender:(originNode,file,currFileList,actions)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(UploadListItem,{resourceType,originNode,file,fileList:internalFileList||currFileList,actions,tenantID,apiUrl}),children:uploadMessage});return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{"aria-live":"polite",children:[useImageCrop?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(antd_img_crop__WEBPACK_IMPORTED_MODULE_6__.Z,{rotate:!0,aspect:imageProportions,fillColor:"transparent",modalCancel:t("cancel")||"Cancel",modalMaskTransitionName:"none",modalTransitionName:"none",children:upload}):upload,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_ui_Modal__WEBPACK_IMPORTED_MODULE_4__.Z,{open:!!fileTitleModal,title:t("media.editAttributes"),onClose:()=>{setFileTitleModal(void 0)},footer:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment,{}),width:"100%",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("label",{htmlFor:"media-title-input",className:"media-title-label",children:t("media.title")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("input",{id:"media-title-input",className:"media-title-input",type:"text",name:"title",defaultValue:fileTitleModal?.title||"",onChange:e=>{setFileTitleModal({...fileTitleModal,title:e.target.value})}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"memori-modal--footer",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{onClick:()=>{setFileTitleModal(void 0)},children:t("cancel")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,onClick:()=>{onFileChanged&&fileTitleModal?.assetID&&onFileChanged(fileTitleModal.assetID,{...fileTitleModal}),setInternalFileList((fl=>fl.map((f=>f.uid===fileTitleModal?.assetID||f.response?.asset?.assetID===fileTitleModal?.assetID?{...f,title:fileTitleModal?.title,name:fileTitleModal?.title}:f)))),setFileTitleModal(void 0)},children:t("confirm")})]})]}),showHelper&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("legend",{className:"helper",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p",{children:t(allowedMimeTypes?"media.uploadHelper":"media.uploadHelperImages").replace("@size@",(maxFileSizeInMB??2).toString())}),imageProportionsHelper&&useImageCrop&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("p",{children:[t("media.scaleRatio"),": ",imageProportionsHelper]}),additionalHelper&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p",{children:additionalHelper})]})]})};ImageUpload.displayName="ImageUpload";const __WEBPACK_DEFAULT_EXPORT__=ImageUpload;try{ImageUpload.displayName="ImageUpload",ImageUpload.__docgenInfo={description:"",displayName:"ImageUpload",props:{uploadMultipleImages:{defaultValue:null,description:"",name:"uploadMultipleImages",required:!0,type:{name:"boolean"}},maxNumberOfVisualizedUploads:{defaultValue:null,description:"",name:"maxNumberOfVisualizedUploads",required:!1,type:{name:"number"}},fileList:{defaultValue:null,description:"",name:"fileList",required:!1,type:{name:"any[]"}},uploadUrl:{defaultValue:null,description:"",name:"uploadUrl",required:!0,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},tenantID:{defaultValue:null,description:"",name:"tenantID",required:!0,type:{name:"string"}},maxFileSizeInMB:{defaultValue:{value:"2"},description:"",name:"maxFileSizeInMB",required:!1,type:{name:"number"}},fileResolution:{defaultValue:null,description:"",name:"fileResolution",required:!1,type:{name:"number[]"}},useImageCrop:{defaultValue:null,description:"",name:"useImageCrop",required:!1,type:{name:"boolean"}},uploadMessage:{defaultValue:null,description:"",name:"uploadMessage",required:!0,type:{name:"string"}},imageProportions:{defaultValue:{value:"1"},description:"",name:"imageProportions",required:!1,type:{name:"number"}},imageProportionsHelper:{defaultValue:null,description:"",name:"imageProportionsHelper",required:!1,type:{name:"string"}},allowedMimeTypes:{defaultValue:null,description:"",name:"allowedMimeTypes",required:!1,type:{name:"string[]"}},onRemove:{defaultValue:null,description:"",name:"onRemove",required:!1,type:{name:"((file: UploadFile) => Promise)"}},onUploadFinished:{defaultValue:null,description:"",name:"onUploadFinished",required:!1,type:{name:"((file: UploadFile) => void)"}},onFileChanged:{defaultValue:null,description:"",name:"onFileChanged",required:!1,type:{name:"((assetID: string, asset: Partial) => void)"}},onFileNotValid:{defaultValue:null,description:"",name:"onFileNotValid",required:!1,type:{name:"(() => void)"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},showHelper:{defaultValue:null,description:"",name:"showHelper",required:!1,type:{name:"boolean"}},additionalHelper:{defaultValue:null,description:"",name:"additionalHelper",required:!1,type:{name:"string"}},resourceType:{defaultValue:null,description:"",name:"resourceType",required:!1,type:{name:"enum",value:[{value:'"cover"'},{value:'"avatar"'}]}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ImageUpload/ImageUpload.tsx#ImageUpload"]={docgenInfo:ImageUpload.__docgenInfo,name:"ImageUpload",path:"src/components/ImageUpload/ImageUpload.tsx#ImageUpload"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MemoriWidget/MemoriWidget.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>MemoriWidget_MemoriWidget});var react=__webpack_require__("./node_modules/react/index.js"),useTranslation=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),esm=__webpack_require__("./node_modules/@memori.ai/memori-api-client/esm/index.js"),es2019_module=__webpack_require__("./node_modules/standardized-audio-context/build/es2019/module.js"),SpeechConfig=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/SpeechConfig.js"),SpeechSynthesisOutputFormat=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/SpeechSynthesisOutputFormat.js"),SpeakerAudioDestination=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/Audio/SpeakerAudioDestination.js"),AudioConfig=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/Audio/AudioConfig.js"),SpeechSynthesizer=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/SpeechSynthesizer.js"),SpeechRecognizer=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/SpeechRecognizer.js"),ResultReason=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/ResultReason.js"),CancellationReason=__webpack_require__("./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/sdk/CancellationReason.js"),classnames=__webpack_require__("./node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),Message=__webpack_require__("./src/components/ui/Message.tsx"),Auth=__webpack_require__("./src/components/Auth/Auth.tsx"),Chat_Chat=__webpack_require__("./src/components/Chat/Chat.tsx"),StartPanel=__webpack_require__("./src/components/StartPanel/StartPanel.tsx"),Avatar=__webpack_require__("./src/components/Avatar/Avatar.tsx"),ChangeMode=__webpack_require__("./src/components/ChangeMode/ChangeMode.tsx"),Header=__webpack_require__("./src/components/Header/Header.tsx"),AttachmentMediaModal=__webpack_require__("./src/components/AttachmentMediaModal/AttachmentMediaModal.tsx"),AttachmentLinkModal=__webpack_require__("./src/components/AttachmentLinkModal/AttachmentLinkModal.tsx"),PoweredBy=__webpack_require__("./src/components/PoweredBy/PoweredBy.tsx"),Spin=__webpack_require__("./src/components/ui/Spin.tsx"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const layouts_FullPage=({Header,headerProps,Avatar,avatarProps,Chat,chatProps,StartPanel,startPanelProps,integrationStyle,integrationBackground,ChangeMode,changeModeProps,sessionId,hasUserActivatedSpeak,showInstruct=!1,loading=!1,poweredBy})=>(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[integrationStyle,integrationBackground,(0,jsx_runtime.jsxs)(Spin.Z,{spinning:loading,children:[showInstruct&&ChangeMode&&changeModeProps&&(0,jsx_runtime.jsx)(ChangeMode,{...changeModeProps}),Header&&headerProps&&(0,jsx_runtime.jsx)(Header,{...headerProps}),(0,jsx_runtime.jsxs)("div",{className:"memori--grid",children:[(0,jsx_runtime.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[Avatar&&avatarProps&&(0,jsx_runtime.jsx)(Avatar,{...avatarProps}),(0,jsx_runtime.jsx)("div",{id:"extension"})]}),(0,jsx_runtime.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:sessionId&&hasUserActivatedSpeak&&Chat&&chatProps?(0,jsx_runtime.jsx)(Chat,{...chatProps}):startPanelProps?(0,jsx_runtime.jsx)(StartPanel,{...startPanelProps}):null}),poweredBy]})]})]});try{FullPage.displayName="FullPage",FullPage.__docgenInfo={description:"",displayName:"FullPage",props:{Header:{defaultValue:null,description:"",name:"Header",required:!1,type:{name:"FC"}},headerProps:{defaultValue:null,description:"",name:"headerProps",required:!1,type:{name:"Props"}},Avatar:{defaultValue:null,description:"",name:"Avatar",required:!0,type:{name:"NamedExoticComponent"}},avatarProps:{defaultValue:null,description:"",name:"avatarProps",required:!1,type:{name:"Props"}},Chat:{defaultValue:null,description:"",name:"Chat",required:!1,type:{name:"NamedExoticComponent"}},chatProps:{defaultValue:null,description:"",name:"chatProps",required:!1,type:{name:"Props"}},StartPanel:{defaultValue:null,description:"",name:"StartPanel",required:!0,type:{name:"FC"}},startPanelProps:{defaultValue:null,description:"",name:"startPanelProps",required:!1,type:{name:"Props"}},integrationStyle:{defaultValue:null,description:"",name:"integrationStyle",required:!1,type:{name:"Element | null"}},integrationBackground:{defaultValue:null,description:"",name:"integrationBackground",required:!1,type:{name:"Element | null"}},ChangeMode:{defaultValue:null,description:"",name:"ChangeMode",required:!1,type:{name:"FC"}},changeModeProps:{defaultValue:null,description:"",name:"changeModeProps",required:!1,type:{name:"Props"}},poweredBy:{defaultValue:null,description:"",name:"poweredBy",required:!1,type:{name:"Element | null"}},sessionId:{defaultValue:null,description:"",name:"sessionId",required:!1,type:{name:"string"}},hasUserActivatedSpeak:{defaultValue:null,description:"",name:"hasUserActivatedSpeak",required:!1,type:{name:"boolean"}},showInstruct:{defaultValue:{value:"false"},description:"",name:"showInstruct",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/layouts/FullPage.tsx#FullPage"]={docgenInfo:FullPage.__docgenInfo,name:"FullPage",path:"src/components/layouts/FullPage.tsx#FullPage"})}catch(__react_docgen_typescript_loader_error){}const layouts_Totem=({Header,headerProps,Avatar,avatarProps,Chat,chatProps,StartPanel,startPanelProps,integrationStyle,integrationBackground,ChangeMode,changeModeProps,sessionId,hasUserActivatedSpeak,showInstruct=!1,loading=!1,poweredBy})=>(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[integrationStyle,integrationBackground,(0,jsx_runtime.jsxs)(Spin.Z,{spinning:loading,className:"memori-totem-layout",children:[poweredBy,showInstruct&&ChangeMode&&changeModeProps&&(0,jsx_runtime.jsx)(ChangeMode,{...changeModeProps}),(0,jsx_runtime.jsx)("div",{className:"memori-totem-layout--header",children:Header&&headerProps&&(0,jsx_runtime.jsx)(Header,{...headerProps})}),(0,jsx_runtime.jsx)("div",{className:"memori-totem-layout--avatar",children:Avatar&&avatarProps&&(0,jsx_runtime.jsx)(Avatar,{...avatarProps})}),(0,jsx_runtime.jsx)("div",{id:"extension"}),(0,jsx_runtime.jsx)("div",{className:"memori-totem-layout--controls",children:sessionId&&hasUserActivatedSpeak&&Chat&&chatProps?(0,jsx_runtime.jsx)(Chat,{...chatProps}):startPanelProps?(0,jsx_runtime.jsx)(StartPanel,{...startPanelProps}):null})]})]});try{Totem.displayName="Totem",Totem.__docgenInfo={description:"",displayName:"Totem",props:{Header:{defaultValue:null,description:"",name:"Header",required:!1,type:{name:"FC"}},headerProps:{defaultValue:null,description:"",name:"headerProps",required:!1,type:{name:"Props"}},Avatar:{defaultValue:null,description:"",name:"Avatar",required:!0,type:{name:"NamedExoticComponent"}},avatarProps:{defaultValue:null,description:"",name:"avatarProps",required:!1,type:{name:"Props"}},Chat:{defaultValue:null,description:"",name:"Chat",required:!1,type:{name:"NamedExoticComponent"}},chatProps:{defaultValue:null,description:"",name:"chatProps",required:!1,type:{name:"Props"}},StartPanel:{defaultValue:null,description:"",name:"StartPanel",required:!0,type:{name:"FC"}},startPanelProps:{defaultValue:null,description:"",name:"startPanelProps",required:!1,type:{name:"Props"}},integrationStyle:{defaultValue:null,description:"",name:"integrationStyle",required:!1,type:{name:"Element | null"}},integrationBackground:{defaultValue:null,description:"",name:"integrationBackground",required:!1,type:{name:"Element | null"}},ChangeMode:{defaultValue:null,description:"",name:"ChangeMode",required:!1,type:{name:"FC"}},changeModeProps:{defaultValue:null,description:"",name:"changeModeProps",required:!1,type:{name:"Props"}},poweredBy:{defaultValue:null,description:"",name:"poweredBy",required:!1,type:{name:"Element | null"}},sessionId:{defaultValue:null,description:"",name:"sessionId",required:!1,type:{name:"string"}},hasUserActivatedSpeak:{defaultValue:null,description:"",name:"hasUserActivatedSpeak",required:!1,type:{name:"boolean"}},showInstruct:{defaultValue:{value:"false"},description:"",name:"showInstruct",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/layouts/Totem.tsx#Totem"]={docgenInfo:Totem.__docgenInfo,name:"Totem",path:"src/components/layouts/Totem.tsx#Totem"})}catch(__react_docgen_typescript_loader_error){}const layouts_Chat=({Header,headerProps,Chat,chatProps,StartPanel,startPanelProps,integrationStyle,integrationBackground,ChangeMode,changeModeProps,sessionId,hasUserActivatedSpeak,showInstruct=!1,loading=!1,poweredBy})=>(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[integrationStyle,integrationBackground,(0,jsx_runtime.jsxs)(Spin.Z,{spinning:loading,className:"memori-chat-layout",children:[poweredBy,showInstruct&&ChangeMode&&changeModeProps&&(0,jsx_runtime.jsx)(ChangeMode,{...changeModeProps}),(0,jsx_runtime.jsx)("div",{className:"memori-chat-layout--header",children:Header&&headerProps&&(0,jsx_runtime.jsx)(Header,{...headerProps})}),(0,jsx_runtime.jsx)("div",{id:"extension"}),(0,jsx_runtime.jsx)("div",{className:"memori-chat-layout--controls",children:sessionId&&hasUserActivatedSpeak&&Chat&&chatProps?(0,jsx_runtime.jsx)(Chat,{...chatProps}):startPanelProps?(0,jsx_runtime.jsx)(StartPanel,{...startPanelProps}):null})]})]});try{Chat.displayName="Chat",Chat.__docgenInfo={description:"",displayName:"Chat",props:{Header:{defaultValue:null,description:"",name:"Header",required:!1,type:{name:"FC"}},headerProps:{defaultValue:null,description:"",name:"headerProps",required:!1,type:{name:"Props"}},Avatar:{defaultValue:null,description:"",name:"Avatar",required:!0,type:{name:"NamedExoticComponent"}},avatarProps:{defaultValue:null,description:"",name:"avatarProps",required:!1,type:{name:"Props"}},Chat:{defaultValue:null,description:"",name:"Chat",required:!1,type:{name:"NamedExoticComponent"}},chatProps:{defaultValue:null,description:"",name:"chatProps",required:!1,type:{name:"Props"}},StartPanel:{defaultValue:null,description:"",name:"StartPanel",required:!0,type:{name:"FC"}},startPanelProps:{defaultValue:null,description:"",name:"startPanelProps",required:!1,type:{name:"Props"}},integrationStyle:{defaultValue:null,description:"",name:"integrationStyle",required:!1,type:{name:"Element | null"}},integrationBackground:{defaultValue:null,description:"",name:"integrationBackground",required:!1,type:{name:"Element | null"}},ChangeMode:{defaultValue:null,description:"",name:"ChangeMode",required:!1,type:{name:"FC"}},changeModeProps:{defaultValue:null,description:"",name:"changeModeProps",required:!1,type:{name:"Props"}},poweredBy:{defaultValue:null,description:"",name:"poweredBy",required:!1,type:{name:"Element | null"}},sessionId:{defaultValue:null,description:"",name:"sessionId",required:!1,type:{name:"string"}},hasUserActivatedSpeak:{defaultValue:null,description:"",name:"hasUserActivatedSpeak",required:!1,type:{name:"boolean"}},showInstruct:{defaultValue:{value:"false"},description:"",name:"showInstruct",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/layouts/Chat.tsx#Chat"]={docgenInfo:Chat.__docgenInfo,name:"Chat",path:"src/components/layouts/Chat.tsx#Chat"})}catch(__react_docgen_typescript_loader_error){}var Button=__webpack_require__("./src/components/ui/Button.tsx"),Blob=__webpack_require__("./src/components/Blob/Blob.tsx"),Close=__webpack_require__("./src/components/icons/Close.tsx");const WebsiteAssistantLayout=({Header,headerProps,Avatar,avatarProps,Chat,chatProps,StartPanel,startPanelProps,integrationStyle,ChangeMode,changeModeProps,sessionId,hasUserActivatedSpeak,showInstruct=!1,loading=!1,poweredBy})=>{const{t}=(0,useTranslation.$)(),[collapsed,_setCollapsed]=(0,react.useState)(!0),[expandedKey,setExpandedKey]=(0,react.useState)(),stopAudio=(0,react.useMemo)((()=>chatProps?.stopAudio),[chatProps?.stopAudio]),setCollapsed=collapsed=>{_setCollapsed(collapsed),setExpandedKey(collapsed?void 0:(new Date).toISOString());try{stopAudio?.()}catch(e){console.log(e)}};return(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant--"+(collapsed?"collapsed":"expanded"),children:collapsed?(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,jsx_runtime.jsx)(Button.Z,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>setCollapsed(!1),title:t("expand")||"Expand",children:(0,jsx_runtime.jsx)(Blob.Z,{avatar:avatarProps?.memori.avatarURL})})}):(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[integrationStyle,(0,jsx_runtime.jsxs)(Spin.Z,{spinning:loading,className:"memori-website_assistant-layout",children:[poweredBy,(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,jsx_runtime.jsx)(Button.Z,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>setCollapsed(!0),icon:(0,jsx_runtime.jsx)(Close.default,{}),title:t("close")||"Close"})}),showInstruct&&ChangeMode&&changeModeProps&&(0,jsx_runtime.jsx)(ChangeMode,{...changeModeProps}),(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant-layout--header",children:Header&&headerProps&&(0,jsx_runtime.jsx)(Header,{...headerProps,showSettings:!1,showReload:!1})}),(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:Avatar&&avatarProps&&(0,react.createElement)(Avatar,{...avatarProps,integrationConfig:avatarProps.integrationConfig?{...avatarProps.integrationConfig,avatarURL:avatarProps.integrationConfig?.avatarURL?`${avatarProps.integrationConfig?.avatarURL.split("#")[0]}#${expandedKey}`:void 0}:{},key:expandedKey})}),(0,jsx_runtime.jsx)("div",{id:"extension"}),(0,jsx_runtime.jsx)("div",{className:"memori-website_assistant-layout--controls",children:sessionId&&hasUserActivatedSpeak&&Chat&&chatProps?(0,jsx_runtime.jsx)(Chat,{...chatProps}):startPanelProps?(0,jsx_runtime.jsx)(StartPanel,{...startPanelProps}):null})]})]})})};WebsiteAssistantLayout.displayName="WebsiteAssistantLayout";const layouts_WebsiteAssistant=WebsiteAssistantLayout;try{WebsiteAssistant.displayName="WebsiteAssistant",WebsiteAssistant.__docgenInfo={description:"",displayName:"WebsiteAssistant",props:{Header:{defaultValue:null,description:"",name:"Header",required:!1,type:{name:"FC"}},headerProps:{defaultValue:null,description:"",name:"headerProps",required:!1,type:{name:"Props"}},Avatar:{defaultValue:null,description:"",name:"Avatar",required:!0,type:{name:"NamedExoticComponent"}},avatarProps:{defaultValue:null,description:"",name:"avatarProps",required:!1,type:{name:"Props"}},Chat:{defaultValue:null,description:"",name:"Chat",required:!1,type:{name:"NamedExoticComponent"}},chatProps:{defaultValue:null,description:"",name:"chatProps",required:!1,type:{name:"Props"}},StartPanel:{defaultValue:null,description:"",name:"StartPanel",required:!0,type:{name:"FC"}},startPanelProps:{defaultValue:null,description:"",name:"startPanelProps",required:!1,type:{name:"Props"}},integrationStyle:{defaultValue:null,description:"",name:"integrationStyle",required:!1,type:{name:"Element | null"}},integrationBackground:{defaultValue:null,description:"",name:"integrationBackground",required:!1,type:{name:"Element | null"}},ChangeMode:{defaultValue:null,description:"",name:"ChangeMode",required:!1,type:{name:"FC"}},changeModeProps:{defaultValue:null,description:"",name:"changeModeProps",required:!1,type:{name:"Props"}},poweredBy:{defaultValue:null,description:"",name:"poweredBy",required:!1,type:{name:"Element | null"}},sessionId:{defaultValue:null,description:"",name:"sessionId",required:!1,type:{name:"string"}},hasUserActivatedSpeak:{defaultValue:null,description:"",name:"hasUserActivatedSpeak",required:!1,type:{name:"boolean"}},showInstruct:{defaultValue:{value:"false"},description:"",name:"showInstruct",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/layouts/WebsiteAssistant.tsx#WebsiteAssistant"]={docgenInfo:WebsiteAssistant.__docgenInfo,name:"WebsiteAssistant",path:"src/components/layouts/WebsiteAssistant.tsx#WebsiteAssistant"})}catch(__react_docgen_typescript_loader_error){}var translations=__webpack_require__("./src/helpers/translations.ts"),configuration=__webpack_require__("./src/helpers/configuration.ts"),utils=__webpack_require__("./src/helpers/utils.ts"),constants=__webpack_require__("./src/helpers/constants.ts"),error=__webpack_require__("./src/helpers/error.ts");const{deleteSession,getStatistics,initSession}=(0,esm.Z)(),BADGES_MAP=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,"🧠"]]),getBadge=points=>{const unlockedBadges=Array.from(BADGES_MAP.keys()).filter((k=>k<=points));if(unlockedBadges.length>0){const lastBadge=unlockedBadges[unlockedBadges.length-1];return BADGES_MAP.get(lastBadge)}return""},getNextBadge=badge=>{if("🆕"===badge)return{points:10,badge:"🐹"};let nextBadgePoints,nextBadge,currentSeen=!1;for(const[key,value]of BADGES_MAP){if(currentSeen){nextBadgePoints=key,nextBadge=value;break}value===badge&&(currentSeen=!0)}return nextBadge&&nextBadgePoints?{points:nextBadgePoints,badge:nextBadge}:void 0},getPointsForBadge=badge=>{let points=0;for(const[key,value]of BADGES_MAP)if(value===badge){points=key;break}return points};var AgeVerificationModal=__webpack_require__("./src/components/AgeVerificationModal/AgeVerificationModal.tsx"),SettingsDrawer=__webpack_require__("./src/components/SettingsDrawer/SettingsDrawer.tsx");const typeMessage=(message,waitForPrevious=!0,hidden=!1,typingText,useLoaderTextAsMsg=!1,hasBatchQueued=!1)=>{const e=new CustomEvent("MemoriTextEntered",{detail:{text:message,waitForPrevious,hidden,typingText,useLoaderTextAsMsg,hasBatchQueued}});document.dispatchEvent(e);window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))}),300)};let recognizer,speechConfig,speechSynthesizer,audioDestination,audioContext,memoriPassword;window.getMemoriState=integrationId=>{let widget=integrationId?document.querySelector(`.memori-widget[data-memori-integration="${integrationId}"]`)||document.querySelector("memori-client")?.shadowRoot?.querySelector(".memori-widget[data-memori-integration]"):document.querySelector(".memori-widget")||document.querySelector("memori-client")?.shadowRoot?.querySelector(".memori-widget");if(!widget)return null;let engineState=widget.dataset?.memoriEngineState;return engineState?JSON.parse(engineState):null},window.typeMessage=typeMessage,window.typeMessageHidden=(message,waitForPrevious=!0,typingText,useLoaderTextAsMsg=!1,hasBatchQueued=!1)=>typeMessage(message,waitForPrevious,!0,typingText,useLoaderTextAsMsg,hasBatchQueued),window.typeBatchMessages=messages=>{function disableInputs(){document.querySelector("fieldset#chat-fieldset")?.setAttribute("disabled","");const styles="opacity: 0.5; touch-action: none; pointer-events: none;";document.querySelector("textarea.memori-chat-textarea--input")?.setAttribute("style",styles),document.querySelector("button.memori-chat-inputs--send")?.setAttribute("style",styles),document.querySelector("button.memori-chat-inputs--mic")?.setAttribute("style",styles)}function reEnableInputs(){document.querySelector("fieldset#chat-fieldset")?.removeAttribute("disabled"),document.querySelector("textarea.memori-chat-textarea--input")?.removeAttribute("style"),document.querySelector("button.memori-chat-inputs--send")?.removeAttribute("style"),document.querySelector("button.memori-chat-inputs--mic")?.removeAttribute("style")}function areInputsDisabled(){return!!document.querySelector("fieldset#chat-fieldset")?.hasAttribute("disabled")}const isSafariIOS=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),stepsGenerator=function*(){yield*messages}();disableInputs();const submitNewMessage=()=>{const next=stepsGenerator.next(),step=next.value;if(step){areInputsDisabled()||disableInputs();let waitForPrevious=step.waitForPrevious;isSafariIOS&&(waitForPrevious=!1),typeMessage(step.message,waitForPrevious,step.hidden,step.typingText,step.useLoaderTextAsMsg,!next.done),isSafariIOS&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),reEnableInputs()}),3e3)}else areInputsDisabled()&&reEnableInputs();if(next.done)return document.removeEventListener("MemoriEndSpeak",submitNewMessage),void(areInputsDisabled()&&reEnableInputs())};document.addEventListener("MemoriEndSpeak",submitNewMessage),submitNewMessage()};let speakerMuted=!1,memoriSpeaking=!1;const MemoriWidget=({memori,memoriConfigs,memoriLang,multilingual,integration,layout="DEFAULT",customLayout,showInstruct=!1,showShare,preview=!1,embed=!1,showInputs=!0,showDates=!1,showContextPerLine=!1,showSettings=!0,showTypingText=!1,showClear=!1,showOnlyLastMessages,height="100vh",secret,baseUrl="https://app.twincreator.com",apiUrl="https://backend.memori.ai",initialContextVars,initialQuestion,ogImage,sessionID:initialSessionID,tenant,personification,authToken,AZURE_COGNITIVE_SERVICES_TTS_KEY,onStateChange,additionalInfo,additionalSettings,customMediaRenderer,userAvatar})=>{const{t,i18n}=(0,useTranslation.$)(),[isClient,setIsClient]=(0,react.useState)(!1);(0,react.useEffect)((()=>{setIsClient(!0)}),[]);const client=(0,esm.Z)(apiUrl),{initSession,postTextEnteredEvent,postPlaceChangedEvent,postTimeoutEvent,postTagChangedEvent,getSession,getContentQualityIndexes}=client,[instruct,setInstruct]=(0,react.useState)(!1),[user,setUser]=(0,react.useState)({avatarURL:"string"==typeof userAvatar?userAvatar:void 0}),[clickedStart,setClickedStart]=(0,react.useState)(!1),[gotErrorInOpening,setGotErrorInOpening]=(0,react.useState)(!1),language=memori.culture?.split("-")?.[0]?.toUpperCase()||memoriConfigs?.find((c=>c.memoriConfigID===memori.memoriConfigurationID))?.culture?.split("-")?.[0]?.toUpperCase(),integrationConfig=integration?.customData?JSON.parse(integration.customData):null,isMultilanguageEnabled=void 0!==multilingual?multilingual:!!integrationConfig?.multilanguage,[userLang,setUserLang]=(0,react.useState)(memoriLang??integrationConfig?.lang??language??integrationConfig?.uiLang??i18n.language??"IT"),[loading,setLoading]=(0,react.useState)(!1),[memoriTyping,setMemoriTyping]=(0,react.useState)(!1),[typingText,setTypingText]=(0,react.useState)(),selectedLayout=layout||integrationConfig?.layout||"DEFAULT",[hasUserActivatedSpeak,setHasUserActivatedSpeak]=(0,react.useState)(!1),[hasUserActivatedListening,setHasUserActivatedListening]=(0,react.useState)(!1),[showPositionDrawer,setShowPositionDrawer]=(0,react.useState)(!1),[showSettingsDrawer,setShowSettingsDrawer]=(0,react.useState)(!1),[muteSpeaker,setMuteSpeaker]=(0,react.useState)(!1),[continuousSpeech,setContinuousSpeech]=(0,react.useState)(!1),[continuousSpeechTimeout,setContinuousSpeechTimeout]=(0,react.useState)(2),[isPlayingAudio,setIsPlayingAudio]=(0,react.useState)(!1),[controlsPosition,setControlsPosition]=(0,react.useState)("center"),[hideEmissions,setHideEmissions]=(0,react.useState)(!1);(0,react.useEffect)((()=>{setIsPlayingAudio(!!speechSynthesizer),memoriSpeaking=!!speechSynthesizer}),[speechSynthesizer]),(0,react.useEffect)((()=>{let defaultControlsPosition="bottom",microphoneMode=(0,configuration.wm)("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(defaultControlsPosition="bottom",microphoneMode="HOLD_TO_TALK"):defaultControlsPosition=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",setMuteSpeaker((0,configuration.wm)("muteSpeaker",!1)),speakerMuted=(0,configuration.wm)("muteSpeaker",!1),setContinuousSpeech("CONTINUOUS"===microphoneMode),setContinuousSpeechTimeout((0,configuration.wm)("continuousSpeechTimeout",2)),setControlsPosition((0,configuration.wm)("controlsPosition",defaultControlsPosition)),setHideEmissions((0,configuration.wm)("hideEmissions",!1))}),[]);const[memoriPwd,setMemoriPwd]=(0,react.useState)(secret),[memoriTokens,setMemoriTokens]=(0,react.useState)(),[authModalState,setAuthModalState]=(0,react.useState)(null),[position,_setPosition]=(0,react.useState)(),applyPosition=async(venue,sessionID)=>{const session=sessionID??sessionId;if(venue&&session){const{currentState,...response}=await postPlaceChangedEvent({sessionId:session,placeName:venue.placeName,latitude:venue.latitude,longitude:venue.longitude,uncertaintyKm:venue.uncertainty??0});currentState&&0===response.resultCode&&setCurrentDialogState({...currentDialogState,...currentState})}},[userMessage,setUserMessage]=(0,react.useState)(""),[listening,setListening]=(0,react.useState)(!1),[history,setHistory]=(0,react.useState)([]),pushMessage=message=>{setHistory((history=>[...history,{...message,media:message.media?.filter((m=>!("text/javascript"===m.mimeType&&m.properties?.executable)))??[]}]))},sendMessage=async(text,media,newSessionId,translate=!0,translatedText,hidden=!1,typingText,useLoaderTextAsMsg=!1,hasBatchQueued=!1)=>{const sessionID=newSessionId||sessionId||window.getMemoriState()?.sessionID;if(!sessionID||!text?.length)return;hidden||pushMessage({text,translatedText,fromUser:!0,media:media??[],initial:sessionId?!!newSessionId&&newSessionId!==sessionId:!!newSessionId}),setMemoriTyping(!0),setTypingText(typingText);let msg=text,gotError=!1;if(translate&&!instruct&&isMultilanguageEnabled&&userLang.toUpperCase()!==language.toUpperCase()){msg=(await(0,translations.i)(text,language,userLang,baseUrl)).text}const{currentState,...response}=await postTextEnteredEvent({sessionId:sessionID,text:msg});if(0===response.resultCode&¤tState){const emission=useLoaderTextAsMsg&&typingText?typingText:currentState.emission??currentDialogState?.emission;if("X4"===currentState.state&&memori.giverTag){const{currentState,...resp}=await postTagChangedEvent(sessionID,memori.giverTag);0===resp.resultCode?(setCurrentDialogState(currentState),emission&&(pushMessage({text:emission,media:currentState.media,fromUser:!1}),speak(emission))):(console.error(response,resp),Message.Z.error(t((0,error.r)(resp.resultCode))),gotError=!0)}else if("X2d"===currentState.state&&memori.giverTag){const{currentState,...resp}=await postTextEnteredEvent({sessionId:sessionID,text:Math.random().toString().substring(2,8)});if(0===resp.resultCode){const{currentState,...resp}=await postTagChangedEvent(sessionID,memori.giverTag);0===resp.resultCode?(setCurrentDialogState(currentState),emission&&(pushMessage({text:emission,media:currentState.media,fromUser:!1}),speak(emission))):(console.error(response,resp),Message.Z.error(t((0,error.r)(resp.resultCode))),gotError=!0)}else console.error(response,resp),Message.Z.error(t((0,error.r)(resp.resultCode))),gotError=!0}else userLang.toLowerCase()!==language.toLowerCase()&&emission&&!instruct&&isMultilanguageEnabled?translateDialogState(currentState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})):(setCurrentDialogState({...currentState,emission}),emission&&(pushMessage({text:emission,media:currentState.media,fromUser:!1,generatedByAI:!!currentState.completion}),speak(emission)))}else 404===response.resultCode&&(setHistory((h=>[...h.slice(0,h.length-1)])),reopenSession(!1,memoriPwd||memori.secretToken,memoriTokens,instruct&&memori.giverTag?memori.giverTag:void 0,instruct&&memori.giverPIN?memori.giverPIN:void 0,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion).then((state=>{console.info("session timeout"),state?.sessionID&&setTimeout((()=>{sendMessage(text,media,state?.sessionID)}),500)})));hasBatchQueued||(setTypingText(void 0),setMemoriTyping(!1))},translateDialogState=async(state,userLang)=>{const emission=state.emission??currentDialogState?.emission;let translatedState={...state},translatedMsg=null;if(emission&&!instruct&&language.toUpperCase()!==userLang.toUpperCase()&&isMultilanguageEnabled){const t=await(0,translations.i)(emission,userLang,language,baseUrl);if(state.hints&&state.hints.length>0){const translatedHints=await Promise.all((state.hints??[]).map((async hint=>{const tHint=await(0,translations.i)(hint,userLang,language,baseUrl);return{text:tHint?.text??hint,originalText:hint}})));translatedState={...state,emission:t.text,translatedHints}}else translatedState={...state,emission:t.text,hints:state.hints??("G1"===state.state?currentDialogState?.hints:[])};t.text.length>0&&(translatedMsg={text:t.text,media:state.media,fromUser:!1,generatedByAI:!!state.completion})}else translatedState={...state,emission},emission&&(translatedMsg={text:emission,media:state.media,fromUser:!1});return setCurrentDialogState(translatedState),translatedMsg&&pushMessage(translatedMsg),translatedState},minAge=void 0!==memori.ageRestriction?memori.ageRestriction:memori.nsfw?18:memori.enableCompletions?14:0,[birthDate,setBirthDate]=(0,react.useState)(),[showAgeVerification,setShowAgeVerification]=(0,react.useState)(!1),[sessionId,setSessionId]=(0,react.useState)(initialSessionID),[currentDialogState,_setCurrentDialogState]=(0,react.useState)(),setCurrentDialogState=state=>{_setCurrentDialogState(state),onStateChange&&onStateChange(state);const executableSnippets=state?.media?.filter((m=>"text/javascript"===m.mimeType&&!!m.properties?.executable));executableSnippets?.forEach((s=>{try{setTimeout((()=>{console.log("snippet",s),new Function(s.content??"")(),setTimeout((()=>{document.querySelector(".memori-chat--content")?.scrollTo(0,document.querySelector(".memori-chat--content")?.scrollHeight??0)}),400)}),1e3)}catch(e){console.error(e)}}))},fetchSession=async params=>{let storageBirthDate=(0,configuration.wm)("birthDate",void 0);if(birthDate||storageBirthDate||!minAge)if("PUBLIC"===memori.privacyType||memori.secretToken||memoriPwd||memoriTokens){setLoading(!0);try{if(!memori.giverTag&&memori.receivedInvitations?.length){let giverInvitation=memori.receivedInvitations.find((i=>"GIVER"===i.type&&"ACCEPTED"===i.state));giverInvitation&&(memori.giverTag=giverInvitation.tag,memori.giverPIN=giverInvitation.pin)}let referral;try{referral=window.location.href}catch(err){console.error(err)}const session=await initSession({...params,tag:params.tag??personification?.tag,pin:params.pin??personification?.pin,additionalInfo:{...additionalInfo||{},loginToken:additionalInfo?.loginToken??loginToken??authToken,language:getCultureCodeByLanguage(userLang),referral}});if(session?.sessionID&&session?.currentState&&0===session.resultCode)return setSessionId(session.sessionID),position&&applyPosition(position,session.sessionID),setLoading(!1),{dialogState:session.currentState,sessionID:session.sessionID};session?.resultMessage.startsWith("This Memori is aged restricted")?(console.error(session),Message.Z.error(t("underageTwinSession",{age:minAge})),setGotErrorInOpening(!0)):403===session?.resultCode?(setMemoriPwd(void 0),setAuthModalState("password")):(console.error(session),Message.Z.error(t((0,error.r)(session?.resultCode))),setGotErrorInOpening(!0))}catch(err){console.error(err),new Error("Error fetching session")}}else setAuthModalState("password");else setShowAgeVerification(!0)},reopenSession=async(updateDialogState=!1,password,recoveryTokens,tag,pin,initialContextVars,initialQuestion,birthDate)=>{setLoading(!0);try{let referral,storageBirthDate=(0,configuration.wm)("birthDate",void 0);if(!birthDate&&!storageBirthDate&&minAge)return void setShowAgeVerification(!0);if(!("PUBLIC"===memori.privacyType||password||memori.secretToken||memoriPwd||recoveryTokens||memoriTokens))return void setAuthModalState("password");try{referral=window.location.href}catch(err){console.error(err)}const{sessionID,currentState,...response}=await initSession({memoriID:memori.engineMemoriID??"",password:password||memoriPwd||memori.secretToken,recoveryTokens:recoveryTokens||memoriTokens,tag,pin,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birthDate:birthDate||storageBirthDate||void 0,additionalInfo:{...additionalInfo||{},loginToken:additionalInfo?.loginToken??loginToken??authToken,language:getCultureCodeByLanguage(userLang),referral}});if(sessionID&¤tState&&0===response.resultCode)return setSessionId(sessionID),updateDialogState&&(setCurrentDialogState(currentState),currentState.emission&&(history.length<=1?setHistory([{text:currentState.emission,media:currentState.media,fromUser:!1,initial:!0}]):pushMessage({text:currentState.emission,media:currentState.media,fromUser:!1,initial:!0}))),position&&applyPosition(position,sessionID),setLoading(!1),{dialogState:currentState,sessionID};response?.resultMessage.startsWith("This Memori is aged restricted")?(console.error(response),Message.Z.error(t("underageTwinSession",{age:minAge})),setGotErrorInOpening(!0)):403===response?.resultCode?(setMemoriPwd(void 0),setAuthModalState("password")):(console.error(response),Message.Z.error(t((0,error.r)(response.resultCode))),setGotErrorInOpening(!0))}catch(err){console.error(err)}return setLoading(!1),null},changeTag=async(memoriId,sessionId,tag,pin)=>{if(!memoriId||!sessionId)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState,resultCode}=await postTagChangedEvent(sessionId,tag??constants.QV);if(0===resultCode){let textResult=0;if(tag!==constants.QV&&pin&&("X1a"===currentState.state||"X1b"===currentState.state)){const{resultCode:textResultCode}=await postTextEnteredEvent({sessionId,text:pin??""});textResult=textResultCode}if(0===textResult){const{currentState,...response}=await getSession(sessionId);if(0===response.resultCode&¤tState)return{currentState,sessionId,...response}}else if([400,401,403,404,500].includes(resultCode)){console.warn("[APPCONTEXT/CHANGETAG]",resultCode);let referral,storageBirthDate=(0,configuration.wm)("birthDate",void 0);try{referral=window.location.href}catch(err){console.error(err)}fetchSession({memoriID:memori.engineMemoriID??"",password:secret||memoriPwd||memori.secretToken,tag:memori.giverTag,pin:memori.giverPIN,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birthDate:birthDate||storageBirthDate||void 0,additionalInfo:{...additionalInfo||{},loginToken:additionalInfo?.loginToken??loginToken??authToken,language:getCultureCodeByLanguage(userLang),referral}})}else if(currentState)return{currentState,sessionId,resultCode}}}catch(_e){let err=_e;return console.error("[APPCONTEXT/CHANGETAG]",err),Promise.reject(err)}return null};(0,react.useEffect)((()=>()=>{currentDialogState&¤tDialogState?.currentTag===memori.giverTag||(async()=>{sessionId&&memori.giverTag&&memori.giverPIN&&(setHistory([]),await changeTag(memori.engineMemoriID,sessionId,memori.giverTag,memori.giverPIN))})()}),[]);const[userInteractionTimeout,setUserInteractionTimeout]=(0,react.useState)(),timeoutRef=(0,react.useRef)(),clearInteractionTimeout=()=>{userInteractionTimeout&&(clearTimeout(userInteractionTimeout),setUserInteractionTimeout(void 0)),timeoutRef?.current&&(clearTimeout(timeoutRef.current),timeoutRef.current=void 0)},resetInteractionTimeout=()=>{clearInteractionTimeout(),!currentDialogState?.acceptsTimeout||speechSynthesizer||isPlayingAudio||userMessage.length||memoriTyping||listening||setInteractionTimeout()},handleTimeout=async()=>{if(speechSynthesizer||isPlayingAudio||userMessage.length||memoriTyping||listening)resetInteractionTimeout();else if(sessionId&&hasUserActivatedSpeak&¤tDialogState?.acceptsTimeout){const{currentState,...response}=await postTimeoutEvent(sessionId);if(0===response.resultCode&¤tState){const emission=currentState.emission;!instruct&&isMultilanguageEnabled&&userLang!==i18n?.language&&emission&&emission.length>0?translateDialogState({...currentState,emission},userLang).then((ts=>{ts.emission&&speak(ts.emission)})):emission&&emission.length>0&&(pushMessage({text:emission,media:currentState.media,fromUser:!1,generatedByAI:!!currentState.completion}),speak(emission),setCurrentDialogState({...currentState,hints:currentState.hints??("G1"===currentState.state?currentDialogState?.hints:[])}))}}},setInteractionTimeout=()=>{let timeout=currentDialogState?.timeout;if(!timeout){let timeoutLimit=40,timeoutMinLimit=25;if(timeout=Math.floor(Math.random()*(timeoutLimit-timeoutMinLimit))+timeoutMinLimit,currentDialogState?.emission){timeout+=currentDialogState.emission.length/26.5}}let uiTimeout=setTimeout(handleTimeout,1e3*timeout);setUserInteractionTimeout(uiTimeout),timeoutRef.current=uiTimeout};(0,react.useEffect)((()=>{(userMessage.length||isPlayingAudio||memoriTyping)&&clearInteractionTimeout(),sessionId&&!userMessage.length&&resetInteractionTimeout()}),[currentDialogState?.acceptsTimeout,currentDialogState?.timeout,currentDialogState?.state,isPlayingAudio,sessionId,history,userMessage,memoriTyping]),(0,react.useEffect)((()=>()=>{setHasUserActivatedSpeak(!1),setClickedStart(!1),clearInteractionTimeout(),timeoutRef.current=void 0}),[]);const getTTSVoice=(0,react.useCallback)((lang=>{let voice="";switch((lang??memori.culture?.split("-")?.[0]??i18n.language??"IT").toUpperCase()){case"IT":voice=""+("MALE"===memori.voiceType?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":voice=""+("MALE"===memori.voiceType?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":voice=""+("MALE"===memori.voiceType?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":voice=""+("MALE"===memori.voiceType?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":voice=""+("MALE"===memori.voiceType?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":voice=""+("MALE"===memori.voiceType?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":voice=""+("MALE"===memori.voiceType?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":voice=""+("MALE"===memori.voiceType?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;case"PL":voice=""+("MALE"===memori.voiceType?"pl-PL-MarekNeural":"pl-PL-AgnieszkaNeural");break;case"FI":voice=""+("MALE"===memori.voiceType?"fi-FI-HarriNeural":"fi-FI-SelmaNeural");break;default:voice=""+("MALE"===memori.voiceType?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return voice}),[memori.voiceType,i18n.language,memori.culture]),getCultureCodeByLanguage=lang=>{let voice="";switch((lang||memori.culture?.split("-")?.[0]||i18n.language||"IT").toUpperCase()){case"IT":default:voice="it-IT";break;case"DE":voice="de-DE";break;case"EN":voice="en-GB";break;case"ES":voice="es-ES";break;case"FR":voice="fr-FR";break;case"PT":voice="pt-PT";break;case"UK":voice="uk-UK";break;case"RU":voice="ru-RU";break;case"PL":voice="pl-PL";break;case"FI":voice="fi-FI"}return voice},[phonemesMap,setPhonemesMap]=(0,react.useState)();(0,react.useEffect)((()=>{(async()=>{try{const lexiconReq=await fetch(`${baseUrl||"https://app.twincreator.com"}/api/lexiconmap`);return await lexiconReq.json()}catch(err){console.error(err)}})().then((lexicon=>{setPhonemesMap(lexicon)}))}),[]);const emitEndSpeakEvent=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},speak=text=>{if(!AZURE_COGNITIVE_SERVICES_TTS_KEY||preview)return void emitEndSpeakEvent();if(stopListening(),preview)return;if(muteSpeaker||speakerMuted)return memoriSpeaking=!1,setMemoriTyping(!1),emitEndSpeakEvent(),void(continuousSpeech&&setListeningTimeout());audioDestination&&audioDestination.pause();let isSafari=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),isIOS=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===audioContext.state)return void audioContext.resume().then((()=>speak(text)));if("closed"===audioContext.state){audioContext=new es2019_module.Hm;let buffer=audioContext.createBuffer(1,1e4,22050),source=audioContext.createBufferSource();source.buffer=buffer,source.connect(audioContext.destination)}else if("suspended"===audioContext.state){stopAudio(),audioContext=new es2019_module.Hm;let buffer=audioContext.createBuffer(1,1e4,22050),source=audioContext.createBufferSource();source.buffer=buffer,source.connect(audioContext.destination)}if(!speechSynthesizer){isIOS||(audioDestination=new SpeakerAudioDestination.K);let audioConfig=AudioConfig.rU.fromSpeakerOutput(audioDestination);speechSynthesizer=new SpeechSynthesizer.a(speechConfig,audioConfig)}const source=audioContext.createBufferSource();source.addEventListener("ended",(()=>{setIsPlayingAudio(!1),memoriSpeaking=!1})),audioDestination.onAudioEnd=()=>{setIsPlayingAudio(!1),memoriSpeaking=!1,source.disconnect(),emitEndSpeakEvent(),onEndSpeakStartListen()},speechSynthesizer.speakSsmlAsync(`${((text,lang)=>{if(!phonemesMap)return text;const phonemes={...phonemesMap.common??{},...tenant?.id&&phonemesMap[tenant.id]?phonemesMap[tenant.id]:{}};return Object.keys(phonemes).map((word=>({word,phoneme:phonemes[word][lang.toLowerCase()]??phonemes[word].default,caseSensitive:phonemes[word].caseSensitive}))).reduce(((acc,{word,phoneme,caseSensitive})=>acc.replace(new RegExp(`\\b${word}\\b`,caseSensitive?"g":"gi"),`${word}`)),text)})((text=>{const el=document.createElement("textarea");return el.textContent=text,el.innerHTML})((0,utils.h)(text)),userLang.toLowerCase())}`,(result=>{if(result){setIsPlayingAudio(!0),memoriSpeaking=!0;try{audioContext.decodeAudioData(result.audioData,(function(buffer){source.buffer=buffer,source.connect(audioContext.destination),(history.length<1||isSafari&&isIOS)&&source.start(0)})),audioContext.onstatechange=()=>{"suspended"===audioContext.state||"closed"===audioContext.state?(source.disconnect(),setIsPlayingAudio(!1),memoriSpeaking=!1):"interrupted"===audioContext.state&&audioContext.resume()},audioContext.resume(),speechSynthesizer&&(speechSynthesizer.close(),speechSynthesizer=null)}catch(e){console.error("speak error: ",e),window.speechSynthesis.speak(new SpeechSynthesisUtterance(text)),setIsPlayingAudio(!1),memoriSpeaking=!1,speechSynthesizer&&(speechSynthesizer.close(),speechSynthesizer=null),emitEndSpeakEvent()}}else audioContext.resume(),setIsPlayingAudio(!1),memoriSpeaking=!1,emitEndSpeakEvent()}),(error=>{console.error("speak:",error),window.speechSynthesis.speak(new SpeechSynthesisUtterance(text)),setIsPlayingAudio(!1),memoriSpeaking=!1,emitEndSpeakEvent()})),setMemoriTyping(!1)},stopAudio=()=>{setIsPlayingAudio(!1),memoriSpeaking=!1;try{speechSynthesizer&&(speechSynthesizer.close(),speechSynthesizer=null),"closed"!==audioContext.state&&audioContext.close(),audioDestination&&(audioDestination.pause(),audioDestination.close())}catch(e){console.error("stopAudio error: ",e)}};(0,react.useEffect)((()=>{let textarea=document.querySelector("#chat-fieldset textarea");textarea&&textarea.focus()}),[currentDialogState?.emission]);const[transcript,setTranscript]=(0,react.useState)(""),resetTranscript=()=>setTranscript(""),[transcriptTimeout,setTranscriptTimeout]=(0,react.useState)(null),setListeningTimeout=()=>{let timeout=setTimeout((async()=>{clearListening();const message=(0,utils.vw)(transcript);message.length>0&&listening?(sendMessage(message),resetTranscript(),setUserMessage("")):listening&&resetInteractionTimeout()}),1e3*continuousSpeechTimeout);setTranscriptTimeout(timeout)},clearListeningTimeout=()=>{transcriptTimeout&&(clearTimeout(transcriptTimeout),setTranscriptTimeout(null))};(0,react.useEffect)((()=>{clearListeningTimeout(),continuousSpeech&&setListeningTimeout(),resetInteractionTimeout()}),[transcript]);const startListening=()=>{if(AZURE_COGNITIVE_SERVICES_TTS_KEY){clearListening(),setTranscript(""),resetTranscript();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(_stream){setHasUserActivatedListening(!0),speechConfig||(speechConfig=SpeechConfig.c.fromSubscription(AZURE_COGNITIVE_SERVICES_TTS_KEY,"eastus"),speechConfig.speechRecognitionLanguage=getCultureCodeByLanguage(userLang),speechConfig.speechSynthesisLanguage=getCultureCodeByLanguage(userLang),speechConfig.speechSynthesisVoiceName=getTTSVoice(userLang));const audioConfig=AudioConfig.rU.fromDefaultMicrophoneInput();recognizer=new SpeechRecognizer.F(speechConfig,audioConfig),setListening(!0),recognizer.recognized=(_s,e)=>{if(e.result.text)if(e.result.reason===ResultReason.s.RecognizedSpeech){let transcript=e.result.text;if(setTranscript(transcript||""),transcript?.length>0){const transcriptMessage=(0,utils.vw)(transcript);transcriptMessage.length>0&&setUserMessage((msg=>`${msg} ${transcriptMessage}`))}}else e.result.reason===ResultReason.s.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},recognizer.canceled=(_s,e)=>{e.reason===CancellationReason._.Error&&(console.debug(`"CANCELED: ErrorCode=${e.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${e.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),stopListening()},recognizer.sessionStopped=(_s,_e)=>{stopListening()},resetTranscript(),recognizer.startContinuousRecognitionAsync()})).catch(console.error)}catch(error){console.error(error)}}},stopListening=()=>{recognizer&&(recognizer.stopContinuousRecognitionAsync(),recognizer.close(),recognizer=null),setListening(!1)},clearListening=()=>{setHasUserActivatedListening(!1),stopListening(),clearListeningTimeout()},resetUIEffects=()=>{try{clearListening(),clearInteractionTimeout(),setClickedStart(!1),timeoutRef.current=void 0,stopAudio()}catch(e){console.log("Error: resetUIEffects",e)}};(0,react.useEffect)((()=>()=>{resetUIEffects()}),[]),(0,react.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",resetUIEffects),()=>{document.removeEventListener("MemoriResetUIEffects",resetUIEffects)})),[]),(0,react.useEffect)((()=>{"Z0"===currentDialogState?.state&&clearListening()}),[currentDialogState?.state]);const[requestedListening,setRequestedListening]=(0,react.useState)(!1),onEndSpeakStartListen=(0,react.useCallback)((_e=>{isPlayingAudio&&speechSynthesizer&&(speechSynthesizer.close(),speechSynthesizer=null),!continuousSpeech||!hasUserActivatedListening&&requestedListening||(setRequestedListening(!0),startListening())}),[continuousSpeech,hasUserActivatedListening]);(0,react.useEffect)((()=>{history.length>1&&!isPlayingAudio&&continuousSpeech&&(hasUserActivatedListening||!requestedListening)?startListening():isPlayingAudio&&listening&&stopListening()}),[isPlayingAudio]),(0,react.useEffect)((()=>{listening&&(clearListening(),resetTranscript(),setUserMessage(""),startListening())}),[language]);const[sendOnEnter,setSendOnEnter]=(0,react.useState)("keypress");(0,react.useEffect)((()=>{const stored=(0,configuration.wm)("sendOnEnter","keypress");window.innerWidth<=768?setSendOnEnter("click"):setSendOnEnter(stored)}),[]),(0,react.useEffect)((()=>{(0,configuration.A2)("sendOnEnter",sendOnEnter)}),[sendOnEnter]);const[attachmentsMenuOpen,setAttachmentsMenuOpen]=(0,react.useState)(),globalBackground=integrationConfig?.globalBackground,globalBackgroundUrl=globalBackground?`url(${globalBackground})`:null,integrationProperties=integration?{"--memori-chat-bubble-bg":"#fff",...integrationConfig&&!showInstruct?{"--memori-text-color":integrationConfig.textColor??"#000"}:{},...integrationConfig?.buttonBgColor?{"--memori-button-bg":integrationConfig.buttonBgColor,"--memori-primary":integrationConfig.buttonBgColor}:{},...integrationConfig?.buttonTextColor?{"--memori-button-text":integrationConfig.buttonTextColor}:{},...integrationConfig?.blurBackground?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...integrationConfig?.innerBgColor?{"--memori-inner-bg":`rgba(${"dark"===integrationConfig.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${integrationConfig.innerBgAlpha??.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===integrationConfig.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${integrationConfig?.innerBgAlpha??.4})`}:{"--memori-inner-content-pad":"0px"}}:{},integrationStylesheet=`\n ${preview?"#preview,":"WEBSITE_ASSISTANT"===selectedLayout?"":":root,"} .memori-widget {\n ${Object.entries(integrationProperties).map((([key,value])=>`${key}: ${value};`)).join("\n")}\n }\n `,showAIicon=void 0===integrationConfig?.showAIicon||integrationConfig?.showAIicon,[avatar3dVisible,setAvatar3dVisible]=(0,react.useState)(!1);(0,react.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===selectedLayout||"FULLPAGE"!==selectedLayout)&&setAvatar3dVisible(!0)}),[]);const[gamificationLevel,setGamificationLevel]=(0,react.useState)();(0,react.useEffect)((()=>{memori.engineMemoriID&&(async memoriID=>{let gamificationPoints,unansQuestions;try{const{contentQualityIndex,answerQualityIndex,unansweredQuestions,...cqResp}=await getContentQualityIndexes(memoriID);0===cqResp.resultCode&&(gamificationPoints=contentQualityIndex,unansQuestions=unansweredQuestions)}catch(_e){let err=_e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",err)}return{points:gamificationPoints??0,unansweredQuestions:unansQuestions??0}})(memori.engineMemoriID).then((value=>{setGamificationLevel((points=>{const roundedPoints=Math.round(points),badge=getBadge(roundedPoints);return{points:roundedPoints,badge,pointsForCurrentBadge:getPointsForBadge(badge),nextBadge:getNextBadge(badge)}})(value.points))})).catch(console.error)}),[memori.engineMemoriID]),(0,react.useEffect)((()=>{if(integrationConfig?.seoTitle){let meta=document.createElement("meta");meta.setAttribute("property","og:title"),meta.setAttribute("content",integrationConfig.seoTitle),document.head.append(meta)}if(integrationConfig?.seoDescription){let meta=document.createElement("meta");meta.setAttribute("property","og:description"),meta.setAttribute("content",integrationConfig.seoDescription),document.head.append(meta)}if(integrationConfig?.seoUrl){let meta=document.createElement("meta");meta.setAttribute("property","og:url"),meta.setAttribute("content",integrationConfig.seoUrl),document.head.append(meta)}let image=ogImage||memori.avatarURL;if(integrationConfig?.seoImageShowAvatar&&image){let meta=document.createElement("meta");meta.setAttribute("property","og:image"),meta.setAttribute("content",image),document.head.append(meta)}}),[integrationConfig,memori.avatarURL,ogImage]);const memoriTextEnteredHandler=(0,react.useCallback)((e=>{const{text,waitForPrevious,hidden,typingText,useLoaderTextAsMsg,hasBatchQueued}=e.detail;text&&(waitForPrevious&&!speakerMuted&&(memoriSpeaking||memoriTyping)?setTimeout((()=>{memoriTextEnteredHandler(e)}),1e3):(stopListening(),stopAudio(),sendMessage(text,void 0,void 0,void 0,void 0,hidden,typingText,useLoaderTextAsMsg,hasBatchQueued)))}),[sessionId,isPlayingAudio,memoriTyping,userLang]);(0,react.useEffect)((()=>(document.addEventListener("MemoriTextEntered",memoriTextEnteredHandler),()=>{document.removeEventListener("MemoriTextEntered",memoriTextEnteredHandler)})),[sessionId,userLang]);const onClickStart=(0,react.useCallback)((async session=>{const sessionID=session?.sessionID||sessionId,dialogState=session?.dialogState||currentDialogState;setClickedStart(!0);let memoriAudioElement=document.getElementById("memori-audio"),isSafari=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");memoriAudioElement&&isSafari&&(memoriAudioElement.muted=!1,memoriAudioElement.play().catch((e=>{console.error("error playing intro audio",e)})));let storageBirthDate=(0,configuration.wm)("birthDate",void 0),birth=birthDate||storageBirthDate||void 0;if(sessionID||!minAge||birth){if(!sessionID&&"PUBLIC"!==memori.privacyType&&!memori.secretToken&&!memoriPwd&&!memoriTokens||!sessionID&&gotErrorInOpening)return setAuthModalState("password"),void setClickedStart(!1);if(!sessionID){setClickedStart(!1),setGotErrorInOpening(!1);const session=await fetchSession({memoriID:memori.engineMemoriID,password:secret||memoriPwd||memori.secretToken,tag:personification?.tag,pin:personification?.pin,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birthDate:birth});return void(session?.dialogState?(setHistory([]),translateDialogState(session.dialogState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}))):await onClickStart(session||void 0))}if(initialSessionID){const{currentState,...response}=await getSession(sessionID);if(0!==response.resultCode||!currentState)return console.debug("session expired, opening new session"),setGotErrorInOpening(!0),setSessionId(void 0),setClickedStart(!1),void await onClickStart();if(setHistory([]),instruct&&memori.giverTag&¤tDialogState?.currentTag!==memori.giverTag)try{console.debug("change tag #0"),await changeTag(memori.engineMemoriID,sessionID,"-");const session=await changeTag(memori.engineMemoriID,sessionID,memori.giverTag,memori.giverPIN);if(!session||0!==session.resultCode)throw console.error("session #1",session),new Error("No session");translateDialogState(session.currentState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}))}catch(e){console.error("session #2",e),reopenSession(!0,memori?.secretToken,void 0,memori?.giverTag,memori?.giverPIN,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birth).then((()=>{setHasUserActivatedSpeak(!0)}))}else if(!instruct&&personification&¤tDialogState?.currentTag!==personification.tag)try{console.debug("change tag #3"),await changeTag(memori.engineMemoriID,sessionID,"-");const session=await changeTag(memori.engineMemoriID,sessionID,personification.tag,personification.pin);if(!session||0!==session.resultCode)throw console.error("session #4",session),new Error("No session");translateDialogState(session.currentState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}))}catch(e){console.error("session #5",e),reopenSession(!0,memori?.secretToken,void 0,personification.tag,personification.pin,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birth).then((()=>{setHasUserActivatedSpeak(!0)}))}else if(instruct||personification||currentDialogState?.currentTag===constants.QV)translateDialogState(currentState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}));else try{console.debug("change tag #6"),await changeTag(memori.engineMemoriID,sessionID,"-");const session=await changeTag(memori.engineMemoriID,sessionID,constants.QV);if(!session||0!==session.resultCode)throw console.error("session #7",session),new Error("No session");translateDialogState(session.currentState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}))}catch(e){console.error("session #8",e),reopenSession(!0,memori?.secretToken,void 0,void 0,void 0,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birth).then((()=>{setHasUserActivatedSpeak(!0)}))}}else setHistory([]),translateDialogState(dialogState,userLang).then((ts=>{ts.emission&&speak(ts.emission)})).finally((()=>{setHasUserActivatedSpeak(!0)}))}else setShowAgeVerification(!0),setClickedStart(!1)}),[memoriPwd,memori,memoriTokens,birthDate,sessionId,userLang]),[loginToken,setLoginToken]=(0,react.useState)(additionalInfo?.loginToken??authToken);(0,react.useEffect)((()=>{const targetNode=document.querySelector(`memori-client[memoriname="${memori.name}"]`)||document.querySelector(`memori-client[memoriid="${memori.memoriID}"]`)||document.querySelector("memori-client");if(!targetNode)return;const observer=new MutationObserver(((mutationList,_observer)=>{for(const mutation of mutationList)"attributes"===mutation.type&&"authtoken"===mutation.attributeName?.toLowerCase()&&("MEMORI-CLIENT"===mutation.target.nodeName?setLoginToken(mutation.target.getAttribute("authtoken")||void 0):setLoginToken(mutation.target?.parentElement?.getAttribute("authtoken")||void 0))}));return observer.observe(targetNode,{attributes:!0,childList:!1,subtree:!1}),()=>{observer.disconnect()}}),[]);const showFullHistory=void 0===showOnlyLastMessages?"TOTEM"!==layout&&"WEBSITE_ASSISTANT"!==layout:!showOnlyLastMessages,headerProps={memori,tenant,history,showShare:showShare??integrationConfig?.showShare??!0,position,setShowPositionDrawer,setShowSettingsDrawer,showSpeaker:!!AZURE_COGNITIVE_SERVICES_TTS_KEY,speakerMuted:muteSpeaker||speakerMuted,setSpeakerMuted:mute=>{if(speakerMuted=!!mute,setMuteSpeaker(mute),(0,configuration.A2)("muteSpeaker",!!mute),mute)stopAudio();else{audioContext=new es2019_module.Hm;let buffer=audioContext.createBuffer(1,1e4,22050),source=audioContext.createBufferSource();source.buffer=buffer,source.connect(audioContext.destination)}},showSettings,hasUserActivatedSpeak,showReload:"TOTEM"===selectedLayout,showClear,clearHistory:()=>setHistory((h=>h.slice(-1)))},avatarProps={memori,integration,integrationConfig,tenant,instruct,avatar3dVisible,setAvatar3dVisible,hasUserActivatedSpeak,isPlayingAudio:isPlayingAudio&&!muteSpeaker,loading:!!memoriTyping,baseUrl,apiUrl},startPanelProps={memori,tenant,gamificationLevel,language,userLang,setUserLang,baseUrl,apiUrl,position,openPositionDrawer:()=>setShowPositionDrawer(!0),integrationConfig,instruct,sessionId,clickedStart,onClickStart,initializeTTS:()=>{if(!AZURE_COGNITIVE_SERVICES_TTS_KEY)return;speechConfig=SpeechConfig.c.fromSubscription(AZURE_COGNITIVE_SERVICES_TTS_KEY,"eastus"),speechConfig.speechSynthesisLanguage=getCultureCodeByLanguage(userLang),speechConfig.speechSynthesisVoiceName=getTTSVoice(userLang),speechConfig.speechRecognitionLanguage=getCultureCodeByLanguage(userLang),(0,utils.xZ)()&&(speechConfig.speechSynthesisOutputFormat=SpeechSynthesisOutputFormat.Y.Audio16Khz32KBitRateMonoMp3),audioContext=new es2019_module.Hm;let buffer=audioContext.createBuffer(1,1e4,22050),source=audioContext.createBufferSource();source.buffer=buffer,source.connect(audioContext.destination),audioDestination=new SpeakerAudioDestination.K;let audioConfig=AudioConfig.rU.fromSpeakerOutput(audioDestination);speechSynthesizer=new SpeechSynthesizer.a(speechConfig,audioConfig)}},chatProps={memori,sessionID:sessionId||"",tenant,translateTo:isMultilanguageEnabled&&userLang.toUpperCase()!==(memori.culture?.split("-")?.[0]??i18n.language??"IT")?.toUpperCase()?userLang:void 0,baseUrl,apiUrl,layout,memoriTyping,typingText,showTypingText,history:showFullHistory?history:history.slice(-2),authToken:loginToken,dialogState:currentDialogState,setDialogState:setCurrentDialogState,pushMessage,simulateUserPrompt:(text,translatedText)=>{stopListening(),stopAudio(),sendMessage(text,void 0,void 0,!1,translatedText)},showDates,showContextPerLine,showAIicon,client,selectReceiverTag:async tag=>{if(sessionId)try{const{currentState,...resp}=await postTagChangedEvent(sessionId,tag);if(0===resp.resultCode)if(pushMessage({text:tag,fromUser:!0}),"X4"===currentState.state&&memori.giverTag){const{currentState,...resp}=await client.postTagChangedEvent(sessionId,memori.giverTag);0===resp.resultCode?(setCurrentDialogState(currentState),currentState.emission&&pushMessage({text:currentState.emission,media:currentState.media,fromUser:!1})):(console.error(resp),Message.Z.error(t((0,error.r)(resp.resultCode))))}else setCurrentDialogState(currentState),currentState.emission&&pushMessage({text:currentState.emission,media:currentState.media,fromUser:!1});else console.error(resp,tag,currentDialogState?.knownTags?.[tag]),Message.Z.error(t((0,error.r)(resp.resultCode)))}catch(e){let err=e;console.error(err),Message.Z.error(err.message)}},preview,sendOnEnter,setSendOnEnter,microphoneMode:continuousSpeech?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen,setAttachmentsMenuOpen,instruct,showInputs,showMicrophone:!!AZURE_COGNITIVE_SERVICES_TTS_KEY,userMessage,onChangeUserMessage:value=>{if(!value||"\n"===value||""===value.trim())return setUserMessage(""),void resetInteractionTimeout();setUserMessage(value),clearInteractionTimeout()},sendMessage:msg=>{stopAudio(),stopListening(),sendMessage(msg),setUserMessage(""),resetTranscript()},stopListening:clearListening,startListening,stopAudio,resetTranscript,listening,isPlayingAudio,customMediaRenderer,user,userAvatar},integrationBackground=integration&&globalBackgroundUrl?(0,jsx_runtime.jsx)("div",{className:"memori--global-background",children:(0,jsx_runtime.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:globalBackgroundUrl}})}):(0,jsx_runtime.jsx)("div",{className:"memori--global-background no-background-image"}),integrationStyle=integration?(0,jsx_runtime.jsx)("style",{dangerouslySetInnerHTML:{__html:integrationStylesheet}}):null,changeModeProps={canInstruct:!!memori.giverTag,instruct:!!instruct,onChangeMode:mode=>{setInstruct("instruct"===mode),setHasUserActivatedSpeak(!1),setClickedStart(!1)}},poweredBy=(0,jsx_runtime.jsx)(PoweredBy.Z,{tenant,userLang}),Layout=customLayout||("TOTEM"===selectedLayout?layouts_Totem:"CHAT"===selectedLayout?layouts_Chat:"FULLPAGE"===selectedLayout?layouts_FullPage:"WEBSITE_ASSISTANT"===selectedLayout?layouts_WebsiteAssistant:layouts_FullPage);return(0,jsx_runtime.jsxs)("div",{className:classnames_default()("memori","memori-widget",`memori-layout-${layout.toLowerCase()}`,`memori-controls-${controlsPosition.toLowerCase()}`,`memori--avatar-${integrationConfig?.avatar||"default"}`,{"memori--preview":preview,"memori--embed":embed,"memori--with-integration":integration,"memori--with-speechkey":!!AZURE_COGNITIVE_SERVICES_TTS_KEY,"memori--active":hasUserActivatedSpeak,"memori--hide-emissions":hideEmissions,"memori--has-active-session":!!sessionId}),"data-memori-name":memori?.name,"data-memori-id":memori?.engineMemoriID,"data-memori-secondary-id":memori?.memoriID,"data-memori-session-id":sessionId,"data-memori-integration":integration?.integrationID,"data-memori-engine-state":JSON.stringify({...currentDialogState,sessionID:sessionId}),style:{height},children:[(0,jsx_runtime.jsx)(Layout,{Header:Header.Z,headerProps,Avatar:Avatar.Z,avatarProps,Chat:Chat_Chat.Z,chatProps,StartPanel:StartPanel.Z,startPanelProps,integrationStyle,integrationBackground,ChangeMode:ChangeMode.Z,changeModeProps,poweredBy,sessionId,hasUserActivatedSpeak,showInstruct,loading}),(0,jsx_runtime.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://app.twincreator.com/intro.mp3"}),isClient&&(0,jsx_runtime.jsx)(Auth.Z,{withModal:!0,pwdOrTokens:authModalState,openModal:!!authModalState,setPwdOrTokens:setAuthModalState,showTokens:"SECRET"===memori.privacyType,onFinish:async values=>{values.password&&setMemoriPwd(values.password),values.password&&(memoriPassword=values.password),values.tokens&&setMemoriTokens(values.tokens),reopenSession(!sessionId,values.password,values.tokens,instruct?memori.giverTag:personification?.tag,instruct?memori.giverPIN:personification?.pin,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birthDate).then((state=>{setAuthModalState(null),onClickStart(state||void 0)})).catch((()=>{setAuthModalState(null),setGotErrorInOpening(!0)}))},minimumNumberOfRecoveryTokens:memori?.minimumNumberOfRecoveryTokens??1}),isClient&&(0,jsx_runtime.jsx)(AgeVerificationModal.Z,{visible:showAgeVerification,minAge,onClose:birthDate=>{birthDate?(setBirthDate(birthDate),(0,configuration.A2)("birthDate",birthDate),reopenSession(!sessionId,memoriPassword||memoriPwd||memori?.secretToken,memoriTokens,instruct?memori.giverTag:personification?.tag,instruct?memori.giverPIN:personification?.pin,{PATHNAME:window.location.pathname,ROUTE:window.location.pathname?.split("/")?.pop()||"",...initialContextVars||{}},initialQuestion,birthDate).then((state=>{setShowAgeVerification(!1),setAuthModalState(null),onClickStart(state||void 0)})).catch((()=>{setShowAgeVerification(!1),setGotErrorInOpening(!0)}))):(setShowAgeVerification(!1),setClickedStart(!1))}}),showSettingsDrawer&&(0,jsx_runtime.jsx)(SettingsDrawer.Z,{layout:selectedLayout,open:!!showSettingsDrawer,onClose:()=>setShowSettingsDrawer(!1),microphoneMode:continuousSpeech?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout,setMicrophoneMode:mode=>setContinuousSpeech("CONTINUOUS"===mode),setContinuousSpeechTimeout,controlsPosition,setControlsPosition,hideEmissions,setHideEmissions,additionalSettings}),sessionId&&(0,jsx_runtime.jsx)(AttachmentLinkModal.Z,{apiURL:apiUrl,visible:"link"===attachmentsMenuOpen,onCancel:()=>setAttachmentsMenuOpen(void 0),onOk:async link=>{if(!sessionId)return;let medium={mediumID:"",mimeType:"text/html",url:link.url,title:link.title};pushMessage({text:t("media.insertThisLink",{url:medium.url,title:medium.title}),fromUser:!0,media:[medium]});try{const{currentState,...resp}=await client.postMediumSelectedEvent(sessionId,medium);currentState&&0===resp.resultCode?(setCurrentDialogState(currentState),currentState.emission&&(pushMessage({text:currentState.emission,media:currentState.media,fromUser:!1}),speak(currentState.emission))):(console.error(resp,currentState,medium),Message.Z.error(t((0,error.r)(resp.resultCode),{ns:"common"})))}catch(e){let err=e;console.error(err),Message.Z.error(err.message)}setAttachmentsMenuOpen(void 0)}}),loginToken&&sessionId&&tenant?.id&&(0,jsx_runtime.jsx)(AttachmentMediaModal.Z,{apiURL:apiUrl,visible:"media"===attachmentsMenuOpen,authToken:loginToken,tenantID:tenant?.id,sessionID:sessionId,uploadAssetURL:client.backend.getUploadAssetURL(loginToken,memori.memoriID),deleteAsset:client.backend.deleteAsset,onCancel:()=>setAttachmentsMenuOpen(void 0),onOk:async asset=>{if(!sessionId)return;let medium={mediumID:"",mimeType:asset.mimeType,url:asset.assetURL,title:asset.title||asset.assetID};pushMessage({text:t("media.insertThisMediaMsg"),fromUser:!0,media:[medium]});try{const{currentState,...resp}=await client.postMediumSelectedEvent(sessionId,medium);currentState&&0===resp.resultCode?(setCurrentDialogState(currentState),currentState.emission&&(pushMessage({text:currentState.emission,media:currentState.media,fromUser:!1}),speak(currentState.emission))):(console.error(resp,currentState,medium),Message.Z.error(t((0,error.r)(resp.resultCode),{ns:"common"})))}catch(e){let err=e;console.error(err),Message.Z.error(err.message)}setAttachmentsMenuOpen(void 0)}})]})};MemoriWidget.displayName="MemoriWidget";const MemoriWidget_MemoriWidget=MemoriWidget;try{MemoriWidget.displayName="MemoriWidget",MemoriWidget.__docgenInfo={description:"",displayName:"MemoriWidget",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},memoriConfigs:{defaultValue:null,description:"",name:"memoriConfigs",required:!1,type:{name:"MemoriConfig[]"}},memoriLang:{defaultValue:null,description:"",name:"memoriLang",required:!1,type:{name:"string"}},multilingual:{defaultValue:null,description:"",name:"multilingual",required:!1,type:{name:"boolean"}},integration:{defaultValue:null,description:"",name:"integration",required:!1,type:{name:"Integration"}},layout:{defaultValue:{value:"DEFAULT"},description:"",name:"layout",required:!1,type:{name:"enum",value:[{value:'"DEFAULT"'},{value:'"FULLPAGE"'},{value:'"TOTEM"'},{value:'"CHAT"'},{value:'"WEBSITE_ASSISTANT"'}]}},customLayout:{defaultValue:null,description:"",name:"customLayout",required:!1,type:{name:"FC"}},showShare:{defaultValue:null,description:"",name:"showShare",required:!1,type:{name:"boolean"}},showInstruct:{defaultValue:{value:"false"},description:"",name:"showInstruct",required:!1,type:{name:"boolean"}},showInputs:{defaultValue:{value:"true"},description:"",name:"showInputs",required:!1,type:{name:"boolean"}},showDates:{defaultValue:{value:"false"},description:"",name:"showDates",required:!1,type:{name:"boolean"}},showContextPerLine:{defaultValue:{value:"false"},description:"",name:"showContextPerLine",required:!1,type:{name:"boolean"}},showSettings:{defaultValue:{value:"true"},description:"",name:"showSettings",required:!1,type:{name:"boolean"}},showClear:{defaultValue:{value:"false"},description:"",name:"showClear",required:!1,type:{name:"boolean"}},showOnlyLastMessages:{defaultValue:null,description:"",name:"showOnlyLastMessages",required:!1,type:{name:"boolean"}},showTypingText:{defaultValue:{value:"false"},description:"",name:"showTypingText",required:!1,type:{name:"boolean"}},preview:{defaultValue:{value:"false"},description:"",name:"preview",required:!1,type:{name:"boolean"}},embed:{defaultValue:{value:"false"},description:"",name:"embed",required:!1,type:{name:"boolean"}},height:{defaultValue:{value:"100vh"},description:"",name:"height",required:!1,type:{name:"string | number"}},secret:{defaultValue:null,description:"",name:"secret",required:!1,type:{name:"string"}},baseUrl:{defaultValue:{value:"https://app.twincreator.com"},description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:{value:"https://backend.memori.ai"},description:"",name:"apiUrl",required:!1,type:{name:"string"}},initialContextVars:{defaultValue:null,description:"",name:"initialContextVars",required:!1,type:{name:"{ [key: string]: string; }"}},initialQuestion:{defaultValue:null,description:"",name:"initialQuestion",required:!1,type:{name:"string"}},ogImage:{defaultValue:null,description:"",name:"ogImage",required:!1,type:{name:"string"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!1,type:{name:"string"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},personification:{defaultValue:null,description:"",name:"personification",required:!1,type:{name:"{ name?: string; tag: string; pin: string; }"}},authToken:{defaultValue:null,description:"",name:"authToken",required:!1,type:{name:"string"}},AZURE_COGNITIVE_SERVICES_TTS_KEY:{defaultValue:null,description:"",name:"AZURE_COGNITIVE_SERVICES_TTS_KEY",required:!1,type:{name:"string"}},onStateChange:{defaultValue:null,description:"",name:"onStateChange",required:!1,type:{name:"((state?: DialogState) => void)"}},additionalInfo:{defaultValue:null,description:"",name:"additionalInfo",required:!1,type:{name:"({ loginToken?: string; language?: string; referral?: string | undefined; } & { [key: string]: string; }) | undefined"}},customMediaRenderer:{defaultValue:null,description:"",name:"customMediaRenderer",required:!1,type:{name:"((mimeType: string) => Element | null)"}},additionalSettings:{defaultValue:null,description:"",name:"additionalSettings",required:!1,type:{name:"Element | null"}},userAvatar:{defaultValue:null,description:"",name:"userAvatar",required:!1,type:{name:"string | Element"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MemoriWidget/MemoriWidget.tsx#MemoriWidget"]={docgenInfo:MemoriWidget.__docgenInfo,name:"MemoriWidget",path:"src/components/MemoriWidget/MemoriWidget.tsx#MemoriWidget"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/PoweredBy/PoweredBy.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/jsx-runtime.js");const PoweredBy=({tenant,userLang="en"})=>{const tenantId="memorytwin"===tenant?.theme?"memorytwin":"twincreator";return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:"memori--powered-by",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img",{src:`https://app.twincreator.com/images/${tenantId}/logo.png`,alt:""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p",{children:["Powered by"," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a",{href:`https://app.${tenantId}.com/${userLang?userLang.toLowerCase():""}`,target:"_blank",rel:"noopener noreferrer",children:"memorytwin"===tenantId?"MemoryTwin":"TwinCreator"})]})]})};PoweredBy.displayName="PoweredBy";const __WEBPACK_DEFAULT_EXPORT__=PoweredBy;try{PoweredBy.displayName="PoweredBy",PoweredBy.__docgenInfo={description:"",displayName:"PoweredBy",props:{tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},userLang:{defaultValue:{value:"en"},description:"",name:"userLang",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/PoweredBy/PoweredBy.tsx#PoweredBy"]={docgenInfo:PoweredBy.__docgenInfo,name:"PoweredBy",path:"src/components/PoweredBy/PoweredBy.tsx#PoweredBy"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/StartPanel/StartPanel.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_helpers_media__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./src/helpers/media.ts"),react_i18next__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_helpers_translations__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./src/helpers/translations.ts"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Translation__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Translation.tsx"),_helpers_constants__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/helpers/constants.ts"),_BlockedMemoriBadge_BlockedMemoriBadge__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx"),_icons_AI__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/icons/AI.tsx"),_CompletionProviderStatus_CompletionProviderStatus__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/CompletionProviderStatus/CompletionProviderStatus.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/react/jsx-runtime.js");const StartPanel=({memori,tenant,gamificationLevel,language,userLang,setUserLang,baseUrl,apiUrl,position,openPositionDrawer,integrationConfig,instruct=!1,clickedStart,onClickStart,initializeTTS,_TEST_forceProviderStatus})=>{const{t,i18n}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_9__.$)(),[translatedDescription,setTranslatedDescription]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(memori.description),[showTranslation,setShowTranslation]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!0);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{(i18n.language?.toUpperCase()??"IT")!==(language?.toUpperCase()??"IT")&&memori.description?.length&&(0,_helpers_translations__WEBPACK_IMPORTED_MODULE_10__.i)(memori.description,i18n.language?.toUpperCase()??"IT",language,baseUrl).then((value=>{setTranslatedDescription(value.text)})).catch(console.error)}),[i18n.language,language,memori.description,baseUrl]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div",{className:"memori--start-panel",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div",{className:"memori--cover",style:{backgroundImage:`url("${(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({type:"cover",tenantID:tenant?.id,resourceURI:memori.coverURL,baseURL:baseUrl,apiURL:apiUrl})}"), url("${(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({type:"cover",tenantID:tenant?.id,baseURL:baseUrl,apiURL:apiUrl})}")`},children:[!!gamificationLevel?.badge?.length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div",{className:"memori--gamification-badge",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:`${t("gamification.level")} ${gamificationLevel.badge}, ${gamificationLevel.points} ${t("gamification.points")}`,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span",{"aria-label":`${t("gamification.level")} ${gamificationLevel.badge}, ${gamificationLevel.points} ${t("gamification.points")}`,children:gamificationLevel.badge})})}),!!memori.enableCompletions&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div",{className:"memori--completions-enabled",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:t("completionsEnabled"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span",{"aria-label":t("completionsEnabled")||"Completions",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_icons_AI__WEBPACK_IMPORTED_MODULE_6__.default,{})})})}),!!memori.nsfw&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div",{className:"memori--nsfw",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:t("nsfw"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span",{title:t("nsfw")||"NSFW",children:"🔞"})})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("picture",{className:"memori--avatar",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("source",{src:memori.avatarURL??(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl,apiURL:apiUrl})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("img",{alt:memori.name,src:memori.avatarURL&&memori.avatarURL.length>0?(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl,apiURL:apiUrl}):(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({type:"avatar",tenantID:tenant?.id,baseURL:baseUrl,apiURL:apiUrl})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("h2",{className:"memori--title",children:memori.name}),memori.needsPosition&&!position&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div",{className:"memori--needsPosition",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("p",{children:t("write_and_speak.requirePosition")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,onClick:()=>openPositionDrawer(),className:"memori--start-button",children:t("widget.position")})]}),(memori.needsPosition&&position||!memori.needsPosition)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div",{className:"memori--description",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span",{className:"memori--description-text",children:translatedDescription&&showTranslation?translatedDescription:memori.description}),translatedDescription!==memori.description&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{ghost:!0,className:"memori--translation-toggle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_icons_Translation__WEBPACK_IMPORTED_MODULE_3__.default,{}),onClick:()=>{setShowTranslation((show=>!show))},children:t(showTranslation?"showOriginalText":"showTranslatedText")})]}),integrationConfig?.multilanguage&&!instruct&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div",{className:"memori--language-chooser",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref",children:t("write_and_speak.iWantToTalkToIn",{name:memori.name})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("select",{id:"user-lang-pref",className:"memori-select--button",value:(userLang??i18n.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{setUserLang(e.target.value)},children:_helpers_constants__WEBPACK_IMPORTED_MODULE_4__.cG.map((lang=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("option",{value:lang.value,"aria-label":lang.label,children:lang.label},lang.value)))})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,disabled:!!memori.blockedUntil&&!memori.isGiver,loading:clickedStart,onClick:_e=>{try{window.speechSynthesis.speak(new SpeechSynthesisUtterance(""))}catch(e){console.error(e)}initializeTTS&&initializeTTS(),onClickStart&&onClickStart()},className:"memori--start-button",children:t("write_and_speak."+(instruct?"instructButton":"tryMeButton"))}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_CompletionProviderStatus_CompletionProviderStatus__WEBPACK_IMPORTED_MODULE_7__.Z,{provider:memori.completionProvider,forceStatus:_TEST_forceProviderStatus}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("p",{className:"memori--start-description",children:t(instruct?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")}),!!memori.blockedUntil&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_BlockedMemoriBadge_BlockedMemoriBadge__WEBPACK_IMPORTED_MODULE_5__.Z,{memoriName:memori.name,blockedUntil:memori.blockedUntil,showGiverInfo:memori.isGiver,showTitle:!0,marginLeft:!0})]})]})};StartPanel.displayName="StartPanel";const __WEBPACK_DEFAULT_EXPORT__=StartPanel;try{StartPanel.displayName="StartPanel",StartPanel.__docgenInfo={description:"",displayName:"StartPanel",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},gamificationLevel:{defaultValue:null,description:"",name:"gamificationLevel",required:!1,type:{name:"GamificationLevel"}},language:{defaultValue:null,description:"",name:"language",required:!1,type:{name:"string"}},userLang:{defaultValue:null,description:"",name:"userLang",required:!1,type:{name:"string"}},setUserLang:{defaultValue:null,description:"",name:"setUserLang",required:!0,type:{name:"(lang: string) => void"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},position:{defaultValue:null,description:"",name:"position",required:!1,type:{name:"Venue"}},openPositionDrawer:{defaultValue:null,description:"",name:"openPositionDrawer",required:!0,type:{name:"() => void"}},integrationConfig:{defaultValue:null,description:"",name:"integrationConfig",required:!1,type:{name:"{ [key: string]: any; }"}},instruct:{defaultValue:{value:"false"},description:"",name:"instruct",required:!1,type:{name:"boolean"}},sessionId:{defaultValue:null,description:"",name:"sessionId",required:!1,type:{name:"string"}},clickedStart:{defaultValue:null,description:"",name:"clickedStart",required:!1,type:{name:"boolean"}},onClickStart:{defaultValue:null,description:"",name:"onClickStart",required:!1,type:{name:"(() => void)"}},initializeTTS:{defaultValue:null,description:"",name:"initializeTTS",required:!1,type:{name:"(() => void)"}},_TEST_forceProviderStatus:{defaultValue:null,description:"",name:"_TEST_forceProviderStatus",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/StartPanel/StartPanel.tsx#StartPanel"]={docgenInfo:StartPanel.__docgenInfo,name:"StartPanel",path:"src/components/StartPanel/StartPanel.tsx#StartPanel"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Delete.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Delete=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})});Delete.displayName="Delete";const __WEBPACK_DEFAULT_EXPORT__=Delete;try{Delete.displayName="Delete",Delete.__docgenInfo={description:"",displayName:"Delete",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Delete.tsx#Delete"]={docgenInfo:Delete.__docgenInfo,name:"Delete",path:"src/components/icons/Delete.tsx#Delete"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Plus.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Plus=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"})]});Plus.displayName="Plus";const __WEBPACK_DEFAULT_EXPORT__=Plus;try{Plus.displayName="Plus",Plus.__docgenInfo={description:"",displayName:"Plus",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Plus.tsx#Plus"]={docgenInfo:Plus.__docgenInfo,name:"Plus",path:"src/components/icons/Plus.tsx#Plus"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Translation.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Translation=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"})]});Translation.displayName="Translation";const __WEBPACK_DEFAULT_EXPORT__=Translation;try{Translation.displayName="Translation",Translation.__docgenInfo={description:"",displayName:"Translation",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Translation.tsx#Translation"]={docgenInfo:Translation.__docgenInfo,name:"Translation",path:"src/components/icons/Translation.tsx#Translation"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Warning.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Warning=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"})});Warning.displayName="Warning";const __WEBPACK_DEFAULT_EXPORT__=Warning;try{Warning.displayName="Warning",Warning.__docgenInfo={description:"",displayName:"Warning",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Warning.tsx#Warning"]={docgenInfo:Warning.__docgenInfo,name:"Warning",path:"src/components/icons/Warning.tsx#Warning"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Message.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js"),__webpack_require__("./node_modules/react/jsx-runtime.js");const __WEBPACK_DEFAULT_EXPORT__={error:console.error,info:console.info,success:console.log}},"./src/helpers/error.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{r:()=>getErrori18nKey});const BACKEND_ERRORS=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((([key,value])=>[value,key]))),getErrori18nKey=errorCode=>{if(!errorCode)return"error.generic";if(401===errorCode||403===errorCode)return"error.unauthorized";if(404===errorCode)return"error.notFound";if(422===errorCode)return"error.unprocessableEntity";if(500===errorCode)return"internal server error";let error=BACKEND_ERRORS.get(errorCode);return error?`errors.${error}`:"error.generic"}},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(module,__unused_webpack_exports,__webpack_require__)=>{var map={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){if(!__webpack_require__.o(map,req)){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}return map[req]}webpackContext.keys=function webpackContextKeys(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"?2454":()=>{},"?6483":()=>{},"?bed2":()=>{},"?72ad":()=>{},"?a1bf":()=>{},"?14d6":()=>{},"?e42a":()=>{},"?9463":()=>{}}]); \ No newline at end of file diff --git a/6866.27e8e1e6.iframe.bundle.js b/6866.27e8e1e6.iframe.bundle.js new file mode 100644 index 00000000..bfe0ddda --- /dev/null +++ b/6866.27e8e1e6.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[6866],{"./src/components/ExportHistoryButton/ExportHistoryButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_i18next__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/popover/popover.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Message__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Message.tsx"),classnames__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ExportHistoryButton=({history,memori,className,buttonClassName,icon,disabled=!1,align="right",filename})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_5__.$)(),text=`${t("write_and_speak.conversationStartedLabel")} ${new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date)}\n\n`.concat(history.map((m=>`${m.fromUser?"YOU":memori.name}: ${m.text}`)).join("\n"));return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J,{title:t("write_and_speak.exportChatHistoryMessage"),className:classnames__WEBPACK_IMPORTED_MODULE_3___default()("memori-export-history-button",className,{"memori-export-history-button--align-left":"left"===align}),children:({close})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J.Button,{disabled,className:classnames__WEBPACK_IMPORTED_MODULE_3___default()("memori-button","memori-button--circle","memori-button--icon-only",buttonClassName,{"memori-button--disabled":disabled,"memori-button--primary":!disabled}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"memori-button--icon",children:icon||(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Message__WEBPACK_IMPORTED_MODULE_2__.default,{})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J.Panel,{className:"memori-export-history-button--panel",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p",{children:t("write_and_speak.exportChatHistory")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{primary:!0,onClick:()=>((text,filename="export-chat.txt")=>{const data=new Blob([text],{type:"text/plain"}),url=URL.createObjectURL(data),element=document.createElement("a");element.setAttribute("href",url),element.setAttribute("download",filename),element.style.display="none",document.body.appendChild(element),element.click(),document.body.removeChild(element)})(text,filename||`${memori.name.replace(/\W+/g,"-")}-export-chat.txt`),children:t("yes")||"Yes"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{onClick:()=>close(),children:t("no")||"No"})]})]})})};ExportHistoryButton.displayName="ExportHistoryButton";const __WEBPACK_DEFAULT_EXPORT__=ExportHistoryButton;try{ExportHistoryButton.displayName="ExportHistoryButton",ExportHistoryButton.__docgenInfo={description:"",displayName:"ExportHistoryButton",props:{history:{defaultValue:null,description:"",name:"history",required:!0,type:{name:"Message[]"}},memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},buttonClassName:{defaultValue:null,description:"",name:"buttonClassName",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},filename:{defaultValue:null,description:"",name:"filename",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ExportHistoryButton/ExportHistoryButton.tsx#ExportHistoryButton"]={docgenInfo:ExportHistoryButton.__docgenInfo,name:"ExportHistoryButton",path:"src/components/ExportHistoryButton/ExportHistoryButton.tsx#ExportHistoryButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/Header/Header.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_MapMarker__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/MapMarker.tsx"),_icons_SoundDeactivated__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/SoundDeactivated.tsx"),_icons_Sound__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/icons/Sound.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ExportHistoryButton_ExportHistoryButton__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/ExportHistoryButton/ExportHistoryButton.tsx"),_icons_Setting__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/Setting.tsx"),_ShareButton_ShareButton__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/ShareButton/ShareButton.tsx"),_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/components/icons/FullscreenExit.tsx"),_icons_Fullscreen__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./src/components/icons/Fullscreen.tsx"),_icons_Refresh__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./src/components/icons/Refresh.tsx"),_icons_Clear__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./src/components/icons/Clear.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Header=({className,memori,tenant,history,position,setShowPositionDrawer,setShowSettingsDrawer,speakerMuted,setSpeakerMuted,hasUserActivatedSpeak=!1,showShare=!0,showSettings=!0,showSpeaker=!0,showReload=!1,showClear=!1,clearHistory})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_14__.$)(),[fullScreenAvailable,setFullScreenAvailable]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[fullScreen,setFullScreen]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{document.fullscreenEnabled&&setFullScreenAvailable(!0)}),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-header",className),children:[showReload&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:t("reload")||"Reload",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Refresh__WEBPACK_IMPORTED_MODULE_11__.default,{}),onClick:()=>{window.location.reload()}}),showClear&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:t("clearHistory")||"Clear chat",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Clear__WEBPACK_IMPORTED_MODULE_12__.default,{}),onClick:clearHistory}),memori.needsPosition&&position&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:"memori-header--position",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"memori-header--position-placeName",children:position.placeName}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_MapMarker__WEBPACK_IMPORTED_MODULE_3__.default,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>setShowPositionDrawer(!0)})]}),fullScreenAvailable&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:fullScreen?t("fullscreenExit")||"Exit fullscreen":t("fullscreenEnter")||"Enter fullscreen",icon:fullScreen?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_9__.default,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Fullscreen__WEBPACK_IMPORTED_MODULE_10__.default,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),setFullScreen(!1)):(document.documentElement.requestFullscreen(),setFullScreen(!0))}}),showSpeaker&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:speakerMuted?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_SoundDeactivated__WEBPACK_IMPORTED_MODULE_4__.default,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Sound__WEBPACK_IMPORTED_MODULE_5__.default,{}),onClick:()=>setSpeakerMuted(!speakerMuted),title:t("widget.sound")||"Sound"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ExportHistoryButton_ExportHistoryButton__WEBPACK_IMPORTED_MODULE_6__.Z,{history,memori,className:"memori-header--button memori-header--button--export",disabled:!hasUserActivatedSpeak||0===history.length}),showSettings&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Setting__WEBPACK_IMPORTED_MODULE_7__.default,{}),onClick:()=>setShowSettingsDrawer(!0),title:t("widget.settings")||"Settings"}),showShare&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ShareButton_ShareButton__WEBPACK_IMPORTED_MODULE_8__.Z,{className:"memori-header--button memori-header--button-share",title:memori.name,tenant,showQrCode:!0,align:"left"})]})};Header.displayName="Header";const __WEBPACK_DEFAULT_EXPORT__=Header;try{Header.displayName="Header",Header.__docgenInfo={description:"",displayName:"Header",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},history:{defaultValue:null,description:"",name:"history",required:!0,type:{name:"Message[]"}},position:{defaultValue:null,description:"",name:"position",required:!1,type:{name:"Venue"}},setShowPositionDrawer:{defaultValue:null,description:"",name:"setShowPositionDrawer",required:!0,type:{name:"(show: boolean) => void"}},setShowSettingsDrawer:{defaultValue:null,description:"",name:"setShowSettingsDrawer",required:!0,type:{name:"(show: boolean) => void"}},speakerMuted:{defaultValue:null,description:"",name:"speakerMuted",required:!0,type:{name:"boolean"}},setSpeakerMuted:{defaultValue:null,description:"",name:"setSpeakerMuted",required:!0,type:{name:"(mute: boolean) => void"}},hasUserActivatedSpeak:{defaultValue:{value:"false"},description:"",name:"hasUserActivatedSpeak",required:!1,type:{name:"boolean"}},showShare:{defaultValue:{value:"true"},description:"",name:"showShare",required:!1,type:{name:"boolean"}},showSettings:{defaultValue:{value:"true"},description:"",name:"showSettings",required:!1,type:{name:"boolean"}},showSpeaker:{defaultValue:{value:"true"},description:"",name:"showSpeaker",required:!1,type:{name:"boolean"}},showReload:{defaultValue:{value:"false"},description:"",name:"showReload",required:!1,type:{name:"boolean"}},showClear:{defaultValue:{value:"false"},description:"",name:"showClear",required:!1,type:{name:"boolean"}},clearHistory:{defaultValue:null,description:"",name:"clearHistory",required:!0,type:{name:"() => void"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Header/Header.tsx#Header"]={docgenInfo:Header.__docgenInfo,name:"Header",path:"src/components/Header/Header.tsx#Header"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/SettingsDrawer/SettingsDrawer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var _ui_Drawer__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/components/ui/Drawer.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Checkbox__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Checkbox.tsx"),_ui_Select__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Select.tsx"),_helpers_configuration__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/helpers/configuration.ts"),_headlessui_react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/components/radio-group/radio-group.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Button.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const silenceSeconds=[2,3,5,10,15,20,30,60],SettingsDrawer=({open,layout="DEFAULT",onClose,microphoneMode="HOLD_TO_TALK",continuousSpeechTimeout,setMicrophoneMode,setContinuousSpeechTimeout,controlsPosition,setControlsPosition,hideEmissions,setHideEmissions,additionalSettings})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_ui_Drawer__WEBPACK_IMPORTED_MODULE_0__.Z,{className:"memori-settings-drawer",open,onClose,title:t("widget.settings")||"Settings",description:t("write_and_speak.settingsHeaderLabel"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("label",{htmlFor:"#microphoneMode",children:[t("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E,{id:"microphoneMode",name:"microphoneMode",value:microphoneMode,defaultValue:microphoneMode,className:"memori-settings-drawer--microphoneMode-radio",onChange:value=>{let micMode="CONTINUOUS"===value?"CONTINUOUS":"HOLD_TO_TALK";setMicrophoneMode(micMode),(0,_helpers_configuration__WEBPACK_IMPORTED_MODULE_3__.A2)("microphoneMode",micMode)},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{primary:checked,children:t("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{primary:checked,children:t("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===microphoneMode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-settings-drawer--field",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Select__WEBPACK_IMPORTED_MODULE_2__.Z,{label:t("write_and_speak.secondsLabel")||"Seconds",placeholder:t("write_and_speak.secondsLabel")||"Seconds",options:silenceSeconds.map((s=>({value:s,label:s}))),value:continuousSpeechTimeout,onChange:value=>{setContinuousSpeechTimeout(value),(0,_helpers_configuration__WEBPACK_IMPORTED_MODULE_3__.A2)("continuousSpeechTimeout",value)}})}),"TOTEM"===layout&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("label",{htmlFor:"#controlsPosition",children:[t("write_and_speak.controlsPosition")||"Controls",":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E,{id:"controlsPosition",name:"controlsPosition",value:controlsPosition,defaultValue:controlsPosition,className:"memori-settings-drawer--controlsposition-radio",onChange:value=>{setControlsPosition(value),(0,_helpers_configuration__WEBPACK_IMPORTED_MODULE_3__.A2)("controlsPosition",value)},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{primary:checked,children:t("center")||"Center"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{primary:checked,children:t("bottom")||"Bottom"})})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-settings-drawer--field",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Checkbox__WEBPACK_IMPORTED_MODULE_1__.Z,{label:t("write_and_speak.hideEmissionsLabel"),name:"hideControls",checked:hideEmissions,onChange:e=>{setHideEmissions(e.target.checked),(0,_helpers_configuration__WEBPACK_IMPORTED_MODULE_3__.A2)("hideEmissions",e.target.checked)}})})]}),additionalSettings&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-settings-drawer--field controls",children:additionalSettings})]})};SettingsDrawer.displayName="SettingsDrawer";const __WEBPACK_DEFAULT_EXPORT__=SettingsDrawer;try{SettingsDrawer.displayName="SettingsDrawer",SettingsDrawer.__docgenInfo={description:"",displayName:"SettingsDrawer",props:{open:{defaultValue:null,description:"",name:"open",required:!0,type:{name:"boolean"}},layout:{defaultValue:{value:"DEFAULT"},description:"",name:"layout",required:!1,type:{name:"enum",value:[{value:'"DEFAULT"'},{value:'"FULLPAGE"'},{value:'"TOTEM"'},{value:'"CHAT"'},{value:'"WEBSITE_ASSISTANT"'}]}},onClose:{defaultValue:null,description:"",name:"onClose",required:!0,type:{name:"() => void"}},microphoneMode:{defaultValue:{value:"HOLD_TO_TALK"},description:"",name:"microphoneMode",required:!1,type:{name:"enum",value:[{value:'"HOLD_TO_TALK"'},{value:'"CONTINUOUS"'}]}},continuousSpeechTimeout:{defaultValue:null,description:"",name:"continuousSpeechTimeout",required:!1,type:{name:"number"}},setMicrophoneMode:{defaultValue:null,description:"",name:"setMicrophoneMode",required:!0,type:{name:'(value: "HOLD_TO_TALK" | "CONTINUOUS") => void'}},setContinuousSpeechTimeout:{defaultValue:null,description:"",name:"setContinuousSpeechTimeout",required:!0,type:{name:"(value: number) => void"}},controlsPosition:{defaultValue:null,description:"",name:"controlsPosition",required:!1,type:{name:"enum",value:[{value:'"center"'},{value:'"bottom"'}]}},setControlsPosition:{defaultValue:null,description:"",name:"setControlsPosition",required:!0,type:{name:'(value: "center" | "bottom") => void'}},hideEmissions:{defaultValue:null,description:"",name:"hideEmissions",required:!1,type:{name:"boolean"}},setHideEmissions:{defaultValue:null,description:"",name:"setHideEmissions",required:!0,type:{name:"(value: boolean) => void"}},additionalSettings:{defaultValue:null,description:"",name:"additionalSettings",required:!1,type:{name:"Element | null"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/SettingsDrawer/SettingsDrawer.tsx#SettingsDrawer"]={docgenInfo:SettingsDrawer.__docgenInfo,name:"SettingsDrawer",path:"src/components/SettingsDrawer/SettingsDrawer.tsx#SettingsDrawer"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ShareButton/ShareButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_i18next__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_Facebook__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/icons/Facebook.tsx"),_icons_Twitter__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Twitter.tsx"),_icons_Linkedin__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Linkedin.tsx"),_icons_WhatsApp__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/WhatsApp.tsx"),_icons_Mail__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/icons/Mail.tsx"),_icons_Link__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/icons/Link.tsx"),_icons_Share__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/Share.tsx"),_icons_Download__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/icons/Download.tsx"),_icons_Telegram__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/components/icons/Telegram.tsx"),qrcode_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/qrcode.react/lib/esm/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./src/components/ui/Button.tsx"),classnames__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_12__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ShareButton=({tenant,url,title="",className,baseUrl,primary=!0,showQrCode=!0,align="right"})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_14__.$)(),[targetUrl,setTargetUrl]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(url),qrImageURL=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>tenant?.theme?`${baseUrl??"https://app.twincreator.com"}/images/${tenant.theme}/square_logo.png`:`${baseUrl??"https://app.twincreator.com"}/images/memori_logo.png`),[tenant,baseUrl]);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{url||setTargetUrl(window.location.href)}),[url]);const socialShare=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${targetUrl}`,icon:_icons_Facebook__WEBPACK_IMPORTED_MODULE_1__.default},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${targetUrl}`,icon:_icons_Twitter__WEBPACK_IMPORTED_MODULE_2__.default},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${title}&url=${targetUrl}`,icon:_icons_Linkedin__WEBPACK_IMPORTED_MODULE_3__.default},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${targetUrl}`,icon:_icons_WhatsApp__WEBPACK_IMPORTED_MODULE_4__.default},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${title}&url=${targetUrl}`,icon:_icons_Telegram__WEBPACK_IMPORTED_MODULE_9__.default},{id:"email",title:"Email",url:`mailto:?subject=${title?.length>0?title:url}&body=${targetUrl}`,icon:_icons_Mail__WEBPACK_IMPORTED_MODULE_5__.default}];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v,{as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-share-button",{"memori-share-button--align-left":"left"===align}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Button,{className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",className,{"memori-button--primary":primary}),title:t("widget.share")||void 0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Share__WEBPACK_IMPORTED_MODULE_7__.default,{})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_11__.Z,{className:"memori-share-button--link",ghost:!0,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Link__WEBPACK_IMPORTED_MODULE_6__.default,{}),onClick:()=>{targetUrl&&navigator.clipboard.writeText(targetUrl)},children:t("copyToClipboard")||void 0})},"copy"),socialShare.map((item=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("a",{className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:item.url??"",target:"_blank",rel:"noopener noreferrer",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(item.icon,{})}),item.title]})},item.id))),showQrCode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(qrcode_react__WEBPACK_IMPORTED_MODULE_10__.Qd,{id:"qr-canvas",value:targetUrl??"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:qrImageURL,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_11__.Z,{onClick:()=>{const canvas=document.getElementById("qr-canvas");if(!canvas)return;const link=document.createElement("a");link.href=canvas.toDataURL(),link.download=`memori-${title}-share.png`,document.body.appendChild(link),link.click(),document.body.removeChild(link)},icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Download__WEBPACK_IMPORTED_MODULE_8__.default,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};ShareButton.displayName="ShareButton";const __WEBPACK_DEFAULT_EXPORT__=ShareButton;try{ShareButton.displayName="ShareButton",ShareButton.__docgenInfo={description:"",displayName:"ShareButton",props:{tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},title:{defaultValue:{value:""},description:"",name:"title",required:!1,type:{name:"string"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},primary:{defaultValue:{value:"true"},description:"",name:"primary",required:!1,type:{name:"boolean"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},showQrCode:{defaultValue:{value:"true"},description:"",name:"showQrCode",required:!1,type:{name:"boolean"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'}]}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ShareButton/ShareButton.tsx#ShareButton"]={docgenInfo:ShareButton.__docgenInfo,name:"ShareButton",path:"src/components/ShareButton/ShareButton.tsx#ShareButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Checkbox.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Checkbox=({label,className,disabled=!1,checked,children,onChange,name,...props})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("label",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-checkbox",className,{"memori-checkbox--disabled":disabled}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input",{type:"checkbox",...props,name,disabled,defaultChecked:checked,className:"memori-checkbox--input",onChange}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span",{className:"memori-checkbox--text",children:label})]});Checkbox.displayName="Checkbox";const __WEBPACK_DEFAULT_EXPORT__=Checkbox;try{Checkbox.displayName="Checkbox",Checkbox.__docgenInfo={description:"",displayName:"Checkbox",props:{label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},checked:{defaultValue:null,description:"",name:"checked",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((event: ChangeEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Checkbox.tsx#Checkbox"]={docgenInfo:Checkbox.__docgenInfo,name:"Checkbox",path:"src/components/ui/Checkbox.tsx#Checkbox"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Drawer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/components/dialog/dialog.js"),_Spin__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Spin.tsx"),_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Close__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Close.tsx"),classnames__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Drawer=({open=!1,onClose,className,title,description,children,footer,loading=!1,side="right",closable=!0,width="100%",widthMd="80%",widthLg="60%"})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{appear:!0,show:open,as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.V,{open,onClose,className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-drawer",className),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u.Child,{as:react__WEBPACK_IMPORTED_MODULE_0__.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,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-drawer--backdrop"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-drawer--container",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-drawer--container-scrollable",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u.Child,{as:react__WEBPACK_IMPORTED_MODULE_0__.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,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.V.Panel,{className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-drawer--panel",{"memori-drawer--panel-left":"left"===side,"memori-drawer--with-footer":!!footer}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-drawer--panel {\n --memori-drawer--width: ${width};\n --memori-drawer--width-lg: ${widthLg};\n --memori-drawer--width-md: ${widthMd};\n }\n `}}),closable&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-drawer--close",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{shape:"circle",outlined:!0,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Close__WEBPACK_IMPORTED_MODULE_3__.default,{}),onClick:()=>onClose(!1)})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_Spin__WEBPACK_IMPORTED_MODULE_1__.Z,{spinning:loading,children:[title&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.V.Title,{className:"memori-drawer--title",children:title}),description&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.V.Description,{className:"memori-drawer--description",children:description}),children,footer&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-drawer--footer",children:footer})]})]})})})})]})});Drawer.displayName="Drawer";const __WEBPACK_DEFAULT_EXPORT__=Drawer;try{Drawer.displayName="Drawer",Drawer.__docgenInfo={description:"",displayName:"Drawer",props:{open:{defaultValue:{value:"false"},description:"",name:"open",required:!1,type:{name:"boolean"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!0,type:{name:"(value: boolean) => void"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"Element | ReactNode"}},description:{defaultValue:null,description:"",name:"description",required:!1,type:{name:"Element | ReactNode"}},footer:{defaultValue:null,description:"",name:"footer",required:!1,type:{name:"Element | ReactNode"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},closable:{defaultValue:{value:"true"},description:"",name:"closable",required:!1,type:{name:"boolean"}},side:{defaultValue:{value:"right"},description:"",name:"side",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'}]}},width:{defaultValue:{value:"100%"},description:"",name:"width",required:!1,type:{name:"string"}},widthMd:{defaultValue:{value:"80%"},description:"",name:"widthMd",required:!1,type:{name:"string"}},widthLg:{defaultValue:{value:"60%"},description:"",name:"widthLg",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Drawer.tsx#Drawer"]={docgenInfo:Drawer.__docgenInfo,name:"Drawer",path:"src/components/ui/Drawer.tsx#Drawer"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Select.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_headlessui_react__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@headlessui/react/dist/components/listbox/listbox.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/SelectIcon.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Select=({className,value,displayValue,options,onChange,disabled=!1,label,placeholder})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-select",className),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.R,{value,onChange:value=>{onChange(value)},disabled,name:"day",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.R.Label,{className:"memori-select--label",children:[label,":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.R.Button,{"aria-label":label,className:"memori-select--button",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-select--value",{"memori-select--value-placeholder":!value}),children:value?displayValue||value:placeholder}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-select--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__.default,{})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.R.Options,{className:"memori-select--options",children:options.map((opt=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.R.Option,{value:opt.value,className:"memori-select--option",children:opt.label},opt.value)))})})]})});Select.displayName="Select";const __WEBPACK_DEFAULT_EXPORT__=Select;try{Select.displayName="Select",Select.__docgenInfo={description:"",displayName:"Select",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"any"}},displayValue:{defaultValue:null,description:"",name:"displayValue",required:!1,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!0,type:{name:"(value: any) => void"}},options:{defaultValue:null,description:"",name:"options",required:!0,type:{name:"{ value: any; label: any; }[]"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string"}},placeholder:{defaultValue:null,description:"",name:"placeholder",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Select.tsx#Select"]={docgenInfo:Select.__docgenInfo,name:"Select",path:"src/components/ui/Select.tsx#Select"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/configuration.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A2:()=>setLocalConfig,wm:()=>getLocalConfig});const keys={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions"},getLocalConfig=(key,defaultValue)=>{const value=window.localStorage.getItem(keys[key]??key);if(!value)return defaultValue;try{return JSON.parse(value)}catch{return value}},setLocalConfig=(key,value)=>{window.localStorage.setItem(keys[key]??key,value.toString())}}}]); \ No newline at end of file diff --git a/6866.2f62415b.iframe.bundle.js b/6866.2f62415b.iframe.bundle.js deleted file mode 100644 index bc508bd9..00000000 --- a/6866.2f62415b.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[6866],{"./src/components/ExportHistoryButton/ExportHistoryButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_i18next__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/popover/popover.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Message__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Message.tsx"),classnames__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ExportHistoryButton=({history,memori,className,buttonClassName,icon,disabled=!1,align="right",filename})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_5__.$)(),text=`${t("write_and_speak.conversationStartedLabel")} ${new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date)}\n\n`.concat(history.map((m=>`${m.fromUser?"YOU":memori.name}: ${m.text}`)).join("\n"));return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J,{title:t("write_and_speak.exportChatHistoryMessage"),className:classnames__WEBPACK_IMPORTED_MODULE_3___default()("memori-export-history-button",className,{"memori-export-history-button--align-left":"left"===align}),children:({close})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J.Button,{disabled,className:classnames__WEBPACK_IMPORTED_MODULE_3___default()("memori-button","memori-button--circle","memori-button--icon-only",buttonClassName,{"memori-button--disabled":disabled,"memori-button--primary":!disabled}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"memori-button--icon",children:icon||(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Message__WEBPACK_IMPORTED_MODULE_2__.default,{})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J.Panel,{className:"memori-export-history-button--panel",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p",{children:t("write_and_speak.exportChatHistory")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{primary:!0,onClick:()=>((text,filename="export-chat.txt")=>{const data=new Blob([text],{type:"text/plain"}),url=URL.createObjectURL(data),element=document.createElement("a");element.setAttribute("href",url),element.setAttribute("download",filename),element.style.display="none",document.body.appendChild(element),element.click(),document.body.removeChild(element)})(text,filename||`${memori.name.replace(/\W+/g,"-")}-export-chat.txt`),children:t("yes")||"Yes"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{onClick:()=>close(),children:t("no")||"No"})]})]})})};ExportHistoryButton.displayName="ExportHistoryButton";const __WEBPACK_DEFAULT_EXPORT__=ExportHistoryButton;try{ExportHistoryButton.displayName="ExportHistoryButton",ExportHistoryButton.__docgenInfo={description:"",displayName:"ExportHistoryButton",props:{history:{defaultValue:null,description:"",name:"history",required:!0,type:{name:"Message[]"}},memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},buttonClassName:{defaultValue:null,description:"",name:"buttonClassName",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},filename:{defaultValue:null,description:"",name:"filename",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ExportHistoryButton/ExportHistoryButton.tsx#ExportHistoryButton"]={docgenInfo:ExportHistoryButton.__docgenInfo,name:"ExportHistoryButton",path:"src/components/ExportHistoryButton/ExportHistoryButton.tsx#ExportHistoryButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/Header/Header.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_MapMarker__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/MapMarker.tsx"),_icons_SoundDeactivated__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/SoundDeactivated.tsx"),_icons_Sound__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/icons/Sound.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ExportHistoryButton_ExportHistoryButton__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/ExportHistoryButton/ExportHistoryButton.tsx"),_icons_Setting__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/Setting.tsx"),_ShareButton_ShareButton__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/ShareButton/ShareButton.tsx"),_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/components/icons/FullscreenExit.tsx"),_icons_Fullscreen__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./src/components/icons/Fullscreen.tsx"),_icons_Refresh__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./src/components/icons/Refresh.tsx"),_icons_Clear__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./src/components/icons/Clear.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Header=({className,memori,history,position,setShowPositionDrawer,setShowSettingsDrawer,speakerMuted,setSpeakerMuted,hasUserActivatedSpeak=!1,showShare=!0,showSettings=!0,showSpeaker=!0,showReload=!1,showClear=!1,clearHistory})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_14__.$)(),[fullScreenAvailable,setFullScreenAvailable]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[fullScreen,setFullScreen]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{document.fullscreenEnabled&&setFullScreenAvailable(!0)}),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-header",className),children:[showReload&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:t("reload")||"Reload",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Refresh__WEBPACK_IMPORTED_MODULE_11__.default,{}),onClick:()=>{window.location.reload()}}),showClear&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:t("clearHistory")||"Clear chat",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Clear__WEBPACK_IMPORTED_MODULE_12__.default,{}),onClick:clearHistory}),memori.needsPosition&&position&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:"memori-header--position",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"memori-header--position-placeName",children:position.placeName}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_MapMarker__WEBPACK_IMPORTED_MODULE_3__.default,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>setShowPositionDrawer(!0)})]}),fullScreenAvailable&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:fullScreen?t("fullscreenExit")||"Exit fullscreen":t("fullscreenEnter")||"Enter fullscreen",icon:fullScreen?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_9__.default,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Fullscreen__WEBPACK_IMPORTED_MODULE_10__.default,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),setFullScreen(!1)):(document.documentElement.requestFullscreen(),setFullScreen(!0))}}),showSpeaker&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:speakerMuted?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_SoundDeactivated__WEBPACK_IMPORTED_MODULE_4__.default,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Sound__WEBPACK_IMPORTED_MODULE_5__.default,{}),onClick:()=>setSpeakerMuted(!speakerMuted),title:t("widget.sound")||"Sound"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ExportHistoryButton_ExportHistoryButton__WEBPACK_IMPORTED_MODULE_6__.Z,{history,memori,className:"memori-header--button memori-header--button--export",disabled:!hasUserActivatedSpeak||0===history.length}),showSettings&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Setting__WEBPACK_IMPORTED_MODULE_7__.default,{}),onClick:()=>setShowSettingsDrawer(!0),title:t("widget.settings")||"Settings"}),showShare&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ShareButton_ShareButton__WEBPACK_IMPORTED_MODULE_8__.Z,{className:"memori-header--button memori-header--button-share",title:memori.name,showQrCode:!0,align:"left"})]})};Header.displayName="Header";const __WEBPACK_DEFAULT_EXPORT__=Header;try{Header.displayName="Header",Header.__docgenInfo={description:"",displayName:"Header",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},history:{defaultValue:null,description:"",name:"history",required:!0,type:{name:"Message[]"}},position:{defaultValue:null,description:"",name:"position",required:!1,type:{name:"Venue"}},setShowPositionDrawer:{defaultValue:null,description:"",name:"setShowPositionDrawer",required:!0,type:{name:"(show: boolean) => void"}},setShowSettingsDrawer:{defaultValue:null,description:"",name:"setShowSettingsDrawer",required:!0,type:{name:"(show: boolean) => void"}},speakerMuted:{defaultValue:null,description:"",name:"speakerMuted",required:!0,type:{name:"boolean"}},setSpeakerMuted:{defaultValue:null,description:"",name:"setSpeakerMuted",required:!0,type:{name:"(mute: boolean) => void"}},hasUserActivatedSpeak:{defaultValue:{value:"false"},description:"",name:"hasUserActivatedSpeak",required:!1,type:{name:"boolean"}},showShare:{defaultValue:{value:"true"},description:"",name:"showShare",required:!1,type:{name:"boolean"}},showSettings:{defaultValue:{value:"true"},description:"",name:"showSettings",required:!1,type:{name:"boolean"}},showSpeaker:{defaultValue:{value:"true"},description:"",name:"showSpeaker",required:!1,type:{name:"boolean"}},showReload:{defaultValue:{value:"false"},description:"",name:"showReload",required:!1,type:{name:"boolean"}},showClear:{defaultValue:{value:"false"},description:"",name:"showClear",required:!1,type:{name:"boolean"}},clearHistory:{defaultValue:null,description:"",name:"clearHistory",required:!0,type:{name:"() => void"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Header/Header.tsx#Header"]={docgenInfo:Header.__docgenInfo,name:"Header",path:"src/components/Header/Header.tsx#Header"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/SettingsDrawer/SettingsDrawer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var _ui_Drawer__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/components/ui/Drawer.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Checkbox__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Checkbox.tsx"),_ui_Select__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Select.tsx"),_helpers_configuration__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/helpers/configuration.ts"),_headlessui_react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/components/radio-group/radio-group.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Button.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const silenceSeconds=[2,3,5,10,15,20,30,60],SettingsDrawer=({open,layout="DEFAULT",onClose,microphoneMode="HOLD_TO_TALK",continuousSpeechTimeout,setMicrophoneMode,setContinuousSpeechTimeout,controlsPosition,setControlsPosition,hideEmissions,setHideEmissions,additionalSettings})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_ui_Drawer__WEBPACK_IMPORTED_MODULE_0__.Z,{className:"memori-settings-drawer",open,onClose,title:t("widget.settings")||"Settings",description:t("write_and_speak.settingsHeaderLabel"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("label",{htmlFor:"#microphoneMode",children:[t("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E,{id:"microphoneMode",name:"microphoneMode",value:microphoneMode,defaultValue:microphoneMode,className:"memori-settings-drawer--microphoneMode-radio",onChange:value=>{let micMode="CONTINUOUS"===value?"CONTINUOUS":"HOLD_TO_TALK";setMicrophoneMode(micMode),(0,_helpers_configuration__WEBPACK_IMPORTED_MODULE_3__.A2)("microphoneMode",micMode)},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{primary:checked,children:t("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{primary:checked,children:t("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===microphoneMode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-settings-drawer--field",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Select__WEBPACK_IMPORTED_MODULE_2__.Z,{label:t("write_and_speak.secondsLabel")||"Seconds",placeholder:t("write_and_speak.secondsLabel")||"Seconds",options:silenceSeconds.map((s=>({value:s,label:s}))),value:continuousSpeechTimeout,onChange:value=>{setContinuousSpeechTimeout(value),(0,_helpers_configuration__WEBPACK_IMPORTED_MODULE_3__.A2)("continuousSpeechTimeout",value)}})}),"TOTEM"===layout&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("label",{htmlFor:"#controlsPosition",children:[t("write_and_speak.controlsPosition")||"Controls",":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E,{id:"controlsPosition",name:"controlsPosition",value:controlsPosition,defaultValue:controlsPosition,className:"memori-settings-drawer--controlsposition-radio",onChange:value=>{setControlsPosition(value),(0,_helpers_configuration__WEBPACK_IMPORTED_MODULE_3__.A2)("controlsPosition",value)},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{primary:checked,children:t("center")||"Center"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.E.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{primary:checked,children:t("bottom")||"Bottom"})})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-settings-drawer--field",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Checkbox__WEBPACK_IMPORTED_MODULE_1__.Z,{label:t("write_and_speak.hideEmissionsLabel"),name:"hideControls",checked:hideEmissions,onChange:e=>{setHideEmissions(e.target.checked),(0,_helpers_configuration__WEBPACK_IMPORTED_MODULE_3__.A2)("hideEmissions",e.target.checked)}})})]}),additionalSettings&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-settings-drawer--field controls",children:additionalSettings})]})};SettingsDrawer.displayName="SettingsDrawer";const __WEBPACK_DEFAULT_EXPORT__=SettingsDrawer;try{SettingsDrawer.displayName="SettingsDrawer",SettingsDrawer.__docgenInfo={description:"",displayName:"SettingsDrawer",props:{open:{defaultValue:null,description:"",name:"open",required:!0,type:{name:"boolean"}},layout:{defaultValue:{value:"DEFAULT"},description:"",name:"layout",required:!1,type:{name:"enum",value:[{value:'"DEFAULT"'},{value:'"FULLPAGE"'},{value:'"TOTEM"'},{value:'"CHAT"'},{value:'"WEBSITE_ASSISTANT"'}]}},onClose:{defaultValue:null,description:"",name:"onClose",required:!0,type:{name:"() => void"}},microphoneMode:{defaultValue:{value:"HOLD_TO_TALK"},description:"",name:"microphoneMode",required:!1,type:{name:"enum",value:[{value:'"HOLD_TO_TALK"'},{value:'"CONTINUOUS"'}]}},continuousSpeechTimeout:{defaultValue:null,description:"",name:"continuousSpeechTimeout",required:!1,type:{name:"number"}},setMicrophoneMode:{defaultValue:null,description:"",name:"setMicrophoneMode",required:!0,type:{name:'(value: "HOLD_TO_TALK" | "CONTINUOUS") => void'}},setContinuousSpeechTimeout:{defaultValue:null,description:"",name:"setContinuousSpeechTimeout",required:!0,type:{name:"(value: number) => void"}},controlsPosition:{defaultValue:null,description:"",name:"controlsPosition",required:!1,type:{name:"enum",value:[{value:'"center"'},{value:'"bottom"'}]}},setControlsPosition:{defaultValue:null,description:"",name:"setControlsPosition",required:!0,type:{name:'(value: "center" | "bottom") => void'}},hideEmissions:{defaultValue:null,description:"",name:"hideEmissions",required:!1,type:{name:"boolean"}},setHideEmissions:{defaultValue:null,description:"",name:"setHideEmissions",required:!0,type:{name:"(value: boolean) => void"}},additionalSettings:{defaultValue:null,description:"",name:"additionalSettings",required:!1,type:{name:"Element | null"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/SettingsDrawer/SettingsDrawer.tsx#SettingsDrawer"]={docgenInfo:SettingsDrawer.__docgenInfo,name:"SettingsDrawer",path:"src/components/SettingsDrawer/SettingsDrawer.tsx#SettingsDrawer"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ShareButton/ShareButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_i18next__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_Facebook__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/icons/Facebook.tsx"),_icons_Twitter__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Twitter.tsx"),_icons_Linkedin__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Linkedin.tsx"),_icons_WhatsApp__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/WhatsApp.tsx"),_icons_Mail__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/icons/Mail.tsx"),_icons_Link__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/icons/Link.tsx"),_icons_Share__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/Share.tsx"),_icons_Download__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/icons/Download.tsx"),_icons_Telegram__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/components/icons/Telegram.tsx"),qrcode_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/qrcode.react/lib/esm/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./src/components/ui/Button.tsx"),classnames__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_12__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ShareButton=({url,title="",className,baseUrl,primary=!0,showQrCode=!0,align="right"})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_14__.$)(),[targetUrl,setTargetUrl]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(url);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{url||setTargetUrl(window.location.href)}),[url]);const socialShare=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${targetUrl}`,icon:_icons_Facebook__WEBPACK_IMPORTED_MODULE_1__.default},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${targetUrl}`,icon:_icons_Twitter__WEBPACK_IMPORTED_MODULE_2__.default},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${title}&url=${targetUrl}`,icon:_icons_Linkedin__WEBPACK_IMPORTED_MODULE_3__.default},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${targetUrl}`,icon:_icons_WhatsApp__WEBPACK_IMPORTED_MODULE_4__.default},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${title}&url=${targetUrl}`,icon:_icons_Telegram__WEBPACK_IMPORTED_MODULE_9__.default},{id:"email",title:"Email",url:`mailto:?subject=${title?.length>0?title:url}&body=${targetUrl}`,icon:_icons_Mail__WEBPACK_IMPORTED_MODULE_5__.default}];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v,{as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-share-button",{"memori-share-button--align-left":"left"===align}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Button,{className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",className,{"memori-button--primary":primary}),title:t("widget.share")||void 0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Share__WEBPACK_IMPORTED_MODULE_7__.default,{})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_11__.Z,{className:"memori-share-button--link",ghost:!0,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Link__WEBPACK_IMPORTED_MODULE_6__.default,{}),onClick:()=>{targetUrl&&navigator.clipboard.writeText(targetUrl)},children:t("copyToClipboard")||void 0})},"copy"),socialShare.map((item=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("a",{className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:item.url??"",target:"_blank",rel:"noopener noreferrer",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(item.icon,{})}),item.title]})},item.id))),showQrCode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(qrcode_react__WEBPACK_IMPORTED_MODULE_10__.Qd,{id:"qr-canvas",value:targetUrl??"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:`${baseUrl||"https://app.twincreator.com"}/images/memori_logo.png`,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_11__.Z,{onClick:()=>{const canvas=document.getElementById("qr-canvas");if(!canvas)return;const link=document.createElement("a");link.href=canvas.toDataURL(),link.download=`memori-${title}-share.png`,document.body.appendChild(link),link.click(),document.body.removeChild(link)},icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Download__WEBPACK_IMPORTED_MODULE_8__.default,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};ShareButton.displayName="ShareButton";const __WEBPACK_DEFAULT_EXPORT__=ShareButton;try{ShareButton.displayName="ShareButton",ShareButton.__docgenInfo={description:"",displayName:"ShareButton",props:{url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},title:{defaultValue:{value:""},description:"",name:"title",required:!1,type:{name:"string"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},primary:{defaultValue:{value:"true"},description:"",name:"primary",required:!1,type:{name:"boolean"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},showQrCode:{defaultValue:{value:"true"},description:"",name:"showQrCode",required:!1,type:{name:"boolean"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'}]}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ShareButton/ShareButton.tsx#ShareButton"]={docgenInfo:ShareButton.__docgenInfo,name:"ShareButton",path:"src/components/ShareButton/ShareButton.tsx#ShareButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Checkbox.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Checkbox=({label,className,disabled=!1,checked,children,onChange,name,...props})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("label",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-checkbox",className,{"memori-checkbox--disabled":disabled}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input",{type:"checkbox",...props,name,disabled,defaultChecked:checked,className:"memori-checkbox--input",onChange}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span",{className:"memori-checkbox--text",children:label})]});Checkbox.displayName="Checkbox";const __WEBPACK_DEFAULT_EXPORT__=Checkbox;try{Checkbox.displayName="Checkbox",Checkbox.__docgenInfo={description:"",displayName:"Checkbox",props:{label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},checked:{defaultValue:null,description:"",name:"checked",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},name:{defaultValue:null,description:"",name:"name",required:!1,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((event: ChangeEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Checkbox.tsx#Checkbox"]={docgenInfo:Checkbox.__docgenInfo,name:"Checkbox",path:"src/components/ui/Checkbox.tsx#Checkbox"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Drawer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/components/dialog/dialog.js"),_Spin__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Spin.tsx"),_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Close__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Close.tsx"),classnames__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Drawer=({open=!1,onClose,className,title,description,children,footer,loading=!1,side="right",closable=!0,width="100%",widthMd="80%",widthLg="60%"})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{appear:!0,show:open,as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.V,{open,onClose,className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-drawer",className),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u.Child,{as:react__WEBPACK_IMPORTED_MODULE_0__.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,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-drawer--backdrop"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-drawer--container",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-drawer--container-scrollable",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u.Child,{as:react__WEBPACK_IMPORTED_MODULE_0__.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,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.V.Panel,{className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-drawer--panel",{"memori-drawer--panel-left":"left"===side,"memori-drawer--with-footer":!!footer}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-drawer--panel {\n --memori-drawer--width: ${width};\n --memori-drawer--width-lg: ${widthLg};\n --memori-drawer--width-md: ${widthMd};\n }\n `}}),closable&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-drawer--close",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{shape:"circle",outlined:!0,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Close__WEBPACK_IMPORTED_MODULE_3__.default,{}),onClick:()=>onClose(!1)})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_Spin__WEBPACK_IMPORTED_MODULE_1__.Z,{spinning:loading,children:[title&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.V.Title,{className:"memori-drawer--title",children:title}),description&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.V.Description,{className:"memori-drawer--description",children:description}),children,footer&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-drawer--footer",children:footer})]})]})})})})]})});Drawer.displayName="Drawer";const __WEBPACK_DEFAULT_EXPORT__=Drawer;try{Drawer.displayName="Drawer",Drawer.__docgenInfo={description:"",displayName:"Drawer",props:{open:{defaultValue:{value:"false"},description:"",name:"open",required:!1,type:{name:"boolean"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!0,type:{name:"(value: boolean) => void"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"Element | ReactNode"}},description:{defaultValue:null,description:"",name:"description",required:!1,type:{name:"Element | ReactNode"}},footer:{defaultValue:null,description:"",name:"footer",required:!1,type:{name:"Element | ReactNode"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},closable:{defaultValue:{value:"true"},description:"",name:"closable",required:!1,type:{name:"boolean"}},side:{defaultValue:{value:"right"},description:"",name:"side",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'}]}},width:{defaultValue:{value:"100%"},description:"",name:"width",required:!1,type:{name:"string"}},widthMd:{defaultValue:{value:"80%"},description:"",name:"widthMd",required:!1,type:{name:"string"}},widthLg:{defaultValue:{value:"60%"},description:"",name:"widthLg",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Drawer.tsx#Drawer"]={docgenInfo:Drawer.__docgenInfo,name:"Drawer",path:"src/components/ui/Drawer.tsx#Drawer"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Select.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_headlessui_react__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@headlessui/react/dist/components/listbox/listbox.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/SelectIcon.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Select=({className,value,displayValue,options,onChange,disabled=!1,label,placeholder})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-select",className),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.R,{value,onChange:value=>{onChange(value)},disabled,name:"day",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.R.Label,{className:"memori-select--label",children:[label,":"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.R.Button,{"aria-label":label,className:"memori-select--button",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-select--value",{"memori-select--value-placeholder":!value}),children:value?displayValue||value:placeholder}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-select--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_SelectIcon__WEBPACK_IMPORTED_MODULE_2__.default,{})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.R.Options,{className:"memori-select--options",children:options.map((opt=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_4__.R.Option,{value:opt.value,className:"memori-select--option",children:opt.label},opt.value)))})})]})});Select.displayName="Select";const __WEBPACK_DEFAULT_EXPORT__=Select;try{Select.displayName="Select",Select.__docgenInfo={description:"",displayName:"Select",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"any"}},displayValue:{defaultValue:null,description:"",name:"displayValue",required:!1,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!0,type:{name:"(value: any) => void"}},options:{defaultValue:null,description:"",name:"options",required:!0,type:{name:"{ value: any; label: any; }[]"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!1,type:{name:"string"}},placeholder:{defaultValue:null,description:"",name:"placeholder",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Select.tsx#Select"]={docgenInfo:Select.__docgenInfo,name:"Select",path:"src/components/ui/Select.tsx#Select"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/configuration.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A2:()=>setLocalConfig,wm:()=>getLocalConfig});const keys={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions"},getLocalConfig=(key,defaultValue)=>{const value=window.localStorage.getItem(keys[key]??key);if(!value)return defaultValue;try{return JSON.parse(value)}catch{return value}},setLocalConfig=(key,value)=>{window.localStorage.setItem(keys[key]??key,value.toString())}}}]); \ No newline at end of file diff --git a/components-Avatar-Avatar-stories.ac75b6a9.iframe.bundle.js b/components-Avatar-Avatar-stories.8fe40e8d.iframe.bundle.js similarity index 81% rename from components-Avatar-Avatar-stories.ac75b6a9.iframe.bundle.js rename to components-Avatar-Avatar-stories.8fe40e8d.iframe.bundle.js index 4edae98f..27530a5a 100644 --- a/components-Avatar-Avatar-stories.ac75b6a9.iframe.bundle.js +++ b/components-Avatar-Avatar-stories.8fe40e8d.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[5989],{"./src/components/Avatar/Avatar.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AvatarInBlob:()=>AvatarInBlob,CustomGLBModel:()=>CustomGLBModel,Default:()=>Default,FullbodyReadyPlayerMeAvatar:()=>FullbodyReadyPlayerMeAvatar,ReadyPlayerMeAvatar:()=>ReadyPlayerMeAvatar,__namedExportsOrder:()=>__namedExportsOrder,default:()=>Avatar_stories});var react=__webpack_require__("./node_modules/react/index.js"),data=__webpack_require__("./src/mocks/data.ts"),Avatar=__webpack_require__("./src/components/Avatar/Avatar.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),Avatar_Avatar=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/Avatar/Avatar.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(Avatar_Avatar.Z,options);Avatar_Avatar.Z&&Avatar_Avatar.Z.locals&&Avatar_Avatar.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const Avatar_stories={title:"Widget/Avatar",component:Avatar.Z,argTypes:{avatar3dVisible:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},integrationConfig=JSON.parse(data.WM.customData??"{}"),Template=args=>{const[avatar3dVisible,setAvatar3dVisible]=react.useState(args.avatar3dVisible);return(0,jsx_runtime.jsx)("div",{style:"customglb"===args.integrationConfig?.avatar||"readyplayerme"===args.integrationConfig?.avatar||"readyplayerme-full"===args.integrationConfig?.avatar?{}:{marginTop:"20vw"},children:(0,react.createElement)(Avatar.Z,{...args,integrationConfig:args.integrationConfig?{...args.integrationConfig,avatarURL:args.integrationConfig.avatarURL?.split("#")?.[0]+`#${new Date(Date.now()).toISOString()}`}:void 0,avatar3dVisible,setAvatar3dVisible,key:Date.now()})})};Template.displayName="Template";const Default=Template.bind({});Default.args={memori:data.jF,tenant:data.cm,instruct:!1,avatar3dVisible:!0,setAvatar3dVisible:()=>{},hasUserActivatedSpeak:!1,isPlayingAudio:!1};const AvatarInBlob=Template.bind({});AvatarInBlob.args={memori:data.jF,tenant:data.cm,instruct:!1,avatar3dVisible:!0,setAvatar3dVisible:()=>{},hasUserActivatedSpeak:!1,isPlayingAudio:!1,integrationConfig:{...integrationConfig,avatar:"userAvatar",avatarURL:data.jF.avatarURL}};const CustomGLBModel=Template.bind({});CustomGLBModel.args={memori:data.jF,tenant:data.cm,instruct:!1,avatar3dVisible:!0,setAvatar3dVisible:()=>{},hasUserActivatedSpeak:!1,isPlayingAudio:!1,integrationConfig:{...integrationConfig,avatar:"customglb",avatarURL:"https://assets.memori.ai/api/v2/asset/7383f05a-0788-49b0-b9b9-3bfc402c7ddf.glb#1669136149862"}};const ReadyPlayerMeAvatar=Template.bind({});ReadyPlayerMeAvatar.args={memori:data.jF,tenant:data.cm,instruct:!1,avatar3dVisible:!0,setAvatar3dVisible:()=>{},hasUserActivatedSpeak:!1,isPlayingAudio:!1,integration:data.WM,integrationConfig};const FullbodyReadyPlayerMeAvatar=Template.bind({});FullbodyReadyPlayerMeAvatar.args={memori:data.jF,tenant:data.cm,instruct:!1,avatar3dVisible:!0,setAvatar3dVisible:()=>{},hasUserActivatedSpeak:!1,isPlayingAudio:!1,integration:data.WM,integrationConfig:{...integrationConfig,avatar:"readyplayerme-full",avatarURL:"https://models.readyplayer.me/63b55751f17e295642bf07a2.glb#1669136149862"}},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => {\n const [avatar3dVisible, setAvatar3dVisible] = React.useState(args.avatar3dVisible);\n return
\n \n
;\n}",...Default.parameters?.docs?.source}}},AvatarInBlob.parameters={...AvatarInBlob.parameters,docs:{...AvatarInBlob.parameters?.docs,source:{originalSource:"args => {\n const [avatar3dVisible, setAvatar3dVisible] = React.useState(args.avatar3dVisible);\n return
\n \n
;\n}",...AvatarInBlob.parameters?.docs?.source}}},CustomGLBModel.parameters={...CustomGLBModel.parameters,docs:{...CustomGLBModel.parameters?.docs,source:{originalSource:"args => {\n const [avatar3dVisible, setAvatar3dVisible] = React.useState(args.avatar3dVisible);\n return
\n \n
;\n}",...CustomGLBModel.parameters?.docs?.source}}},ReadyPlayerMeAvatar.parameters={...ReadyPlayerMeAvatar.parameters,docs:{...ReadyPlayerMeAvatar.parameters?.docs,source:{originalSource:"args => {\n const [avatar3dVisible, setAvatar3dVisible] = React.useState(args.avatar3dVisible);\n return
\n \n
;\n}",...ReadyPlayerMeAvatar.parameters?.docs?.source}}},FullbodyReadyPlayerMeAvatar.parameters={...FullbodyReadyPlayerMeAvatar.parameters,docs:{...FullbodyReadyPlayerMeAvatar.parameters?.docs,source:{originalSource:"args => {\n const [avatar3dVisible, setAvatar3dVisible] = React.useState(args.avatar3dVisible);\n return
\n \n
;\n}",...FullbodyReadyPlayerMeAvatar.parameters?.docs?.source}}};const __namedExportsOrder=["Default","AvatarInBlob","CustomGLBModel","ReadyPlayerMeAvatar","FullbodyReadyPlayerMeAvatar"]},"./src/components/CustomGLBModelViewer/ModelViewer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ModelViewer=({src,poster,alt=""})=>((0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const script=document.createElement("script");return script.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",script.type="module",document.head.appendChild(script),()=>{document.head.removeChild(script)}}),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div",{className:"model-viewer",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("model-viewer",{src,"ios-src":"",poster,alt,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));ModelViewer.displayName="ModelViewer";const __WEBPACK_DEFAULT_EXPORT__=ModelViewer;try{ModelViewer.displayName="ModelViewer",ModelViewer.__docgenInfo={description:"",displayName:"ModelViewer",props:{src:{defaultValue:null,description:"",name:"src",required:!0,type:{name:"string"}},poster:{defaultValue:null,description:"",name:"poster",required:!0,type:{name:"string"}},alt:{defaultValue:{value:""},description:"",name:"alt",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/CustomGLBModelViewer/ModelViewer.tsx#ModelViewer"]={docgenInfo:ModelViewer.__docgenInfo,name:"ModelViewer",path:"src/components/CustomGLBModelViewer/ModelViewer.tsx#ModelViewer"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Spin.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Spin=({spinning=!1,primary=!1,className,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-spin",className,{"memori-spin--spinning":spinning,"memori-spin--primary":primary}),children:[children,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-spin--spinner",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})})]});Spin.displayName="Spin";const __WEBPACK_DEFAULT_EXPORT__=Spin;try{Spin.displayName="Spin",Spin.__docgenInfo={description:"",displayName:"Spin",props:{spinning:{defaultValue:{value:"false"},description:"",name:"spinning",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Spin.tsx#Spin"]={docgenInfo:Spin.__docgenInfo,name:"Spin",path:"src/components/ui/Spin.tsx#Spin"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Tooltip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Tooltip=({content,className,align="right",disabled=!1,visible=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-tooltip",`memori-tooltip--align-${align}`,className,{"memori-tooltip--disabled":disabled,"memori-tooltip--visible":visible}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--content",children:content}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--trigger",children})]});Tooltip.displayName="Tooltip";const __WEBPACK_DEFAULT_EXPORT__=Tooltip;try{Tooltip.displayName="Tooltip",Tooltip.__docgenInfo={description:"",displayName:"Tooltip",props:{content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"Element | ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'},{value:'"topLeft"'},{value:'"topRight"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Tooltip.tsx#Tooltip"]={docgenInfo:Tooltip.__docgenInfo,name:"Tooltip",path:"src/components/ui/Tooltip.tsx#Tooltip"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/media.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{v:()=>getResourceUrl});const getResourceUrl=({type,resourceURI,sessionID,baseURL="",apiURL=""})=>{let defaultUri="cover"===type?`${baseURL}/images/memoriCover.png`:`${baseURL}/images/memoriAvatar.png`;try{return resourceURI&&0!==resourceURI.length?resourceURI.includes("memoriai/memory")&&!resourceURI.includes("memori-ai-session-id")&&sessionID?`${resourceURI}?memori-ai-session-id=${sessionID}`:(resourceURI.startsWith("https://")||resourceURI.startsWith("http://"))&&(new URL(resourceURI).hostname.includes("memori.ai")||new URL(resourceURI).hostname.includes("aclambda.online"))?`${resourceURI}${resourceURI.endsWith("/")||!sessionID?"":"/"}${sessionID||""}`:resourceURI.startsWith("cloud://")?`${apiURL?.replace(/v2/,"v1")||""}/CloudAsset/${resourceURI.replace("cloud://","")}`:resourceURI.startsWith("guid://")?`${apiURL?.replace(/v2/,"v1")||""}/GuidAsset/${resourceURI.replace("guid://","")}`:resourceURI||defaultUri:defaultUri}catch(e){return resourceURI||defaultUri}}},"./src/helpers/utils.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Dt:()=>isAndroid,Tt:()=>isiOS,h:()=>stripEmojis,vw:()=>stripDuplicates,xZ:()=>hasTouchscreen});__webpack_require__("./node_modules/react/index.js");const hasTouchscreen=()=>{let hasTouchScreen=!1;if("maxTouchPoints"in navigator)hasTouchScreen=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)hasTouchScreen=navigator.msMaxTouchPoints>0;else{const mQ=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(mQ&&"(pointer:coarse)"===mQ.media)hasTouchScreen=!!mQ.matches;else if("orientation"in window)hasTouchScreen=!0;else{var UA=navigator?.userAgent;hasTouchScreen=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(UA)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(UA)}}return hasTouchScreen},isiOS=()=>{let platform=navigator?.userAgentData?.platform||navigator?.platform||"unknown",userAgent=navigator?.userAgent||"unknown";return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(platform)||userAgent.includes("Mac")&&"ontouchend"in document},isAndroid=()=>"android"===(navigator?.userAgentData?.platform||navigator?.platform||"unknown").toLowerCase()||navigator.userAgent.includes("Android");const stripDuplicates=text=>text.slice(0,text.length/2).trim().toLowerCase()===text.slice(text.length/2+1).trim().toLowerCase()?text.slice(0,text.length/2):text,stripEmojis=text=>text.replaceAll(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu,"").trim()},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={id:"locahost:3000",theme:"twincreator",config:{name:"Memori",showNewUser:!0,requirePosition:!1,feedbackURL:"https://form.asana.com/"}},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[5989],{"./src/components/Avatar/Avatar.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AvatarInBlob:()=>AvatarInBlob,CustomGLBModel:()=>CustomGLBModel,Default:()=>Default,FullbodyReadyPlayerMeAvatar:()=>FullbodyReadyPlayerMeAvatar,ReadyPlayerMeAvatar:()=>ReadyPlayerMeAvatar,__namedExportsOrder:()=>__namedExportsOrder,default:()=>Avatar_stories});var react=__webpack_require__("./node_modules/react/index.js"),data=__webpack_require__("./src/mocks/data.ts"),Avatar=__webpack_require__("./src/components/Avatar/Avatar.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),Avatar_Avatar=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/Avatar/Avatar.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(Avatar_Avatar.Z,options);Avatar_Avatar.Z&&Avatar_Avatar.Z.locals&&Avatar_Avatar.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const Avatar_stories={title:"Widget/Avatar",component:Avatar.Z,argTypes:{avatar3dVisible:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},integrationConfig=JSON.parse(data.WM.customData??"{}"),Template=args=>{const[avatar3dVisible,setAvatar3dVisible]=react.useState(args.avatar3dVisible);return(0,jsx_runtime.jsx)("div",{style:"customglb"===args.integrationConfig?.avatar||"readyplayerme"===args.integrationConfig?.avatar||"readyplayerme-full"===args.integrationConfig?.avatar?{}:{marginTop:"20vw"},children:(0,react.createElement)(Avatar.Z,{...args,integrationConfig:args.integrationConfig?{...args.integrationConfig,avatarURL:args.integrationConfig.avatarURL?.split("#")?.[0]+`#${new Date(Date.now()).toISOString()}`}:void 0,avatar3dVisible,setAvatar3dVisible,key:Date.now()})})};Template.displayName="Template";const Default=Template.bind({});Default.args={memori:data.jF,tenant:data.cm,instruct:!1,avatar3dVisible:!0,setAvatar3dVisible:()=>{},hasUserActivatedSpeak:!1,isPlayingAudio:!1};const AvatarInBlob=Template.bind({});AvatarInBlob.args={memori:data.jF,tenant:data.cm,instruct:!1,avatar3dVisible:!0,setAvatar3dVisible:()=>{},hasUserActivatedSpeak:!1,isPlayingAudio:!1,integrationConfig:{...integrationConfig,avatar:"userAvatar",avatarURL:data.jF.avatarURL}};const CustomGLBModel=Template.bind({});CustomGLBModel.args={memori:data.jF,tenant:data.cm,instruct:!1,avatar3dVisible:!0,setAvatar3dVisible:()=>{},hasUserActivatedSpeak:!1,isPlayingAudio:!1,integrationConfig:{...integrationConfig,avatar:"customglb",avatarURL:"https://assets.memori.ai/api/v2/asset/7383f05a-0788-49b0-b9b9-3bfc402c7ddf.glb#1669136149862"}};const ReadyPlayerMeAvatar=Template.bind({});ReadyPlayerMeAvatar.args={memori:data.jF,tenant:data.cm,instruct:!1,avatar3dVisible:!0,setAvatar3dVisible:()=>{},hasUserActivatedSpeak:!1,isPlayingAudio:!1,integration:data.WM,integrationConfig};const FullbodyReadyPlayerMeAvatar=Template.bind({});FullbodyReadyPlayerMeAvatar.args={memori:data.jF,tenant:data.cm,instruct:!1,avatar3dVisible:!0,setAvatar3dVisible:()=>{},hasUserActivatedSpeak:!1,isPlayingAudio:!1,integration:data.WM,integrationConfig:{...integrationConfig,avatar:"readyplayerme-full",avatarURL:"https://models.readyplayer.me/63b55751f17e295642bf07a2.glb#1669136149862"}},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => {\n const [avatar3dVisible, setAvatar3dVisible] = React.useState(args.avatar3dVisible);\n return
\n \n
;\n}",...Default.parameters?.docs?.source}}},AvatarInBlob.parameters={...AvatarInBlob.parameters,docs:{...AvatarInBlob.parameters?.docs,source:{originalSource:"args => {\n const [avatar3dVisible, setAvatar3dVisible] = React.useState(args.avatar3dVisible);\n return
\n \n
;\n}",...AvatarInBlob.parameters?.docs?.source}}},CustomGLBModel.parameters={...CustomGLBModel.parameters,docs:{...CustomGLBModel.parameters?.docs,source:{originalSource:"args => {\n const [avatar3dVisible, setAvatar3dVisible] = React.useState(args.avatar3dVisible);\n return
\n \n
;\n}",...CustomGLBModel.parameters?.docs?.source}}},ReadyPlayerMeAvatar.parameters={...ReadyPlayerMeAvatar.parameters,docs:{...ReadyPlayerMeAvatar.parameters?.docs,source:{originalSource:"args => {\n const [avatar3dVisible, setAvatar3dVisible] = React.useState(args.avatar3dVisible);\n return
\n \n
;\n}",...ReadyPlayerMeAvatar.parameters?.docs?.source}}},FullbodyReadyPlayerMeAvatar.parameters={...FullbodyReadyPlayerMeAvatar.parameters,docs:{...FullbodyReadyPlayerMeAvatar.parameters?.docs,source:{originalSource:"args => {\n const [avatar3dVisible, setAvatar3dVisible] = React.useState(args.avatar3dVisible);\n return
\n \n
;\n}",...FullbodyReadyPlayerMeAvatar.parameters?.docs?.source}}};const __namedExportsOrder=["Default","AvatarInBlob","CustomGLBModel","ReadyPlayerMeAvatar","FullbodyReadyPlayerMeAvatar"]},"./src/components/CustomGLBModelViewer/ModelViewer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ModelViewer=({src,poster,alt=""})=>((0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const script=document.createElement("script");return script.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",script.type="module",document.head.appendChild(script),()=>{document.head.removeChild(script)}}),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div",{className:"model-viewer",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("model-viewer",{src,"ios-src":"",poster,alt,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));ModelViewer.displayName="ModelViewer";const __WEBPACK_DEFAULT_EXPORT__=ModelViewer;try{ModelViewer.displayName="ModelViewer",ModelViewer.__docgenInfo={description:"",displayName:"ModelViewer",props:{src:{defaultValue:null,description:"",name:"src",required:!0,type:{name:"string"}},poster:{defaultValue:null,description:"",name:"poster",required:!0,type:{name:"string"}},alt:{defaultValue:{value:""},description:"",name:"alt",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/CustomGLBModelViewer/ModelViewer.tsx#ModelViewer"]={docgenInfo:ModelViewer.__docgenInfo,name:"ModelViewer",path:"src/components/CustomGLBModelViewer/ModelViewer.tsx#ModelViewer"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Spin.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Spin=({spinning=!1,primary=!1,className,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-spin",className,{"memori-spin--spinning":spinning,"memori-spin--primary":primary}),children:[children,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-spin--spinner",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})})]});Spin.displayName="Spin";const __WEBPACK_DEFAULT_EXPORT__=Spin;try{Spin.displayName="Spin",Spin.__docgenInfo={description:"",displayName:"Spin",props:{spinning:{defaultValue:{value:"false"},description:"",name:"spinning",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Spin.tsx#Spin"]={docgenInfo:Spin.__docgenInfo,name:"Spin",path:"src/components/ui/Spin.tsx#Spin"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Tooltip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Tooltip=({content,className,align="right",disabled=!1,visible=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-tooltip",`memori-tooltip--align-${align}`,className,{"memori-tooltip--disabled":disabled,"memori-tooltip--visible":visible}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--content",children:content}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--trigger",children})]});Tooltip.displayName="Tooltip";const __WEBPACK_DEFAULT_EXPORT__=Tooltip;try{Tooltip.displayName="Tooltip",Tooltip.__docgenInfo={description:"",displayName:"Tooltip",props:{content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"Element | ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'},{value:'"topLeft"'},{value:'"topRight"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Tooltip.tsx#Tooltip"]={docgenInfo:Tooltip.__docgenInfo,name:"Tooltip",path:"src/components/ui/Tooltip.tsx#Tooltip"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/media.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{v:()=>getResourceUrl});const getResourceUrl=({type,resourceURI,sessionID,baseURL="",apiURL=""})=>{let defaultUri="cover"===type?`${baseURL}/images/memoriCover.png`:`${baseURL}/images/memoriAvatar.png`;try{return resourceURI&&0!==resourceURI.length?resourceURI.includes("memoriai/memory")&&!resourceURI.includes("memori-ai-session-id")&&sessionID?`${resourceURI}?memori-ai-session-id=${sessionID}`:(resourceURI.startsWith("https://")||resourceURI.startsWith("http://"))&&(new URL(resourceURI).hostname.includes("memori.ai")||new URL(resourceURI).hostname.includes("aclambda.online"))?`${resourceURI}${resourceURI.endsWith("/")||!sessionID?"":"/"}${sessionID||""}`:resourceURI.startsWith("cloud://")?`${apiURL?.replace(/v2/,"v1")||""}/CloudAsset/${resourceURI.replace("cloud://","")}`:resourceURI.startsWith("guid://")?`${apiURL?.replace(/v2/,"v1")||""}/GuidAsset/${resourceURI.replace("guid://","")}`:resourceURI||defaultUri:defaultUri}catch(e){return resourceURI||defaultUri}}},"./src/helpers/utils.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Dt:()=>isAndroid,Tt:()=>isiOS,h:()=>stripEmojis,vw:()=>stripDuplicates,xZ:()=>hasTouchscreen});__webpack_require__("./node_modules/react/index.js");const hasTouchscreen=()=>{let hasTouchScreen=!1;if("maxTouchPoints"in navigator)hasTouchScreen=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)hasTouchScreen=navigator.msMaxTouchPoints>0;else{const mQ=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(mQ&&"(pointer:coarse)"===mQ.media)hasTouchScreen=!!mQ.matches;else if("orientation"in window)hasTouchScreen=!0;else{var UA=navigator?.userAgent;hasTouchScreen=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(UA)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(UA)}}return hasTouchScreen},isiOS=()=>{let platform=navigator?.userAgentData?.platform||navigator?.platform||"unknown",userAgent=navigator?.userAgent||"unknown";return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(platform)||userAgent.includes("Mac")&&"ontouchend"in document},isAndroid=()=>"android"===(navigator?.userAgentData?.platform||navigator?.platform||"unknown").toLowerCase()||navigator.userAgent.includes("Android");const stripDuplicates=text=>text.slice(0,text.length/2).trim().toLowerCase()===text.slice(text.length/2+1).trim().toLowerCase()?text.slice(0,text.length/2):text,stripEmojis=text=>text.replaceAll(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu,"").trim()},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={adminCount:3,config:{feedbackURL:"https://form.asana.com/?k=XC7S3JWQeIhnjipBuA3gbw&d=1199599736247413",name:"TwinCreator",requirePosition:!1,showNewUser:!0},creationTimestamp:"2023-05-31T14:32:48.885287Z",description:"TwinCreator",disableRegistration:!1,id:"app.twincreator.com",lastChangeTimestamp:"2023-05-31T14:32:48.885287Z",logoURL:"https://app.twincreator.com/images/twincreator/logo.png",maxAdmins:0,maxCompletions:0,maxCompletionsPerUser:0,maxFreeSessions:400,maxFreeSessionsPerUser:100,maxMemoriPerAdmin:0,maxMemoriPerUser:3,maxTotalMemori:0,maxUsers:0,memoriCount:0,name:"app.twincreator.com",nonFreeSessionCost:.02,paying:!0,tenantID:"96caa4b4-31a4-48e5-8163-dec61869a2a7",theme:"twincreator",userCount:0,usersCanAccessAPI:!1,usersCanCreateMemori:!1,usersCanEditDynamicIntents:!1,usersCanEditIntegrations:!1,usersCanEditMemoriChaining:!1,usersCanRunSnippets:!1},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file diff --git a/components-Chat-Chat-stories.bce5b0c1.iframe.bundle.js b/components-Chat-Chat-stories.a1e87aac.iframe.bundle.js similarity index 75% rename from components-Chat-Chat-stories.bce5b0c1.iframe.bundle.js rename to components-Chat-Chat-stories.a1e87aac.iframe.bundle.js index 3f7ea4d3..8627e4ea 100644 --- a/components-Chat-Chat-stories.bce5b0c1.iframe.bundle.js +++ b/components-Chat-Chat-stories.a1e87aac.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[3061],{"./src/components/Chat/Chat.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AcceptsFeedback:()=>AcceptsFeedback,Default:()=>Default,MemoriTyping:()=>MemoriTyping,OnX2aState:()=>OnX2aState,OnX3State:()=>OnX3State,WithAIGeneratedMessages:()=>WithAIGeneratedMessages,WithContext:()=>WithContext,WithCustomUserAvatar:()=>WithCustomUserAvatar,WithCustomUserAvatarAsElement:()=>WithCustomUserAvatarAsElement,WithDates:()=>WithDates,WithDatesAndContext:()=>WithDatesAndContext,WithHints:()=>WithHints,WithMedia:()=>WithMedia,WithUser:()=>WithUser,__namedExportsOrder:()=>__namedExportsOrder,default:()=>Chat_stories});var react=__webpack_require__("./node_modules/react/index.js"),data=__webpack_require__("./src/mocks/data.ts"),Chat=__webpack_require__("./src/components/Chat/Chat.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),Chat_Chat=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/Chat/Chat.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(Chat_Chat.Z,options);Chat_Chat.Z&&Chat_Chat.Z.locals&&Chat_Chat.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const Chat_stories={title:"Widget/Chat",component:Chat.Z,argTypes:{},parameters:{controls:{expanded:!0}}},dialogState={...data.Gs,hints:[]},Template=args=>{const[userMessage,setUserMessage]=(0,react.useState)(args.userMessage);return(0,jsx_runtime.jsx)(Chat.Z,{...args,userMessage,onChangeUserMessage:setUserMessage})};Template.displayName="Template";const Default=Template.bind({});Default.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const MemoriTyping=Template.bind({});MemoriTyping.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},memoriTyping:!0,sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithHints=Template.bind({});WithHints.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState:data.Gs,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithMedia=Template.bind({});WithMedia.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.Eu,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithDates=Template.bind({});WithDates.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},showDates:!0};const WithContext=Template.bind({});WithContext.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},showContextPerLine:!0};const WithDatesAndContext=Template.bind({});WithDatesAndContext.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},showDates:!0,showContextPerLine:!0};const OnX3State=Template.bind({});OnX3State.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState:{...dialogState,state:"X3"},layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const OnX2aState=Template.bind({});OnX2aState.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState:{...dialogState,state:"X2a"},layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const AcceptsFeedback=Template.bind({});AcceptsFeedback.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState:{...dialogState,acceptsFeedback:!0},layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithAIGeneratedMessages=Template.bind({});WithAIGeneratedMessages.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.I_,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithUser=Template.bind({});WithUser.args={user:{avatarURL:"https://picsum.photos/200"},memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithCustomUserAvatar=Template.bind({});WithCustomUserAvatar.args={userAvatar:"https://picsum.photos/200",memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithCustomUserAvatarAsElement=Template.bind({});WithCustomUserAvatarAsElement.args={userAvatar:(0,jsx_runtime.jsx)("span",{children:"USER"}),memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...Default.parameters?.docs?.source}}},MemoriTyping.parameters={...MemoriTyping.parameters,docs:{...MemoriTyping.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...MemoriTyping.parameters?.docs?.source}}},WithHints.parameters={...WithHints.parameters,docs:{...WithHints.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithHints.parameters?.docs?.source}}},WithMedia.parameters={...WithMedia.parameters,docs:{...WithMedia.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithMedia.parameters?.docs?.source}}},WithDates.parameters={...WithDates.parameters,docs:{...WithDates.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithDates.parameters?.docs?.source}}},WithContext.parameters={...WithContext.parameters,docs:{...WithContext.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithContext.parameters?.docs?.source}}},WithDatesAndContext.parameters={...WithDatesAndContext.parameters,docs:{...WithDatesAndContext.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithDatesAndContext.parameters?.docs?.source}}},OnX3State.parameters={...OnX3State.parameters,docs:{...OnX3State.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...OnX3State.parameters?.docs?.source}}},OnX2aState.parameters={...OnX2aState.parameters,docs:{...OnX2aState.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...OnX2aState.parameters?.docs?.source}}},AcceptsFeedback.parameters={...AcceptsFeedback.parameters,docs:{...AcceptsFeedback.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...AcceptsFeedback.parameters?.docs?.source}}},WithAIGeneratedMessages.parameters={...WithAIGeneratedMessages.parameters,docs:{...WithAIGeneratedMessages.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithAIGeneratedMessages.parameters?.docs?.source}}},WithUser.parameters={...WithUser.parameters,docs:{...WithUser.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithUser.parameters?.docs?.source}}},WithCustomUserAvatar.parameters={...WithCustomUserAvatar.parameters,docs:{...WithCustomUserAvatar.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithCustomUserAvatar.parameters?.docs?.source}}},WithCustomUserAvatarAsElement.parameters={...WithCustomUserAvatarAsElement.parameters,docs:{...WithCustomUserAvatarAsElement.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithCustomUserAvatarAsElement.parameters?.docs?.source}}};const __namedExportsOrder=["Default","MemoriTyping","WithHints","WithMedia","WithDates","WithContext","WithDatesAndContext","OnX3State","OnX2aState","AcceptsFeedback","WithAIGeneratedMessages","WithUser","WithCustomUserAvatar","WithCustomUserAvatarAsElement"]},"./src/components/icons/FullscreenExit.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const FullscreenExit=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});FullscreenExit.displayName="FullscreenExit";const __WEBPACK_DEFAULT_EXPORT__=FullscreenExit;try{FullscreenExit.displayName="FullscreenExit",FullscreenExit.__docgenInfo={description:"",displayName:"FullscreenExit",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/FullscreenExit.tsx#FullscreenExit"]={docgenInfo:FullscreenExit.__docgenInfo,name:"FullscreenExit",path:"src/components/icons/FullscreenExit.tsx#FullscreenExit"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Link.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Link=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})});Link.displayName="Link";const __WEBPACK_DEFAULT_EXPORT__=Link;try{Link.displayName="Link",Link.__docgenInfo={description:"",displayName:"Link",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Link.tsx#Link"]={docgenInfo:Link.__docgenInfo,name:"Link",path:"src/components/icons/Link.tsx#Link"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={id:"locahost:3000",theme:"twincreator",config:{name:"Memori",showNewUser:!0,requirePosition:!1,feedbackURL:"https://form.asana.com/"}},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[3061],{"./src/components/Chat/Chat.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AcceptsFeedback:()=>AcceptsFeedback,Default:()=>Default,MemoriTyping:()=>MemoriTyping,OnX2aState:()=>OnX2aState,OnX3State:()=>OnX3State,WithAIGeneratedMessages:()=>WithAIGeneratedMessages,WithContext:()=>WithContext,WithCustomUserAvatar:()=>WithCustomUserAvatar,WithCustomUserAvatarAsElement:()=>WithCustomUserAvatarAsElement,WithDates:()=>WithDates,WithDatesAndContext:()=>WithDatesAndContext,WithHints:()=>WithHints,WithMedia:()=>WithMedia,WithUser:()=>WithUser,__namedExportsOrder:()=>__namedExportsOrder,default:()=>Chat_stories});var react=__webpack_require__("./node_modules/react/index.js"),data=__webpack_require__("./src/mocks/data.ts"),Chat=__webpack_require__("./src/components/Chat/Chat.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),Chat_Chat=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/Chat/Chat.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(Chat_Chat.Z,options);Chat_Chat.Z&&Chat_Chat.Z.locals&&Chat_Chat.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const Chat_stories={title:"Widget/Chat",component:Chat.Z,argTypes:{},parameters:{controls:{expanded:!0}}},dialogState={...data.Gs,hints:[]},Template=args=>{const[userMessage,setUserMessage]=(0,react.useState)(args.userMessage);return(0,jsx_runtime.jsx)(Chat.Z,{...args,userMessage,onChangeUserMessage:setUserMessage})};Template.displayName="Template";const Default=Template.bind({});Default.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const MemoriTyping=Template.bind({});MemoriTyping.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},memoriTyping:!0,sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithHints=Template.bind({});WithHints.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState:data.Gs,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithMedia=Template.bind({});WithMedia.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.Eu,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithDates=Template.bind({});WithDates.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},showDates:!0};const WithContext=Template.bind({});WithContext.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},showContextPerLine:!0};const WithDatesAndContext=Template.bind({});WithDatesAndContext.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},showDates:!0,showContextPerLine:!0};const OnX3State=Template.bind({});OnX3State.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState:{...dialogState,state:"X3"},layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const OnX2aState=Template.bind({});OnX2aState.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState:{...dialogState,state:"X2a"},layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const AcceptsFeedback=Template.bind({});AcceptsFeedback.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState:{...dialogState,acceptsFeedback:!0},layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithAIGeneratedMessages=Template.bind({});WithAIGeneratedMessages.args={memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.I_,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithUser=Template.bind({});WithUser.args={user:{avatarURL:"https://picsum.photos/200"},memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithCustomUserAvatar=Template.bind({});WithCustomUserAvatar.args={userAvatar:"https://picsum.photos/200",memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}};const WithCustomUserAvatarAsElement=Template.bind({});WithCustomUserAvatarAsElement.args={userAvatar:(0,jsx_runtime.jsx)("span",{children:"USER"}),memori:data.jF,tenant:data.cm,sessionID:data.M9,history:data.m8,dialogState,layout:"DEFAULT",simulateUserPrompt:()=>{},sendMessage:msg=>console.log(msg),stopListening:()=>{},resetTranscript:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{}},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...Default.parameters?.docs?.source}}},MemoriTyping.parameters={...MemoriTyping.parameters,docs:{...MemoriTyping.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...MemoriTyping.parameters?.docs?.source}}},WithHints.parameters={...WithHints.parameters,docs:{...WithHints.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithHints.parameters?.docs?.source}}},WithMedia.parameters={...WithMedia.parameters,docs:{...WithMedia.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithMedia.parameters?.docs?.source}}},WithDates.parameters={...WithDates.parameters,docs:{...WithDates.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithDates.parameters?.docs?.source}}},WithContext.parameters={...WithContext.parameters,docs:{...WithContext.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithContext.parameters?.docs?.source}}},WithDatesAndContext.parameters={...WithDatesAndContext.parameters,docs:{...WithDatesAndContext.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithDatesAndContext.parameters?.docs?.source}}},OnX3State.parameters={...OnX3State.parameters,docs:{...OnX3State.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...OnX3State.parameters?.docs?.source}}},OnX2aState.parameters={...OnX2aState.parameters,docs:{...OnX2aState.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...OnX2aState.parameters?.docs?.source}}},AcceptsFeedback.parameters={...AcceptsFeedback.parameters,docs:{...AcceptsFeedback.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...AcceptsFeedback.parameters?.docs?.source}}},WithAIGeneratedMessages.parameters={...WithAIGeneratedMessages.parameters,docs:{...WithAIGeneratedMessages.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithAIGeneratedMessages.parameters?.docs?.source}}},WithUser.parameters={...WithUser.parameters,docs:{...WithUser.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithUser.parameters?.docs?.source}}},WithCustomUserAvatar.parameters={...WithCustomUserAvatar.parameters,docs:{...WithCustomUserAvatar.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithCustomUserAvatar.parameters?.docs?.source}}},WithCustomUserAvatarAsElement.parameters={...WithCustomUserAvatarAsElement.parameters,docs:{...WithCustomUserAvatarAsElement.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = useState(args.userMessage);\n return ;\n}",...WithCustomUserAvatarAsElement.parameters?.docs?.source}}};const __namedExportsOrder=["Default","MemoriTyping","WithHints","WithMedia","WithDates","WithContext","WithDatesAndContext","OnX3State","OnX2aState","AcceptsFeedback","WithAIGeneratedMessages","WithUser","WithCustomUserAvatar","WithCustomUserAvatarAsElement"]},"./src/components/icons/FullscreenExit.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const FullscreenExit=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});FullscreenExit.displayName="FullscreenExit";const __WEBPACK_DEFAULT_EXPORT__=FullscreenExit;try{FullscreenExit.displayName="FullscreenExit",FullscreenExit.__docgenInfo={description:"",displayName:"FullscreenExit",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/FullscreenExit.tsx#FullscreenExit"]={docgenInfo:FullscreenExit.__docgenInfo,name:"FullscreenExit",path:"src/components/icons/FullscreenExit.tsx#FullscreenExit"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Link.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Link=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})});Link.displayName="Link";const __WEBPACK_DEFAULT_EXPORT__=Link;try{Link.displayName="Link",Link.__docgenInfo={description:"",displayName:"Link",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Link.tsx#Link"]={docgenInfo:Link.__docgenInfo,name:"Link",path:"src/components/icons/Link.tsx#Link"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={adminCount:3,config:{feedbackURL:"https://form.asana.com/?k=XC7S3JWQeIhnjipBuA3gbw&d=1199599736247413",name:"TwinCreator",requirePosition:!1,showNewUser:!0},creationTimestamp:"2023-05-31T14:32:48.885287Z",description:"TwinCreator",disableRegistration:!1,id:"app.twincreator.com",lastChangeTimestamp:"2023-05-31T14:32:48.885287Z",logoURL:"https://app.twincreator.com/images/twincreator/logo.png",maxAdmins:0,maxCompletions:0,maxCompletionsPerUser:0,maxFreeSessions:400,maxFreeSessionsPerUser:100,maxMemoriPerAdmin:0,maxMemoriPerUser:3,maxTotalMemori:0,maxUsers:0,memoriCount:0,name:"app.twincreator.com",nonFreeSessionCost:.02,paying:!0,tenantID:"96caa4b4-31a4-48e5-8163-dec61869a2a7",theme:"twincreator",userCount:0,usersCanAccessAPI:!1,usersCanCreateMemori:!1,usersCanEditDynamicIntents:!1,usersCanEditIntegrations:!1,usersCanEditMemoriChaining:!1,usersCanRunSnippets:!1},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file diff --git a/components-ChatBubble-ChatBubble-stories.bb739e8e.iframe.bundle.js b/components-ChatBubble-ChatBubble-stories.679cc267.iframe.bundle.js similarity index 87% rename from components-ChatBubble-ChatBubble-stories.bb739e8e.iframe.bundle.js rename to components-ChatBubble-ChatBubble-stories.679cc267.iframe.bundle.js index 3e26da18..8b92e119 100644 --- a/components-ChatBubble-ChatBubble-stories.bb739e8e.iframe.bundle.js +++ b/components-ChatBubble-ChatBubble-stories.679cc267.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[2994],{"./src/components/ChatBubble/ChatBubble.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,FromUser:()=>FromUser,FromUserWithAvatar:()=>FromUserWithAvatar,FromUserWithAvatarAndCustomAvatar:()=>FromUserWithAvatarAndCustomAvatar,FromUserWithCustomAvatar:()=>FromUserWithCustomAvatar,FromUserWithCustomAvatarElement:()=>FromUserWithCustomAvatarElement,GeneratedByAI:()=>GeneratedByAI,Initial:()=>Initial,WithAllAddonsContents:()=>WithAllAddonsContents,WithFeedbackButtons:()=>WithFeedbackButtons,__namedExportsOrder:()=>__namedExportsOrder,default:()=>ChatBubble_stories});__webpack_require__("./node_modules/react/index.js");var data=__webpack_require__("./src/mocks/data.ts"),ChatBubble=__webpack_require__("./src/components/ChatBubble/ChatBubble.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),ChatBubble_ChatBubble=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/ChatBubble/ChatBubble.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(ChatBubble_ChatBubble.Z,options);ChatBubble_ChatBubble.Z&&ChatBubble_ChatBubble.Z.locals&&ChatBubble_ChatBubble.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatBubble_stories={title:"Widget/Chat bubble",component:ChatBubble.Z,argTypes:{fromUser:{control:{type:"boolean"}},text:{control:{type:"text"}},initial:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},Template=args=>(0,jsx_runtime.jsx)(ChatBubble.Z,{...args});Template.displayName="Template";const Default=Template.bind({});Default.args={memori:data.jF,tenant:data.cm,message:{fromUser:!1,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const FromUser=Template.bind({});FromUser.args={memori:data.jF,tenant:data.cm,message:{fromUser:!0,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const Initial=Template.bind({});Initial.args={memori:data.jF,tenant:data.cm,message:{fromUser:!1,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!0,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const GeneratedByAI=Template.bind({});GeneratedByAI.args={memori:data.jF,tenant:data.cm,message:{fromUser:!1,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",generatedByAI:!0}};const WithFeedbackButtons=Template.bind({});WithFeedbackButtons.args={memori:data.jF,tenant:data.cm,message:{fromUser:!1,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",generatedByAI:!1},showFeedback:!0,simulateUserPrompt:()=>{}};const WithAllAddonsContents=Template.bind({});WithAllAddonsContents.args={memori:data.jF,tenant:data.cm,message:{fromUser:!1,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",generatedByAI:!0},showFeedback:!0,simulateUserPrompt:()=>{}};const FromUserWithAvatar=Template.bind({});FromUserWithAvatar.args={memori:data.jF,tenant:data.cm,user:{avatarURL:"https://picsum.photos/200"},message:{fromUser:!0,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const FromUserWithCustomAvatar=Template.bind({});FromUserWithCustomAvatar.args={memori:data.jF,tenant:data.cm,userAvatar:"https://picsum.photos/200",message:{fromUser:!0,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const FromUserWithCustomAvatarElement=Template.bind({});FromUserWithCustomAvatarElement.args={memori:data.jF,tenant:data.cm,userAvatar:(0,jsx_runtime.jsx)("span",{children:"USER"}),message:{fromUser:!0,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const FromUserWithAvatarAndCustomAvatar=Template.bind({});FromUserWithAvatarAndCustomAvatar.args={memori:data.jF,tenant:data.cm,userAvatar:()=>(0,jsx_runtime.jsx)("span",{children:"USER"}),user:{avatarURL:"https://picsum.photos/200"},message:{fromUser:!0,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => ",...Default.parameters?.docs?.source}}},FromUser.parameters={...FromUser.parameters,docs:{...FromUser.parameters?.docs,source:{originalSource:"args => ",...FromUser.parameters?.docs?.source}}},Initial.parameters={...Initial.parameters,docs:{...Initial.parameters?.docs,source:{originalSource:"args => ",...Initial.parameters?.docs?.source}}},GeneratedByAI.parameters={...GeneratedByAI.parameters,docs:{...GeneratedByAI.parameters?.docs,source:{originalSource:"args => ",...GeneratedByAI.parameters?.docs?.source}}},WithFeedbackButtons.parameters={...WithFeedbackButtons.parameters,docs:{...WithFeedbackButtons.parameters?.docs,source:{originalSource:"args => ",...WithFeedbackButtons.parameters?.docs?.source}}},WithAllAddonsContents.parameters={...WithAllAddonsContents.parameters,docs:{...WithAllAddonsContents.parameters?.docs,source:{originalSource:"args => ",...WithAllAddonsContents.parameters?.docs?.source}}},FromUserWithAvatar.parameters={...FromUserWithAvatar.parameters,docs:{...FromUserWithAvatar.parameters?.docs,source:{originalSource:"args => ",...FromUserWithAvatar.parameters?.docs?.source}}},FromUserWithCustomAvatar.parameters={...FromUserWithCustomAvatar.parameters,docs:{...FromUserWithCustomAvatar.parameters?.docs,source:{originalSource:"args => ",...FromUserWithCustomAvatar.parameters?.docs?.source}}},FromUserWithCustomAvatarElement.parameters={...FromUserWithCustomAvatarElement.parameters,docs:{...FromUserWithCustomAvatarElement.parameters?.docs,source:{originalSource:"args => ",...FromUserWithCustomAvatarElement.parameters?.docs?.source}}},FromUserWithAvatarAndCustomAvatar.parameters={...FromUserWithAvatarAndCustomAvatar.parameters,docs:{...FromUserWithAvatarAndCustomAvatar.parameters?.docs,source:{originalSource:"args => ",...FromUserWithAvatarAndCustomAvatar.parameters?.docs?.source}}};const __namedExportsOrder=["Default","FromUser","Initial","GeneratedByAI","WithFeedbackButtons","WithAllAddonsContents","FromUserWithAvatar","FromUserWithCustomAvatar","FromUserWithCustomAvatarElement","FromUserWithAvatarAndCustomAvatar"]},"./src/components/ChatBubble/ChatBubble.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_headlessui_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_helpers_media__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/helpers/media.ts"),_icons_User__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/User.tsx"),_icons_AI__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/AI.tsx"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_FeedbackButtons_FeedbackButtons__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/FeedbackButtons/FeedbackButtons.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatBubble=({message,memori,tenant,baseUrl,apiUrl,showFeedback,simulateUserPrompt,showAIicon=!0,isFirst=!1,user,userAvatar})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_7__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment,{children:[(message.initial||isFirst)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u,{show:!0,appear:!0,as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!message.fromUser,"memori-chat--with-addon":message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt}),children:[!message.fromUser&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("source",{src:(0,_helpers_media__WEBPACK_IMPORTED_MODULE_9__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl,apiURL:apiUrl})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:memori.name,src:memori.avatarURL&&memori.avatarURL.length>0?(0,_helpers_media__WEBPACK_IMPORTED_MODULE_9__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl,apiURL:apiUrl}):(0,_helpers_media__WEBPACK_IMPORTED_MODULE_9__.v)({tenantID:tenant?.id,type:"avatar",baseURL:baseUrl||"https://app.twincreator.com",apiURL:apiUrl})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u.Child,{as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--bubble",{"memori-chat--user-bubble":!!message.fromUser,"memori-chat--with-addon":message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt,"memori-chat--ai-generated":message.generatedByAI&&showAIicon,"memori-chat--with-feedback":showFeedback}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(message.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(message.fromUser?"30":"-30"),children:[(message.translatedText||message.text).split(/\r\n|\r|\n/).map(((row,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p",{children:row},index))),(message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div",{className:"memori-chat--bubble-addon",children:[showFeedback&&!!simulateUserPrompt&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_FeedbackButtons_FeedbackButtons__WEBPACK_IMPORTED_MODULE_5__.Z,{memori,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:msg=>{msg&&simulateUserPrompt(msg)}}),message.generatedByAI&&showAIicon&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_4__.Z,{align:"left",content:t("generatedByAI"),className:"memori-chat--bubble-ai-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icons_AI__WEBPACK_IMPORTED_MODULE_3__.default,{title:t("generatedByAI")||void 0})})})]})]}),message.fromUser&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment,{children:userAvatar&&"string"==typeof userAvatar||!userAvatar&&user?.avatarURL?.length?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:user?.userName??"User",src:userAvatar??user?.avatarURL})}):userAvatar?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:userAvatar}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icons_User__WEBPACK_IMPORTED_MODULE_2__.default,{})})})]})]})},__WEBPACK_DEFAULT_EXPORT__=ChatBubble;try{ChatBubble.displayName="ChatBubble",ChatBubble.__docgenInfo={description:"",displayName:"ChatBubble",props:{message:{defaultValue:null,description:"",name:"message",required:!0,type:{name:"Message"}},memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},showFeedback:{defaultValue:null,description:"",name:"showFeedback",required:!1,type:{name:"boolean"}},simulateUserPrompt:{defaultValue:null,description:"",name:"simulateUserPrompt",required:!1,type:{name:"((msg: string) => void)"}},showAIicon:{defaultValue:{value:"true"},description:"",name:"showAIicon",required:!1,type:{name:"boolean"}},isFirst:{defaultValue:{value:"false"},description:"",name:"isFirst",required:!1,type:{name:"boolean"}},userAvatar:{defaultValue:null,description:"",name:"userAvatar",required:!1,type:{name:"string | Element"}},user:{defaultValue:null,description:"",name:"user",required:!1,type:{name:"User"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatBubble/ChatBubble.tsx#ChatBubble"]={docgenInfo:ChatBubble.__docgenInfo,name:"ChatBubble",path:"src/components/ChatBubble/ChatBubble.tsx#ChatBubble"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/FeedbackButtons/FeedbackButtons.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Feedback.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const feedbackMsgs={"it-IT":"Non è quello che ti ho chiesto","fr-FR":"Ce n'est pas ce que je t'ai demandé","en-GB":"It's not what I asked"},feedbackMsgsHelpers={"it-IT":"La risposta non era corretta","fr-FR":"La réponse n'était pas correcte","en-GB":"The answer was not correct"},dislikeMsgs={"it-IT":"Non mi è piaciuta la risposta","fr-FR":"Je n'ai pas aimé la réponse","en-GB":"I didn't like the answer"},FeedbackButtons=({memori,className,onNegativeClick,toggle=!1,dropdown=!1})=>{const[clicked,setClicked]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),culture="it-IT"===memori.culture?"it-IT":"fr-FR"===memori.culture?"fr-FR":"en-GB",feedbackMsg=feedbackMsgs[culture],feedbackMsgHelper=feedbackMsgsHelpers[culture],dislikeMsg=dislikeMsgs[culture];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"memori-chat--feedback"+(className?` ${className}`:""),children:dropdown?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v,{as:"div",className:"memori-chat--feedback-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Button,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{ghost:!0,shape:"circle",title:"Feedback",className:"memori-chat--feedback-menu-button",disabled:!!clicked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Items,{className:"memori-chat--feedback-menu-items",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-chat--feedback-menu-items-container",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("up"===clicked&&toggle?void 0:"up")},children:dislikeMsg})},"ok"),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},children:feedbackMsgHelper})},"no")]})})})]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:"Feedback",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{title:"Feedback",onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},ghost:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})})})};FeedbackButtons.displayName="FeedbackButtons";const __WEBPACK_DEFAULT_EXPORT__=FeedbackButtons;try{FeedbackButtons.displayName="FeedbackButtons",FeedbackButtons.__docgenInfo={description:"",displayName:"FeedbackButtons",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},onNegativeClick:{defaultValue:null,description:"",name:"onNegativeClick",required:!0,type:{name:"(msg?: string | undefined) => void"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},toggle:{defaultValue:{value:"false"},description:"",name:"toggle",required:!1,type:{name:"boolean"}},dropdown:{defaultValue:{value:"false"},description:"",name:"dropdown",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"]={docgenInfo:FeedbackButtons.__docgenInfo,name:"FeedbackButtons",path:"src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/AI.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AI=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z",clipRule:"evenodd"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z",clipRule:"evenodd"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z",clipRule:"evenodd"})]})});AI.displayName="AI";const __WEBPACK_DEFAULT_EXPORT__=AI;try{AI.displayName="AI",AI.__docgenInfo={description:"",displayName:"AI",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/AI.tsx#AI"]={docgenInfo:AI.__docgenInfo,name:"AI",path:"src/components/icons/AI.tsx#AI"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Feedback.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Feedback=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"})]});Feedback.displayName="Feedback";const __WEBPACK_DEFAULT_EXPORT__=Feedback;try{Feedback.displayName="Feedback",Feedback.__docgenInfo={description:"",displayName:"Feedback",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Feedback.tsx#Feedback"]={docgenInfo:Feedback.__docgenInfo,name:"Feedback",path:"src/components/icons/Feedback.tsx#Feedback"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/User.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const User=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"})});User.displayName="User";const __WEBPACK_DEFAULT_EXPORT__=User;try{User.displayName="User",User.__docgenInfo={description:"",displayName:"User",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/User.tsx#User"]={docgenInfo:User.__docgenInfo,name:"User",path:"src/components/icons/User.tsx#User"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Tooltip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Tooltip=({content,className,align="right",disabled=!1,visible=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-tooltip",`memori-tooltip--align-${align}`,className,{"memori-tooltip--disabled":disabled,"memori-tooltip--visible":visible}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--content",children:content}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--trigger",children})]});Tooltip.displayName="Tooltip";const __WEBPACK_DEFAULT_EXPORT__=Tooltip;try{Tooltip.displayName="Tooltip",Tooltip.__docgenInfo={description:"",displayName:"Tooltip",props:{content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"Element | ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'},{value:'"topLeft"'},{value:'"topRight"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Tooltip.tsx#Tooltip"]={docgenInfo:Tooltip.__docgenInfo,name:"Tooltip",path:"src/components/ui/Tooltip.tsx#Tooltip"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/media.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{v:()=>getResourceUrl});const getResourceUrl=({type,resourceURI,sessionID,baseURL="",apiURL=""})=>{let defaultUri="cover"===type?`${baseURL}/images/memoriCover.png`:`${baseURL}/images/memoriAvatar.png`;try{return resourceURI&&0!==resourceURI.length?resourceURI.includes("memoriai/memory")&&!resourceURI.includes("memori-ai-session-id")&&sessionID?`${resourceURI}?memori-ai-session-id=${sessionID}`:(resourceURI.startsWith("https://")||resourceURI.startsWith("http://"))&&(new URL(resourceURI).hostname.includes("memori.ai")||new URL(resourceURI).hostname.includes("aclambda.online"))?`${resourceURI}${resourceURI.endsWith("/")||!sessionID?"":"/"}${sessionID||""}`:resourceURI.startsWith("cloud://")?`${apiURL?.replace(/v2/,"v1")||""}/CloudAsset/${resourceURI.replace("cloud://","")}`:resourceURI.startsWith("guid://")?`${apiURL?.replace(/v2/,"v1")||""}/GuidAsset/${resourceURI.replace("guid://","")}`:resourceURI||defaultUri:defaultUri}catch(e){return resourceURI||defaultUri}}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={id:"locahost:3000",theme:"twincreator",config:{name:"Memori",showNewUser:!0,requirePosition:!1,feedbackURL:"https://form.asana.com/"}},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[2994],{"./src/components/ChatBubble/ChatBubble.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,FromUser:()=>FromUser,FromUserWithAvatar:()=>FromUserWithAvatar,FromUserWithAvatarAndCustomAvatar:()=>FromUserWithAvatarAndCustomAvatar,FromUserWithCustomAvatar:()=>FromUserWithCustomAvatar,FromUserWithCustomAvatarElement:()=>FromUserWithCustomAvatarElement,GeneratedByAI:()=>GeneratedByAI,Initial:()=>Initial,WithAllAddonsContents:()=>WithAllAddonsContents,WithFeedbackButtons:()=>WithFeedbackButtons,__namedExportsOrder:()=>__namedExportsOrder,default:()=>ChatBubble_stories});__webpack_require__("./node_modules/react/index.js");var data=__webpack_require__("./src/mocks/data.ts"),ChatBubble=__webpack_require__("./src/components/ChatBubble/ChatBubble.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),ChatBubble_ChatBubble=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/ChatBubble/ChatBubble.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(ChatBubble_ChatBubble.Z,options);ChatBubble_ChatBubble.Z&&ChatBubble_ChatBubble.Z.locals&&ChatBubble_ChatBubble.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatBubble_stories={title:"Widget/Chat bubble",component:ChatBubble.Z,argTypes:{fromUser:{control:{type:"boolean"}},text:{control:{type:"text"}},initial:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},Template=args=>(0,jsx_runtime.jsx)(ChatBubble.Z,{...args});Template.displayName="Template";const Default=Template.bind({});Default.args={memori:data.jF,tenant:data.cm,message:{fromUser:!1,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const FromUser=Template.bind({});FromUser.args={memori:data.jF,tenant:data.cm,message:{fromUser:!0,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const Initial=Template.bind({});Initial.args={memori:data.jF,tenant:data.cm,message:{fromUser:!1,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!0,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const GeneratedByAI=Template.bind({});GeneratedByAI.args={memori:data.jF,tenant:data.cm,message:{fromUser:!1,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",generatedByAI:!0}};const WithFeedbackButtons=Template.bind({});WithFeedbackButtons.args={memori:data.jF,tenant:data.cm,message:{fromUser:!1,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",generatedByAI:!1},showFeedback:!0,simulateUserPrompt:()=>{}};const WithAllAddonsContents=Template.bind({});WithAllAddonsContents.args={memori:data.jF,tenant:data.cm,message:{fromUser:!1,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",generatedByAI:!0},showFeedback:!0,simulateUserPrompt:()=>{}};const FromUserWithAvatar=Template.bind({});FromUserWithAvatar.args={memori:data.jF,tenant:data.cm,user:{avatarURL:"https://picsum.photos/200"},message:{fromUser:!0,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const FromUserWithCustomAvatar=Template.bind({});FromUserWithCustomAvatar.args={memori:data.jF,tenant:data.cm,userAvatar:"https://picsum.photos/200",message:{fromUser:!0,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const FromUserWithCustomAvatarElement=Template.bind({});FromUserWithCustomAvatarElement.args={memori:data.jF,tenant:data.cm,userAvatar:(0,jsx_runtime.jsx)("span",{children:"USER"}),message:{fromUser:!0,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}};const FromUserWithAvatarAndCustomAvatar=Template.bind({});FromUserWithAvatarAndCustomAvatar.args={memori:data.jF,tenant:data.cm,userAvatar:()=>(0,jsx_runtime.jsx)("span",{children:"USER"}),user:{avatarURL:"https://picsum.photos/200"},message:{fromUser:!0,text:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor.",initial:!1,translatedText:"Proin libero ante, dignissim sit amet turpis a, pretium condimentum dolor."}},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => ",...Default.parameters?.docs?.source}}},FromUser.parameters={...FromUser.parameters,docs:{...FromUser.parameters?.docs,source:{originalSource:"args => ",...FromUser.parameters?.docs?.source}}},Initial.parameters={...Initial.parameters,docs:{...Initial.parameters?.docs,source:{originalSource:"args => ",...Initial.parameters?.docs?.source}}},GeneratedByAI.parameters={...GeneratedByAI.parameters,docs:{...GeneratedByAI.parameters?.docs,source:{originalSource:"args => ",...GeneratedByAI.parameters?.docs?.source}}},WithFeedbackButtons.parameters={...WithFeedbackButtons.parameters,docs:{...WithFeedbackButtons.parameters?.docs,source:{originalSource:"args => ",...WithFeedbackButtons.parameters?.docs?.source}}},WithAllAddonsContents.parameters={...WithAllAddonsContents.parameters,docs:{...WithAllAddonsContents.parameters?.docs,source:{originalSource:"args => ",...WithAllAddonsContents.parameters?.docs?.source}}},FromUserWithAvatar.parameters={...FromUserWithAvatar.parameters,docs:{...FromUserWithAvatar.parameters?.docs,source:{originalSource:"args => ",...FromUserWithAvatar.parameters?.docs?.source}}},FromUserWithCustomAvatar.parameters={...FromUserWithCustomAvatar.parameters,docs:{...FromUserWithCustomAvatar.parameters?.docs,source:{originalSource:"args => ",...FromUserWithCustomAvatar.parameters?.docs?.source}}},FromUserWithCustomAvatarElement.parameters={...FromUserWithCustomAvatarElement.parameters,docs:{...FromUserWithCustomAvatarElement.parameters?.docs,source:{originalSource:"args => ",...FromUserWithCustomAvatarElement.parameters?.docs?.source}}},FromUserWithAvatarAndCustomAvatar.parameters={...FromUserWithAvatarAndCustomAvatar.parameters,docs:{...FromUserWithAvatarAndCustomAvatar.parameters?.docs,source:{originalSource:"args => ",...FromUserWithAvatarAndCustomAvatar.parameters?.docs?.source}}};const __namedExportsOrder=["Default","FromUser","Initial","GeneratedByAI","WithFeedbackButtons","WithAllAddonsContents","FromUserWithAvatar","FromUserWithCustomAvatar","FromUserWithCustomAvatarElement","FromUserWithAvatarAndCustomAvatar"]},"./src/components/ChatBubble/ChatBubble.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_headlessui_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_helpers_media__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/helpers/media.ts"),_icons_User__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/User.tsx"),_icons_AI__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/AI.tsx"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_FeedbackButtons_FeedbackButtons__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/FeedbackButtons/FeedbackButtons.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatBubble=({message,memori,tenant,baseUrl,apiUrl,showFeedback,simulateUserPrompt,showAIicon=!0,isFirst=!1,user,userAvatar})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_7__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment,{children:[(message.initial||isFirst)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u,{show:!0,appear:!0,as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!message.fromUser,"memori-chat--with-addon":message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt}),children:[!message.fromUser&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("source",{src:(0,_helpers_media__WEBPACK_IMPORTED_MODULE_9__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl,apiURL:apiUrl})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:memori.name,src:memori.avatarURL&&memori.avatarURL.length>0?(0,_helpers_media__WEBPACK_IMPORTED_MODULE_9__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl,apiURL:apiUrl}):(0,_helpers_media__WEBPACK_IMPORTED_MODULE_9__.v)({tenantID:tenant?.id,type:"avatar",baseURL:baseUrl||"https://app.twincreator.com",apiURL:apiUrl})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u.Child,{as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--bubble",{"memori-chat--user-bubble":!!message.fromUser,"memori-chat--with-addon":message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt,"memori-chat--ai-generated":message.generatedByAI&&showAIicon,"memori-chat--with-feedback":showFeedback}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(message.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(message.fromUser?"30":"-30"),children:[(message.translatedText||message.text).split(/\r\n|\r|\n/).map(((row,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("p",{children:row},index))),(message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div",{className:"memori-chat--bubble-addon",children:[showFeedback&&!!simulateUserPrompt&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_FeedbackButtons_FeedbackButtons__WEBPACK_IMPORTED_MODULE_5__.Z,{memori,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:msg=>{msg&&simulateUserPrompt(msg)}}),message.generatedByAI&&showAIicon&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_4__.Z,{align:"left",content:t("generatedByAI"),className:"memori-chat--bubble-ai-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icons_AI__WEBPACK_IMPORTED_MODULE_3__.default,{title:t("generatedByAI")||void 0})})})]})]}),message.fromUser&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment,{children:userAvatar&&"string"==typeof userAvatar||!userAvatar&&user?.avatarURL?.length?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:user?.userName??"User",src:userAvatar??user?.avatarURL})}):userAvatar?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:userAvatar}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.u.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icons_User__WEBPACK_IMPORTED_MODULE_2__.default,{})})})]})]})},__WEBPACK_DEFAULT_EXPORT__=ChatBubble;try{ChatBubble.displayName="ChatBubble",ChatBubble.__docgenInfo={description:"",displayName:"ChatBubble",props:{message:{defaultValue:null,description:"",name:"message",required:!0,type:{name:"Message"}},memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},showFeedback:{defaultValue:null,description:"",name:"showFeedback",required:!1,type:{name:"boolean"}},simulateUserPrompt:{defaultValue:null,description:"",name:"simulateUserPrompt",required:!1,type:{name:"((msg: string) => void)"}},showAIicon:{defaultValue:{value:"true"},description:"",name:"showAIicon",required:!1,type:{name:"boolean"}},isFirst:{defaultValue:{value:"false"},description:"",name:"isFirst",required:!1,type:{name:"boolean"}},userAvatar:{defaultValue:null,description:"",name:"userAvatar",required:!1,type:{name:"string | Element"}},user:{defaultValue:null,description:"",name:"user",required:!1,type:{name:"User"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatBubble/ChatBubble.tsx#ChatBubble"]={docgenInfo:ChatBubble.__docgenInfo,name:"ChatBubble",path:"src/components/ChatBubble/ChatBubble.tsx#ChatBubble"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/FeedbackButtons/FeedbackButtons.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Feedback.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const feedbackMsgs={"it-IT":"Non è quello che ti ho chiesto","fr-FR":"Ce n'est pas ce que je t'ai demandé","en-GB":"It's not what I asked"},feedbackMsgsHelpers={"it-IT":"La risposta non era corretta","fr-FR":"La réponse n'était pas correcte","en-GB":"The answer was not correct"},dislikeMsgs={"it-IT":"Non mi è piaciuta la risposta","fr-FR":"Je n'ai pas aimé la réponse","en-GB":"I didn't like the answer"},FeedbackButtons=({memori,className,onNegativeClick,toggle=!1,dropdown=!1})=>{const[clicked,setClicked]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),culture="it-IT"===memori.culture?"it-IT":"fr-FR"===memori.culture?"fr-FR":"en-GB",feedbackMsg=feedbackMsgs[culture],feedbackMsgHelper=feedbackMsgsHelpers[culture],dislikeMsg=dislikeMsgs[culture];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"memori-chat--feedback"+(className?` ${className}`:""),children:dropdown?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v,{as:"div",className:"memori-chat--feedback-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Button,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{ghost:!0,shape:"circle",title:"Feedback",className:"memori-chat--feedback-menu-button",disabled:!!clicked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Items,{className:"memori-chat--feedback-menu-items",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-chat--feedback-menu-items-container",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("up"===clicked&&toggle?void 0:"up")},children:dislikeMsg})},"ok"),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},children:feedbackMsgHelper})},"no")]})})})]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:"Feedback",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{title:"Feedback",onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},ghost:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})})})};FeedbackButtons.displayName="FeedbackButtons";const __WEBPACK_DEFAULT_EXPORT__=FeedbackButtons;try{FeedbackButtons.displayName="FeedbackButtons",FeedbackButtons.__docgenInfo={description:"",displayName:"FeedbackButtons",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},onNegativeClick:{defaultValue:null,description:"",name:"onNegativeClick",required:!0,type:{name:"(msg?: string | undefined) => void"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},toggle:{defaultValue:{value:"false"},description:"",name:"toggle",required:!1,type:{name:"boolean"}},dropdown:{defaultValue:{value:"false"},description:"",name:"dropdown",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"]={docgenInfo:FeedbackButtons.__docgenInfo,name:"FeedbackButtons",path:"src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/AI.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AI=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z",clipRule:"evenodd"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z",clipRule:"evenodd"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z",clipRule:"evenodd"})]})});AI.displayName="AI";const __WEBPACK_DEFAULT_EXPORT__=AI;try{AI.displayName="AI",AI.__docgenInfo={description:"",displayName:"AI",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/AI.tsx#AI"]={docgenInfo:AI.__docgenInfo,name:"AI",path:"src/components/icons/AI.tsx#AI"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Feedback.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Feedback=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"})]});Feedback.displayName="Feedback";const __WEBPACK_DEFAULT_EXPORT__=Feedback;try{Feedback.displayName="Feedback",Feedback.__docgenInfo={description:"",displayName:"Feedback",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Feedback.tsx#Feedback"]={docgenInfo:Feedback.__docgenInfo,name:"Feedback",path:"src/components/icons/Feedback.tsx#Feedback"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/User.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const User=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"})});User.displayName="User";const __WEBPACK_DEFAULT_EXPORT__=User;try{User.displayName="User",User.__docgenInfo={description:"",displayName:"User",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/User.tsx#User"]={docgenInfo:User.__docgenInfo,name:"User",path:"src/components/icons/User.tsx#User"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Tooltip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Tooltip=({content,className,align="right",disabled=!1,visible=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-tooltip",`memori-tooltip--align-${align}`,className,{"memori-tooltip--disabled":disabled,"memori-tooltip--visible":visible}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--content",children:content}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--trigger",children})]});Tooltip.displayName="Tooltip";const __WEBPACK_DEFAULT_EXPORT__=Tooltip;try{Tooltip.displayName="Tooltip",Tooltip.__docgenInfo={description:"",displayName:"Tooltip",props:{content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"Element | ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'},{value:'"topLeft"'},{value:'"topRight"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Tooltip.tsx#Tooltip"]={docgenInfo:Tooltip.__docgenInfo,name:"Tooltip",path:"src/components/ui/Tooltip.tsx#Tooltip"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/media.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{v:()=>getResourceUrl});const getResourceUrl=({type,resourceURI,sessionID,baseURL="",apiURL=""})=>{let defaultUri="cover"===type?`${baseURL}/images/memoriCover.png`:`${baseURL}/images/memoriAvatar.png`;try{return resourceURI&&0!==resourceURI.length?resourceURI.includes("memoriai/memory")&&!resourceURI.includes("memori-ai-session-id")&&sessionID?`${resourceURI}?memori-ai-session-id=${sessionID}`:(resourceURI.startsWith("https://")||resourceURI.startsWith("http://"))&&(new URL(resourceURI).hostname.includes("memori.ai")||new URL(resourceURI).hostname.includes("aclambda.online"))?`${resourceURI}${resourceURI.endsWith("/")||!sessionID?"":"/"}${sessionID||""}`:resourceURI.startsWith("cloud://")?`${apiURL?.replace(/v2/,"v1")||""}/CloudAsset/${resourceURI.replace("cloud://","")}`:resourceURI.startsWith("guid://")?`${apiURL?.replace(/v2/,"v1")||""}/GuidAsset/${resourceURI.replace("guid://","")}`:resourceURI||defaultUri:defaultUri}catch(e){return resourceURI||defaultUri}}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={adminCount:3,config:{feedbackURL:"https://form.asana.com/?k=XC7S3JWQeIhnjipBuA3gbw&d=1199599736247413",name:"TwinCreator",requirePosition:!1,showNewUser:!0},creationTimestamp:"2023-05-31T14:32:48.885287Z",description:"TwinCreator",disableRegistration:!1,id:"app.twincreator.com",lastChangeTimestamp:"2023-05-31T14:32:48.885287Z",logoURL:"https://app.twincreator.com/images/twincreator/logo.png",maxAdmins:0,maxCompletions:0,maxCompletionsPerUser:0,maxFreeSessions:400,maxFreeSessionsPerUser:100,maxMemoriPerAdmin:0,maxMemoriPerUser:3,maxTotalMemori:0,maxUsers:0,memoriCount:0,name:"app.twincreator.com",nonFreeSessionCost:.02,paying:!0,tenantID:"96caa4b4-31a4-48e5-8163-dec61869a2a7",theme:"twincreator",userCount:0,usersCanAccessAPI:!1,usersCanCreateMemori:!1,usersCanEditDynamicIntents:!1,usersCanEditIntegrations:!1,usersCanEditMemoriChaining:!1,usersCanRunSnippets:!1},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file diff --git a/components-ChatInputs-ChatInputs-stories.abd65798.iframe.bundle.js b/components-ChatInputs-ChatInputs-stories.0e6684c7.iframe.bundle.js similarity index 91% rename from components-ChatInputs-ChatInputs-stories.abd65798.iframe.bundle.js rename to components-ChatInputs-ChatInputs-stories.0e6684c7.iframe.bundle.js index 7428d5c4..48d175b4 100644 --- a/components-ChatInputs-ChatInputs-stories.abd65798.iframe.bundle.js +++ b/components-ChatInputs-ChatInputs-stories.0e6684c7.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[4296],{"./src/components/ChatInputs/ChatInputs.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ContinuousSpeech:()=>ContinuousSpeech,ContinuousSpeechListening:()=>ContinuousSpeechListening,Default:()=>Default,Disabled:()=>Disabled,Instruct:()=>Instruct,InstructAcceptingMedia:()=>InstructAcceptingMedia,WithLongText:()=>WithLongText,WithValue:()=>WithValue,WithoutMicrophone:()=>WithoutMicrophone,__namedExportsOrder:()=>__namedExportsOrder,default:()=>ChatInputs_stories});var react=__webpack_require__("./node_modules/react/index.js"),ChatInputs=__webpack_require__("./src/components/ChatInputs/ChatInputs.tsx"),data=__webpack_require__("./src/mocks/data.ts"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),ChatInputs_ChatInputs=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/ChatInputs/ChatInputs.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(ChatInputs_ChatInputs.Z,options);ChatInputs_ChatInputs.Z&&ChatInputs_ChatInputs.Z.locals&&ChatInputs_ChatInputs.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatInputs_stories={title:"Widget/Chat inputs (footer)",component:ChatInputs.Z,argTypes:{disabled:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},ChatInputs_stories_text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.".split(" ").reverse(),Template=args=>{const[userMessage,setUserMessage]=react.useState(args.userMessage),[listening,setListening]=react.useState(args.listening);return(0,react.useEffect)((()=>{if(listening){const interval=setInterval((()=>{let nextWord=ChatInputs_stories_text.pop();nextWord?setUserMessage((prev=>`${prev||""}${prev?" ":""}${nextWord}`)):clearInterval(interval)}),500*Math.random()+100);return()=>clearInterval(interval)}}),[listening]),(0,jsx_runtime.jsx)("div",{style:{paddingTop:"10rem"},children:(0,jsx_runtime.jsx)(ChatInputs.Z,{...args,listening,startListening:()=>setListening(!0),stopListening:()=>setListening(!1),userMessage,onChangeUserMessage:setUserMessage})})};Template.displayName="Template";const Default=Template.bind({});Default.args={userMessage:"",dialogState:data.Gs,sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0};const WithValue=Template.bind({});WithValue.args={userMessage:"Suspendisse sit amet volutpat velit.",dialogState:data.Gs,sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0};const WithLongText=Template.bind({});WithLongText.args={userMessage:"Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur. Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur.",dialogState:data.Gs,sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0};const Instruct=Template.bind({});Instruct.args={instruct:!0,userMessage:"Suspendisse sit amet volutpat velit.",dialogState:{...data.Gs,acceptsMedia:!1},sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0};const InstructAcceptingMedia=Template.bind({});InstructAcceptingMedia.args={instruct:!0,userMessage:"Suspendisse sit amet volutpat velit.",dialogState:{...data.Gs,acceptsMedia:!0},sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0,authToken:"123"};const Disabled=Template.bind({});Disabled.args={dialogState:{...data.Gs,state:"X3"},userMessage:"Suspendisse sit amet volutpat velit.",sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0};const ContinuousSpeech=Template.bind({});ContinuousSpeech.args={dialogState:data.Gs,userMessage:"Suspendisse sit amet volutpat velit.",sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0,microphoneMode:"CONTINUOUS"};const ContinuousSpeechListening=Template.bind({});ContinuousSpeechListening.args={dialogState:data.Gs,userMessage:"Suspendisse sit amet volutpat velit.",sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!0,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0,microphoneMode:"CONTINUOUS"};const WithoutMicrophone=Template.bind({});WithoutMicrophone.args={dialogState:data.Gs,userMessage:"Suspendisse sit amet volutpat velit.",sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!0,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!1},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...Default.parameters?.docs?.source}}},WithValue.parameters={...WithValue.parameters,docs:{...WithValue.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...WithValue.parameters?.docs?.source}}},WithLongText.parameters={...WithLongText.parameters,docs:{...WithLongText.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...WithLongText.parameters?.docs?.source}}},Instruct.parameters={...Instruct.parameters,docs:{...Instruct.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...Instruct.parameters?.docs?.source}}},InstructAcceptingMedia.parameters={...InstructAcceptingMedia.parameters,docs:{...InstructAcceptingMedia.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...InstructAcceptingMedia.parameters?.docs?.source}}},Disabled.parameters={...Disabled.parameters,docs:{...Disabled.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...Disabled.parameters?.docs?.source}}},ContinuousSpeech.parameters={...ContinuousSpeech.parameters,docs:{...ContinuousSpeech.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...ContinuousSpeech.parameters?.docs?.source}}},ContinuousSpeechListening.parameters={...ContinuousSpeechListening.parameters,docs:{...ContinuousSpeechListening.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...ContinuousSpeechListening.parameters?.docs?.source}}},WithoutMicrophone.parameters={...WithoutMicrophone.parameters,docs:{...WithoutMicrophone.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...WithoutMicrophone.parameters?.docs?.source}}};const __namedExportsOrder=["Default","WithValue","WithLongText","Instruct","InstructAcceptingMedia","Disabled","ContinuousSpeech","ContinuousSpeechListening","WithoutMicrophone"]},"./src/components/ChatInputs/ChatInputs.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _UploadMenu_UploadMenu__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/UploadMenu/UploadMenu.tsx"),_SendOnEnterMenu_SendOnEnterMenu__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/SendOnEnterMenu/SendOnEnterMenu.tsx"),_ChatTextArea_ChatTextArea__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ChatTextArea/ChatTextArea.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Button.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_Send__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/icons/Send.tsx"),_MicrophoneButton_MicrophoneButton__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/MicrophoneButton/MicrophoneButton.tsx"),classnames__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__),_icons_Microphone__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/icons/Microphone.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatInputs=({dialogState,instruct=!1,sendOnEnter="click",setSendOnEnter,attachmentsMenuOpen,setAttachmentsMenuOpen,userMessage="",onChangeUserMessage,sendMessage,onTextareaFocus,onTextareaBlur,onTextareaPressEnter,showMicrophone=!1,microphoneMode="HOLD_TO_TALK",listening=!1,stopAudio,startListening,stopListening,authToken})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_10__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===dialogState?.state||"X3"===dialogState?.state,children:[(instruct||dialogState?.acceptsMedia)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_UploadMenu_UploadMenu__WEBPACK_IMPORTED_MODULE_1__.Z,{attachmentsMenuOpen,setAttachmentsMenuOpen,authToken,disabled:!dialogState?.acceptsMedia}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_SendOnEnterMenu_SendOnEnterMenu__WEBPACK_IMPORTED_MODULE_2__.Z,{sendOnEnter,setSendOnEnter}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ChatTextArea_ChatTextArea__WEBPACK_IMPORTED_MODULE_3__.Z,{value:userMessage,onChange:onChangeUserMessage,onPressEnter:onTextareaPressEnter,onFocus:onTextareaFocus,onBlur:onTextareaBlur,disabled:["R2","R3","R4","R5","G3","X3"].includes(dialogState?.state||"")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{shape:"circle",primary:!!userMessage?.length,disabled:!userMessage||0===userMessage.length,className:"memori-chat-inputs--send",onClick:()=>{sendMessage(userMessage),stopAudio(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:t("send")||"Send",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_icons_Send__WEBPACK_IMPORTED_MODULE_5__.default,{})}),showMicrophone&&"HOLD_TO_TALK"===microphoneMode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_MicrophoneButton_MicrophoneButton__WEBPACK_IMPORTED_MODULE_6__.Z,{listening,startListening,stopListening:()=>{stopListening(),userMessage?.length&&sendMessage(userMessage)},stopAudio}),showMicrophone&&"CONTINUOUS"===microphoneMode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{primary:!0,className:classnames__WEBPACK_IMPORTED_MODULE_7___default()("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":listening}),title:listening?t("write_and_speak.micButtonPopoverListening")||"Listening":t("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{listening?stopListening():(stopAudio(),startListening())},shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_icons_Microphone__WEBPACK_IMPORTED_MODULE_8__.default,{})})]})};ChatInputs.displayName="ChatInputs";const __WEBPACK_DEFAULT_EXPORT__=ChatInputs;try{ChatInputs.displayName="ChatInputs",ChatInputs.__docgenInfo={description:"",displayName:"ChatInputs",props:{dialogState:{defaultValue:null,description:"",name:"dialogState",required:!1,type:{name:"DialogState"}},instruct:{defaultValue:{value:"false"},description:"",name:"instruct",required:!1,type:{name:"boolean"}},sendOnEnter:{defaultValue:{value:"click"},description:"",name:"sendOnEnter",required:!1,type:{name:"enum",value:[{value:'"keypress"'},{value:'"click"'}]}},setSendOnEnter:{defaultValue:null,description:"",name:"setSendOnEnter",required:!0,type:{name:'(sendOnEnter: "keypress" | "click") => void'}},attachmentsMenuOpen:{defaultValue:null,description:"",name:"attachmentsMenuOpen",required:!1,type:{name:"enum",value:[{value:'"link"'},{value:'"media"'}]}},setAttachmentsMenuOpen:{defaultValue:null,description:"",name:"setAttachmentsMenuOpen",required:!0,type:{name:'(attachmentsMenuOpen: "link" | "media") => void'}},userMessage:{defaultValue:{value:""},description:"",name:"userMessage",required:!1,type:{name:"string"}},onChangeUserMessage:{defaultValue:null,description:"",name:"onChangeUserMessage",required:!0,type:{name:"(userMessage: string) => void"}},sendMessage:{defaultValue:null,description:"",name:"sendMessage",required:!0,type:{name:"(msg: string) => void"}},onTextareaFocus:{defaultValue:null,description:"",name:"onTextareaFocus",required:!0,type:{name:"() => void"}},onTextareaBlur:{defaultValue:null,description:"",name:"onTextareaBlur",required:!0,type:{name:"() => void"}},onTextareaPressEnter:{defaultValue:null,description:"",name:"onTextareaPressEnter",required:!0,type:{name:"(e: KeyboardEvent) => void"}},listening:{defaultValue:{value:"false"},description:"",name:"listening",required:!1,type:{name:"boolean"}},isPlayingAudio:{defaultValue:null,description:"",name:"isPlayingAudio",required:!1,type:{name:"boolean"}},stopAudio:{defaultValue:null,description:"",name:"stopAudio",required:!0,type:{name:"() => void"}},startListening:{defaultValue:null,description:"",name:"startListening",required:!0,type:{name:"() => void"}},stopListening:{defaultValue:null,description:"",name:"stopListening",required:!0,type:{name:"() => void"}},showMicrophone:{defaultValue:{value:"false"},description:"",name:"showMicrophone",required:!1,type:{name:"boolean"}},microphoneMode:{defaultValue:{value:"HOLD_TO_TALK"},description:"",name:"microphoneMode",required:!1,type:{name:"enum",value:[{value:'"HOLD_TO_TALK"'},{value:'"CONTINUOUS"'}]}},authToken:{defaultValue:null,description:"",name:"authToken",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatInputs/ChatInputs.tsx#ChatInputs"]={docgenInfo:ChatInputs.__docgenInfo,name:"ChatInputs",path:"src/components/ChatInputs/ChatInputs.tsx#ChatInputs"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ChatTextArea/ChatTextArea.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Expand__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Expand.tsx"),_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/FullscreenExit.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatTextArea=({disabled=!1,value,onChange,onPressEnter,onFocus,onBlur})=>{const[expanded,setExpanded]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{"data-testid":"chat-textarea",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat-textarea",{"memori-chat-textarea--expanded":expanded,"memori-chat-textarea--disabled":disabled}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("textarea",{className:"memori-chat-textarea--input",disabled,value,onChange:e=>{onChange(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&onPressEnter&&onPressEnter(e)},onFocus,onBlur}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat-textarea--expand-button"),onClick:()=>setExpanded(!expanded),padded:!1,ghost:!0,icon:expanded?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_4__.default,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Expand__WEBPACK_IMPORTED_MODULE_3__.default,{})})})]})})};ChatTextArea.displayName="ChatTextArea";const __WEBPACK_DEFAULT_EXPORT__=ChatTextArea;try{ChatTextArea.displayName="ChatTextArea",ChatTextArea.__docgenInfo={description:"",displayName:"ChatTextArea",props:{disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},value:{defaultValue:null,description:"",name:"value",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!0,type:{name:"(value: string) => void"}},onPressEnter:{defaultValue:null,description:"",name:"onPressEnter",required:!1,type:{name:"((e: KeyboardEvent) => void)"}},onFocus:{defaultValue:null,description:"",name:"onFocus",required:!1,type:{name:"((e: FocusEvent) => void)"}},onBlur:{defaultValue:null,description:"",name:"onBlur",required:!1,type:{name:"((e: FocusEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatTextArea/ChatTextArea.tsx#ChatTextArea"]={docgenInfo:ChatTextArea.__docgenInfo,name:"ChatTextArea",path:"src/components/ChatTextArea/ChatTextArea.tsx#ChatTextArea"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MicrophoneButton/MicrophoneButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_icons_Microphone__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/icons/Microphone.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Tooltip.tsx"),classnames__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const MicrophoneButton=({listening,stopAudio,startListening,stopListening})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)(),[micBtnTooltip,setMicBtnTooltip]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),intervalRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),startHold=e=>{e.preventDefault(),setMicBtnTooltip(t("write_and_speak.holdToSpeak")||"Hold to record"),intervalRef.current||(intervalRef.current=setTimeout((()=>{stopAudio(),setMicBtnTooltip(t("write_and_speak.releaseToEndListening")||"Release to end listening"),startListening()}),300))},stopHold=()=>{intervalRef.current&&(clearTimeout(intervalRef.current),intervalRef.current=null),stopListening(),setMicBtnTooltip(void 0)};return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>()=>stopHold()),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__.Z,{visible:!!micBtnTooltip,content:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span",{children:micBtnTooltip||t("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":listening}),title:listening?t("write_and_speak.micButtonPopoverListening")||"Listening":t("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:startHold,onTouchStart:startHold,onMouseUp:stopHold,onMouseLeave:stopHold,onTouchEnd:stopHold,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Microphone__WEBPACK_IMPORTED_MODULE_1__.default,{})})})};MicrophoneButton.displayName="MicrophoneButton";const __WEBPACK_DEFAULT_EXPORT__=MicrophoneButton;try{MicrophoneButton.displayName="MicrophoneButton",MicrophoneButton.__docgenInfo={description:"",displayName:"MicrophoneButton",props:{listening:{defaultValue:null,description:"",name:"listening",required:!1,type:{name:"boolean"}},stopAudio:{defaultValue:null,description:"",name:"stopAudio",required:!0,type:{name:"() => void"}},startListening:{defaultValue:null,description:"",name:"startListening",required:!0,type:{name:"() => void"}},stopListening:{defaultValue:null,description:"",name:"stopListening",required:!0,type:{name:"() => void"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MicrophoneButton/MicrophoneButton.tsx#MicrophoneButton"]={docgenInfo:MicrophoneButton.__docgenInfo,name:"MicrophoneButton",path:"src/components/MicrophoneButton/MicrophoneButton.tsx#MicrophoneButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/SendOnEnterMenu/SendOnEnterMenu.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/radio-group/radio-group.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const SendOnEnterMenu=({sendOnEnter,setSendOnEnter})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v,{as:"div",className:"memori-send-on-enter-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Button,{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{style:{display:"block",width:"1rem",height:"1rem"},children:"…"})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Items,{className:"memori-menu--overlay",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E,{value:sendOnEnter,onChange:setSendOnEnter,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E.Option,{value:"keypress",className:"memori-menu--option",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,outlined:checked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-menu--icon",children:checked?"✓":""}),children:t("widget.sendOnKeypress")})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E.Option,{value:"click",className:"memori-menu--option",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,outlined:checked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-menu--icon",children:checked?"✓":""}),children:t("widget.sendOnClick")})})})]})})]})};SendOnEnterMenu.displayName="SendOnEnterMenu";const __WEBPACK_DEFAULT_EXPORT__=SendOnEnterMenu;try{SendOnEnterMenu.displayName="SendOnEnterMenu",SendOnEnterMenu.__docgenInfo={description:"",displayName:"SendOnEnterMenu",props:{sendOnEnter:{defaultValue:null,description:"",name:"sendOnEnter",required:!0,type:{name:"enum",value:[{value:'"keypress"'},{value:'"click"'}]}},setSendOnEnter:{defaultValue:null,description:"",name:"setSendOnEnter",required:!0,type:{name:'(value: "keypress" | "click") => void'}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/SendOnEnterMenu/SendOnEnterMenu.tsx#SendOnEnterMenu"]={docgenInfo:SendOnEnterMenu.__docgenInfo,name:"SendOnEnterMenu",path:"src/components/SendOnEnterMenu/SendOnEnterMenu.tsx#SendOnEnterMenu"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/UploadMenu/UploadMenu.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _headlessui_react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Link__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Link.tsx"),_icons_Picture__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/Picture.tsx"),_icons_PaperClip__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/icons/PaperClip.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react/jsx-runtime.js");const UploadMenu=({attachmentsMenuOpen,setAttachmentsMenuOpen,disabled=!1,authToken})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.v,{as:"div",className:"memori-upload-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.v.Button,{disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icons_PaperClip__WEBPACK_IMPORTED_MODULE_5__.default,{})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.v.Items,{as:"ul",className:"memori-menu--overlay",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.v.Item,{as:"li",className:"memori-menu--li",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icons_Link__WEBPACK_IMPORTED_MODULE_3__.default,{}),outlined:"link"===attachmentsMenuOpen,onClick:()=>setAttachmentsMenuOpen("link"),children:"Link"})}),!!authToken?.length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.v.Item,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icons_Picture__WEBPACK_IMPORTED_MODULE_4__.default,{}),outlined:"media"===attachmentsMenuOpen,onClick:()=>setAttachmentsMenuOpen("media"),children:"Media"})})]})]});UploadMenu.displayName="UploadMenu";const __WEBPACK_DEFAULT_EXPORT__=UploadMenu;try{UploadMenu.displayName="UploadMenu",UploadMenu.__docgenInfo={description:"",displayName:"UploadMenu",props:{attachmentsMenuOpen:{defaultValue:null,description:"",name:"attachmentsMenuOpen",required:!1,type:{name:"enum",value:[{value:'"link"'},{value:'"media"'}]}},setAttachmentsMenuOpen:{defaultValue:null,description:"",name:"setAttachmentsMenuOpen",required:!0,type:{name:'(value: "link" | "media") => void'}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},authToken:{defaultValue:null,description:"",name:"authToken",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/UploadMenu/UploadMenu.tsx#UploadMenu"]={docgenInfo:UploadMenu.__docgenInfo,name:"UploadMenu",path:"src/components/UploadMenu/UploadMenu.tsx#UploadMenu"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Expand.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Expand=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});Expand.displayName="Expand";const __WEBPACK_DEFAULT_EXPORT__=Expand;try{Expand.displayName="Expand",Expand.__docgenInfo={description:"",displayName:"Expand",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Expand.tsx#Expand"]={docgenInfo:Expand.__docgenInfo,name:"Expand",path:"src/components/icons/Expand.tsx#Expand"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/FullscreenExit.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const FullscreenExit=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});FullscreenExit.displayName="FullscreenExit";const __WEBPACK_DEFAULT_EXPORT__=FullscreenExit;try{FullscreenExit.displayName="FullscreenExit",FullscreenExit.__docgenInfo={description:"",displayName:"FullscreenExit",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/FullscreenExit.tsx#FullscreenExit"]={docgenInfo:FullscreenExit.__docgenInfo,name:"FullscreenExit",path:"src/components/icons/FullscreenExit.tsx#FullscreenExit"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Link.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Link=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})});Link.displayName="Link";const __WEBPACK_DEFAULT_EXPORT__=Link;try{Link.displayName="Link",Link.__docgenInfo={description:"",displayName:"Link",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Link.tsx#Link"]={docgenInfo:Link.__docgenInfo,name:"Link",path:"src/components/icons/Link.tsx#Link"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Microphone.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Microphone=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});Microphone.displayName="Microphone";const __WEBPACK_DEFAULT_EXPORT__=Microphone;try{Microphone.displayName="Microphone",Microphone.__docgenInfo={description:"",displayName:"Microphone",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Microphone.tsx#Microphone"]={docgenInfo:Microphone.__docgenInfo,name:"Microphone",path:"src/components/icons/Microphone.tsx#Microphone"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/PaperClip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const PaperClip=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 0 0 174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"})});PaperClip.displayName="PaperClip";const __WEBPACK_DEFAULT_EXPORT__=PaperClip;try{PaperClip.displayName="PaperClip",PaperClip.__docgenInfo={description:"",displayName:"PaperClip",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/PaperClip.tsx#PaperClip"]={docgenInfo:PaperClip.__docgenInfo,name:"PaperClip",path:"src/components/icons/PaperClip.tsx#PaperClip"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Picture.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Picture=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 1 0 0-176 88 88 0 0 0 0 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"})});Picture.displayName="Picture";const __WEBPACK_DEFAULT_EXPORT__=Picture;try{Picture.displayName="Picture",Picture.__docgenInfo={description:"",displayName:"Picture",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Picture.tsx#Picture"]={docgenInfo:Picture.__docgenInfo,name:"Picture",path:"src/components/icons/Picture.tsx#Picture"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Send.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Send=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});Send.displayName="Send";const __WEBPACK_DEFAULT_EXPORT__=Send;try{Send.displayName="Send",Send.__docgenInfo={description:"",displayName:"Send",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Send.tsx#Send"]={docgenInfo:Send.__docgenInfo,name:"Send",path:"src/components/icons/Send.tsx#Send"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Tooltip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Tooltip=({content,className,align="right",disabled=!1,visible=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-tooltip",`memori-tooltip--align-${align}`,className,{"memori-tooltip--disabled":disabled,"memori-tooltip--visible":visible}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--content",children:content}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--trigger",children})]});Tooltip.displayName="Tooltip";const __WEBPACK_DEFAULT_EXPORT__=Tooltip;try{Tooltip.displayName="Tooltip",Tooltip.__docgenInfo={description:"",displayName:"Tooltip",props:{content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"Element | ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'},{value:'"topLeft"'},{value:'"topRight"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Tooltip.tsx#Tooltip"]={docgenInfo:Tooltip.__docgenInfo,name:"Tooltip",path:"src/components/ui/Tooltip.tsx#Tooltip"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={id:"locahost:3000",theme:"twincreator",config:{name:"Memori",showNewUser:!0,requirePosition:!1,feedbackURL:"https://form.asana.com/"}},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[4296],{"./src/components/ChatInputs/ChatInputs.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ContinuousSpeech:()=>ContinuousSpeech,ContinuousSpeechListening:()=>ContinuousSpeechListening,Default:()=>Default,Disabled:()=>Disabled,Instruct:()=>Instruct,InstructAcceptingMedia:()=>InstructAcceptingMedia,WithLongText:()=>WithLongText,WithValue:()=>WithValue,WithoutMicrophone:()=>WithoutMicrophone,__namedExportsOrder:()=>__namedExportsOrder,default:()=>ChatInputs_stories});var react=__webpack_require__("./node_modules/react/index.js"),ChatInputs=__webpack_require__("./src/components/ChatInputs/ChatInputs.tsx"),data=__webpack_require__("./src/mocks/data.ts"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),ChatInputs_ChatInputs=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/ChatInputs/ChatInputs.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(ChatInputs_ChatInputs.Z,options);ChatInputs_ChatInputs.Z&&ChatInputs_ChatInputs.Z.locals&&ChatInputs_ChatInputs.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatInputs_stories={title:"Widget/Chat inputs (footer)",component:ChatInputs.Z,argTypes:{disabled:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},ChatInputs_stories_text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.".split(" ").reverse(),Template=args=>{const[userMessage,setUserMessage]=react.useState(args.userMessage),[listening,setListening]=react.useState(args.listening);return(0,react.useEffect)((()=>{if(listening){const interval=setInterval((()=>{let nextWord=ChatInputs_stories_text.pop();nextWord?setUserMessage((prev=>`${prev||""}${prev?" ":""}${nextWord}`)):clearInterval(interval)}),500*Math.random()+100);return()=>clearInterval(interval)}}),[listening]),(0,jsx_runtime.jsx)("div",{style:{paddingTop:"10rem"},children:(0,jsx_runtime.jsx)(ChatInputs.Z,{...args,listening,startListening:()=>setListening(!0),stopListening:()=>setListening(!1),userMessage,onChangeUserMessage:setUserMessage})})};Template.displayName="Template";const Default=Template.bind({});Default.args={userMessage:"",dialogState:data.Gs,sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0};const WithValue=Template.bind({});WithValue.args={userMessage:"Suspendisse sit amet volutpat velit.",dialogState:data.Gs,sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0};const WithLongText=Template.bind({});WithLongText.args={userMessage:"Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur. Suspendisse sit amet volutpat velit. Nunc at commodo tortor, id rutrum nunc. Vivamus condimentum vel nunc et congue. Ut laoreet imperdiet nisi ac finibus. Suspendisse molestie risus a justo sagittis efficitur.",dialogState:data.Gs,sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0};const Instruct=Template.bind({});Instruct.args={instruct:!0,userMessage:"Suspendisse sit amet volutpat velit.",dialogState:{...data.Gs,acceptsMedia:!1},sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0};const InstructAcceptingMedia=Template.bind({});InstructAcceptingMedia.args={instruct:!0,userMessage:"Suspendisse sit amet volutpat velit.",dialogState:{...data.Gs,acceptsMedia:!0},sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0,authToken:"123"};const Disabled=Template.bind({});Disabled.args={dialogState:{...data.Gs,state:"X3"},userMessage:"Suspendisse sit amet volutpat velit.",sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0};const ContinuousSpeech=Template.bind({});ContinuousSpeech.args={dialogState:data.Gs,userMessage:"Suspendisse sit amet volutpat velit.",sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!1,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0,microphoneMode:"CONTINUOUS"};const ContinuousSpeechListening=Template.bind({});ContinuousSpeechListening.args={dialogState:data.Gs,userMessage:"Suspendisse sit amet volutpat velit.",sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!0,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!0,microphoneMode:"CONTINUOUS"};const WithoutMicrophone=Template.bind({});WithoutMicrophone.args={dialogState:data.Gs,userMessage:"Suspendisse sit amet volutpat velit.",sendMessage:msg=>console.log(msg),onTextareaBlur:()=>{},onTextareaFocus:()=>{},onTextareaPressEnter:()=>{},setAttachmentsMenuOpen:()=>{},setSendOnEnter:()=>{},listening:!0,isPlayingAudio:!1,stopAudio:()=>{},startListening:()=>{},stopListening:()=>{},showMicrophone:!1},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...Default.parameters?.docs?.source}}},WithValue.parameters={...WithValue.parameters,docs:{...WithValue.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...WithValue.parameters?.docs?.source}}},WithLongText.parameters={...WithLongText.parameters,docs:{...WithLongText.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...WithLongText.parameters?.docs?.source}}},Instruct.parameters={...Instruct.parameters,docs:{...Instruct.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...Instruct.parameters?.docs?.source}}},InstructAcceptingMedia.parameters={...InstructAcceptingMedia.parameters,docs:{...InstructAcceptingMedia.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...InstructAcceptingMedia.parameters?.docs?.source}}},Disabled.parameters={...Disabled.parameters,docs:{...Disabled.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...Disabled.parameters?.docs?.source}}},ContinuousSpeech.parameters={...ContinuousSpeech.parameters,docs:{...ContinuousSpeech.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...ContinuousSpeech.parameters?.docs?.source}}},ContinuousSpeechListening.parameters={...ContinuousSpeechListening.parameters,docs:{...ContinuousSpeechListening.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...ContinuousSpeechListening.parameters?.docs?.source}}},WithoutMicrophone.parameters={...WithoutMicrophone.parameters,docs:{...WithoutMicrophone.parameters?.docs,source:{originalSource:"args => {\n const [userMessage, setUserMessage] = React.useState(args.userMessage);\n const [listening, setListening] = React.useState(args.listening);\n const startListening = () => setListening(true);\n const stopListening = () => setListening(false);\n useEffect(() => {\n if (listening) {\n const interval = setInterval(() => {\n let nextWord = text.pop();\n if (!nextWord) {\n clearInterval(interval);\n return;\n }\n setUserMessage(prev => `${prev || ''}${prev ? ' ' : ''}${nextWord}`);\n }, Math.random() * 500 + 100);\n return () => clearInterval(interval);\n }\n }, [listening]);\n return
\n \n
;\n}",...WithoutMicrophone.parameters?.docs?.source}}};const __namedExportsOrder=["Default","WithValue","WithLongText","Instruct","InstructAcceptingMedia","Disabled","ContinuousSpeech","ContinuousSpeechListening","WithoutMicrophone"]},"./src/components/ChatInputs/ChatInputs.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _UploadMenu_UploadMenu__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/UploadMenu/UploadMenu.tsx"),_SendOnEnterMenu_SendOnEnterMenu__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/SendOnEnterMenu/SendOnEnterMenu.tsx"),_ChatTextArea_ChatTextArea__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ChatTextArea/ChatTextArea.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Button.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_Send__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/icons/Send.tsx"),_MicrophoneButton_MicrophoneButton__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/MicrophoneButton/MicrophoneButton.tsx"),classnames__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_7__),_icons_Microphone__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/icons/Microphone.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatInputs=({dialogState,instruct=!1,sendOnEnter="click",setSendOnEnter,attachmentsMenuOpen,setAttachmentsMenuOpen,userMessage="",onChangeUserMessage,sendMessage,onTextareaFocus,onTextareaBlur,onTextareaPressEnter,showMicrophone=!1,microphoneMode="HOLD_TO_TALK",listening=!1,stopAudio,startListening,stopListening,authToken})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_10__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===dialogState?.state||"X3"===dialogState?.state,children:[(instruct||dialogState?.acceptsMedia)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_UploadMenu_UploadMenu__WEBPACK_IMPORTED_MODULE_1__.Z,{attachmentsMenuOpen,setAttachmentsMenuOpen,authToken,disabled:!dialogState?.acceptsMedia}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_SendOnEnterMenu_SendOnEnterMenu__WEBPACK_IMPORTED_MODULE_2__.Z,{sendOnEnter,setSendOnEnter}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ChatTextArea_ChatTextArea__WEBPACK_IMPORTED_MODULE_3__.Z,{value:userMessage,onChange:onChangeUserMessage,onPressEnter:onTextareaPressEnter,onFocus:onTextareaFocus,onBlur:onTextareaBlur,disabled:["R2","R3","R4","R5","G3","X3"].includes(dialogState?.state||"")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{shape:"circle",primary:!!userMessage?.length,disabled:!userMessage||0===userMessage.length,className:"memori-chat-inputs--send",onClick:()=>{sendMessage(userMessage),stopAudio(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:t("send")||"Send",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_icons_Send__WEBPACK_IMPORTED_MODULE_5__.default,{})}),showMicrophone&&"HOLD_TO_TALK"===microphoneMode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_MicrophoneButton_MicrophoneButton__WEBPACK_IMPORTED_MODULE_6__.Z,{listening,startListening,stopListening:()=>{stopListening(),userMessage?.length&&sendMessage(userMessage)},stopAudio}),showMicrophone&&"CONTINUOUS"===microphoneMode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_4__.Z,{primary:!0,className:classnames__WEBPACK_IMPORTED_MODULE_7___default()("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":listening}),title:listening?t("write_and_speak.micButtonPopoverListening")||"Listening":t("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{listening?stopListening():(stopAudio(),startListening())},shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_icons_Microphone__WEBPACK_IMPORTED_MODULE_8__.default,{})})]})};ChatInputs.displayName="ChatInputs";const __WEBPACK_DEFAULT_EXPORT__=ChatInputs;try{ChatInputs.displayName="ChatInputs",ChatInputs.__docgenInfo={description:"",displayName:"ChatInputs",props:{dialogState:{defaultValue:null,description:"",name:"dialogState",required:!1,type:{name:"DialogState"}},instruct:{defaultValue:{value:"false"},description:"",name:"instruct",required:!1,type:{name:"boolean"}},sendOnEnter:{defaultValue:{value:"click"},description:"",name:"sendOnEnter",required:!1,type:{name:"enum",value:[{value:'"keypress"'},{value:'"click"'}]}},setSendOnEnter:{defaultValue:null,description:"",name:"setSendOnEnter",required:!0,type:{name:'(sendOnEnter: "keypress" | "click") => void'}},attachmentsMenuOpen:{defaultValue:null,description:"",name:"attachmentsMenuOpen",required:!1,type:{name:"enum",value:[{value:'"link"'},{value:'"media"'}]}},setAttachmentsMenuOpen:{defaultValue:null,description:"",name:"setAttachmentsMenuOpen",required:!0,type:{name:'(attachmentsMenuOpen: "link" | "media") => void'}},userMessage:{defaultValue:{value:""},description:"",name:"userMessage",required:!1,type:{name:"string"}},onChangeUserMessage:{defaultValue:null,description:"",name:"onChangeUserMessage",required:!0,type:{name:"(userMessage: string) => void"}},sendMessage:{defaultValue:null,description:"",name:"sendMessage",required:!0,type:{name:"(msg: string) => void"}},onTextareaFocus:{defaultValue:null,description:"",name:"onTextareaFocus",required:!0,type:{name:"() => void"}},onTextareaBlur:{defaultValue:null,description:"",name:"onTextareaBlur",required:!0,type:{name:"() => void"}},onTextareaPressEnter:{defaultValue:null,description:"",name:"onTextareaPressEnter",required:!0,type:{name:"(e: KeyboardEvent) => void"}},listening:{defaultValue:{value:"false"},description:"",name:"listening",required:!1,type:{name:"boolean"}},isPlayingAudio:{defaultValue:null,description:"",name:"isPlayingAudio",required:!1,type:{name:"boolean"}},stopAudio:{defaultValue:null,description:"",name:"stopAudio",required:!0,type:{name:"() => void"}},startListening:{defaultValue:null,description:"",name:"startListening",required:!0,type:{name:"() => void"}},stopListening:{defaultValue:null,description:"",name:"stopListening",required:!0,type:{name:"() => void"}},showMicrophone:{defaultValue:{value:"false"},description:"",name:"showMicrophone",required:!1,type:{name:"boolean"}},microphoneMode:{defaultValue:{value:"HOLD_TO_TALK"},description:"",name:"microphoneMode",required:!1,type:{name:"enum",value:[{value:'"HOLD_TO_TALK"'},{value:'"CONTINUOUS"'}]}},authToken:{defaultValue:null,description:"",name:"authToken",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatInputs/ChatInputs.tsx#ChatInputs"]={docgenInfo:ChatInputs.__docgenInfo,name:"ChatInputs",path:"src/components/ChatInputs/ChatInputs.tsx#ChatInputs"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ChatTextArea/ChatTextArea.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Expand__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Expand.tsx"),_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/FullscreenExit.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatTextArea=({disabled=!1,value,onChange,onPressEnter,onFocus,onBlur})=>{const[expanded,setExpanded]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{"data-testid":"chat-textarea",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat-textarea",{"memori-chat-textarea--expanded":expanded,"memori-chat-textarea--disabled":disabled}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("textarea",{className:"memori-chat-textarea--input",disabled,value,onChange:e=>{onChange(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&onPressEnter&&onPressEnter(e)},onFocus,onBlur}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat-textarea--expand-button"),onClick:()=>setExpanded(!expanded),padded:!1,ghost:!0,icon:expanded?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_4__.default,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Expand__WEBPACK_IMPORTED_MODULE_3__.default,{})})})]})})};ChatTextArea.displayName="ChatTextArea";const __WEBPACK_DEFAULT_EXPORT__=ChatTextArea;try{ChatTextArea.displayName="ChatTextArea",ChatTextArea.__docgenInfo={description:"",displayName:"ChatTextArea",props:{disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},value:{defaultValue:null,description:"",name:"value",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!0,type:{name:"(value: string) => void"}},onPressEnter:{defaultValue:null,description:"",name:"onPressEnter",required:!1,type:{name:"((e: KeyboardEvent) => void)"}},onFocus:{defaultValue:null,description:"",name:"onFocus",required:!1,type:{name:"((e: FocusEvent) => void)"}},onBlur:{defaultValue:null,description:"",name:"onBlur",required:!1,type:{name:"((e: FocusEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatTextArea/ChatTextArea.tsx#ChatTextArea"]={docgenInfo:ChatTextArea.__docgenInfo,name:"ChatTextArea",path:"src/components/ChatTextArea/ChatTextArea.tsx#ChatTextArea"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MicrophoneButton/MicrophoneButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_icons_Microphone__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/icons/Microphone.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Tooltip.tsx"),classnames__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const MicrophoneButton=({listening,stopAudio,startListening,stopListening})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)(),[micBtnTooltip,setMicBtnTooltip]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),intervalRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),startHold=e=>{e.preventDefault(),setMicBtnTooltip(t("write_and_speak.holdToSpeak")||"Hold to record"),intervalRef.current||(intervalRef.current=setTimeout((()=>{stopAudio(),setMicBtnTooltip(t("write_and_speak.releaseToEndListening")||"Release to end listening"),startListening()}),300))},stopHold=()=>{intervalRef.current&&(clearTimeout(intervalRef.current),intervalRef.current=null),stopListening(),setMicBtnTooltip(void 0)};return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>()=>stopHold()),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__.Z,{visible:!!micBtnTooltip,content:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span",{children:micBtnTooltip||t("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":listening}),title:listening?t("write_and_speak.micButtonPopoverListening")||"Listening":t("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:startHold,onTouchStart:startHold,onMouseUp:stopHold,onMouseLeave:stopHold,onTouchEnd:stopHold,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Microphone__WEBPACK_IMPORTED_MODULE_1__.default,{})})})};MicrophoneButton.displayName="MicrophoneButton";const __WEBPACK_DEFAULT_EXPORT__=MicrophoneButton;try{MicrophoneButton.displayName="MicrophoneButton",MicrophoneButton.__docgenInfo={description:"",displayName:"MicrophoneButton",props:{listening:{defaultValue:null,description:"",name:"listening",required:!1,type:{name:"boolean"}},stopAudio:{defaultValue:null,description:"",name:"stopAudio",required:!0,type:{name:"() => void"}},startListening:{defaultValue:null,description:"",name:"startListening",required:!0,type:{name:"() => void"}},stopListening:{defaultValue:null,description:"",name:"stopListening",required:!0,type:{name:"() => void"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MicrophoneButton/MicrophoneButton.tsx#MicrophoneButton"]={docgenInfo:MicrophoneButton.__docgenInfo,name:"MicrophoneButton",path:"src/components/MicrophoneButton/MicrophoneButton.tsx#MicrophoneButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/SendOnEnterMenu/SendOnEnterMenu.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/radio-group/radio-group.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const SendOnEnterMenu=({sendOnEnter,setSendOnEnter})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v,{as:"div",className:"memori-send-on-enter-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Button,{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{style:{display:"block",width:"1rem",height:"1rem"},children:"…"})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Items,{className:"memori-menu--overlay",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E,{value:sendOnEnter,onChange:setSendOnEnter,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E.Option,{value:"keypress",className:"memori-menu--option",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,outlined:checked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-menu--icon",children:checked?"✓":""}),children:t("widget.sendOnKeypress")})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E.Option,{value:"click",className:"memori-menu--option",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,outlined:checked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-menu--icon",children:checked?"✓":""}),children:t("widget.sendOnClick")})})})]})})]})};SendOnEnterMenu.displayName="SendOnEnterMenu";const __WEBPACK_DEFAULT_EXPORT__=SendOnEnterMenu;try{SendOnEnterMenu.displayName="SendOnEnterMenu",SendOnEnterMenu.__docgenInfo={description:"",displayName:"SendOnEnterMenu",props:{sendOnEnter:{defaultValue:null,description:"",name:"sendOnEnter",required:!0,type:{name:"enum",value:[{value:'"keypress"'},{value:'"click"'}]}},setSendOnEnter:{defaultValue:null,description:"",name:"setSendOnEnter",required:!0,type:{name:'(value: "keypress" | "click") => void'}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/SendOnEnterMenu/SendOnEnterMenu.tsx#SendOnEnterMenu"]={docgenInfo:SendOnEnterMenu.__docgenInfo,name:"SendOnEnterMenu",path:"src/components/SendOnEnterMenu/SendOnEnterMenu.tsx#SendOnEnterMenu"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/UploadMenu/UploadMenu.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _headlessui_react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Link__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Link.tsx"),_icons_Picture__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/Picture.tsx"),_icons_PaperClip__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/icons/PaperClip.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react/jsx-runtime.js");const UploadMenu=({attachmentsMenuOpen,setAttachmentsMenuOpen,disabled=!1,authToken})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.v,{as:"div",className:"memori-upload-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.v.Button,{disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icons_PaperClip__WEBPACK_IMPORTED_MODULE_5__.default,{})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.v.Items,{as:"ul",className:"memori-menu--overlay",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.v.Item,{as:"li",className:"memori-menu--li",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icons_Link__WEBPACK_IMPORTED_MODULE_3__.default,{}),outlined:"link"===attachmentsMenuOpen,onClick:()=>setAttachmentsMenuOpen("link"),children:"Link"})}),!!authToken?.length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.v.Item,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icons_Picture__WEBPACK_IMPORTED_MODULE_4__.default,{}),outlined:"media"===attachmentsMenuOpen,onClick:()=>setAttachmentsMenuOpen("media"),children:"Media"})})]})]});UploadMenu.displayName="UploadMenu";const __WEBPACK_DEFAULT_EXPORT__=UploadMenu;try{UploadMenu.displayName="UploadMenu",UploadMenu.__docgenInfo={description:"",displayName:"UploadMenu",props:{attachmentsMenuOpen:{defaultValue:null,description:"",name:"attachmentsMenuOpen",required:!1,type:{name:"enum",value:[{value:'"link"'},{value:'"media"'}]}},setAttachmentsMenuOpen:{defaultValue:null,description:"",name:"setAttachmentsMenuOpen",required:!0,type:{name:'(value: "link" | "media") => void'}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},authToken:{defaultValue:null,description:"",name:"authToken",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/UploadMenu/UploadMenu.tsx#UploadMenu"]={docgenInfo:UploadMenu.__docgenInfo,name:"UploadMenu",path:"src/components/UploadMenu/UploadMenu.tsx#UploadMenu"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Expand.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Expand=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});Expand.displayName="Expand";const __WEBPACK_DEFAULT_EXPORT__=Expand;try{Expand.displayName="Expand",Expand.__docgenInfo={description:"",displayName:"Expand",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Expand.tsx#Expand"]={docgenInfo:Expand.__docgenInfo,name:"Expand",path:"src/components/icons/Expand.tsx#Expand"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/FullscreenExit.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const FullscreenExit=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});FullscreenExit.displayName="FullscreenExit";const __WEBPACK_DEFAULT_EXPORT__=FullscreenExit;try{FullscreenExit.displayName="FullscreenExit",FullscreenExit.__docgenInfo={description:"",displayName:"FullscreenExit",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/FullscreenExit.tsx#FullscreenExit"]={docgenInfo:FullscreenExit.__docgenInfo,name:"FullscreenExit",path:"src/components/icons/FullscreenExit.tsx#FullscreenExit"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Link.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Link=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})});Link.displayName="Link";const __WEBPACK_DEFAULT_EXPORT__=Link;try{Link.displayName="Link",Link.__docgenInfo={description:"",displayName:"Link",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Link.tsx#Link"]={docgenInfo:Link.__docgenInfo,name:"Link",path:"src/components/icons/Link.tsx#Link"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Microphone.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Microphone=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});Microphone.displayName="Microphone";const __WEBPACK_DEFAULT_EXPORT__=Microphone;try{Microphone.displayName="Microphone",Microphone.__docgenInfo={description:"",displayName:"Microphone",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Microphone.tsx#Microphone"]={docgenInfo:Microphone.__docgenInfo,name:"Microphone",path:"src/components/icons/Microphone.tsx#Microphone"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/PaperClip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const PaperClip=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 0 0 174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"})});PaperClip.displayName="PaperClip";const __WEBPACK_DEFAULT_EXPORT__=PaperClip;try{PaperClip.displayName="PaperClip",PaperClip.__docgenInfo={description:"",displayName:"PaperClip",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/PaperClip.tsx#PaperClip"]={docgenInfo:PaperClip.__docgenInfo,name:"PaperClip",path:"src/components/icons/PaperClip.tsx#PaperClip"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Picture.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Picture=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 1 0 0-176 88 88 0 0 0 0 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"})});Picture.displayName="Picture";const __WEBPACK_DEFAULT_EXPORT__=Picture;try{Picture.displayName="Picture",Picture.__docgenInfo={description:"",displayName:"Picture",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Picture.tsx#Picture"]={docgenInfo:Picture.__docgenInfo,name:"Picture",path:"src/components/icons/Picture.tsx#Picture"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Send.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Send=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});Send.displayName="Send";const __WEBPACK_DEFAULT_EXPORT__=Send;try{Send.displayName="Send",Send.__docgenInfo={description:"",displayName:"Send",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Send.tsx#Send"]={docgenInfo:Send.__docgenInfo,name:"Send",path:"src/components/icons/Send.tsx#Send"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Tooltip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Tooltip=({content,className,align="right",disabled=!1,visible=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-tooltip",`memori-tooltip--align-${align}`,className,{"memori-tooltip--disabled":disabled,"memori-tooltip--visible":visible}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--content",children:content}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--trigger",children})]});Tooltip.displayName="Tooltip";const __WEBPACK_DEFAULT_EXPORT__=Tooltip;try{Tooltip.displayName="Tooltip",Tooltip.__docgenInfo={description:"",displayName:"Tooltip",props:{content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"Element | ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'},{value:'"topLeft"'},{value:'"topRight"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Tooltip.tsx#Tooltip"]={docgenInfo:Tooltip.__docgenInfo,name:"Tooltip",path:"src/components/ui/Tooltip.tsx#Tooltip"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={adminCount:3,config:{feedbackURL:"https://form.asana.com/?k=XC7S3JWQeIhnjipBuA3gbw&d=1199599736247413",name:"TwinCreator",requirePosition:!1,showNewUser:!0},creationTimestamp:"2023-05-31T14:32:48.885287Z",description:"TwinCreator",disableRegistration:!1,id:"app.twincreator.com",lastChangeTimestamp:"2023-05-31T14:32:48.885287Z",logoURL:"https://app.twincreator.com/images/twincreator/logo.png",maxAdmins:0,maxCompletions:0,maxCompletionsPerUser:0,maxFreeSessions:400,maxFreeSessionsPerUser:100,maxMemoriPerAdmin:0,maxMemoriPerUser:3,maxTotalMemori:0,maxUsers:0,memoriCount:0,name:"app.twincreator.com",nonFreeSessionCost:.02,paying:!0,tenantID:"96caa4b4-31a4-48e5-8163-dec61869a2a7",theme:"twincreator",userCount:0,usersCanAccessAPI:!1,usersCanCreateMemori:!1,usersCanEditDynamicIntents:!1,usersCanEditIntegrations:!1,usersCanEditMemoriChaining:!1,usersCanRunSnippets:!1},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file diff --git a/components-ExportHistoryButton-ExportHistoryButton-stories.7dccbd22.iframe.bundle.js b/components-ExportHistoryButton-ExportHistoryButton-stories.cfb189b7.iframe.bundle.js similarity index 77% rename from components-ExportHistoryButton-ExportHistoryButton-stories.7dccbd22.iframe.bundle.js rename to components-ExportHistoryButton-ExportHistoryButton-stories.cfb189b7.iframe.bundle.js index da5c85b7..8d8c0d83 100644 --- a/components-ExportHistoryButton-ExportHistoryButton-stories.7dccbd22.iframe.bundle.js +++ b/components-ExportHistoryButton-ExportHistoryButton-stories.cfb189b7.iframe.bundle.js @@ -1,2 +1,2 @@ -/*! For license information please see components-ExportHistoryButton-ExportHistoryButton-stories.7dccbd22.iframe.bundle.js.LICENSE.txt */ -(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[1281],{"./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i_arrayLikeToArray})},"./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}__webpack_require__.d(__webpack_exports__,{Z:()=>_arrayWithHoles})},"./node_modules/@babel/runtime/helpers/esm/classCallCheck.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}__webpack_require__.d(__webpack_exports__,{Z:()=>_classCallCheck})},"./node_modules/@babel/runtime/helpers/esm/createClass.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_createClass});var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");function _defineProperties(target,props){for(var i=0;i{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_defineProperty});var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");function _defineProperty(obj,key,value){return(key=(0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__.Z)(key))in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}},"./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}__webpack_require__.d(__webpack_exports__,{Z:()=>_nonIterableRest})},"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_slicedToArray});var arrayWithHoles=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");var unsupportedIterableToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js"),nonIterableRest=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");function _slicedToArray(arr,i){return(0,arrayWithHoles.Z)(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}(arr,i)||(0,unsupportedIterableToArray.Z)(arr,i)||(0,nonIterableRest.Z)()}},"./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_toPropertyKey});var esm_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");function _toPropertyKey(arg){var key=function _toPrimitive(input,hint){if("object"!==(0,esm_typeof.Z)(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!==(0,esm_typeof.Z)(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"===(0,esm_typeof.Z)(key)?key:String(key)}},"./node_modules/@babel/runtime/helpers/esm/typeof.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}__webpack_require__.d(__webpack_exports__,{Z:()=>_typeof})},"./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_unsupportedIterableToArray});var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return(0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__.Z)(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__.Z)(o,minLen):void 0}}},"./node_modules/@headlessui/react/dist/components/keyboard.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{R:()=>o});var r,o=((r=o||{}).Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r)},"./node_modules/@headlessui/react/dist/components/popover/popover.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{J:()=>mt});var n,f,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_utils_match_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),_utils_render_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/render.js"),_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-sync-refs.js"),_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-id.js"),_keyboard_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/@headlessui/react/dist/components/keyboard.js"),_utils_bugs_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/bugs.js"),_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/focus-management.js"),_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@headlessui/react/dist/internal/open-closed.js"),_hooks_use_resolve_button_type_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js"),_hooks_use_outside_click_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-outside-click.js"),_utils_owner_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js"),_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-owner.js"),_hooks_use_event_listener_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event-listener.js"),_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/@headlessui/react/dist/internal/hidden.js"),_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event.js"),_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-tab-direction.js"),Ae=((f=Ae||{})[f.Open=0]="Open",f[f.Closed=1]="Closed",f),Ce=((n=Ce||{})[n.TogglePopover=0]="TogglePopover",n[n.ClosePopover=1]="ClosePopover",n[n.SetButton=2]="SetButton",n[n.SetButtonId=3]="SetButtonId",n[n.SetPanel=4]="SetPanel",n[n.SetPanelId=5]="SetPanelId",n);let Re={0:r=>({...r,popoverState:(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(r.popoverState,{0:1,1:0})}),1:r=>1===r.popoverState?r:{...r,popoverState:1},2:(r,t)=>r.button===t.button?r:{...r,button:t.button},3:(r,t)=>r.buttonId===t.buttonId?r:{...r,buttonId:t.buttonId},4:(r,t)=>r.panel===t.panel?r:{...r,panel:t.panel},5:(r,t)=>r.panelId===t.panelId?r:{...r,panelId:t.panelId}},te=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);function Q(r){let t=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(te);if(null===t){let f=new Error(`<${r} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(f,Q),f}return t}te.displayName="PopoverContext";let oe=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);function re(r){let t=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(oe);if(null===t){let f=new Error(`<${r} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(f,re),f}return t}oe.displayName="PopoverAPIContext";let ne=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);function ce(){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ne)}ne.displayName="PopoverGroupContext";let le=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);function Me(r,t){return(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(t.type,Re,r,t)}le.displayName="PopoverPanelContext";let Ie=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.yV)((function(t,f){var O;let o=`headlessui-popover-button-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,v=`headlessui-popover-panel-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,a=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),n=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(f,(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.h)((e=>{a.current=e}))),g=(0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)(Me,{popoverState:1,button:null,buttonId:o,panel:null,panelId:v,beforePanelSentinel:(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)(),afterPanelSentinel:(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)()}),[{popoverState:y,button:l,panel:P,beforePanelSentinel:s,afterPanelSentinel:B},i]=g,T=(0,_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_5__.i)(null!=(O=a.current)?O:l);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>i({type:3,buttonId:o})),[o,i]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>i({type:5,panelId:v})),[v,i]);let c=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>{if(!l||!P)return!1;for(let M of document.querySelectorAll("body > *"))if(Number(null==M?void 0:M.contains(l))^Number(null==M?void 0:M.contains(P)))return!0;let e=(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.GO)(),p=e.indexOf(l),m=(p+e.length-1)%e.length,C=(p+1)%e.length,D=e[m],V=e[C];return!P.contains(D)&&!P.contains(V)}),[l,P]),d=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({buttonId:o,panelId:v,close:()=>i({type:1})})),[o,v,i]),E=ce(),A=null==E?void 0:E.registerPopover,L=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{var e;return null!=(e=null==E?void 0:E.isFocusWithinPopoverGroup())?e:(null==T?void 0:T.activeElement)&&((null==l?void 0:l.contains(T.activeElement))||(null==P?void 0:P.contains(T.activeElement)))}));(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>null==A?void 0:A(d)),[A,d]),(0,_hooks_use_event_listener_js__WEBPACK_IMPORTED_MODULE_8__.O)(null==T?void 0:T.defaultView,"focus",(e=>{var p,m,C,D;0===y&&(L()||!l||!P||null!=(m=null==(p=s.current)?void 0:p.contains)&&m.call(p,e.target)||null!=(D=null==(C=B.current)?void 0:C.contains)&&D.call(C,e.target)||i({type:1}))}),!0),(0,_hooks_use_outside_click_js__WEBPACK_IMPORTED_MODULE_9__.O)([l,P],((e,p)=>{i({type:1}),(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.sP)(p,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.tJ.Loose)||(e.preventDefault(),null==l||l.focus())}),0===y);let I=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((e=>{i({type:1});let p=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:l:l;null==p||p.focus()})),H=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({close:I,isPortalled:c})),[I,c]),u=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===y,close:I})),[y,I]),S=t,R={ref:n};return react__WEBPACK_IMPORTED_MODULE_0__.createElement(te.Provider,{value:g},react__WEBPACK_IMPORTED_MODULE_0__.createElement(oe.Provider,{value:H},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.up,{value:(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(y,{0:_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.ZM.Open,1:_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.ZM.Closed})},(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.sY)({ourProps:R,theirProps:S,slot:u,defaultTag:"div",name:"Popover"}))))})),he=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.yV)((function(t,f){let[o,v]=Q("Popover.Button"),{isPortalled:a}=re("Popover.Button"),n=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),g=`headlessui-focus-sentinel-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,y=ce(),l=null==y?void 0:y.closeOthers,P=function Oe(){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(le)}(),s=null!==P&&P===o.panelId,B=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(n,f,s?null:e=>e&&v({type:2,button:e})),i=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(n,f),T=(0,_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_5__.i)(n),c=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((e=>{var p,m,C;if(s){if(1===o.popoverState)return;switch(e.key){case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Enter:e.preventDefault(),null==(m=(p=e.target).click)||m.call(p),v({type:1}),null==(C=o.button)||C.focus()}}else switch(e.key){case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Enter:e.preventDefault(),e.stopPropagation(),1===o.popoverState&&(null==l||l(o.buttonId)),v({type:0});break;case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Escape:if(0!==o.popoverState)return null==l?void 0:l(o.buttonId);if(!n.current||(null==T?void 0:T.activeElement)&&!n.current.contains(T.activeElement))return;e.preventDefault(),e.stopPropagation(),v({type:1})}})),d=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((e=>{s||e.key===_keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space&&e.preventDefault()})),E=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((e=>{var p,m;(0,_utils_bugs_js__WEBPACK_IMPORTED_MODULE_12__.P)(e.currentTarget)||t.disabled||(s?(v({type:1}),null==(p=o.button)||p.focus()):(e.preventDefault(),e.stopPropagation(),1===o.popoverState&&(null==l||l(o.buttonId)),v({type:0}),null==(m=o.button)||m.focus()))})),A=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((e=>{e.preventDefault(),e.stopPropagation()})),L=0===o.popoverState,I=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:L})),[L]),H=(0,_hooks_use_resolve_button_type_js__WEBPACK_IMPORTED_MODULE_13__.f)(t,n),u=t,S=s?{ref:i,type:H,onKeyDown:c,onClick:E}:{ref:B,id:o.buttonId,type:H,"aria-expanded":t.disabled?void 0:0===o.popoverState,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:c,onKeyUp:d,onClick:E,onMouseDown:A},R=(0,_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.l)(),O=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{let e=o.panel;e&&function p(){(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(R.current,{[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Forwards]:()=>(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(e,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.First),[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Backwards]:()=>(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(e,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.Last)})}()}));return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.sY)({ourProps:S,theirProps:u,slot:I,defaultTag:"button",name:"Popover.Button"}),L&&!s&&a&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__._,{id:g,features:_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__.A.Focusable,as:"button",type:"button",onFocus:O}))})),De=_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.AN.RenderStrategy|_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.AN.Static,xe=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.yV)((function(t,f){let[{popoverState:o},v]=Q("Popover.Overlay"),a=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(f),n=`headlessui-popover-overlay-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,g=(0,_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.oJ)(),y=null!==g?g===_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.ZM.Open:0===o,l=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((i=>{if((0,_utils_bugs_js__WEBPACK_IMPORTED_MODULE_12__.P)(i.currentTarget))return i.preventDefault();v({type:1})})),P=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===o})),[o]);return(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.sY)({ourProps:{ref:a,id:n,"aria-hidden":!0,onClick:l},theirProps:t,slot:P,defaultTag:"div",features:De,visible:y,name:"Popover.Overlay"})})),Ge=_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.AN.RenderStrategy|_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.AN.Static,ke=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.yV)((function(t,f){let{focus:o=!1,...v}=t,[a,n]=Q("Popover.Panel"),{close:g,isPortalled:y}=re("Popover.Panel"),l=`headlessui-focus-sentinel-before-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,P=`headlessui-focus-sentinel-after-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,s=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),B=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(s,f,(u=>{n({type:4,panel:u})})),i=(0,_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_5__.i)(s),T=(0,_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.oJ)(),c=null!==T?T===_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.ZM.Open:0===a.popoverState,d=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((u=>{var S;if(u.key===_keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Escape){if(0!==a.popoverState||!s.current||(null==i?void 0:i.activeElement)&&!s.current.contains(i.activeElement))return;u.preventDefault(),u.stopPropagation(),n({type:1}),null==(S=a.button)||S.focus()}}));(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{var u;t.static||1===a.popoverState&&(null==(u=t.unmount)||u)&&n({type:4,panel:null})}),[a.popoverState,t.unmount,t.static,n]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{if(!o||0!==a.popoverState||!s.current)return;let u=null==i?void 0:i.activeElement;s.current.contains(u)||(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(s.current,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.First)}),[o,s,a.popoverState]);let E=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===a.popoverState,close:g})),[a,g]),A={ref:B,id:a.panelId,onKeyDown:d,onBlur:o&&0===a.popoverState?u=>{var R,O,e,p,m;let S=u.relatedTarget;!S||!s.current||null!=(R=s.current)&&R.contains(S)||(n({type:1}),((null==(e=null==(O=a.beforePanelSentinel.current)?void 0:O.contains)?void 0:e.call(O,S))||(null==(m=null==(p=a.afterPanelSentinel.current)?void 0:p.contains)?void 0:m.call(p,S)))&&S.focus({preventScroll:!0}))}:void 0,tabIndex:-1},L=(0,_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.l)(),I=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{let u=s.current;u&&function S(){(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(L.current,{[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Forwards]:()=>{(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(u,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.First)},[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Backwards]:()=>{var R;null==(R=a.button)||R.focus({preventScroll:!0})}})}()})),H=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{let u=s.current;u&&function S(){(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(L.current,{[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Forwards]:()=>{var C,D,V;if(!a.button)return;let R=(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.GO)(),O=R.indexOf(a.button),e=R.slice(0,O+1),m=[...R.slice(O+1),...e];for(let M of m.slice())if((null==(D=null==(C=null==M?void 0:M.id)?void 0:C.startsWith)?void 0:D.call(C,"headlessui-focus-sentinel-"))||(null==(V=a.panel)?void 0:V.contains(M))){let ae=m.indexOf(M);-1!==ae&&m.splice(ae,1)}(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(m,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.First,!1)},[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Backwards]:()=>(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(u,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.Last)})}()}));return react__WEBPACK_IMPORTED_MODULE_0__.createElement(le.Provider,{value:a.panelId},c&&y&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__._,{id:l,ref:a.beforePanelSentinel,features:_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__.A.Focusable,as:"button",type:"button",onFocus:I}),(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.sY)({ourProps:A,theirProps:v,slot:E,defaultTag:"div",features:Ge,visible:c,name:"Popover.Panel"}),c&&y&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__._,{id:P,ref:a.afterPanelSentinel,features:_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__.A.Focusable,as:"button",type:"button",onFocus:H}))})),we=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.yV)((function(t,f){let o=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),v=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(o,f),[a,n]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),g=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((c=>{n((d=>{let E=d.indexOf(c);if(-1!==E){let A=d.slice();return A.splice(E,1),A}return d}))})),y=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((c=>(n((d=>[...d,c])),()=>g(c)))),l=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{var E;let c=(0,_utils_owner_js__WEBPACK_IMPORTED_MODULE_16__.r)(o);if(!c)return!1;let d=c.activeElement;return!(null==(E=o.current)||!E.contains(d))||a.some((A=>{var L,I;return(null==(L=c.getElementById(A.buttonId))?void 0:L.contains(d))||(null==(I=c.getElementById(A.panelId))?void 0:I.contains(d))}))})),P=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((c=>{for(let d of a)d.buttonId!==c&&d.close()})),s=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({registerPopover:y,unregisterPopover:g,isFocusWithinPopoverGroup:l,closeOthers:P})),[y,g,l,P]),B=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({})),[]),i=t,T={ref:v};return react__WEBPACK_IMPORTED_MODULE_0__.createElement(ne.Provider,{value:s},(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.sY)({ourProps:T,theirProps:i,slot:B,defaultTag:"div",name:"Popover.Group"}))})),mt=Object.assign(Ie,{Button:he,Overlay:xe,Panel:ke,Group:we})},"./node_modules/@headlessui/react/dist/hooks/use-event-listener.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{O:()=>E});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");function E(n,e,a,t){let i=(0,_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__.E)(a);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{function r(o){i.current(o)}return(n=null!=n?n:window).addEventListener(e,r,t),()=>n.removeEventListener(e,r,t)}),[n,e,t])}},"./node_modules/@headlessui/react/dist/hooks/use-event.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{z:()=>o});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");let o=function(t){let e=(0,_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__.E)(t);return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(((...r)=>e.current(...r)),[e])}},"./node_modules/@headlessui/react/dist/hooks/use-id.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{M:()=>I});var u,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js"),_use_server_handoff_complete_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js");let l=0;function r(){return++l}let I=null!=(u=react__WEBPACK_IMPORTED_MODULE_0__.useId)?u:function(){let n=(0,_use_server_handoff_complete_js__WEBPACK_IMPORTED_MODULE_1__.H)(),[e,o]=react__WEBPACK_IMPORTED_MODULE_0__.useState(n?r:null);return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_2__.e)((()=>{null===e&&o(r())}),[e]),null!=e?""+e:void 0}},"./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{e:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let s=__webpack_require__("./node_modules/@headlessui/react/dist/utils/ssr.js").s?react__WEBPACK_IMPORTED_MODULE_0__.useEffect:react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect},"./node_modules/@headlessui/react/dist/hooks/use-latest-value.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{E:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js");function s(e){let r=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(e);return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{r.current=e}),[e]),r}},"./node_modules/@headlessui/react/dist/hooks/use-outside-click.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{O:()=>L});var react=__webpack_require__("./node_modules/react/index.js"),focus_management=__webpack_require__("./node_modules/@headlessui/react/dist/utils/focus-management.js"),use_latest_value=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");function d(e,r,n){let o=(0,use_latest_value.E)(r);(0,react.useEffect)((()=>{function t(u){o.current(u)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}function L(E,m,c=!0){let i=(0,react.useRef)(!1);function f(e,o){if(!i.current||e.defaultPrevented)return;let l=function r(t){return"function"==typeof t?r(t()):Array.isArray(t)||t instanceof Set?t:[t]}(E),n=o(e);if(null!==n&&n.getRootNode().contains(n)){for(let r of l){if(null===r)continue;let t=r instanceof HTMLElement?r:r.current;if(null!=t&&t.contains(n))return}return!(0,focus_management.sP)(n,focus_management.tJ.Loose)&&-1!==n.tabIndex&&e.preventDefault(),m(e,n)}}(0,react.useEffect)((()=>{requestAnimationFrame((()=>{i.current=c}))}),[c]);let u=(0,react.useRef)(null);d("mousedown",(e=>{var o,l;i.current&&(u.current=(null==(l=null==(o=e.composedPath)?void 0:o.call(e))?void 0:l[0])||e.target)}),!0),d("click",(e=>{!u.current||(f(e,(()=>u.current)),u.current=null)}),!0),d("blur",(e=>f(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}},"./node_modules/@headlessui/react/dist/hooks/use-owner.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{i:()=>n});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_utils_owner_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js");function n(...e){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>(0,_utils_owner_js__WEBPACK_IMPORTED_MODULE_1__.r)(...e)),[...e])}},"./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{f:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js");function i(t){var n;if(t.type)return t.type;let e=null!=(n=t.as)?n:"button";return"string"==typeof e&&"button"===e.toLowerCase()?"button":void 0}function s(t,e){let[n,u]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((()=>i(t)));return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{u(i(t))}),[t.type,t.as]),(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{n||!e.current||e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&u("button")}),[n,e]),n}},"./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{H:()=>a});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let r={serverHandoffComplete:!1};function a(){let[e,f]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(r.serverHandoffComplete);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{!0!==e&&f(!0)}),[e]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{!1===r.serverHandoffComplete&&(r.serverHandoffComplete=!0)}),[]),e}},"./node_modules/@headlessui/react/dist/hooks/use-sync-refs.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{T:()=>y,h:()=>T});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_event_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event.js");let u=Symbol();function T(t,n=!0){return Object.assign(t,{[u]:n})}function y(...t){let n=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(t);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{n.current=t}),[t]);let c=(0,_use_event_js__WEBPACK_IMPORTED_MODULE_1__.z)((e=>{for(let o of n.current)null!=o&&("function"==typeof o?o(e):o.current=e)}));return t.every((e=>null==e||(null==e?void 0:e[u])))?void 0:c}},"./node_modules/@headlessui/react/dist/hooks/use-tab-direction.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{N:()=>use_tab_direction_s,l:()=>n});var react=__webpack_require__("./node_modules/react/index.js"),use_latest_value=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");var r,use_tab_direction_s=((r=use_tab_direction_s||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r);function n(){let e=(0,react.useRef)(0);return function s(e,r,n){let o=(0,use_latest_value.E)(r);(0,react.useEffect)((()=>{function t(i){o.current(i)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)}),[e,n])}("keydown",(o=>{"Tab"===o.key&&(e.current=o.shiftKey?1:0)}),!0),e}},"./node_modules/@headlessui/react/dist/internal/hidden.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>s,_:()=>h});var _utils_render_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/render.js");var e,s=((e=s||{})[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e);let h=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_0__.yV)((function(t,o){let{features:e=1,...r}=t,d={ref:o,"aria-hidden":2==(2&e)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&e)&&2!=(2&e)&&{display:"none"}}};return(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_0__.sY)({ourProps:d,theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}))},"./node_modules/@headlessui/react/dist/internal/open-closed.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{ZM:()=>p,oJ:()=>s,up:()=>C});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let o=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);o.displayName="OpenClosedContext";var e,p=((e=p||{})[e.Open=0]="Open",e[e.Closed=1]="Closed",e);function s(){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(o)}function C({value:t,children:n}){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(o.Provider,{value:t},n)}},"./node_modules/@headlessui/react/dist/utils/bugs.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function r(n){let e=n.parentElement,l=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(l=e),e=e.parentElement;let t=""===(null==e?void 0:e.getAttribute("disabled"));return(!t||!function i(n){if(!n)return!1;let e=n.previousElementSibling;for(;null!==e;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}(l))&&t}__webpack_require__.d(__webpack_exports__,{P:()=>r})},"./node_modules/@headlessui/react/dist/utils/disposables.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{k:()=>m});var _micro_task_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/micro-task.js");function m(){let n=[],i=[],r={enqueue(e){i.push(e)},addEventListener:(e,t,a,o)=>(e.addEventListener(t,a,o),r.add((()=>e.removeEventListener(t,a,o)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>r.requestAnimationFrame((()=>r.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return r.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return(0,_micro_task_js__WEBPACK_IMPORTED_MODULE_0__.Y)((()=>{t.current&&e[0]()})),r.add((()=>{t.current=!1}))},add:e=>(n.push(e),()=>{let t=n.indexOf(e);if(t>=0){let[a]=n.splice(t,1);a()}}),dispose(){for(let e of n.splice(0))e()},async workQueue(){for(let e of i.splice(0))await e()}};return r}},"./node_modules/@headlessui/react/dist/utils/focus-management.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{C5:()=>h,EO:()=>D,GO:()=>d,TO:()=>T,fE:()=>M,jA:()=>O,sP:()=>F,tJ:()=>N,wI:()=>I,z2:()=>S});var _disposables_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/disposables.js"),_match_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),_owner_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js");let m=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var r,o,n,T=((n=T||{})[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n),M=((o=M||{})[o.Error=0]="Error",o[o.Overflow=1]="Overflow",o[o.Success=2]="Success",o[o.Underflow=3]="Underflow",o),b=((r=b||{})[r.Previous=-1]="Previous",r[r.Next=1]="Next",r);function d(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(m))}var N=(r=>(r[r.Strict=0]="Strict",r[r.Loose=1]="Loose",r))(N||{});function F(e,t=0){var r;return e!==(null==(r=(0,_owner_js__WEBPACK_IMPORTED_MODULE_0__.r)(e))?void 0:r.body)&&(0,_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(t,{0:()=>e.matches(m),1(){let l=e;for(;null!==l;){if(l.matches(m))return!0;l=l.parentElement}return!1}})}function I(e){let t=(0,_owner_js__WEBPACK_IMPORTED_MODULE_0__.r)(e);(0,_disposables_js__WEBPACK_IMPORTED_MODULE_2__.k)().nextFrame((()=>{t&&!F(t.activeElement,0)&&h(e)}))}function h(e){null==e||e.focus({preventScroll:!0})}let w=["textarea","input"].join(",");function S(e,t=(r=>r)){return e.slice().sort(((r,l)=>{let o=t(r),s=t(l);if(null===o||null===s)return 0;let n=o.compareDocumentPosition(s);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function D(e,t){return O(d(),t,!0,e)}function O(e,t,r=!0,l=null){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?r?S(e):e:d(e);l=null!=l?l:o.activeElement;let u,n=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),E=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,s.indexOf(l))-1;if(4&t)return Math.max(0,s.indexOf(l))+1;if(8&t)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),x=32&t?{preventScroll:!0}:{},f=0,i=s.length;do{if(f>=i||f+i<=0)return 0;let a=E+f;if(16&t)a=(a+i)%i;else{if(a<0)return 3;if(a>=i)return 1}u=s[a],null==u||u.focus(x),f+=n}while(u!==o.activeElement);return 6&t&&function H(e){var t,r;return null!=(r=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,w))&&r}(u)&&u.select(),u.hasAttribute("tabindex")||u.setAttribute("tabindex","0"),2}},"./node_modules/@headlessui/react/dist/utils/match.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function u(r,n,...a){if(r in n){let e=n[r];return"function"==typeof e?e(...a):e}let t=new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,u),t}__webpack_require__.d(__webpack_exports__,{E:()=>u})},"./node_modules/@headlessui/react/dist/utils/micro-task.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function t(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((o=>setTimeout((()=>{throw o}))))}__webpack_require__.d(__webpack_exports__,{Y:()=>t})},"./node_modules/@headlessui/react/dist/utils/owner.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{r:()=>e});var _ssr_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/ssr.js");function e(r){return _ssr_js__WEBPACK_IMPORTED_MODULE_0__.s?null:r instanceof Node?r.ownerDocument:null!=r&&r.hasOwnProperty("current")&&r.current instanceof Node?r.current.ownerDocument:document}},"./node_modules/@headlessui/react/dist/utils/render.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{AN:()=>S,l4:()=>j,oA:()=>F,sY:()=>$,yV:()=>C});var e,a,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_match_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),S=((a=S||{})[a.None=0]="None",a[a.RenderStrategy=1]="RenderStrategy",a[a.Static=2]="Static",a),j=((e=j||{})[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e);function $({ourProps:r,theirProps:t,slot:e,defaultTag:a,features:o,visible:n=!0,name:l}){let s=T(t,r);if(n)return p(s,e,a,l);let u=null!=o?o:0;if(2&u){let{static:i=!1,...d}=s;if(i)return p(d,e,a,l)}if(1&u){let{unmount:i=!0,...d}=s;return(0,_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(i?0:1,{0:()=>null,1:()=>p({...d,hidden:!0,style:{display:"none"}},e,a,l)})}return p(s,e,a,l)}function p(r,t={},e,a){let{as:o=e,children:n,refName:l="ref",...s}=m(r,["unmount","static"]),u=void 0!==r.ref?{[l]:r.ref}:{},i="function"==typeof n?n(t):n;s.className&&"function"==typeof s.className&&(s.className=s.className(t));let d={};if(t){let f=!1,y=[];for(let[h,g]of Object.entries(t))"boolean"==typeof g&&(f=!0),!0===g&&y.push(h);f&&(d["data-headlessui-state"]=y.join(" "))}if(o===react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&Object.keys(F(s)).length>0){if(!(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(i)||Array.isArray(i)&&i.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${a} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map((f=>` - ${f}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((f=>` - ${f}`)).join("\n")].join("\n"));return(0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(i,Object.assign({},T(i.props,F(m(s,["ref"]))),d,u,function w(...r){return{ref:r.every((t=>null==t))?void 0:t=>{for(let e of r)null!=e&&("function"==typeof e?e(t):e.current=t)}}}(i.ref,u.ref)))}return(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(o,Object.assign({},m(s,["ref"]),o!==react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&u,o!==react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&d),i)}function T(...r){if(0===r.length)return{};if(1===r.length)return r[0];let t={},e={};for(let o of r)for(let n in o)n.startsWith("on")&&"function"==typeof o[n]?(null!=e[n]||(e[n]=[]),e[n].push(o[n])):t[n]=o[n];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(e).map((o=>[o,void 0]))));for(let o in e)Object.assign(t,{[o](n,...l){let s=e[o];for(let u of s){if((n instanceof Event||(null==n?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;u(n,...l)}}});return t}function C(r){var t;return Object.assign((0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(r),{displayName:null!=(t=r.displayName)?t:r.name})}function F(r){let t=Object.assign({},r);for(let e in t)void 0===t[e]&&delete t[e];return t}function m(r,t=[]){let e=Object.assign({},r);for(let a of t)a in e&&delete e[a];return e}},"./node_modules/@headlessui/react/dist/utils/ssr.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{s:()=>e});const e="undefined"==typeof window||"undefined"==typeof document},"./src/components/ExportHistoryButton/ExportHistoryButton.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AlignLeft:()=>AlignLeft,Default:()=>Default,WithCustomCSSClass:()=>WithCustomCSSClass,WithCustomIcon:()=>WithCustomIcon,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _ExportHistoryButton__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ExportHistoryButton/ExportHistoryButton.tsx"),_mocks_data__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/mocks/data.ts"),_icons_Download__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Download.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const __WEBPACK_DEFAULT_EXPORT__={title:"Export History Button",component:_ExportHistoryButton__WEBPACK_IMPORTED_MODULE_1__.Z,argTypes:{memori:{control:{type:"object"}},icon:{control:{type:"object"}}},parameters:{controls:{expanded:!0}}},Template=args=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{style:{textAlign:"right"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ExportHistoryButton__WEBPACK_IMPORTED_MODULE_1__.Z,{...args})});Template.displayName="Template";const TemplateRight=args=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{style:{textAlign:"left"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ExportHistoryButton__WEBPACK_IMPORTED_MODULE_1__.Z,{...args})});TemplateRight.displayName="TemplateRight";const Default=Template.bind({});Default.args={memori:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.jF,history:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.m8};const WithCustomIcon=Template.bind({});WithCustomIcon.args={memori:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.jF,history:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.m8,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Download__WEBPACK_IMPORTED_MODULE_3__.default,{})};const WithCustomCSSClass=Template.bind({});WithCustomCSSClass.args={memori:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.jF,history:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.m8,buttonClassName:"memori-button--primary"};const AlignLeft=TemplateRight.bind({});AlignLeft.args={memori:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.jF,history:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.m8,align:"left"},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args =>
\n \n
",...Default.parameters?.docs?.source}}},WithCustomIcon.parameters={...WithCustomIcon.parameters,docs:{...WithCustomIcon.parameters?.docs,source:{originalSource:"args =>
\n \n
",...WithCustomIcon.parameters?.docs?.source}}},WithCustomCSSClass.parameters={...WithCustomCSSClass.parameters,docs:{...WithCustomCSSClass.parameters?.docs,source:{originalSource:"args =>
\n \n
",...WithCustomCSSClass.parameters?.docs?.source}}},AlignLeft.parameters={...AlignLeft.parameters,docs:{...AlignLeft.parameters?.docs,source:{originalSource:"args =>
\n \n
",...AlignLeft.parameters?.docs?.source}}};const __namedExportsOrder=["Default","WithCustomIcon","WithCustomCSSClass","AlignLeft"]},"./src/components/ExportHistoryButton/ExportHistoryButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_i18next__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/popover/popover.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Message__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Message.tsx"),classnames__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ExportHistoryButton=({history,memori,className,buttonClassName,icon,disabled=!1,align="right",filename})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_5__.$)(),text=`${t("write_and_speak.conversationStartedLabel")} ${new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date)}\n\n`.concat(history.map((m=>`${m.fromUser?"YOU":memori.name}: ${m.text}`)).join("\n"));return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J,{title:t("write_and_speak.exportChatHistoryMessage"),className:classnames__WEBPACK_IMPORTED_MODULE_3___default()("memori-export-history-button",className,{"memori-export-history-button--align-left":"left"===align}),children:({close})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J.Button,{disabled,className:classnames__WEBPACK_IMPORTED_MODULE_3___default()("memori-button","memori-button--circle","memori-button--icon-only",buttonClassName,{"memori-button--disabled":disabled,"memori-button--primary":!disabled}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"memori-button--icon",children:icon||(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Message__WEBPACK_IMPORTED_MODULE_2__.default,{})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J.Panel,{className:"memori-export-history-button--panel",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p",{children:t("write_and_speak.exportChatHistory")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{primary:!0,onClick:()=>((text,filename="export-chat.txt")=>{const data=new Blob([text],{type:"text/plain"}),url=URL.createObjectURL(data),element=document.createElement("a");element.setAttribute("href",url),element.setAttribute("download",filename),element.style.display="none",document.body.appendChild(element),element.click(),document.body.removeChild(element)})(text,filename||`${memori.name.replace(/\W+/g,"-")}-export-chat.txt`),children:t("yes")||"Yes"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{onClick:()=>close(),children:t("no")||"No"})]})]})})};ExportHistoryButton.displayName="ExportHistoryButton";const __WEBPACK_DEFAULT_EXPORT__=ExportHistoryButton;try{ExportHistoryButton.displayName="ExportHistoryButton",ExportHistoryButton.__docgenInfo={description:"",displayName:"ExportHistoryButton",props:{history:{defaultValue:null,description:"",name:"history",required:!0,type:{name:"Message[]"}},memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},buttonClassName:{defaultValue:null,description:"",name:"buttonClassName",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},filename:{defaultValue:null,description:"",name:"filename",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ExportHistoryButton/ExportHistoryButton.tsx#ExportHistoryButton"]={docgenInfo:ExportHistoryButton.__docgenInfo,name:"ExportHistoryButton",path:"src/components/ExportHistoryButton/ExportHistoryButton.tsx#ExportHistoryButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Download.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Download=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})});Download.displayName="Download";const __WEBPACK_DEFAULT_EXPORT__=Download;try{Download.displayName="Download",Download.__docgenInfo={description:"",displayName:"Download",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Download.tsx#Download"]={docgenInfo:Download.__docgenInfo,name:"Download",path:"src/components/icons/Download.tsx#Download"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Message.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Message=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"})});Message.displayName="Message";const __WEBPACK_DEFAULT_EXPORT__=Message;try{Message.displayName="Message",Message.__docgenInfo={description:"",displayName:"Message",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Message.tsx#Message"]={docgenInfo:Message.__docgenInfo,name:"Message",path:"src/components/icons/Message.tsx#Message"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={id:"locahost:3000",theme:"twincreator",config:{name:"Memori",showNewUser:!0,requirePosition:!1,feedbackURL:"https://form.asana.com/"}},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}},"./node_modules/classnames/index.js":(module,exports)=>{var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";var hasOwn={}.hasOwnProperty;function classNames(){for(var classes=[],i=0;i{"use strict";__webpack_require__.d(__webpack_exports__,{OO:()=>I18nContext,zv:()=>ReportNamespaces,JP:()=>getDefaults,nI:()=>getI18n,Db:()=>initReactI18next});var classCallCheck=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),createClass=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/createClass.js"),defineProperty=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),react=__webpack_require__("./node_modules/react/index.js"),matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},unescapeHtmlEntity=function unescapeHtmlEntity(m){return htmlEntities[m]};function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i0&&void 0!==arguments[0]?arguments[0]:{};defaultOptions=_objectSpread(_objectSpread({},defaultOptions),options)}(instance.options.react),function setI18n(instance){i18nInstance=instance}(instance)}}},"./node_modules/react-i18next/dist/es/useTranslation.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{$:()=>useTranslation});var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/index.js"),_context__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-i18next/dist/es/context.js"),_utils__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react-i18next/dist/es/utils.js");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1&&void 0!==arguments[1]?arguments[1]:{},i18nFromProps=props.i18n,_ref=(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_context__WEBPACK_IMPORTED_MODULE_2__.OO)||{},i18nFromContext=_ref.i18n,defaultNSFromContext=_ref.defaultNS,i18n=i18nFromProps||i18nFromContext||(0,_context__WEBPACK_IMPORTED_MODULE_2__.nI)();if(i18n&&!i18n.reportNamespaces&&(i18n.reportNamespaces=new _context__WEBPACK_IMPORTED_MODULE_2__.zv),!i18n){(0,_utils__WEBPACK_IMPORTED_MODULE_3__.O4)("You will need to pass in an i18next instance by using initReactI18next");var notReadyT=function notReadyT(k){return Array.isArray(k)?k[k.length-1]:k},retNotReady=[notReadyT,{},!1];return retNotReady.t=notReadyT,retNotReady.i18n={},retNotReady.ready=!1,retNotReady}i18n.options.react&&void 0!==i18n.options.react.wait&&(0,_utils__WEBPACK_IMPORTED_MODULE_3__.O4)("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var i18nOptions=_objectSpread(_objectSpread(_objectSpread({},(0,_context__WEBPACK_IMPORTED_MODULE_2__.JP)()),i18n.options.react),props),useSuspense=i18nOptions.useSuspense,keyPrefix=i18nOptions.keyPrefix,namespaces=ns||defaultNSFromContext||i18n.options&&i18n.options.defaultNS;namespaces="string"==typeof namespaces?[namespaces]:namespaces||["translation"],i18n.reportNamespaces.addUsedNamespaces&&i18n.reportNamespaces.addUsedNamespaces(namespaces);var ready=(i18n.isInitialized||i18n.initializedStoreOnce)&&namespaces.every((function(n){return(0,_utils__WEBPACK_IMPORTED_MODULE_3__.F0)(n,i18n,i18nOptions)}));function getT(){return i18n.getFixedT(null,"fallback"===i18nOptions.nsMode?namespaces:namespaces[0],keyPrefix)}var _useState=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(getT),_useState2=(0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.Z)(_useState,2),t=_useState2[0],setT=_useState2[1],joinedNS=namespaces.join(),previousJoinedNS=usePrevious(joinedNS),isMounted=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!0);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((function(){var bindI18n=i18nOptions.bindI18n,bindI18nStore=i18nOptions.bindI18nStore;function boundReset(){isMounted.current&&setT(getT)}return isMounted.current=!0,ready||useSuspense||(0,_utils__WEBPACK_IMPORTED_MODULE_3__.DC)(i18n,namespaces,(function(){isMounted.current&&setT(getT)})),ready&&previousJoinedNS&&previousJoinedNS!==joinedNS&&isMounted.current&&setT(getT),bindI18n&&i18n&&i18n.on(bindI18n,boundReset),bindI18nStore&&i18n&&i18n.store.on(bindI18nStore,boundReset),function(){isMounted.current=!1,bindI18n&&i18n&&bindI18n.split(" ").forEach((function(e){return i18n.off(e,boundReset)})),bindI18nStore&&i18n&&bindI18nStore.split(" ").forEach((function(e){return i18n.store.off(e,boundReset)}))}}),[i18n,joinedNS]);var isInitial=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!0);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((function(){isMounted.current&&!isInitial.current&&setT(getT),isInitial.current=!1}),[i18n,keyPrefix]);var ret=[t,i18n,ready];if(ret.t=t,ret.i18n=i18n,ret.ready=ready,ready)return ret;if(!ready&&!useSuspense)return ret;throw new Promise((function(resolve){(0,_utils__WEBPACK_IMPORTED_MODULE_3__.DC)(i18n,namespaces,(function(){resolve()}))}))}},"./node_modules/react-i18next/dist/es/utils.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function warn(){if(console&&console.warn){for(var _console,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];"string"==typeof args[0]&&(args[0]="react-i18next:: ".concat(args[0])),(_console=console).warn.apply(_console,args)}}__webpack_require__.d(__webpack_exports__,{DC:()=>loadNamespaces,F0:()=>hasLoadedNamespace,Gf:()=>getDisplayName,O4:()=>warnOnce});var alreadyWarned={};function warnOnce(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];"string"==typeof args[0]&&alreadyWarned[args[0]]||("string"==typeof args[0]&&(alreadyWarned[args[0]]=new Date),warn.apply(void 0,args))}function loadNamespaces(i18n,ns,cb){i18n.loadNamespaces(ns,(function(){if(i18n.isInitialized)cb();else{i18n.on("initialized",(function initialized(){setTimeout((function(){i18n.off("initialized",initialized)}),0),cb()}))}}))}function hasLoadedNamespace(ns,i18n){var options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i18n.languages&&i18n.languages.length?void 0!==i18n.options.ignoreJSONStructure?i18n.hasLoadedNamespace(ns,{precheck:function precheck(i18nInstance,loadNotPending){if(options.bindI18n&&options.bindI18n.indexOf("languageChanging")>-1&&i18nInstance.services.backendConnector.backend&&i18nInstance.isLanguageChangingTo&&!loadNotPending(i18nInstance.isLanguageChangingTo,ns))return!1}}):function oldI18nextHasLoadedNamespace(ns,i18n){var options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},lng=i18n.languages[0],fallbackLng=!!i18n.options&&i18n.options.fallbackLng,lastLng=i18n.languages[i18n.languages.length-1];if("cimode"===lng.toLowerCase())return!0;var loadNotPending=function loadNotPending(l,n){var loadState=i18n.services.backendConnector.state["".concat(l,"|").concat(n)];return-1===loadState||2===loadState};return!(options.bindI18n&&options.bindI18n.indexOf("languageChanging")>-1&&i18n.services.backendConnector.backend&&i18n.isLanguageChangingTo&&!loadNotPending(i18n.isLanguageChangingTo,ns)||!i18n.hasResourceBundle(lng,ns)&&i18n.services.backendConnector.backend&&(!i18n.options.resources||i18n.options.partialBundledLanguages)&&(!loadNotPending(lng,ns)||fallbackLng&&!loadNotPending(lastLng,ns)))}(ns,i18n,options):(warnOnce("i18n.languages were undefined or empty",i18n.languages),!0)}function getDisplayName(Component){return Component.displayName||Component.name||("string"==typeof Component&&Component.length>0?Component:"Unknown")}},"./node_modules/react/cjs/react-jsx-runtime.production.min.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";var f=__webpack_require__("./node_modules/react/index.js"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(c,a,g){var b,d={},e=null,h=null;for(b in void 0!==g&&(e=""+g),void 0!==a.key&&(e=""+a.key),void 0!==a.ref&&(h=a.ref),a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l,exports.jsx=q,exports.jsxs=q},"./node_modules/react/jsx-runtime.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";module.exports=__webpack_require__("./node_modules/react/cjs/react-jsx-runtime.production.min.js")}}]); \ No newline at end of file +/*! For license information please see components-ExportHistoryButton-ExportHistoryButton-stories.cfb189b7.iframe.bundle.js.LICENSE.txt */ +(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[1281],{"./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i_arrayLikeToArray})},"./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}__webpack_require__.d(__webpack_exports__,{Z:()=>_arrayWithHoles})},"./node_modules/@babel/runtime/helpers/esm/classCallCheck.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}__webpack_require__.d(__webpack_exports__,{Z:()=>_classCallCheck})},"./node_modules/@babel/runtime/helpers/esm/createClass.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_createClass});var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");function _defineProperties(target,props){for(var i=0;i{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_defineProperty});var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");function _defineProperty(obj,key,value){return(key=(0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__.Z)(key))in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}},"./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}__webpack_require__.d(__webpack_exports__,{Z:()=>_nonIterableRest})},"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_slicedToArray});var arrayWithHoles=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");var unsupportedIterableToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js"),nonIterableRest=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");function _slicedToArray(arr,i){return(0,arrayWithHoles.Z)(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}(arr,i)||(0,unsupportedIterableToArray.Z)(arr,i)||(0,nonIterableRest.Z)()}},"./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_toPropertyKey});var esm_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");function _toPropertyKey(arg){var key=function _toPrimitive(input,hint){if("object"!==(0,esm_typeof.Z)(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!==(0,esm_typeof.Z)(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"===(0,esm_typeof.Z)(key)?key:String(key)}},"./node_modules/@babel/runtime/helpers/esm/typeof.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}__webpack_require__.d(__webpack_exports__,{Z:()=>_typeof})},"./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_unsupportedIterableToArray});var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return(0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__.Z)(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__.Z)(o,minLen):void 0}}},"./node_modules/@headlessui/react/dist/components/keyboard.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{R:()=>o});var r,o=((r=o||{}).Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r)},"./node_modules/@headlessui/react/dist/components/popover/popover.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{J:()=>mt});var n,f,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_utils_match_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),_utils_render_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/render.js"),_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-sync-refs.js"),_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-id.js"),_keyboard_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/@headlessui/react/dist/components/keyboard.js"),_utils_bugs_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/bugs.js"),_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/focus-management.js"),_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@headlessui/react/dist/internal/open-closed.js"),_hooks_use_resolve_button_type_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js"),_hooks_use_outside_click_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-outside-click.js"),_utils_owner_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js"),_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-owner.js"),_hooks_use_event_listener_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event-listener.js"),_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/@headlessui/react/dist/internal/hidden.js"),_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event.js"),_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-tab-direction.js"),Ae=((f=Ae||{})[f.Open=0]="Open",f[f.Closed=1]="Closed",f),Ce=((n=Ce||{})[n.TogglePopover=0]="TogglePopover",n[n.ClosePopover=1]="ClosePopover",n[n.SetButton=2]="SetButton",n[n.SetButtonId=3]="SetButtonId",n[n.SetPanel=4]="SetPanel",n[n.SetPanelId=5]="SetPanelId",n);let Re={0:r=>({...r,popoverState:(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(r.popoverState,{0:1,1:0})}),1:r=>1===r.popoverState?r:{...r,popoverState:1},2:(r,t)=>r.button===t.button?r:{...r,button:t.button},3:(r,t)=>r.buttonId===t.buttonId?r:{...r,buttonId:t.buttonId},4:(r,t)=>r.panel===t.panel?r:{...r,panel:t.panel},5:(r,t)=>r.panelId===t.panelId?r:{...r,panelId:t.panelId}},te=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);function Q(r){let t=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(te);if(null===t){let f=new Error(`<${r} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(f,Q),f}return t}te.displayName="PopoverContext";let oe=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);function re(r){let t=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(oe);if(null===t){let f=new Error(`<${r} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(f,re),f}return t}oe.displayName="PopoverAPIContext";let ne=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);function ce(){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ne)}ne.displayName="PopoverGroupContext";let le=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);function Me(r,t){return(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(t.type,Re,r,t)}le.displayName="PopoverPanelContext";let Ie=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.yV)((function(t,f){var O;let o=`headlessui-popover-button-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,v=`headlessui-popover-panel-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,a=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),n=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(f,(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.h)((e=>{a.current=e}))),g=(0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)(Me,{popoverState:1,button:null,buttonId:o,panel:null,panelId:v,beforePanelSentinel:(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)(),afterPanelSentinel:(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)()}),[{popoverState:y,button:l,panel:P,beforePanelSentinel:s,afterPanelSentinel:B},i]=g,T=(0,_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_5__.i)(null!=(O=a.current)?O:l);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>i({type:3,buttonId:o})),[o,i]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>i({type:5,panelId:v})),[v,i]);let c=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>{if(!l||!P)return!1;for(let M of document.querySelectorAll("body > *"))if(Number(null==M?void 0:M.contains(l))^Number(null==M?void 0:M.contains(P)))return!0;let e=(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.GO)(),p=e.indexOf(l),m=(p+e.length-1)%e.length,C=(p+1)%e.length,D=e[m],V=e[C];return!P.contains(D)&&!P.contains(V)}),[l,P]),d=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({buttonId:o,panelId:v,close:()=>i({type:1})})),[o,v,i]),E=ce(),A=null==E?void 0:E.registerPopover,L=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{var e;return null!=(e=null==E?void 0:E.isFocusWithinPopoverGroup())?e:(null==T?void 0:T.activeElement)&&((null==l?void 0:l.contains(T.activeElement))||(null==P?void 0:P.contains(T.activeElement)))}));(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>null==A?void 0:A(d)),[A,d]),(0,_hooks_use_event_listener_js__WEBPACK_IMPORTED_MODULE_8__.O)(null==T?void 0:T.defaultView,"focus",(e=>{var p,m,C,D;0===y&&(L()||!l||!P||null!=(m=null==(p=s.current)?void 0:p.contains)&&m.call(p,e.target)||null!=(D=null==(C=B.current)?void 0:C.contains)&&D.call(C,e.target)||i({type:1}))}),!0),(0,_hooks_use_outside_click_js__WEBPACK_IMPORTED_MODULE_9__.O)([l,P],((e,p)=>{i({type:1}),(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.sP)(p,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.tJ.Loose)||(e.preventDefault(),null==l||l.focus())}),0===y);let I=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((e=>{i({type:1});let p=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:l:l;null==p||p.focus()})),H=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({close:I,isPortalled:c})),[I,c]),u=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===y,close:I})),[y,I]),S=t,R={ref:n};return react__WEBPACK_IMPORTED_MODULE_0__.createElement(te.Provider,{value:g},react__WEBPACK_IMPORTED_MODULE_0__.createElement(oe.Provider,{value:H},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.up,{value:(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(y,{0:_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.ZM.Open,1:_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.ZM.Closed})},(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.sY)({ourProps:R,theirProps:S,slot:u,defaultTag:"div",name:"Popover"}))))})),he=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.yV)((function(t,f){let[o,v]=Q("Popover.Button"),{isPortalled:a}=re("Popover.Button"),n=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),g=`headlessui-focus-sentinel-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,y=ce(),l=null==y?void 0:y.closeOthers,P=function Oe(){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(le)}(),s=null!==P&&P===o.panelId,B=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(n,f,s?null:e=>e&&v({type:2,button:e})),i=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(n,f),T=(0,_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_5__.i)(n),c=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((e=>{var p,m,C;if(s){if(1===o.popoverState)return;switch(e.key){case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Enter:e.preventDefault(),null==(m=(p=e.target).click)||m.call(p),v({type:1}),null==(C=o.button)||C.focus()}}else switch(e.key){case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Enter:e.preventDefault(),e.stopPropagation(),1===o.popoverState&&(null==l||l(o.buttonId)),v({type:0});break;case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Escape:if(0!==o.popoverState)return null==l?void 0:l(o.buttonId);if(!n.current||(null==T?void 0:T.activeElement)&&!n.current.contains(T.activeElement))return;e.preventDefault(),e.stopPropagation(),v({type:1})}})),d=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((e=>{s||e.key===_keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space&&e.preventDefault()})),E=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((e=>{var p,m;(0,_utils_bugs_js__WEBPACK_IMPORTED_MODULE_12__.P)(e.currentTarget)||t.disabled||(s?(v({type:1}),null==(p=o.button)||p.focus()):(e.preventDefault(),e.stopPropagation(),1===o.popoverState&&(null==l||l(o.buttonId)),v({type:0}),null==(m=o.button)||m.focus()))})),A=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((e=>{e.preventDefault(),e.stopPropagation()})),L=0===o.popoverState,I=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:L})),[L]),H=(0,_hooks_use_resolve_button_type_js__WEBPACK_IMPORTED_MODULE_13__.f)(t,n),u=t,S=s?{ref:i,type:H,onKeyDown:c,onClick:E}:{ref:B,id:o.buttonId,type:H,"aria-expanded":t.disabled?void 0:0===o.popoverState,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:c,onKeyUp:d,onClick:E,onMouseDown:A},R=(0,_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.l)(),O=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{let e=o.panel;e&&function p(){(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(R.current,{[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Forwards]:()=>(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(e,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.First),[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Backwards]:()=>(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(e,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.Last)})}()}));return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,null,(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.sY)({ourProps:S,theirProps:u,slot:I,defaultTag:"button",name:"Popover.Button"}),L&&!s&&a&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__._,{id:g,features:_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__.A.Focusable,as:"button",type:"button",onFocus:O}))})),De=_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.AN.RenderStrategy|_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.AN.Static,xe=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.yV)((function(t,f){let[{popoverState:o},v]=Q("Popover.Overlay"),a=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(f),n=`headlessui-popover-overlay-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,g=(0,_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.oJ)(),y=null!==g?g===_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.ZM.Open:0===o,l=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((i=>{if((0,_utils_bugs_js__WEBPACK_IMPORTED_MODULE_12__.P)(i.currentTarget))return i.preventDefault();v({type:1})})),P=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===o})),[o]);return(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.sY)({ourProps:{ref:a,id:n,"aria-hidden":!0,onClick:l},theirProps:t,slot:P,defaultTag:"div",features:De,visible:y,name:"Popover.Overlay"})})),Ge=_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.AN.RenderStrategy|_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.AN.Static,ke=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.yV)((function(t,f){let{focus:o=!1,...v}=t,[a,n]=Q("Popover.Panel"),{close:g,isPortalled:y}=re("Popover.Panel"),l=`headlessui-focus-sentinel-before-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,P=`headlessui-focus-sentinel-after-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_3__.M)()}`,s=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),B=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(s,f,(u=>{n({type:4,panel:u})})),i=(0,_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_5__.i)(s),T=(0,_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.oJ)(),c=null!==T?T===_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_10__.ZM.Open:0===a.popoverState,d=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((u=>{var S;if(u.key===_keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Escape){if(0!==a.popoverState||!s.current||(null==i?void 0:i.activeElement)&&!s.current.contains(i.activeElement))return;u.preventDefault(),u.stopPropagation(),n({type:1}),null==(S=a.button)||S.focus()}}));(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{var u;t.static||1===a.popoverState&&(null==(u=t.unmount)||u)&&n({type:4,panel:null})}),[a.popoverState,t.unmount,t.static,n]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{if(!o||0!==a.popoverState||!s.current)return;let u=null==i?void 0:i.activeElement;s.current.contains(u)||(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(s.current,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.First)}),[o,s,a.popoverState]);let E=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===a.popoverState,close:g})),[a,g]),A={ref:B,id:a.panelId,onKeyDown:d,onBlur:o&&0===a.popoverState?u=>{var R,O,e,p,m;let S=u.relatedTarget;!S||!s.current||null!=(R=s.current)&&R.contains(S)||(n({type:1}),((null==(e=null==(O=a.beforePanelSentinel.current)?void 0:O.contains)?void 0:e.call(O,S))||(null==(m=null==(p=a.afterPanelSentinel.current)?void 0:p.contains)?void 0:m.call(p,S)))&&S.focus({preventScroll:!0}))}:void 0,tabIndex:-1},L=(0,_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.l)(),I=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{let u=s.current;u&&function S(){(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(L.current,{[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Forwards]:()=>{(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(u,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.First)},[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Backwards]:()=>{var R;null==(R=a.button)||R.focus({preventScroll:!0})}})}()})),H=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{let u=s.current;u&&function S(){(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(L.current,{[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Forwards]:()=>{var C,D,V;if(!a.button)return;let R=(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.GO)(),O=R.indexOf(a.button),e=R.slice(0,O+1),m=[...R.slice(O+1),...e];for(let M of m.slice())if((null==(D=null==(C=null==M?void 0:M.id)?void 0:C.startsWith)?void 0:D.call(C,"headlessui-focus-sentinel-"))||(null==(V=a.panel)?void 0:V.contains(M))){let ae=m.indexOf(M);-1!==ae&&m.splice(ae,1)}(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(m,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.First,!1)},[_hooks_use_tab_direction_js__WEBPACK_IMPORTED_MODULE_14__.N.Backwards]:()=>(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.jA)(u,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_6__.TO.Last)})}()}));return react__WEBPACK_IMPORTED_MODULE_0__.createElement(le.Provider,{value:a.panelId},c&&y&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__._,{id:l,ref:a.beforePanelSentinel,features:_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__.A.Focusable,as:"button",type:"button",onFocus:I}),(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.sY)({ourProps:A,theirProps:v,slot:E,defaultTag:"div",features:Ge,visible:c,name:"Popover.Panel"}),c&&y&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__._,{id:P,ref:a.afterPanelSentinel,features:_internal_hidden_js__WEBPACK_IMPORTED_MODULE_15__.A.Focusable,as:"button",type:"button",onFocus:H}))})),we=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.yV)((function(t,f){let o=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),v=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_4__.T)(o,f),[a,n]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),g=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((c=>{n((d=>{let E=d.indexOf(c);if(-1!==E){let A=d.slice();return A.splice(E,1),A}return d}))})),y=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((c=>(n((d=>[...d,c])),()=>g(c)))),l=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{var E;let c=(0,_utils_owner_js__WEBPACK_IMPORTED_MODULE_16__.r)(o);if(!c)return!1;let d=c.activeElement;return!(null==(E=o.current)||!E.contains(d))||a.some((A=>{var L,I;return(null==(L=c.getElementById(A.buttonId))?void 0:L.contains(d))||(null==(I=c.getElementById(A.panelId))?void 0:I.contains(d))}))})),P=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((c=>{for(let d of a)d.buttonId!==c&&d.close()})),s=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({registerPopover:y,unregisterPopover:g,isFocusWithinPopoverGroup:l,closeOthers:P})),[y,g,l,P]),B=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({})),[]),i=t,T={ref:v};return react__WEBPACK_IMPORTED_MODULE_0__.createElement(ne.Provider,{value:s},(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_2__.sY)({ourProps:T,theirProps:i,slot:B,defaultTag:"div",name:"Popover.Group"}))})),mt=Object.assign(Ie,{Button:he,Overlay:xe,Panel:ke,Group:we})},"./node_modules/@headlessui/react/dist/hooks/use-event-listener.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{O:()=>E});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");function E(n,e,a,t){let i=(0,_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__.E)(a);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{function r(o){i.current(o)}return(n=null!=n?n:window).addEventListener(e,r,t),()=>n.removeEventListener(e,r,t)}),[n,e,t])}},"./node_modules/@headlessui/react/dist/hooks/use-event.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{z:()=>o});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");let o=function(t){let e=(0,_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__.E)(t);return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(((...r)=>e.current(...r)),[e])}},"./node_modules/@headlessui/react/dist/hooks/use-id.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{M:()=>I});var u,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js"),_use_server_handoff_complete_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js");let l=0;function r(){return++l}let I=null!=(u=react__WEBPACK_IMPORTED_MODULE_0__.useId)?u:function(){let n=(0,_use_server_handoff_complete_js__WEBPACK_IMPORTED_MODULE_1__.H)(),[e,o]=react__WEBPACK_IMPORTED_MODULE_0__.useState(n?r:null);return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_2__.e)((()=>{null===e&&o(r())}),[e]),null!=e?""+e:void 0}},"./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{e:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let s=__webpack_require__("./node_modules/@headlessui/react/dist/utils/ssr.js").s?react__WEBPACK_IMPORTED_MODULE_0__.useEffect:react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect},"./node_modules/@headlessui/react/dist/hooks/use-latest-value.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{E:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js");function s(e){let r=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(e);return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{r.current=e}),[e]),r}},"./node_modules/@headlessui/react/dist/hooks/use-outside-click.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{O:()=>L});var react=__webpack_require__("./node_modules/react/index.js"),focus_management=__webpack_require__("./node_modules/@headlessui/react/dist/utils/focus-management.js"),use_latest_value=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");function d(e,r,n){let o=(0,use_latest_value.E)(r);(0,react.useEffect)((()=>{function t(u){o.current(u)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}function L(E,m,c=!0){let i=(0,react.useRef)(!1);function f(e,o){if(!i.current||e.defaultPrevented)return;let l=function r(t){return"function"==typeof t?r(t()):Array.isArray(t)||t instanceof Set?t:[t]}(E),n=o(e);if(null!==n&&n.getRootNode().contains(n)){for(let r of l){if(null===r)continue;let t=r instanceof HTMLElement?r:r.current;if(null!=t&&t.contains(n))return}return!(0,focus_management.sP)(n,focus_management.tJ.Loose)&&-1!==n.tabIndex&&e.preventDefault(),m(e,n)}}(0,react.useEffect)((()=>{requestAnimationFrame((()=>{i.current=c}))}),[c]);let u=(0,react.useRef)(null);d("mousedown",(e=>{var o,l;i.current&&(u.current=(null==(l=null==(o=e.composedPath)?void 0:o.call(e))?void 0:l[0])||e.target)}),!0),d("click",(e=>{!u.current||(f(e,(()=>u.current)),u.current=null)}),!0),d("blur",(e=>f(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}},"./node_modules/@headlessui/react/dist/hooks/use-owner.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{i:()=>n});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_utils_owner_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js");function n(...e){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>(0,_utils_owner_js__WEBPACK_IMPORTED_MODULE_1__.r)(...e)),[...e])}},"./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{f:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js");function i(t){var n;if(t.type)return t.type;let e=null!=(n=t.as)?n:"button";return"string"==typeof e&&"button"===e.toLowerCase()?"button":void 0}function s(t,e){let[n,u]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((()=>i(t)));return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{u(i(t))}),[t.type,t.as]),(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{n||!e.current||e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&u("button")}),[n,e]),n}},"./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{H:()=>a});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let r={serverHandoffComplete:!1};function a(){let[e,f]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(r.serverHandoffComplete);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{!0!==e&&f(!0)}),[e]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{!1===r.serverHandoffComplete&&(r.serverHandoffComplete=!0)}),[]),e}},"./node_modules/@headlessui/react/dist/hooks/use-sync-refs.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{T:()=>y,h:()=>T});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_event_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event.js");let u=Symbol();function T(t,n=!0){return Object.assign(t,{[u]:n})}function y(...t){let n=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(t);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{n.current=t}),[t]);let c=(0,_use_event_js__WEBPACK_IMPORTED_MODULE_1__.z)((e=>{for(let o of n.current)null!=o&&("function"==typeof o?o(e):o.current=e)}));return t.every((e=>null==e||(null==e?void 0:e[u])))?void 0:c}},"./node_modules/@headlessui/react/dist/hooks/use-tab-direction.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{N:()=>use_tab_direction_s,l:()=>n});var react=__webpack_require__("./node_modules/react/index.js"),use_latest_value=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");var r,use_tab_direction_s=((r=use_tab_direction_s||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r);function n(){let e=(0,react.useRef)(0);return function s(e,r,n){let o=(0,use_latest_value.E)(r);(0,react.useEffect)((()=>{function t(i){o.current(i)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)}),[e,n])}("keydown",(o=>{"Tab"===o.key&&(e.current=o.shiftKey?1:0)}),!0),e}},"./node_modules/@headlessui/react/dist/internal/hidden.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>s,_:()=>h});var _utils_render_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/render.js");var e,s=((e=s||{})[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e);let h=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_0__.yV)((function(t,o){let{features:e=1,...r}=t,d={ref:o,"aria-hidden":2==(2&e)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&e)&&2!=(2&e)&&{display:"none"}}};return(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_0__.sY)({ourProps:d,theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}))},"./node_modules/@headlessui/react/dist/internal/open-closed.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{ZM:()=>p,oJ:()=>s,up:()=>C});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let o=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);o.displayName="OpenClosedContext";var e,p=((e=p||{})[e.Open=0]="Open",e[e.Closed=1]="Closed",e);function s(){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(o)}function C({value:t,children:n}){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(o.Provider,{value:t},n)}},"./node_modules/@headlessui/react/dist/utils/bugs.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function r(n){let e=n.parentElement,l=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(l=e),e=e.parentElement;let t=""===(null==e?void 0:e.getAttribute("disabled"));return(!t||!function i(n){if(!n)return!1;let e=n.previousElementSibling;for(;null!==e;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}(l))&&t}__webpack_require__.d(__webpack_exports__,{P:()=>r})},"./node_modules/@headlessui/react/dist/utils/disposables.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{k:()=>m});var _micro_task_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/micro-task.js");function m(){let n=[],i=[],r={enqueue(e){i.push(e)},addEventListener:(e,t,a,o)=>(e.addEventListener(t,a,o),r.add((()=>e.removeEventListener(t,a,o)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>r.requestAnimationFrame((()=>r.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return r.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return(0,_micro_task_js__WEBPACK_IMPORTED_MODULE_0__.Y)((()=>{t.current&&e[0]()})),r.add((()=>{t.current=!1}))},add:e=>(n.push(e),()=>{let t=n.indexOf(e);if(t>=0){let[a]=n.splice(t,1);a()}}),dispose(){for(let e of n.splice(0))e()},async workQueue(){for(let e of i.splice(0))await e()}};return r}},"./node_modules/@headlessui/react/dist/utils/focus-management.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{C5:()=>h,EO:()=>D,GO:()=>d,TO:()=>T,fE:()=>M,jA:()=>O,sP:()=>F,tJ:()=>N,wI:()=>I,z2:()=>S});var _disposables_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/disposables.js"),_match_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),_owner_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js");let m=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var r,o,n,T=((n=T||{})[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n),M=((o=M||{})[o.Error=0]="Error",o[o.Overflow=1]="Overflow",o[o.Success=2]="Success",o[o.Underflow=3]="Underflow",o),b=((r=b||{})[r.Previous=-1]="Previous",r[r.Next=1]="Next",r);function d(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(m))}var N=(r=>(r[r.Strict=0]="Strict",r[r.Loose=1]="Loose",r))(N||{});function F(e,t=0){var r;return e!==(null==(r=(0,_owner_js__WEBPACK_IMPORTED_MODULE_0__.r)(e))?void 0:r.body)&&(0,_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(t,{0:()=>e.matches(m),1(){let l=e;for(;null!==l;){if(l.matches(m))return!0;l=l.parentElement}return!1}})}function I(e){let t=(0,_owner_js__WEBPACK_IMPORTED_MODULE_0__.r)(e);(0,_disposables_js__WEBPACK_IMPORTED_MODULE_2__.k)().nextFrame((()=>{t&&!F(t.activeElement,0)&&h(e)}))}function h(e){null==e||e.focus({preventScroll:!0})}let w=["textarea","input"].join(",");function S(e,t=(r=>r)){return e.slice().sort(((r,l)=>{let o=t(r),s=t(l);if(null===o||null===s)return 0;let n=o.compareDocumentPosition(s);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function D(e,t){return O(d(),t,!0,e)}function O(e,t,r=!0,l=null){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?r?S(e):e:d(e);l=null!=l?l:o.activeElement;let u,n=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),E=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,s.indexOf(l))-1;if(4&t)return Math.max(0,s.indexOf(l))+1;if(8&t)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),x=32&t?{preventScroll:!0}:{},f=0,i=s.length;do{if(f>=i||f+i<=0)return 0;let a=E+f;if(16&t)a=(a+i)%i;else{if(a<0)return 3;if(a>=i)return 1}u=s[a],null==u||u.focus(x),f+=n}while(u!==o.activeElement);return 6&t&&function H(e){var t,r;return null!=(r=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,w))&&r}(u)&&u.select(),u.hasAttribute("tabindex")||u.setAttribute("tabindex","0"),2}},"./node_modules/@headlessui/react/dist/utils/match.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function u(r,n,...a){if(r in n){let e=n[r];return"function"==typeof e?e(...a):e}let t=new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,u),t}__webpack_require__.d(__webpack_exports__,{E:()=>u})},"./node_modules/@headlessui/react/dist/utils/micro-task.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function t(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((o=>setTimeout((()=>{throw o}))))}__webpack_require__.d(__webpack_exports__,{Y:()=>t})},"./node_modules/@headlessui/react/dist/utils/owner.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{r:()=>e});var _ssr_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/ssr.js");function e(r){return _ssr_js__WEBPACK_IMPORTED_MODULE_0__.s?null:r instanceof Node?r.ownerDocument:null!=r&&r.hasOwnProperty("current")&&r.current instanceof Node?r.current.ownerDocument:document}},"./node_modules/@headlessui/react/dist/utils/render.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{AN:()=>S,l4:()=>j,oA:()=>F,sY:()=>$,yV:()=>C});var e,a,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_match_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),S=((a=S||{})[a.None=0]="None",a[a.RenderStrategy=1]="RenderStrategy",a[a.Static=2]="Static",a),j=((e=j||{})[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e);function $({ourProps:r,theirProps:t,slot:e,defaultTag:a,features:o,visible:n=!0,name:l}){let s=T(t,r);if(n)return p(s,e,a,l);let u=null!=o?o:0;if(2&u){let{static:i=!1,...d}=s;if(i)return p(d,e,a,l)}if(1&u){let{unmount:i=!0,...d}=s;return(0,_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(i?0:1,{0:()=>null,1:()=>p({...d,hidden:!0,style:{display:"none"}},e,a,l)})}return p(s,e,a,l)}function p(r,t={},e,a){let{as:o=e,children:n,refName:l="ref",...s}=m(r,["unmount","static"]),u=void 0!==r.ref?{[l]:r.ref}:{},i="function"==typeof n?n(t):n;s.className&&"function"==typeof s.className&&(s.className=s.className(t));let d={};if(t){let f=!1,y=[];for(let[h,g]of Object.entries(t))"boolean"==typeof g&&(f=!0),!0===g&&y.push(h);f&&(d["data-headlessui-state"]=y.join(" "))}if(o===react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&Object.keys(F(s)).length>0){if(!(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(i)||Array.isArray(i)&&i.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${a} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map((f=>` - ${f}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((f=>` - ${f}`)).join("\n")].join("\n"));return(0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(i,Object.assign({},T(i.props,F(m(s,["ref"]))),d,u,function w(...r){return{ref:r.every((t=>null==t))?void 0:t=>{for(let e of r)null!=e&&("function"==typeof e?e(t):e.current=t)}}}(i.ref,u.ref)))}return(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(o,Object.assign({},m(s,["ref"]),o!==react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&u,o!==react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&d),i)}function T(...r){if(0===r.length)return{};if(1===r.length)return r[0];let t={},e={};for(let o of r)for(let n in o)n.startsWith("on")&&"function"==typeof o[n]?(null!=e[n]||(e[n]=[]),e[n].push(o[n])):t[n]=o[n];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(e).map((o=>[o,void 0]))));for(let o in e)Object.assign(t,{[o](n,...l){let s=e[o];for(let u of s){if((n instanceof Event||(null==n?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;u(n,...l)}}});return t}function C(r){var t;return Object.assign((0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(r),{displayName:null!=(t=r.displayName)?t:r.name})}function F(r){let t=Object.assign({},r);for(let e in t)void 0===t[e]&&delete t[e];return t}function m(r,t=[]){let e=Object.assign({},r);for(let a of t)a in e&&delete e[a];return e}},"./node_modules/@headlessui/react/dist/utils/ssr.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{s:()=>e});const e="undefined"==typeof window||"undefined"==typeof document},"./src/components/ExportHistoryButton/ExportHistoryButton.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AlignLeft:()=>AlignLeft,Default:()=>Default,WithCustomCSSClass:()=>WithCustomCSSClass,WithCustomIcon:()=>WithCustomIcon,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _ExportHistoryButton__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ExportHistoryButton/ExportHistoryButton.tsx"),_mocks_data__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/mocks/data.ts"),_icons_Download__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Download.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const __WEBPACK_DEFAULT_EXPORT__={title:"Export History Button",component:_ExportHistoryButton__WEBPACK_IMPORTED_MODULE_1__.Z,argTypes:{memori:{control:{type:"object"}},icon:{control:{type:"object"}}},parameters:{controls:{expanded:!0}}},Template=args=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{style:{textAlign:"right"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ExportHistoryButton__WEBPACK_IMPORTED_MODULE_1__.Z,{...args})});Template.displayName="Template";const TemplateRight=args=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{style:{textAlign:"left"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ExportHistoryButton__WEBPACK_IMPORTED_MODULE_1__.Z,{...args})});TemplateRight.displayName="TemplateRight";const Default=Template.bind({});Default.args={memori:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.jF,history:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.m8};const WithCustomIcon=Template.bind({});WithCustomIcon.args={memori:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.jF,history:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.m8,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Download__WEBPACK_IMPORTED_MODULE_3__.default,{})};const WithCustomCSSClass=Template.bind({});WithCustomCSSClass.args={memori:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.jF,history:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.m8,buttonClassName:"memori-button--primary"};const AlignLeft=TemplateRight.bind({});AlignLeft.args={memori:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.jF,history:_mocks_data__WEBPACK_IMPORTED_MODULE_2__.m8,align:"left"},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args =>
\n \n
",...Default.parameters?.docs?.source}}},WithCustomIcon.parameters={...WithCustomIcon.parameters,docs:{...WithCustomIcon.parameters?.docs,source:{originalSource:"args =>
\n \n
",...WithCustomIcon.parameters?.docs?.source}}},WithCustomCSSClass.parameters={...WithCustomCSSClass.parameters,docs:{...WithCustomCSSClass.parameters?.docs,source:{originalSource:"args =>
\n \n
",...WithCustomCSSClass.parameters?.docs?.source}}},AlignLeft.parameters={...AlignLeft.parameters,docs:{...AlignLeft.parameters?.docs,source:{originalSource:"args =>
\n \n
",...AlignLeft.parameters?.docs?.source}}};const __namedExportsOrder=["Default","WithCustomIcon","WithCustomCSSClass","AlignLeft"]},"./src/components/ExportHistoryButton/ExportHistoryButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_i18next__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/popover/popover.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Message__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Message.tsx"),classnames__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ExportHistoryButton=({history,memori,className,buttonClassName,icon,disabled=!1,align="right",filename})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_5__.$)(),text=`${t("write_and_speak.conversationStartedLabel")} ${new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date)}\n\n`.concat(history.map((m=>`${m.fromUser?"YOU":memori.name}: ${m.text}`)).join("\n"));return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J,{title:t("write_and_speak.exportChatHistoryMessage"),className:classnames__WEBPACK_IMPORTED_MODULE_3___default()("memori-export-history-button",className,{"memori-export-history-button--align-left":"left"===align}),children:({close})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J.Button,{disabled,className:classnames__WEBPACK_IMPORTED_MODULE_3___default()("memori-button","memori-button--circle","memori-button--icon-only",buttonClassName,{"memori-button--disabled":disabled,"memori-button--primary":!disabled}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"memori-button--icon",children:icon||(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Message__WEBPACK_IMPORTED_MODULE_2__.default,{})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.J.Panel,{className:"memori-export-history-button--panel",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p",{children:t("write_and_speak.exportChatHistory")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{primary:!0,onClick:()=>((text,filename="export-chat.txt")=>{const data=new Blob([text],{type:"text/plain"}),url=URL.createObjectURL(data),element=document.createElement("a");element.setAttribute("href",url),element.setAttribute("download",filename),element.style.display="none",document.body.appendChild(element),element.click(),document.body.removeChild(element)})(text,filename||`${memori.name.replace(/\W+/g,"-")}-export-chat.txt`),children:t("yes")||"Yes"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{onClick:()=>close(),children:t("no")||"No"})]})]})})};ExportHistoryButton.displayName="ExportHistoryButton";const __WEBPACK_DEFAULT_EXPORT__=ExportHistoryButton;try{ExportHistoryButton.displayName="ExportHistoryButton",ExportHistoryButton.__docgenInfo={description:"",displayName:"ExportHistoryButton",props:{history:{defaultValue:null,description:"",name:"history",required:!0,type:{name:"Message[]"}},memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},buttonClassName:{defaultValue:null,description:"",name:"buttonClassName",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},filename:{defaultValue:null,description:"",name:"filename",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ExportHistoryButton/ExportHistoryButton.tsx#ExportHistoryButton"]={docgenInfo:ExportHistoryButton.__docgenInfo,name:"ExportHistoryButton",path:"src/components/ExportHistoryButton/ExportHistoryButton.tsx#ExportHistoryButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Download.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Download=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})});Download.displayName="Download";const __WEBPACK_DEFAULT_EXPORT__=Download;try{Download.displayName="Download",Download.__docgenInfo={description:"",displayName:"Download",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Download.tsx#Download"]={docgenInfo:Download.__docgenInfo,name:"Download",path:"src/components/icons/Download.tsx#Download"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Message.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Message=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"})});Message.displayName="Message";const __WEBPACK_DEFAULT_EXPORT__=Message;try{Message.displayName="Message",Message.__docgenInfo={description:"",displayName:"Message",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Message.tsx#Message"]={docgenInfo:Message.__docgenInfo,name:"Message",path:"src/components/icons/Message.tsx#Message"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={adminCount:3,config:{feedbackURL:"https://form.asana.com/?k=XC7S3JWQeIhnjipBuA3gbw&d=1199599736247413",name:"TwinCreator",requirePosition:!1,showNewUser:!0},creationTimestamp:"2023-05-31T14:32:48.885287Z",description:"TwinCreator",disableRegistration:!1,id:"app.twincreator.com",lastChangeTimestamp:"2023-05-31T14:32:48.885287Z",logoURL:"https://app.twincreator.com/images/twincreator/logo.png",maxAdmins:0,maxCompletions:0,maxCompletionsPerUser:0,maxFreeSessions:400,maxFreeSessionsPerUser:100,maxMemoriPerAdmin:0,maxMemoriPerUser:3,maxTotalMemori:0,maxUsers:0,memoriCount:0,name:"app.twincreator.com",nonFreeSessionCost:.02,paying:!0,tenantID:"96caa4b4-31a4-48e5-8163-dec61869a2a7",theme:"twincreator",userCount:0,usersCanAccessAPI:!1,usersCanCreateMemori:!1,usersCanEditDynamicIntents:!1,usersCanEditIntegrations:!1,usersCanEditMemoriChaining:!1,usersCanRunSnippets:!1},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}},"./node_modules/classnames/index.js":(module,exports)=>{var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";var hasOwn={}.hasOwnProperty;function classNames(){for(var classes=[],i=0;i{"use strict";__webpack_require__.d(__webpack_exports__,{OO:()=>I18nContext,zv:()=>ReportNamespaces,JP:()=>getDefaults,nI:()=>getI18n,Db:()=>initReactI18next});var classCallCheck=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"),createClass=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/createClass.js"),defineProperty=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),react=__webpack_require__("./node_modules/react/index.js"),matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},unescapeHtmlEntity=function unescapeHtmlEntity(m){return htmlEntities[m]};function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i0&&void 0!==arguments[0]?arguments[0]:{};defaultOptions=_objectSpread(_objectSpread({},defaultOptions),options)}(instance.options.react),function setI18n(instance){i18nInstance=instance}(instance)}}},"./node_modules/react-i18next/dist/es/useTranslation.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{$:()=>useTranslation});var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js"),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/index.js"),_context__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-i18next/dist/es/context.js"),_utils__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react-i18next/dist/es/utils.js");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1&&void 0!==arguments[1]?arguments[1]:{},i18nFromProps=props.i18n,_ref=(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_context__WEBPACK_IMPORTED_MODULE_2__.OO)||{},i18nFromContext=_ref.i18n,defaultNSFromContext=_ref.defaultNS,i18n=i18nFromProps||i18nFromContext||(0,_context__WEBPACK_IMPORTED_MODULE_2__.nI)();if(i18n&&!i18n.reportNamespaces&&(i18n.reportNamespaces=new _context__WEBPACK_IMPORTED_MODULE_2__.zv),!i18n){(0,_utils__WEBPACK_IMPORTED_MODULE_3__.O4)("You will need to pass in an i18next instance by using initReactI18next");var notReadyT=function notReadyT(k){return Array.isArray(k)?k[k.length-1]:k},retNotReady=[notReadyT,{},!1];return retNotReady.t=notReadyT,retNotReady.i18n={},retNotReady.ready=!1,retNotReady}i18n.options.react&&void 0!==i18n.options.react.wait&&(0,_utils__WEBPACK_IMPORTED_MODULE_3__.O4)("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var i18nOptions=_objectSpread(_objectSpread(_objectSpread({},(0,_context__WEBPACK_IMPORTED_MODULE_2__.JP)()),i18n.options.react),props),useSuspense=i18nOptions.useSuspense,keyPrefix=i18nOptions.keyPrefix,namespaces=ns||defaultNSFromContext||i18n.options&&i18n.options.defaultNS;namespaces="string"==typeof namespaces?[namespaces]:namespaces||["translation"],i18n.reportNamespaces.addUsedNamespaces&&i18n.reportNamespaces.addUsedNamespaces(namespaces);var ready=(i18n.isInitialized||i18n.initializedStoreOnce)&&namespaces.every((function(n){return(0,_utils__WEBPACK_IMPORTED_MODULE_3__.F0)(n,i18n,i18nOptions)}));function getT(){return i18n.getFixedT(null,"fallback"===i18nOptions.nsMode?namespaces:namespaces[0],keyPrefix)}var _useState=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(getT),_useState2=(0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_4__.Z)(_useState,2),t=_useState2[0],setT=_useState2[1],joinedNS=namespaces.join(),previousJoinedNS=usePrevious(joinedNS),isMounted=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!0);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((function(){var bindI18n=i18nOptions.bindI18n,bindI18nStore=i18nOptions.bindI18nStore;function boundReset(){isMounted.current&&setT(getT)}return isMounted.current=!0,ready||useSuspense||(0,_utils__WEBPACK_IMPORTED_MODULE_3__.DC)(i18n,namespaces,(function(){isMounted.current&&setT(getT)})),ready&&previousJoinedNS&&previousJoinedNS!==joinedNS&&isMounted.current&&setT(getT),bindI18n&&i18n&&i18n.on(bindI18n,boundReset),bindI18nStore&&i18n&&i18n.store.on(bindI18nStore,boundReset),function(){isMounted.current=!1,bindI18n&&i18n&&bindI18n.split(" ").forEach((function(e){return i18n.off(e,boundReset)})),bindI18nStore&&i18n&&bindI18nStore.split(" ").forEach((function(e){return i18n.store.off(e,boundReset)}))}}),[i18n,joinedNS]);var isInitial=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!0);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)((function(){isMounted.current&&!isInitial.current&&setT(getT),isInitial.current=!1}),[i18n,keyPrefix]);var ret=[t,i18n,ready];if(ret.t=t,ret.i18n=i18n,ret.ready=ready,ready)return ret;if(!ready&&!useSuspense)return ret;throw new Promise((function(resolve){(0,_utils__WEBPACK_IMPORTED_MODULE_3__.DC)(i18n,namespaces,(function(){resolve()}))}))}},"./node_modules/react-i18next/dist/es/utils.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function warn(){if(console&&console.warn){for(var _console,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];"string"==typeof args[0]&&(args[0]="react-i18next:: ".concat(args[0])),(_console=console).warn.apply(_console,args)}}__webpack_require__.d(__webpack_exports__,{DC:()=>loadNamespaces,F0:()=>hasLoadedNamespace,Gf:()=>getDisplayName,O4:()=>warnOnce});var alreadyWarned={};function warnOnce(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];"string"==typeof args[0]&&alreadyWarned[args[0]]||("string"==typeof args[0]&&(alreadyWarned[args[0]]=new Date),warn.apply(void 0,args))}function loadNamespaces(i18n,ns,cb){i18n.loadNamespaces(ns,(function(){if(i18n.isInitialized)cb();else{i18n.on("initialized",(function initialized(){setTimeout((function(){i18n.off("initialized",initialized)}),0),cb()}))}}))}function hasLoadedNamespace(ns,i18n){var options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i18n.languages&&i18n.languages.length?void 0!==i18n.options.ignoreJSONStructure?i18n.hasLoadedNamespace(ns,{precheck:function precheck(i18nInstance,loadNotPending){if(options.bindI18n&&options.bindI18n.indexOf("languageChanging")>-1&&i18nInstance.services.backendConnector.backend&&i18nInstance.isLanguageChangingTo&&!loadNotPending(i18nInstance.isLanguageChangingTo,ns))return!1}}):function oldI18nextHasLoadedNamespace(ns,i18n){var options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},lng=i18n.languages[0],fallbackLng=!!i18n.options&&i18n.options.fallbackLng,lastLng=i18n.languages[i18n.languages.length-1];if("cimode"===lng.toLowerCase())return!0;var loadNotPending=function loadNotPending(l,n){var loadState=i18n.services.backendConnector.state["".concat(l,"|").concat(n)];return-1===loadState||2===loadState};return!(options.bindI18n&&options.bindI18n.indexOf("languageChanging")>-1&&i18n.services.backendConnector.backend&&i18n.isLanguageChangingTo&&!loadNotPending(i18n.isLanguageChangingTo,ns)||!i18n.hasResourceBundle(lng,ns)&&i18n.services.backendConnector.backend&&(!i18n.options.resources||i18n.options.partialBundledLanguages)&&(!loadNotPending(lng,ns)||fallbackLng&&!loadNotPending(lastLng,ns)))}(ns,i18n,options):(warnOnce("i18n.languages were undefined or empty",i18n.languages),!0)}function getDisplayName(Component){return Component.displayName||Component.name||("string"==typeof Component&&Component.length>0?Component:"Unknown")}},"./node_modules/react/cjs/react-jsx-runtime.production.min.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";var f=__webpack_require__("./node_modules/react/index.js"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(c,a,g){var b,d={},e=null,h=null;for(b in void 0!==g&&(e=""+g),void 0!==a.key&&(e=""+a.key),void 0!==a.ref&&(h=a.ref),a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l,exports.jsx=q,exports.jsxs=q},"./node_modules/react/jsx-runtime.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";module.exports=__webpack_require__("./node_modules/react/cjs/react-jsx-runtime.production.min.js")}}]); \ No newline at end of file diff --git a/components-ExportHistoryButton-ExportHistoryButton-stories.7dccbd22.iframe.bundle.js.LICENSE.txt b/components-ExportHistoryButton-ExportHistoryButton-stories.cfb189b7.iframe.bundle.js.LICENSE.txt similarity index 100% rename from components-ExportHistoryButton-ExportHistoryButton-stories.7dccbd22.iframe.bundle.js.LICENSE.txt rename to components-ExportHistoryButton-ExportHistoryButton-stories.cfb189b7.iframe.bundle.js.LICENSE.txt diff --git a/components-FeedbackButtons-FeedbackButtons-stories.d8b63a2d.iframe.bundle.js b/components-FeedbackButtons-FeedbackButtons-stories.9a058457.iframe.bundle.js similarity index 89% rename from components-FeedbackButtons-FeedbackButtons-stories.d8b63a2d.iframe.bundle.js rename to components-FeedbackButtons-FeedbackButtons-stories.9a058457.iframe.bundle.js index 82e62662..5579a8c0 100644 --- a/components-FeedbackButtons-FeedbackButtons-stories.d8b63a2d.iframe.bundle.js +++ b/components-FeedbackButtons-FeedbackButtons-stories.9a058457.iframe.bundle.js @@ -1,2 +1,2 @@ -/*! For license information please see components-FeedbackButtons-FeedbackButtons-stories.d8b63a2d.iframe.bundle.js.LICENSE.txt */ -(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[6149],{"./node_modules/@headlessui/react/dist/components/keyboard.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{R:()=>o});var r,o=((r=o||{}).Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r)},"./node_modules/@headlessui/react/dist/components/menu/menu.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{v:()=>qe});var n,o,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_utils_match_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),_utils_render_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/render.js"),_utils_disposables_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/disposables.js"),_hooks_use_disposables_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-disposables.js"),_hooks_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js"),_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-sync-refs.js"),_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-id.js"),_keyboard_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/@headlessui/react/dist/components/keyboard.js"),_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/calculate-active-index.js"),_utils_bugs_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/bugs.js"),_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/focus-management.js"),_hooks_use_outside_click_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-outside-click.js"),_hooks_use_tree_walker_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-tree-walker.js"),_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@headlessui/react/dist/internal/open-closed.js"),_hooks_use_resolve_button_type_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js"),_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-owner.js"),_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event.js"),ue=((o=ue||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),se=(o=>(o[o.Pointer=0]="Pointer",o[o.Other=1]="Other",o))(se||{}),le=((n=le||{})[n.OpenMenu=0]="OpenMenu",n[n.CloseMenu=1]="CloseMenu",n[n.GoToItem=2]="GoToItem",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterItem=5]="RegisterItem",n[n.UnregisterItem=6]="UnregisterItem",n);function k(t,i=(o=>o)){let o=null!==t.activeItemIndex?t.items[t.activeItemIndex]:null,e=(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.z2)(i(t.items.slice()),(u=>u.dataRef.current.domRef.current)),r=o?e.indexOf(o):null;return-1===r&&(r=null),{items:e,activeItemIndex:r}}let ce={1:t=>1===t.menuState?t:{...t,activeItemIndex:null,menuState:1},0:t=>0===t.menuState?t:{...t,menuState:0},2:(t,i)=>{var r;let o=k(t),e=(0,_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.d)(i,{resolveItems:()=>o.items,resolveActiveIndex:()=>o.activeItemIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...t,...o,searchQuery:"",activeItemIndex:e,activationTrigger:null!=(r=i.trigger)?r:1}},3:(t,i)=>{let e=""!==t.searchQuery?0:1,r=t.searchQuery+i.value.toLowerCase(),s=(null!==t.activeItemIndex?t.items.slice(t.activeItemIndex+e).concat(t.items.slice(0,t.activeItemIndex+e)):t.items).find((p=>{var c;return(null==(c=p.dataRef.current.textValue)?void 0:c.startsWith(r))&&!p.dataRef.current.disabled})),n=s?t.items.indexOf(s):-1;return-1===n||n===t.activeItemIndex?{...t,searchQuery:r}:{...t,searchQuery:r,activeItemIndex:n,activationTrigger:1}},4:t=>""===t.searchQuery?t:{...t,searchQuery:"",searchActiveItemIndex:null},5:(t,i)=>{let o=k(t,(e=>[...e,{id:i.id,dataRef:i.dataRef}]));return{...t,...o}},6:(t,i)=>{let o=k(t,(e=>{let r=e.findIndex((u=>u.id===i.id));return-1!==r&&e.splice(r,1),e}));return{...t,...o,activationTrigger:1}}},w=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);function C(t){let i=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(w);if(null===i){let o=new Error(`<${t} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,C),o}return i}function pe(t,i){return(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_3__.E)(i.type,ce,t,i)}w.displayName="MenuContext";let de=react__WEBPACK_IMPORTED_MODULE_0__.Fragment,me=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.yV)((function(i,o){let e=(0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)(pe,{menuState:1,buttonRef:(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)(),itemsRef:(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:r,itemsRef:u,buttonRef:s},n]=e,p=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_5__.T)(o);(0,_hooks_use_outside_click_js__WEBPACK_IMPORTED_MODULE_6__.O)([s,u],((A,M)=>{var l;n({type:1}),(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.sP)(M,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.tJ.Loose)||(A.preventDefault(),null==(l=s.current)||l.focus())}),0===r);let c=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{n({type:1})})),b=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===r,close:c})),[r,c]),m=i,g={ref:p};return react__WEBPACK_IMPORTED_MODULE_0__.createElement(w.Provider,{value:e},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__.up,{value:(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_3__.E)(r,{0:_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__.ZM.Open,1:_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__.ZM.Closed})},(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.sY)({ourProps:g,theirProps:m,slot:b,defaultTag:de,name:"Menu"})))})),Te=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.yV)((function(i,o){var M;let[e,r]=C("Menu.Button"),u=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_5__.T)(e.buttonRef,o),s=`headlessui-menu-button-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_9__.M)()}`,n=(0,_hooks_use_disposables_js__WEBPACK_IMPORTED_MODULE_10__.G)(),p=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((l=>{switch(l.key){case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Enter:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.ArrowDown:l.preventDefault(),l.stopPropagation(),r({type:0}),n.nextFrame((()=>r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.First})));break;case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.ArrowUp:l.preventDefault(),l.stopPropagation(),r({type:0}),n.nextFrame((()=>r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Last})))}})),c=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((l=>{if(l.key===_keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space)l.preventDefault()})),b=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((l=>{if((0,_utils_bugs_js__WEBPACK_IMPORTED_MODULE_12__.P)(l.currentTarget))return l.preventDefault();i.disabled||(0===e.menuState?(r({type:1}),n.nextFrame((()=>{var R;return null==(R=e.buttonRef.current)?void 0:R.focus({preventScroll:!0})}))):(l.preventDefault(),r({type:0})))})),m=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===e.menuState})),[e]),g=i,A={ref:u,id:s,type:(0,_hooks_use_resolve_button_type_js__WEBPACK_IMPORTED_MODULE_13__.f)(i,e.buttonRef),"aria-haspopup":!0,"aria-controls":null==(M=e.itemsRef.current)?void 0:M.id,"aria-expanded":i.disabled?void 0:0===e.menuState,onKeyDown:p,onKeyUp:c,onClick:b};return(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.sY)({ourProps:A,theirProps:g,slot:m,defaultTag:"button",name:"Menu.Button"})})),Ie=_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.AN.RenderStrategy|_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.AN.Static,ge=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.yV)((function(i,o){var R,S;let[e,r]=C("Menu.Items"),u=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_5__.T)(e.itemsRef,o),s=(0,_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_14__.i)(e.itemsRef),n=`headlessui-menu-items-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_9__.M)()}`,p=(0,_hooks_use_disposables_js__WEBPACK_IMPORTED_MODULE_10__.G)(),c=(0,_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__.oJ)(),b=null!==c?c===_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__.ZM.Open:0===e.menuState;(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{let a=e.itemsRef.current;!a||0===e.menuState&&a!==(null==s?void 0:s.activeElement)&&a.focus({preventScroll:!0})}),[e.menuState,e.itemsRef,s]),(0,_hooks_use_tree_walker_js__WEBPACK_IMPORTED_MODULE_15__.B)({container:e.itemsRef.current,enabled:0===e.menuState,accept:a=>"menuitem"===a.getAttribute("role")?NodeFilter.FILTER_REJECT:a.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(a){a.setAttribute("role","none")}});let m=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((a=>{var T,y;switch(p.dispose(),a.key){case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space:if(""!==e.searchQuery)return a.preventDefault(),a.stopPropagation(),r({type:3,value:a.key});case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Enter:if(a.preventDefault(),a.stopPropagation(),r({type:1}),null!==e.activeItemIndex){let{dataRef:v}=e.items[e.activeItemIndex];null==(y=null==(T=v.current)?void 0:T.domRef.current)||y.click()}(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.wI)(e.buttonRef.current);break;case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.ArrowDown:return a.preventDefault(),a.stopPropagation(),r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Next});case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.ArrowUp:return a.preventDefault(),a.stopPropagation(),r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Previous});case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Home:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.PageUp:return a.preventDefault(),a.stopPropagation(),r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.First});case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.End:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.PageDown:return a.preventDefault(),a.stopPropagation(),r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Last});case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Escape:a.preventDefault(),a.stopPropagation(),r({type:1}),(0,_utils_disposables_js__WEBPACK_IMPORTED_MODULE_16__.k)().nextFrame((()=>{var v;return null==(v=e.buttonRef.current)?void 0:v.focus({preventScroll:!0})}));break;case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Tab:a.preventDefault(),a.stopPropagation(),r({type:1}),(0,_utils_disposables_js__WEBPACK_IMPORTED_MODULE_16__.k)().nextFrame((()=>{(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.EO)(e.buttonRef.current,a.shiftKey?_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.TO.Previous:_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.TO.Next)}));break;default:1===a.key.length&&(r({type:3,value:a.key}),p.setTimeout((()=>r({type:4})),350))}})),g=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((a=>{if(a.key===_keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space)a.preventDefault()})),A=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===e.menuState})),[e]),M=i,l={"aria-activedescendant":null===e.activeItemIndex||null==(R=e.items[e.activeItemIndex])?void 0:R.id,"aria-labelledby":null==(S=e.buttonRef.current)?void 0:S.id,id:n,onKeyDown:m,onKeyUp:g,role:"menu",tabIndex:0,ref:u};return(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.sY)({ourProps:l,theirProps:M,slot:A,defaultTag:"div",features:Ie,visible:b,name:"Menu.Items"})})),Me=react__WEBPACK_IMPORTED_MODULE_0__.Fragment,Re=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.yV)((function(i,o){let{disabled:e=!1,...r}=i,[u,s]=C("Menu.Item"),n=`headlessui-menu-item-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_9__.M)()}`,p=null!==u.activeItemIndex&&u.items[u.activeItemIndex].id===n,c=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),b=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_5__.T)(o,c);(0,_hooks_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_17__.e)((()=>{if(0!==u.menuState||!p||0===u.activationTrigger)return;let T=(0,_utils_disposables_js__WEBPACK_IMPORTED_MODULE_16__.k)();return T.requestAnimationFrame((()=>{var y,v;null==(v=null==(y=c.current)?void 0:y.scrollIntoView)||v.call(y,{block:"nearest"})})),T.dispose}),[c,p,u.menuState,u.activationTrigger,u.activeItemIndex]);let m=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({disabled:e,domRef:c});(0,_hooks_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_17__.e)((()=>{m.current.disabled=e}),[m,e]),(0,_hooks_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_17__.e)((()=>{var T,y;m.current.textValue=null==(y=null==(T=c.current)?void 0:T.textContent)?void 0:y.toLowerCase()}),[m,c]),(0,_hooks_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_17__.e)((()=>(s({type:5,id:n,dataRef:m}),()=>s({type:6,id:n}))),[m,n]);let g=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{s({type:1})})),A=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((T=>{if(e)return T.preventDefault();s({type:1}),(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.wI)(u.buttonRef.current)})),M=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{if(e)return s({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Nothing});s({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Specific,id:n})})),l=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{e||p||s({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Specific,id:n,trigger:0})})),R=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{e||!p||s({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Nothing})})),S=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({active:p,disabled:e,close:g})),[p,e,g]);return(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.sY)({ourProps:{id:n,ref:b,role:"menuitem",tabIndex:!0===e?void 0:-1,"aria-disabled":!0===e||void 0,disabled:void 0,onClick:A,onFocus:M,onPointerMove:l,onMouseMove:l,onPointerLeave:R,onMouseLeave:R},theirProps:r,slot:S,defaultTag:Me,name:"Menu.Item"})})),qe=Object.assign(me,{Button:Te,Items:ge,Item:Re})},"./node_modules/@headlessui/react/dist/components/transitions/transition.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{u:()=>We});var react=__webpack_require__("./node_modules/react/index.js"),render=__webpack_require__("./node_modules/@headlessui/react/dist/utils/render.js"),open_closed=__webpack_require__("./node_modules/@headlessui/react/dist/internal/open-closed.js"),match=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),use_is_mounted=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-is-mounted.js"),use_iso_morphic_effect=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js"),use_latest_value=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js"),use_server_handoff_complete=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js"),use_sync_refs=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-sync-refs.js");var disposables=__webpack_require__("./node_modules/@headlessui/react/dist/utils/disposables.js");function f(t,...e){t&&e.length>0&&t.classList.add(...e)}function v(t,...e){t&&e.length>0&&t.classList.remove(...e)}var n,T=((n=T||{}).Ended="ended",n.Cancelled="cancelled",n);function C(t,e,n,d){let o=n?"enter":"leave",s=(0,disposables.k)(),u=void 0!==d?function l(r){let e={called:!1};return(...t)=>{if(!e.called)return e.called=!0,r(...t)}}(d):()=>{};"enter"===o&&(t.removeAttribute("hidden"),t.style.display="");let m=(0,match.E)(o,{enter:()=>e.enter,leave:()=>e.leave}),i=(0,match.E)(o,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),a=(0,match.E)(o,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return v(t,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),f(t,...m,...a),s.nextFrame((()=>{v(t,...a),f(t,...i),function c(t,e){let n=(0,disposables.k)();if(!t)return n.dispose;let{transitionDuration:d,transitionDelay:o}=getComputedStyle(t),[s,u]=[d,o].map((i=>{let[a=0]=i.split(",").filter(Boolean).map((r=>r.includes("ms")?parseFloat(r):1e3*parseFloat(r))).sort(((r,l)=>l-r));return a}));if(s+u!==0){let i=[];i.push(n.addEventListener(t,"transitionrun",(a=>{a.target===a.currentTarget&&(i.splice(0).forEach((r=>r())),i.push(n.addEventListener(t,"transitionend",(r=>{r.target===r.currentTarget&&(e("ended"),i.splice(0).forEach((l=>l())))})),n.addEventListener(t,"transitioncancel",(r=>{r.target===r.currentTarget&&(e("cancelled"),i.splice(0).forEach((l=>l())))}))))})))}else e("ended");return n.add((()=>e("cancelled"))),n.dispose}(t,(r=>("ended"===r&&(v(t,...m),f(t,...e.entered)),u(r))))})),s.dispose}var use_disposables=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-disposables.js");var use_event=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event.js");function x(r=""){return r.split(" ").filter((e=>e.trim().length>1))}let F=(0,react.createContext)(null);F.displayName="TransitionContext";var s,ve=((s=ve||{}).Visible="visible",s.Hidden="hidden",s);let M=(0,react.createContext)(null);function transition_I(r){return"children"in r?transition_I(r.children):r.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function ee(r,e){let s=(0,use_latest_value.E)(r),n=(0,react.useRef)([]),m=(0,use_is_mounted.t)(),D=(0,use_disposables.G)(),b=(0,use_event.z)(((l,i=render.l4.Hidden)=>{let t=n.current.findIndex((({el:o})=>o===l));-1!==t&&((0,match.E)(i,{[render.l4.Unmount](){n.current.splice(t,1)},[render.l4.Hidden](){n.current[t].state="hidden"}}),D.microTask((()=>{var o;!transition_I(n)&&m.current&&(null==(o=s.current)||o.call(s))})))})),E=(0,use_event.z)((l=>{let i=n.current.find((({el:t})=>t===l));return i?"visible"!==i.state&&(i.state="visible"):n.current.push({el:l,state:"visible"}),()=>b(l,render.l4.Unmount)})),S=(0,react.useRef)([]),u=(0,react.useRef)(Promise.resolve()),p=(0,react.useRef)({enter:[],leave:[],idle:[]}),d=(0,use_event.z)(((l,i,t)=>{S.current.splice(0),e&&(e.chains.current[i]=e.chains.current[i].filter((([o])=>o!==l))),null==e||e.chains.current[i].push([l,new Promise((o=>{S.current.push(o)}))]),null==e||e.chains.current[i].push([l,new Promise((o=>{Promise.all(p.current[i].map((([f,a])=>a))).then((()=>o()))}))]),"enter"===i?u.current=u.current.then((()=>null==e?void 0:e.wait.current)).then((()=>t(i))):t(i)})),h=(0,use_event.z)(((l,i,t)=>{Promise.all(p.current[i].splice(0).map((([o,f])=>f))).then((()=>{var o;null==(o=S.current.shift())||o()})).then((()=>t(i)))}));return(0,react.useMemo)((()=>({children:n,register:E,unregister:b,onStart:d,onStop:h,wait:u,chains:p})),[E,b,n,d,h,p,u])}function be(){}M.displayName="NestingContext";let Ee=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function te(r){var s;let e={};for(let n of Ee)e[n]=null!=(s=r[n])?s:be;return e}let ne=render.AN.RenderStrategy,re=(0,render.yV)((function(e,s){let{beforeEnter:n,afterEnter:m,beforeLeave:D,afterLeave:b,enter:E,enterFrom:S,enterTo:u,entered:p,leave:d,leaveFrom:h,leaveTo:l,...i}=e,t=(0,react.useRef)(null),o=(0,use_sync_refs.T)(t,s),f=i.unmount?render.l4.Unmount:render.l4.Hidden,{show:a,appear:P,initial:ie}=function Ce(){let r=(0,react.useContext)(F);if(null===r)throw new Error("A is used but it is missing a parent or .");return r}(),[v,_]=(0,react.useState)(a?"visible":"hidden"),z=function ge(){let r=(0,react.useContext)(M);if(null===r)throw new Error("A is used but it is missing a parent or .");return r}(),{register:N,unregister:V}=z,j=(0,react.useRef)(null);(0,react.useEffect)((()=>N(t)),[N,t]),(0,react.useEffect)((()=>{if(f===render.l4.Hidden&&t.current)return a&&"visible"!==v?void _("visible"):(0,match.E)(v,{hidden:()=>V(t),visible:()=>N(t)})}),[v,t,N,V,a,f]);let oe=(0,use_latest_value.E)({enter:x(E),enterFrom:x(S),enterTo:x(u),entered:x(p),leave:x(d),leaveFrom:x(h),leaveTo:x(l)}),L=function Se(r){let e=(0,react.useRef)(te(r));return(0,react.useEffect)((()=>{e.current=te(r)}),[r]),e}({beforeEnter:n,afterEnter:m,beforeLeave:D,afterLeave:b}),U=(0,use_server_handoff_complete.H)();(0,react.useEffect)((()=>{if(U&&"visible"===v&&null===t.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[t,v,U]);let k=ie&&!P,se=!U||k||j.current===a?"idle":a?"enter":"leave",le=(0,use_event.z)((C=>(0,match.E)(C,{enter:()=>L.current.beforeEnter(),leave:()=>L.current.beforeLeave(),idle:()=>{}}))),ae=(0,use_event.z)((C=>(0,match.E)(C,{enter:()=>L.current.afterEnter(),leave:()=>L.current.afterLeave(),idle:()=>{}}))),w=ee((()=>{_("hidden"),V(t)}),z);(function I({container:o,direction:t,classes:s,onStart:a,onStop:u}){let c=(0,use_is_mounted.t)(),d=(0,use_disposables.G)(),r=(0,use_latest_value.E)(t);(0,use_iso_morphic_effect.e)((()=>{let e=(0,disposables.k)();d.add(e.dispose);let n=o.current;if(n&&"idle"!==r.current&&c.current)return e.dispose(),a.current(r.current),e.add(C(n,s.current,"enter"===r.current,(l=>{e.dispose(),(0,match.E)(l,{[T.Ended](){u.current(r.current)},[T.Cancelled]:()=>{}})}))),e.dispose}),[t])})({container:t,classes:oe,direction:se,onStart:(0,use_latest_value.E)((C=>{w.onStart(t,C,le)})),onStop:(0,use_latest_value.E)((C=>{w.onStop(t,C,ae),"leave"===C&&!transition_I(w)&&(_("hidden"),V(t))}))}),(0,react.useEffect)((()=>{!k||(f===render.l4.Hidden?j.current=null:j.current=a)}),[a,k,v]);let ue=i,de={ref:o};return react.createElement(M.Provider,{value:w},react.createElement(open_closed.up,{value:(0,match.E)(v,{visible:open_closed.ZM.Open,hidden:open_closed.ZM.Closed})},(0,render.sY)({ourProps:de,theirProps:ue,defaultTag:"div",features:ne,visible:"visible"===v,name:"Transition.Child"})))})),q=(0,render.yV)((function(e,s){let{show:n,appear:m=!1,unmount:D,...b}=e,E=(0,react.useRef)(null),S=(0,use_sync_refs.T)(E,s);(0,use_server_handoff_complete.H)();let u=(0,open_closed.oJ)();if(void 0===n&&null!==u&&(n=(0,match.E)(u,{[open_closed.ZM.Open]:!0,[open_closed.ZM.Closed]:!1})),![!0,!1].includes(n))throw new Error("A is used but it is missing a `show={true | false}` prop.");let[p,d]=(0,react.useState)(n?"visible":"hidden"),h=ee((()=>{d("hidden")})),[l,i]=(0,react.useState)(!0),t=(0,react.useRef)([n]);(0,use_iso_morphic_effect.e)((()=>{!1!==l&&t.current[t.current.length-1]!==n&&(t.current.push(n),i(!1))}),[t,n]);let o=(0,react.useMemo)((()=>({show:n,appear:m,initial:l})),[n,m,l]);(0,react.useEffect)((()=>{if(n)d("visible");else if(transition_I(h)){let a=E.current;if(!a)return;let P=a.getBoundingClientRect();0===P.x&&0===P.y&&0===P.width&&0===P.height&&d("hidden")}else d("hidden")}),[n,h]);let f={unmount:D};return react.createElement(M.Provider,{value:h},react.createElement(F.Provider,{value:o},(0,render.sY)({ourProps:{...f,as:react.Fragment,children:react.createElement(re,{ref:S,...f,...b})},theirProps:{},defaultTag:react.Fragment,features:ne,visible:"visible"===p,name:"Transition"})))})),Pe=(0,render.yV)((function(e,s){let n=null!==(0,react.useContext)(F),m=null!==(0,open_closed.oJ)();return react.createElement(react.Fragment,null,!n&&m?react.createElement(q,{ref:s,...e}):react.createElement(re,{ref:s,...e}))})),We=Object.assign(q,{Child:Pe,Root:q})},"./node_modules/@headlessui/react/dist/hooks/use-disposables.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{G:()=>p});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_utils_disposables_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/disposables.js");function p(){let[e]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_utils_disposables_js__WEBPACK_IMPORTED_MODULE_1__.k);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>()=>e.dispose()),[e]),e}},"./node_modules/@headlessui/react/dist/hooks/use-event.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{z:()=>o});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");let o=function(t){let e=(0,_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__.E)(t);return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(((...r)=>e.current(...r)),[e])}},"./node_modules/@headlessui/react/dist/hooks/use-id.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{M:()=>I});var u,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js"),_use_server_handoff_complete_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js");let l=0;function r(){return++l}let I=null!=(u=react__WEBPACK_IMPORTED_MODULE_0__.useId)?u:function(){let n=(0,_use_server_handoff_complete_js__WEBPACK_IMPORTED_MODULE_1__.H)(),[e,o]=react__WEBPACK_IMPORTED_MODULE_0__.useState(n?r:null);return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_2__.e)((()=>{null===e&&o(r())}),[e]),null!=e?""+e:void 0}},"./node_modules/@headlessui/react/dist/hooks/use-is-mounted.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{t:()=>f});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js");function f(){let e=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(!1);return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}},"./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{e:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let s=__webpack_require__("./node_modules/@headlessui/react/dist/utils/ssr.js").s?react__WEBPACK_IMPORTED_MODULE_0__.useEffect:react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect},"./node_modules/@headlessui/react/dist/hooks/use-latest-value.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{E:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js");function s(e){let r=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(e);return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{r.current=e}),[e]),r}},"./node_modules/@headlessui/react/dist/hooks/use-outside-click.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{O:()=>L});var react=__webpack_require__("./node_modules/react/index.js"),focus_management=__webpack_require__("./node_modules/@headlessui/react/dist/utils/focus-management.js"),use_latest_value=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");function d(e,r,n){let o=(0,use_latest_value.E)(r);(0,react.useEffect)((()=>{function t(u){o.current(u)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}function L(E,m,c=!0){let i=(0,react.useRef)(!1);function f(e,o){if(!i.current||e.defaultPrevented)return;let l=function r(t){return"function"==typeof t?r(t()):Array.isArray(t)||t instanceof Set?t:[t]}(E),n=o(e);if(null!==n&&n.getRootNode().contains(n)){for(let r of l){if(null===r)continue;let t=r instanceof HTMLElement?r:r.current;if(null!=t&&t.contains(n))return}return!(0,focus_management.sP)(n,focus_management.tJ.Loose)&&-1!==n.tabIndex&&e.preventDefault(),m(e,n)}}(0,react.useEffect)((()=>{requestAnimationFrame((()=>{i.current=c}))}),[c]);let u=(0,react.useRef)(null);d("mousedown",(e=>{var o,l;i.current&&(u.current=(null==(l=null==(o=e.composedPath)?void 0:o.call(e))?void 0:l[0])||e.target)}),!0),d("click",(e=>{!u.current||(f(e,(()=>u.current)),u.current=null)}),!0),d("blur",(e=>f(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}},"./node_modules/@headlessui/react/dist/hooks/use-owner.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{i:()=>n});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_utils_owner_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js");function n(...e){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>(0,_utils_owner_js__WEBPACK_IMPORTED_MODULE_1__.r)(...e)),[...e])}},"./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{f:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js");function i(t){var n;if(t.type)return t.type;let e=null!=(n=t.as)?n:"button";return"string"==typeof e&&"button"===e.toLowerCase()?"button":void 0}function s(t,e){let[n,u]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((()=>i(t)));return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{u(i(t))}),[t.type,t.as]),(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{n||!e.current||e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&u("button")}),[n,e]),n}},"./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{H:()=>a});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let r={serverHandoffComplete:!1};function a(){let[e,f]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(r.serverHandoffComplete);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{!0!==e&&f(!0)}),[e]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{!1===r.serverHandoffComplete&&(r.serverHandoffComplete=!0)}),[]),e}},"./node_modules/@headlessui/react/dist/hooks/use-sync-refs.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{T:()=>y,h:()=>T});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_event_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event.js");let u=Symbol();function T(t,n=!0){return Object.assign(t,{[u]:n})}function y(...t){let n=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(t);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{n.current=t}),[t]);let c=(0,_use_event_js__WEBPACK_IMPORTED_MODULE_1__.z)((e=>{for(let o of n.current)null!=o&&("function"==typeof o?o(e):o.current=e)}));return t.every((e=>null==e||(null==e?void 0:e[u])))?void 0:c}},"./node_modules/@headlessui/react/dist/hooks/use-tree-walker.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{B:()=>F});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js"),_utils_owner_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js");function F({container:e,accept:t,walk:r,enabled:c=!0}){let o=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(t),l=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(r);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{o.current=t,l.current=r}),[t,r]),(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{if(!e||!c)return;let n=(0,_utils_owner_js__WEBPACK_IMPORTED_MODULE_2__.r)(e);if(!n)return;let f=o.current,p=l.current,d=Object.assign((i=>f(i)),{acceptNode:f}),u=n.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,d,!1);for(;u.nextNode();)p(u.currentNode)}),[e,c,o,l])}},"./node_modules/@headlessui/react/dist/internal/open-closed.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{ZM:()=>p,oJ:()=>s,up:()=>C});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let o=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);o.displayName="OpenClosedContext";var e,p=((e=p||{})[e.Open=0]="Open",e[e.Closed=1]="Closed",e);function s(){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(o)}function C({value:t,children:n}){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(o.Provider,{value:t},n)}},"./node_modules/@headlessui/react/dist/utils/bugs.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function r(n){let e=n.parentElement,l=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(l=e),e=e.parentElement;let t=""===(null==e?void 0:e.getAttribute("disabled"));return(!t||!function i(n){if(!n)return!1;let e=n.previousElementSibling;for(;null!==e;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}(l))&&t}__webpack_require__.d(__webpack_exports__,{P:()=>r})},"./node_modules/@headlessui/react/dist/utils/calculate-active-index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{T:()=>a,d:()=>x});var e,a=((e=a||{})[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e);function x(r,n){let t=n.resolveItems();if(t.length<=0)return null;let l=n.resolveActiveIndex(),s=null!=l?l:-1,d=(()=>{switch(r.focus){case 0:return t.findIndex((e=>!n.resolveDisabled(e)));case 1:{let e=t.slice().reverse().findIndex(((i,c,u)=>!(-1!==s&&u.length-c-1>=s)&&!n.resolveDisabled(i)));return-1===e?e:t.length-1-e}case 2:return t.findIndex(((e,i)=>!(i<=s)&&!n.resolveDisabled(e)));case 3:{let e=t.slice().reverse().findIndex((i=>!n.resolveDisabled(i)));return-1===e?e:t.length-1-e}case 4:return t.findIndex((e=>n.resolveId(e)===r.id));case 5:return null;default:!function f(r){throw new Error("Unexpected object: "+r)}(r)}})();return-1===d?l:d}},"./node_modules/@headlessui/react/dist/utils/disposables.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{k:()=>m});var _micro_task_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/micro-task.js");function m(){let n=[],i=[],r={enqueue(e){i.push(e)},addEventListener:(e,t,a,o)=>(e.addEventListener(t,a,o),r.add((()=>e.removeEventListener(t,a,o)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>r.requestAnimationFrame((()=>r.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return r.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return(0,_micro_task_js__WEBPACK_IMPORTED_MODULE_0__.Y)((()=>{t.current&&e[0]()})),r.add((()=>{t.current=!1}))},add:e=>(n.push(e),()=>{let t=n.indexOf(e);if(t>=0){let[a]=n.splice(t,1);a()}}),dispose(){for(let e of n.splice(0))e()},async workQueue(){for(let e of i.splice(0))await e()}};return r}},"./node_modules/@headlessui/react/dist/utils/focus-management.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{C5:()=>h,EO:()=>D,GO:()=>d,TO:()=>T,fE:()=>M,jA:()=>O,sP:()=>F,tJ:()=>N,wI:()=>I,z2:()=>S});var _disposables_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/disposables.js"),_match_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),_owner_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js");let m=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var r,o,n,T=((n=T||{})[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n),M=((o=M||{})[o.Error=0]="Error",o[o.Overflow=1]="Overflow",o[o.Success=2]="Success",o[o.Underflow=3]="Underflow",o),b=((r=b||{})[r.Previous=-1]="Previous",r[r.Next=1]="Next",r);function d(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(m))}var N=(r=>(r[r.Strict=0]="Strict",r[r.Loose=1]="Loose",r))(N||{});function F(e,t=0){var r;return e!==(null==(r=(0,_owner_js__WEBPACK_IMPORTED_MODULE_0__.r)(e))?void 0:r.body)&&(0,_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(t,{0:()=>e.matches(m),1(){let l=e;for(;null!==l;){if(l.matches(m))return!0;l=l.parentElement}return!1}})}function I(e){let t=(0,_owner_js__WEBPACK_IMPORTED_MODULE_0__.r)(e);(0,_disposables_js__WEBPACK_IMPORTED_MODULE_2__.k)().nextFrame((()=>{t&&!F(t.activeElement,0)&&h(e)}))}function h(e){null==e||e.focus({preventScroll:!0})}let w=["textarea","input"].join(",");function S(e,t=(r=>r)){return e.slice().sort(((r,l)=>{let o=t(r),s=t(l);if(null===o||null===s)return 0;let n=o.compareDocumentPosition(s);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function D(e,t){return O(d(),t,!0,e)}function O(e,t,r=!0,l=null){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?r?S(e):e:d(e);l=null!=l?l:o.activeElement;let u,n=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),E=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,s.indexOf(l))-1;if(4&t)return Math.max(0,s.indexOf(l))+1;if(8&t)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),x=32&t?{preventScroll:!0}:{},f=0,i=s.length;do{if(f>=i||f+i<=0)return 0;let a=E+f;if(16&t)a=(a+i)%i;else{if(a<0)return 3;if(a>=i)return 1}u=s[a],null==u||u.focus(x),f+=n}while(u!==o.activeElement);return 6&t&&function H(e){var t,r;return null!=(r=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,w))&&r}(u)&&u.select(),u.hasAttribute("tabindex")||u.setAttribute("tabindex","0"),2}},"./node_modules/@headlessui/react/dist/utils/match.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function u(r,n,...a){if(r in n){let e=n[r];return"function"==typeof e?e(...a):e}let t=new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,u),t}__webpack_require__.d(__webpack_exports__,{E:()=>u})},"./node_modules/@headlessui/react/dist/utils/micro-task.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function t(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((o=>setTimeout((()=>{throw o}))))}__webpack_require__.d(__webpack_exports__,{Y:()=>t})},"./node_modules/@headlessui/react/dist/utils/owner.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{r:()=>e});var _ssr_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/ssr.js");function e(r){return _ssr_js__WEBPACK_IMPORTED_MODULE_0__.s?null:r instanceof Node?r.ownerDocument:null!=r&&r.hasOwnProperty("current")&&r.current instanceof Node?r.current.ownerDocument:document}},"./node_modules/@headlessui/react/dist/utils/render.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{AN:()=>S,l4:()=>j,oA:()=>F,sY:()=>$,yV:()=>C});var e,a,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_match_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),S=((a=S||{})[a.None=0]="None",a[a.RenderStrategy=1]="RenderStrategy",a[a.Static=2]="Static",a),j=((e=j||{})[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e);function $({ourProps:r,theirProps:t,slot:e,defaultTag:a,features:o,visible:n=!0,name:l}){let s=T(t,r);if(n)return p(s,e,a,l);let u=null!=o?o:0;if(2&u){let{static:i=!1,...d}=s;if(i)return p(d,e,a,l)}if(1&u){let{unmount:i=!0,...d}=s;return(0,_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(i?0:1,{0:()=>null,1:()=>p({...d,hidden:!0,style:{display:"none"}},e,a,l)})}return p(s,e,a,l)}function p(r,t={},e,a){let{as:o=e,children:n,refName:l="ref",...s}=m(r,["unmount","static"]),u=void 0!==r.ref?{[l]:r.ref}:{},i="function"==typeof n?n(t):n;s.className&&"function"==typeof s.className&&(s.className=s.className(t));let d={};if(t){let f=!1,y=[];for(let[h,g]of Object.entries(t))"boolean"==typeof g&&(f=!0),!0===g&&y.push(h);f&&(d["data-headlessui-state"]=y.join(" "))}if(o===react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&Object.keys(F(s)).length>0){if(!(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(i)||Array.isArray(i)&&i.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${a} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map((f=>` - ${f}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((f=>` - ${f}`)).join("\n")].join("\n"));return(0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(i,Object.assign({},T(i.props,F(m(s,["ref"]))),d,u,function w(...r){return{ref:r.every((t=>null==t))?void 0:t=>{for(let e of r)null!=e&&("function"==typeof e?e(t):e.current=t)}}}(i.ref,u.ref)))}return(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(o,Object.assign({},m(s,["ref"]),o!==react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&u,o!==react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&d),i)}function T(...r){if(0===r.length)return{};if(1===r.length)return r[0];let t={},e={};for(let o of r)for(let n in o)n.startsWith("on")&&"function"==typeof o[n]?(null!=e[n]||(e[n]=[]),e[n].push(o[n])):t[n]=o[n];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(e).map((o=>[o,void 0]))));for(let o in e)Object.assign(t,{[o](n,...l){let s=e[o];for(let u of s){if((n instanceof Event||(null==n?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;u(n,...l)}}});return t}function C(r){var t;return Object.assign((0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(r),{displayName:null!=(t=r.displayName)?t:r.name})}function F(r){let t=Object.assign({},r);for(let e in t)void 0===t[e]&&delete t[e];return t}function m(r,t=[]){let e=Object.assign({},r);for(let a of t)a in e&&delete e[a];return e}},"./node_modules/@headlessui/react/dist/utils/ssr.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{s:()=>e});const e="undefined"==typeof window||"undefined"==typeof document},"./src/components/FeedbackButtons/FeedbackButtons.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,Dropdown:()=>Dropdown,Toggle:()=>Toggle,__namedExportsOrder:()=>__namedExportsOrder,default:()=>FeedbackButtons_stories});__webpack_require__("./node_modules/react/index.js");var FeedbackButtons=__webpack_require__("./src/components/FeedbackButtons/FeedbackButtons.tsx"),data=__webpack_require__("./src/mocks/data.ts"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),FeedbackButtons_FeedbackButtons=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/FeedbackButtons/FeedbackButtons.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(FeedbackButtons_FeedbackButtons.Z,options);FeedbackButtons_FeedbackButtons.Z&&FeedbackButtons_FeedbackButtons.Z.locals&&FeedbackButtons_FeedbackButtons.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const FeedbackButtons_stories={title:"Feedback Buttons",component:FeedbackButtons.Z,argTypes:{},parameters:{controls:{expanded:!0}},decorators:[Story=>(0,jsx_runtime.jsx)("div",{style:{textAlign:"right",padding:"0 3rem"},children:(0,jsx_runtime.jsx)(Story,{})})]},Template=args=>(0,jsx_runtime.jsx)(FeedbackButtons.Z,{...args});Template.displayName="Template";const Default=Template.bind({});Default.args={memori:data.jF,onNegativeClick:()=>{}};const Toggle=Template.bind({});Toggle.args={memori:data.jF,toggle:!0,onNegativeClick:()=>{}};const Dropdown=Template.bind({});Dropdown.args={memori:data.jF,dropdown:!0,onNegativeClick:()=>{}},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => ",...Default.parameters?.docs?.source}}},Toggle.parameters={...Toggle.parameters,docs:{...Toggle.parameters?.docs,source:{originalSource:"args => ",...Toggle.parameters?.docs?.source}}},Dropdown.parameters={...Dropdown.parameters,docs:{...Dropdown.parameters?.docs,source:{originalSource:"args => ",...Dropdown.parameters?.docs?.source}}};const __namedExportsOrder=["Default","Toggle","Dropdown"]},"./src/components/FeedbackButtons/FeedbackButtons.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Feedback.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const feedbackMsgs={"it-IT":"Non è quello che ti ho chiesto","fr-FR":"Ce n'est pas ce que je t'ai demandé","en-GB":"It's not what I asked"},feedbackMsgsHelpers={"it-IT":"La risposta non era corretta","fr-FR":"La réponse n'était pas correcte","en-GB":"The answer was not correct"},dislikeMsgs={"it-IT":"Non mi è piaciuta la risposta","fr-FR":"Je n'ai pas aimé la réponse","en-GB":"I didn't like the answer"},FeedbackButtons=({memori,className,onNegativeClick,toggle=!1,dropdown=!1})=>{const[clicked,setClicked]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),culture="it-IT"===memori.culture?"it-IT":"fr-FR"===memori.culture?"fr-FR":"en-GB",feedbackMsg=feedbackMsgs[culture],feedbackMsgHelper=feedbackMsgsHelpers[culture],dislikeMsg=dislikeMsgs[culture];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"memori-chat--feedback"+(className?` ${className}`:""),children:dropdown?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v,{as:"div",className:"memori-chat--feedback-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Button,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{ghost:!0,shape:"circle",title:"Feedback",className:"memori-chat--feedback-menu-button",disabled:!!clicked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Items,{className:"memori-chat--feedback-menu-items",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-chat--feedback-menu-items-container",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("up"===clicked&&toggle?void 0:"up")},children:dislikeMsg})},"ok"),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},children:feedbackMsgHelper})},"no")]})})})]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:"Feedback",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{title:"Feedback",onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},ghost:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})})})};FeedbackButtons.displayName="FeedbackButtons";const __WEBPACK_DEFAULT_EXPORT__=FeedbackButtons;try{FeedbackButtons.displayName="FeedbackButtons",FeedbackButtons.__docgenInfo={description:"",displayName:"FeedbackButtons",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},onNegativeClick:{defaultValue:null,description:"",name:"onNegativeClick",required:!0,type:{name:"(msg?: string | undefined) => void"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},toggle:{defaultValue:{value:"false"},description:"",name:"toggle",required:!1,type:{name:"boolean"}},dropdown:{defaultValue:{value:"false"},description:"",name:"dropdown",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"]={docgenInfo:FeedbackButtons.__docgenInfo,name:"FeedbackButtons",path:"src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Feedback.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Feedback=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"})]});Feedback.displayName="Feedback";const __WEBPACK_DEFAULT_EXPORT__=Feedback;try{Feedback.displayName="Feedback",Feedback.__docgenInfo={description:"",displayName:"Feedback",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Feedback.tsx#Feedback"]={docgenInfo:Feedback.__docgenInfo,name:"Feedback",path:"src/components/icons/Feedback.tsx#Feedback"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Tooltip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Tooltip=({content,className,align="right",disabled=!1,visible=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-tooltip",`memori-tooltip--align-${align}`,className,{"memori-tooltip--disabled":disabled,"memori-tooltip--visible":visible}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--content",children:content}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--trigger",children})]});Tooltip.displayName="Tooltip";const __WEBPACK_DEFAULT_EXPORT__=Tooltip;try{Tooltip.displayName="Tooltip",Tooltip.__docgenInfo={description:"",displayName:"Tooltip",props:{content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"Element | ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'},{value:'"topLeft"'},{value:'"topRight"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Tooltip.tsx#Tooltip"]={docgenInfo:Tooltip.__docgenInfo,name:"Tooltip",path:"src/components/ui/Tooltip.tsx#Tooltip"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={id:"locahost:3000",theme:"twincreator",config:{name:"Memori",showNewUser:!0,requirePosition:!1,feedbackURL:"https://form.asana.com/"}},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}},"./node_modules/classnames/index.js":(module,exports)=>{var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";var hasOwn={}.hasOwnProperty;function classNames(){for(var classes=[],i=0;i{"use strict";var f=__webpack_require__("./node_modules/react/index.js"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(c,a,g){var b,d={},e=null,h=null;for(b in void 0!==g&&(e=""+g),void 0!==a.key&&(e=""+a.key),void 0!==a.ref&&(h=a.ref),a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l,exports.jsx=q,exports.jsxs=q},"./node_modules/react/jsx-runtime.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";module.exports=__webpack_require__("./node_modules/react/cjs/react-jsx-runtime.production.min.js")}}]); \ No newline at end of file +/*! For license information please see components-FeedbackButtons-FeedbackButtons-stories.9a058457.iframe.bundle.js.LICENSE.txt */ +(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[6149],{"./node_modules/@headlessui/react/dist/components/keyboard.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{R:()=>o});var r,o=((r=o||{}).Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r)},"./node_modules/@headlessui/react/dist/components/menu/menu.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{v:()=>qe});var n,o,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_utils_match_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),_utils_render_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/render.js"),_utils_disposables_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/disposables.js"),_hooks_use_disposables_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-disposables.js"),_hooks_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js"),_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-sync-refs.js"),_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-id.js"),_keyboard_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/@headlessui/react/dist/components/keyboard.js"),_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/calculate-active-index.js"),_utils_bugs_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/bugs.js"),_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/focus-management.js"),_hooks_use_outside_click_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-outside-click.js"),_hooks_use_tree_walker_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-tree-walker.js"),_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@headlessui/react/dist/internal/open-closed.js"),_hooks_use_resolve_button_type_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js"),_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-owner.js"),_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event.js"),ue=((o=ue||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),se=(o=>(o[o.Pointer=0]="Pointer",o[o.Other=1]="Other",o))(se||{}),le=((n=le||{})[n.OpenMenu=0]="OpenMenu",n[n.CloseMenu=1]="CloseMenu",n[n.GoToItem=2]="GoToItem",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterItem=5]="RegisterItem",n[n.UnregisterItem=6]="UnregisterItem",n);function k(t,i=(o=>o)){let o=null!==t.activeItemIndex?t.items[t.activeItemIndex]:null,e=(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.z2)(i(t.items.slice()),(u=>u.dataRef.current.domRef.current)),r=o?e.indexOf(o):null;return-1===r&&(r=null),{items:e,activeItemIndex:r}}let ce={1:t=>1===t.menuState?t:{...t,activeItemIndex:null,menuState:1},0:t=>0===t.menuState?t:{...t,menuState:0},2:(t,i)=>{var r;let o=k(t),e=(0,_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.d)(i,{resolveItems:()=>o.items,resolveActiveIndex:()=>o.activeItemIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...t,...o,searchQuery:"",activeItemIndex:e,activationTrigger:null!=(r=i.trigger)?r:1}},3:(t,i)=>{let e=""!==t.searchQuery?0:1,r=t.searchQuery+i.value.toLowerCase(),s=(null!==t.activeItemIndex?t.items.slice(t.activeItemIndex+e).concat(t.items.slice(0,t.activeItemIndex+e)):t.items).find((p=>{var c;return(null==(c=p.dataRef.current.textValue)?void 0:c.startsWith(r))&&!p.dataRef.current.disabled})),n=s?t.items.indexOf(s):-1;return-1===n||n===t.activeItemIndex?{...t,searchQuery:r}:{...t,searchQuery:r,activeItemIndex:n,activationTrigger:1}},4:t=>""===t.searchQuery?t:{...t,searchQuery:"",searchActiveItemIndex:null},5:(t,i)=>{let o=k(t,(e=>[...e,{id:i.id,dataRef:i.dataRef}]));return{...t,...o}},6:(t,i)=>{let o=k(t,(e=>{let r=e.findIndex((u=>u.id===i.id));return-1!==r&&e.splice(r,1),e}));return{...t,...o,activationTrigger:1}}},w=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);function C(t){let i=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(w);if(null===i){let o=new Error(`<${t} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,C),o}return i}function pe(t,i){return(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_3__.E)(i.type,ce,t,i)}w.displayName="MenuContext";let de=react__WEBPACK_IMPORTED_MODULE_0__.Fragment,me=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.yV)((function(i,o){let e=(0,react__WEBPACK_IMPORTED_MODULE_0__.useReducer)(pe,{menuState:1,buttonRef:(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)(),itemsRef:(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:r,itemsRef:u,buttonRef:s},n]=e,p=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_5__.T)(o);(0,_hooks_use_outside_click_js__WEBPACK_IMPORTED_MODULE_6__.O)([s,u],((A,M)=>{var l;n({type:1}),(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.sP)(M,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.tJ.Loose)||(A.preventDefault(),null==(l=s.current)||l.focus())}),0===r);let c=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{n({type:1})})),b=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===r,close:c})),[r,c]),m=i,g={ref:p};return react__WEBPACK_IMPORTED_MODULE_0__.createElement(w.Provider,{value:e},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__.up,{value:(0,_utils_match_js__WEBPACK_IMPORTED_MODULE_3__.E)(r,{0:_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__.ZM.Open,1:_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__.ZM.Closed})},(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.sY)({ourProps:g,theirProps:m,slot:b,defaultTag:de,name:"Menu"})))})),Te=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.yV)((function(i,o){var M;let[e,r]=C("Menu.Button"),u=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_5__.T)(e.buttonRef,o),s=`headlessui-menu-button-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_9__.M)()}`,n=(0,_hooks_use_disposables_js__WEBPACK_IMPORTED_MODULE_10__.G)(),p=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((l=>{switch(l.key){case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Enter:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.ArrowDown:l.preventDefault(),l.stopPropagation(),r({type:0}),n.nextFrame((()=>r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.First})));break;case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.ArrowUp:l.preventDefault(),l.stopPropagation(),r({type:0}),n.nextFrame((()=>r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Last})))}})),c=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((l=>{if(l.key===_keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space)l.preventDefault()})),b=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((l=>{if((0,_utils_bugs_js__WEBPACK_IMPORTED_MODULE_12__.P)(l.currentTarget))return l.preventDefault();i.disabled||(0===e.menuState?(r({type:1}),n.nextFrame((()=>{var R;return null==(R=e.buttonRef.current)?void 0:R.focus({preventScroll:!0})}))):(l.preventDefault(),r({type:0})))})),m=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===e.menuState})),[e]),g=i,A={ref:u,id:s,type:(0,_hooks_use_resolve_button_type_js__WEBPACK_IMPORTED_MODULE_13__.f)(i,e.buttonRef),"aria-haspopup":!0,"aria-controls":null==(M=e.itemsRef.current)?void 0:M.id,"aria-expanded":i.disabled?void 0:0===e.menuState,onKeyDown:p,onKeyUp:c,onClick:b};return(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.sY)({ourProps:A,theirProps:g,slot:m,defaultTag:"button",name:"Menu.Button"})})),Ie=_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.AN.RenderStrategy|_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.AN.Static,ge=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.yV)((function(i,o){var R,S;let[e,r]=C("Menu.Items"),u=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_5__.T)(e.itemsRef,o),s=(0,_hooks_use_owner_js__WEBPACK_IMPORTED_MODULE_14__.i)(e.itemsRef),n=`headlessui-menu-items-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_9__.M)()}`,p=(0,_hooks_use_disposables_js__WEBPACK_IMPORTED_MODULE_10__.G)(),c=(0,_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__.oJ)(),b=null!==c?c===_internal_open_closed_js__WEBPACK_IMPORTED_MODULE_8__.ZM.Open:0===e.menuState;(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{let a=e.itemsRef.current;!a||0===e.menuState&&a!==(null==s?void 0:s.activeElement)&&a.focus({preventScroll:!0})}),[e.menuState,e.itemsRef,s]),(0,_hooks_use_tree_walker_js__WEBPACK_IMPORTED_MODULE_15__.B)({container:e.itemsRef.current,enabled:0===e.menuState,accept:a=>"menuitem"===a.getAttribute("role")?NodeFilter.FILTER_REJECT:a.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(a){a.setAttribute("role","none")}});let m=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((a=>{var T,y;switch(p.dispose(),a.key){case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space:if(""!==e.searchQuery)return a.preventDefault(),a.stopPropagation(),r({type:3,value:a.key});case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Enter:if(a.preventDefault(),a.stopPropagation(),r({type:1}),null!==e.activeItemIndex){let{dataRef:v}=e.items[e.activeItemIndex];null==(y=null==(T=v.current)?void 0:T.domRef.current)||y.click()}(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.wI)(e.buttonRef.current);break;case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.ArrowDown:return a.preventDefault(),a.stopPropagation(),r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Next});case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.ArrowUp:return a.preventDefault(),a.stopPropagation(),r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Previous});case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Home:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.PageUp:return a.preventDefault(),a.stopPropagation(),r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.First});case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.End:case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.PageDown:return a.preventDefault(),a.stopPropagation(),r({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Last});case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Escape:a.preventDefault(),a.stopPropagation(),r({type:1}),(0,_utils_disposables_js__WEBPACK_IMPORTED_MODULE_16__.k)().nextFrame((()=>{var v;return null==(v=e.buttonRef.current)?void 0:v.focus({preventScroll:!0})}));break;case _keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Tab:a.preventDefault(),a.stopPropagation(),r({type:1}),(0,_utils_disposables_js__WEBPACK_IMPORTED_MODULE_16__.k)().nextFrame((()=>{(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.EO)(e.buttonRef.current,a.shiftKey?_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.TO.Previous:_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.TO.Next)}));break;default:1===a.key.length&&(r({type:3,value:a.key}),p.setTimeout((()=>r({type:4})),350))}})),g=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((a=>{if(a.key===_keyboard_js__WEBPACK_IMPORTED_MODULE_11__.R.Space)a.preventDefault()})),A=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({open:0===e.menuState})),[e]),M=i,l={"aria-activedescendant":null===e.activeItemIndex||null==(R=e.items[e.activeItemIndex])?void 0:R.id,"aria-labelledby":null==(S=e.buttonRef.current)?void 0:S.id,id:n,onKeyDown:m,onKeyUp:g,role:"menu",tabIndex:0,ref:u};return(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.sY)({ourProps:l,theirProps:M,slot:A,defaultTag:"div",features:Ie,visible:b,name:"Menu.Items"})})),Me=react__WEBPACK_IMPORTED_MODULE_0__.Fragment,Re=(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.yV)((function(i,o){let{disabled:e=!1,...r}=i,[u,s]=C("Menu.Item"),n=`headlessui-menu-item-${(0,_hooks_use_id_js__WEBPACK_IMPORTED_MODULE_9__.M)()}`,p=null!==u.activeItemIndex&&u.items[u.activeItemIndex].id===n,c=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),b=(0,_hooks_use_sync_refs_js__WEBPACK_IMPORTED_MODULE_5__.T)(o,c);(0,_hooks_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_17__.e)((()=>{if(0!==u.menuState||!p||0===u.activationTrigger)return;let T=(0,_utils_disposables_js__WEBPACK_IMPORTED_MODULE_16__.k)();return T.requestAnimationFrame((()=>{var y,v;null==(v=null==(y=c.current)?void 0:y.scrollIntoView)||v.call(y,{block:"nearest"})})),T.dispose}),[c,p,u.menuState,u.activationTrigger,u.activeItemIndex]);let m=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({disabled:e,domRef:c});(0,_hooks_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_17__.e)((()=>{m.current.disabled=e}),[m,e]),(0,_hooks_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_17__.e)((()=>{var T,y;m.current.textValue=null==(y=null==(T=c.current)?void 0:T.textContent)?void 0:y.toLowerCase()}),[m,c]),(0,_hooks_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_17__.e)((()=>(s({type:5,id:n,dataRef:m}),()=>s({type:6,id:n}))),[m,n]);let g=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{s({type:1})})),A=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((T=>{if(e)return T.preventDefault();s({type:1}),(0,_utils_focus_management_js__WEBPACK_IMPORTED_MODULE_1__.wI)(u.buttonRef.current)})),M=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{if(e)return s({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Nothing});s({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Specific,id:n})})),l=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{e||p||s({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Specific,id:n,trigger:0})})),R=(0,_hooks_use_event_js__WEBPACK_IMPORTED_MODULE_7__.z)((()=>{e||!p||s({type:2,focus:_utils_calculate_active_index_js__WEBPACK_IMPORTED_MODULE_2__.T.Nothing})})),S=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({active:p,disabled:e,close:g})),[p,e,g]);return(0,_utils_render_js__WEBPACK_IMPORTED_MODULE_4__.sY)({ourProps:{id:n,ref:b,role:"menuitem",tabIndex:!0===e?void 0:-1,"aria-disabled":!0===e||void 0,disabled:void 0,onClick:A,onFocus:M,onPointerMove:l,onMouseMove:l,onPointerLeave:R,onMouseLeave:R},theirProps:r,slot:S,defaultTag:Me,name:"Menu.Item"})})),qe=Object.assign(me,{Button:Te,Items:ge,Item:Re})},"./node_modules/@headlessui/react/dist/components/transitions/transition.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{u:()=>We});var react=__webpack_require__("./node_modules/react/index.js"),render=__webpack_require__("./node_modules/@headlessui/react/dist/utils/render.js"),open_closed=__webpack_require__("./node_modules/@headlessui/react/dist/internal/open-closed.js"),match=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),use_is_mounted=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-is-mounted.js"),use_iso_morphic_effect=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js"),use_latest_value=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js"),use_server_handoff_complete=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js"),use_sync_refs=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-sync-refs.js");var disposables=__webpack_require__("./node_modules/@headlessui/react/dist/utils/disposables.js");function f(t,...e){t&&e.length>0&&t.classList.add(...e)}function v(t,...e){t&&e.length>0&&t.classList.remove(...e)}var n,T=((n=T||{}).Ended="ended",n.Cancelled="cancelled",n);function C(t,e,n,d){let o=n?"enter":"leave",s=(0,disposables.k)(),u=void 0!==d?function l(r){let e={called:!1};return(...t)=>{if(!e.called)return e.called=!0,r(...t)}}(d):()=>{};"enter"===o&&(t.removeAttribute("hidden"),t.style.display="");let m=(0,match.E)(o,{enter:()=>e.enter,leave:()=>e.leave}),i=(0,match.E)(o,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),a=(0,match.E)(o,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return v(t,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),f(t,...m,...a),s.nextFrame((()=>{v(t,...a),f(t,...i),function c(t,e){let n=(0,disposables.k)();if(!t)return n.dispose;let{transitionDuration:d,transitionDelay:o}=getComputedStyle(t),[s,u]=[d,o].map((i=>{let[a=0]=i.split(",").filter(Boolean).map((r=>r.includes("ms")?parseFloat(r):1e3*parseFloat(r))).sort(((r,l)=>l-r));return a}));if(s+u!==0){let i=[];i.push(n.addEventListener(t,"transitionrun",(a=>{a.target===a.currentTarget&&(i.splice(0).forEach((r=>r())),i.push(n.addEventListener(t,"transitionend",(r=>{r.target===r.currentTarget&&(e("ended"),i.splice(0).forEach((l=>l())))})),n.addEventListener(t,"transitioncancel",(r=>{r.target===r.currentTarget&&(e("cancelled"),i.splice(0).forEach((l=>l())))}))))})))}else e("ended");return n.add((()=>e("cancelled"))),n.dispose}(t,(r=>("ended"===r&&(v(t,...m),f(t,...e.entered)),u(r))))})),s.dispose}var use_disposables=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-disposables.js");var use_event=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event.js");function x(r=""){return r.split(" ").filter((e=>e.trim().length>1))}let F=(0,react.createContext)(null);F.displayName="TransitionContext";var s,ve=((s=ve||{}).Visible="visible",s.Hidden="hidden",s);let M=(0,react.createContext)(null);function transition_I(r){return"children"in r?transition_I(r.children):r.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function ee(r,e){let s=(0,use_latest_value.E)(r),n=(0,react.useRef)([]),m=(0,use_is_mounted.t)(),D=(0,use_disposables.G)(),b=(0,use_event.z)(((l,i=render.l4.Hidden)=>{let t=n.current.findIndex((({el:o})=>o===l));-1!==t&&((0,match.E)(i,{[render.l4.Unmount](){n.current.splice(t,1)},[render.l4.Hidden](){n.current[t].state="hidden"}}),D.microTask((()=>{var o;!transition_I(n)&&m.current&&(null==(o=s.current)||o.call(s))})))})),E=(0,use_event.z)((l=>{let i=n.current.find((({el:t})=>t===l));return i?"visible"!==i.state&&(i.state="visible"):n.current.push({el:l,state:"visible"}),()=>b(l,render.l4.Unmount)})),S=(0,react.useRef)([]),u=(0,react.useRef)(Promise.resolve()),p=(0,react.useRef)({enter:[],leave:[],idle:[]}),d=(0,use_event.z)(((l,i,t)=>{S.current.splice(0),e&&(e.chains.current[i]=e.chains.current[i].filter((([o])=>o!==l))),null==e||e.chains.current[i].push([l,new Promise((o=>{S.current.push(o)}))]),null==e||e.chains.current[i].push([l,new Promise((o=>{Promise.all(p.current[i].map((([f,a])=>a))).then((()=>o()))}))]),"enter"===i?u.current=u.current.then((()=>null==e?void 0:e.wait.current)).then((()=>t(i))):t(i)})),h=(0,use_event.z)(((l,i,t)=>{Promise.all(p.current[i].splice(0).map((([o,f])=>f))).then((()=>{var o;null==(o=S.current.shift())||o()})).then((()=>t(i)))}));return(0,react.useMemo)((()=>({children:n,register:E,unregister:b,onStart:d,onStop:h,wait:u,chains:p})),[E,b,n,d,h,p,u])}function be(){}M.displayName="NestingContext";let Ee=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function te(r){var s;let e={};for(let n of Ee)e[n]=null!=(s=r[n])?s:be;return e}let ne=render.AN.RenderStrategy,re=(0,render.yV)((function(e,s){let{beforeEnter:n,afterEnter:m,beforeLeave:D,afterLeave:b,enter:E,enterFrom:S,enterTo:u,entered:p,leave:d,leaveFrom:h,leaveTo:l,...i}=e,t=(0,react.useRef)(null),o=(0,use_sync_refs.T)(t,s),f=i.unmount?render.l4.Unmount:render.l4.Hidden,{show:a,appear:P,initial:ie}=function Ce(){let r=(0,react.useContext)(F);if(null===r)throw new Error("A is used but it is missing a parent or .");return r}(),[v,_]=(0,react.useState)(a?"visible":"hidden"),z=function ge(){let r=(0,react.useContext)(M);if(null===r)throw new Error("A is used but it is missing a parent or .");return r}(),{register:N,unregister:V}=z,j=(0,react.useRef)(null);(0,react.useEffect)((()=>N(t)),[N,t]),(0,react.useEffect)((()=>{if(f===render.l4.Hidden&&t.current)return a&&"visible"!==v?void _("visible"):(0,match.E)(v,{hidden:()=>V(t),visible:()=>N(t)})}),[v,t,N,V,a,f]);let oe=(0,use_latest_value.E)({enter:x(E),enterFrom:x(S),enterTo:x(u),entered:x(p),leave:x(d),leaveFrom:x(h),leaveTo:x(l)}),L=function Se(r){let e=(0,react.useRef)(te(r));return(0,react.useEffect)((()=>{e.current=te(r)}),[r]),e}({beforeEnter:n,afterEnter:m,beforeLeave:D,afterLeave:b}),U=(0,use_server_handoff_complete.H)();(0,react.useEffect)((()=>{if(U&&"visible"===v&&null===t.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[t,v,U]);let k=ie&&!P,se=!U||k||j.current===a?"idle":a?"enter":"leave",le=(0,use_event.z)((C=>(0,match.E)(C,{enter:()=>L.current.beforeEnter(),leave:()=>L.current.beforeLeave(),idle:()=>{}}))),ae=(0,use_event.z)((C=>(0,match.E)(C,{enter:()=>L.current.afterEnter(),leave:()=>L.current.afterLeave(),idle:()=>{}}))),w=ee((()=>{_("hidden"),V(t)}),z);(function I({container:o,direction:t,classes:s,onStart:a,onStop:u}){let c=(0,use_is_mounted.t)(),d=(0,use_disposables.G)(),r=(0,use_latest_value.E)(t);(0,use_iso_morphic_effect.e)((()=>{let e=(0,disposables.k)();d.add(e.dispose);let n=o.current;if(n&&"idle"!==r.current&&c.current)return e.dispose(),a.current(r.current),e.add(C(n,s.current,"enter"===r.current,(l=>{e.dispose(),(0,match.E)(l,{[T.Ended](){u.current(r.current)},[T.Cancelled]:()=>{}})}))),e.dispose}),[t])})({container:t,classes:oe,direction:se,onStart:(0,use_latest_value.E)((C=>{w.onStart(t,C,le)})),onStop:(0,use_latest_value.E)((C=>{w.onStop(t,C,ae),"leave"===C&&!transition_I(w)&&(_("hidden"),V(t))}))}),(0,react.useEffect)((()=>{!k||(f===render.l4.Hidden?j.current=null:j.current=a)}),[a,k,v]);let ue=i,de={ref:o};return react.createElement(M.Provider,{value:w},react.createElement(open_closed.up,{value:(0,match.E)(v,{visible:open_closed.ZM.Open,hidden:open_closed.ZM.Closed})},(0,render.sY)({ourProps:de,theirProps:ue,defaultTag:"div",features:ne,visible:"visible"===v,name:"Transition.Child"})))})),q=(0,render.yV)((function(e,s){let{show:n,appear:m=!1,unmount:D,...b}=e,E=(0,react.useRef)(null),S=(0,use_sync_refs.T)(E,s);(0,use_server_handoff_complete.H)();let u=(0,open_closed.oJ)();if(void 0===n&&null!==u&&(n=(0,match.E)(u,{[open_closed.ZM.Open]:!0,[open_closed.ZM.Closed]:!1})),![!0,!1].includes(n))throw new Error("A is used but it is missing a `show={true | false}` prop.");let[p,d]=(0,react.useState)(n?"visible":"hidden"),h=ee((()=>{d("hidden")})),[l,i]=(0,react.useState)(!0),t=(0,react.useRef)([n]);(0,use_iso_morphic_effect.e)((()=>{!1!==l&&t.current[t.current.length-1]!==n&&(t.current.push(n),i(!1))}),[t,n]);let o=(0,react.useMemo)((()=>({show:n,appear:m,initial:l})),[n,m,l]);(0,react.useEffect)((()=>{if(n)d("visible");else if(transition_I(h)){let a=E.current;if(!a)return;let P=a.getBoundingClientRect();0===P.x&&0===P.y&&0===P.width&&0===P.height&&d("hidden")}else d("hidden")}),[n,h]);let f={unmount:D};return react.createElement(M.Provider,{value:h},react.createElement(F.Provider,{value:o},(0,render.sY)({ourProps:{...f,as:react.Fragment,children:react.createElement(re,{ref:S,...f,...b})},theirProps:{},defaultTag:react.Fragment,features:ne,visible:"visible"===p,name:"Transition"})))})),Pe=(0,render.yV)((function(e,s){let n=null!==(0,react.useContext)(F),m=null!==(0,open_closed.oJ)();return react.createElement(react.Fragment,null,!n&&m?react.createElement(q,{ref:s,...e}):react.createElement(re,{ref:s,...e}))})),We=Object.assign(q,{Child:Pe,Root:q})},"./node_modules/@headlessui/react/dist/hooks/use-disposables.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{G:()=>p});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_utils_disposables_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/disposables.js");function p(){let[e]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_utils_disposables_js__WEBPACK_IMPORTED_MODULE_1__.k);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>()=>e.dispose()),[e]),e}},"./node_modules/@headlessui/react/dist/hooks/use-event.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{z:()=>o});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");let o=function(t){let e=(0,_use_latest_value_js__WEBPACK_IMPORTED_MODULE_1__.E)(t);return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(((...r)=>e.current(...r)),[e])}},"./node_modules/@headlessui/react/dist/hooks/use-id.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{M:()=>I});var u,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js"),_use_server_handoff_complete_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js");let l=0;function r(){return++l}let I=null!=(u=react__WEBPACK_IMPORTED_MODULE_0__.useId)?u:function(){let n=(0,_use_server_handoff_complete_js__WEBPACK_IMPORTED_MODULE_1__.H)(),[e,o]=react__WEBPACK_IMPORTED_MODULE_0__.useState(n?r:null);return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_2__.e)((()=>{null===e&&o(r())}),[e]),null!=e?""+e:void 0}},"./node_modules/@headlessui/react/dist/hooks/use-is-mounted.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{t:()=>f});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js");function f(){let e=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(!1);return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}},"./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{e:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let s=__webpack_require__("./node_modules/@headlessui/react/dist/utils/ssr.js").s?react__WEBPACK_IMPORTED_MODULE_0__.useEffect:react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect},"./node_modules/@headlessui/react/dist/hooks/use-latest-value.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{E:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js");function s(e){let r=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(e);return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{r.current=e}),[e]),r}},"./node_modules/@headlessui/react/dist/hooks/use-outside-click.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{O:()=>L});var react=__webpack_require__("./node_modules/react/index.js"),focus_management=__webpack_require__("./node_modules/@headlessui/react/dist/utils/focus-management.js"),use_latest_value=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-latest-value.js");function d(e,r,n){let o=(0,use_latest_value.E)(r);(0,react.useEffect)((()=>{function t(u){o.current(u)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}function L(E,m,c=!0){let i=(0,react.useRef)(!1);function f(e,o){if(!i.current||e.defaultPrevented)return;let l=function r(t){return"function"==typeof t?r(t()):Array.isArray(t)||t instanceof Set?t:[t]}(E),n=o(e);if(null!==n&&n.getRootNode().contains(n)){for(let r of l){if(null===r)continue;let t=r instanceof HTMLElement?r:r.current;if(null!=t&&t.contains(n))return}return!(0,focus_management.sP)(n,focus_management.tJ.Loose)&&-1!==n.tabIndex&&e.preventDefault(),m(e,n)}}(0,react.useEffect)((()=>{requestAnimationFrame((()=>{i.current=c}))}),[c]);let u=(0,react.useRef)(null);d("mousedown",(e=>{var o,l;i.current&&(u.current=(null==(l=null==(o=e.composedPath)?void 0:o.call(e))?void 0:l[0])||e.target)}),!0),d("click",(e=>{!u.current||(f(e,(()=>u.current)),u.current=null)}),!0),d("blur",(e=>f(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}},"./node_modules/@headlessui/react/dist/hooks/use-owner.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{i:()=>n});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_utils_owner_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js");function n(...e){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>(0,_utils_owner_js__WEBPACK_IMPORTED_MODULE_1__.r)(...e)),[...e])}},"./node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{f:()=>s});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js");function i(t){var n;if(t.type)return t.type;let e=null!=(n=t.as)?n:"button";return"string"==typeof e&&"button"===e.toLowerCase()?"button":void 0}function s(t,e){let[n,u]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((()=>i(t)));return(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{u(i(t))}),[t.type,t.as]),(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{n||!e.current||e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&u("button")}),[n,e]),n}},"./node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{H:()=>a});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let r={serverHandoffComplete:!1};function a(){let[e,f]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(r.serverHandoffComplete);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{!0!==e&&f(!0)}),[e]),(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{!1===r.serverHandoffComplete&&(r.serverHandoffComplete=!0)}),[]),e}},"./node_modules/@headlessui/react/dist/hooks/use-sync-refs.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{T:()=>y,h:()=>T});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_event_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-event.js");let u=Symbol();function T(t,n=!0){return Object.assign(t,{[u]:n})}function y(...t){let n=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(t);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{n.current=t}),[t]);let c=(0,_use_event_js__WEBPACK_IMPORTED_MODULE_1__.z)((e=>{for(let o of n.current)null!=o&&("function"==typeof o?o(e):o.current=e)}));return t.every((e=>null==e||(null==e?void 0:e[u])))?void 0:c}},"./node_modules/@headlessui/react/dist/hooks/use-tree-walker.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{B:()=>F});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js"),_utils_owner_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js");function F({container:e,accept:t,walk:r,enabled:c=!0}){let o=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(t),l=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(r);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{o.current=t,l.current=r}),[t,r]),(0,_use_iso_morphic_effect_js__WEBPACK_IMPORTED_MODULE_1__.e)((()=>{if(!e||!c)return;let n=(0,_utils_owner_js__WEBPACK_IMPORTED_MODULE_2__.r)(e);if(!n)return;let f=o.current,p=l.current,d=Object.assign((i=>f(i)),{acceptNode:f}),u=n.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,d,!1);for(;u.nextNode();)p(u.currentNode)}),[e,c,o,l])}},"./node_modules/@headlessui/react/dist/internal/open-closed.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{ZM:()=>p,oJ:()=>s,up:()=>C});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");let o=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);o.displayName="OpenClosedContext";var e,p=((e=p||{})[e.Open=0]="Open",e[e.Closed=1]="Closed",e);function s(){return(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(o)}function C({value:t,children:n}){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(o.Provider,{value:t},n)}},"./node_modules/@headlessui/react/dist/utils/bugs.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function r(n){let e=n.parentElement,l=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(l=e),e=e.parentElement;let t=""===(null==e?void 0:e.getAttribute("disabled"));return(!t||!function i(n){if(!n)return!1;let e=n.previousElementSibling;for(;null!==e;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}(l))&&t}__webpack_require__.d(__webpack_exports__,{P:()=>r})},"./node_modules/@headlessui/react/dist/utils/calculate-active-index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{T:()=>a,d:()=>x});var e,a=((e=a||{})[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e);function x(r,n){let t=n.resolveItems();if(t.length<=0)return null;let l=n.resolveActiveIndex(),s=null!=l?l:-1,d=(()=>{switch(r.focus){case 0:return t.findIndex((e=>!n.resolveDisabled(e)));case 1:{let e=t.slice().reverse().findIndex(((i,c,u)=>!(-1!==s&&u.length-c-1>=s)&&!n.resolveDisabled(i)));return-1===e?e:t.length-1-e}case 2:return t.findIndex(((e,i)=>!(i<=s)&&!n.resolveDisabled(e)));case 3:{let e=t.slice().reverse().findIndex((i=>!n.resolveDisabled(i)));return-1===e?e:t.length-1-e}case 4:return t.findIndex((e=>n.resolveId(e)===r.id));case 5:return null;default:!function f(r){throw new Error("Unexpected object: "+r)}(r)}})();return-1===d?l:d}},"./node_modules/@headlessui/react/dist/utils/disposables.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{k:()=>m});var _micro_task_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/micro-task.js");function m(){let n=[],i=[],r={enqueue(e){i.push(e)},addEventListener:(e,t,a,o)=>(e.addEventListener(t,a,o),r.add((()=>e.removeEventListener(t,a,o)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return r.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>r.requestAnimationFrame((()=>r.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return r.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return(0,_micro_task_js__WEBPACK_IMPORTED_MODULE_0__.Y)((()=>{t.current&&e[0]()})),r.add((()=>{t.current=!1}))},add:e=>(n.push(e),()=>{let t=n.indexOf(e);if(t>=0){let[a]=n.splice(t,1);a()}}),dispose(){for(let e of n.splice(0))e()},async workQueue(){for(let e of i.splice(0))await e()}};return r}},"./node_modules/@headlessui/react/dist/utils/focus-management.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{C5:()=>h,EO:()=>D,GO:()=>d,TO:()=>T,fE:()=>M,jA:()=>O,sP:()=>F,tJ:()=>N,wI:()=>I,z2:()=>S});var _disposables_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/disposables.js"),_match_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),_owner_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/owner.js");let m=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var r,o,n,T=((n=T||{})[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n),M=((o=M||{})[o.Error=0]="Error",o[o.Overflow=1]="Overflow",o[o.Success=2]="Success",o[o.Underflow=3]="Underflow",o),b=((r=b||{})[r.Previous=-1]="Previous",r[r.Next=1]="Next",r);function d(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(m))}var N=(r=>(r[r.Strict=0]="Strict",r[r.Loose=1]="Loose",r))(N||{});function F(e,t=0){var r;return e!==(null==(r=(0,_owner_js__WEBPACK_IMPORTED_MODULE_0__.r)(e))?void 0:r.body)&&(0,_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(t,{0:()=>e.matches(m),1(){let l=e;for(;null!==l;){if(l.matches(m))return!0;l=l.parentElement}return!1}})}function I(e){let t=(0,_owner_js__WEBPACK_IMPORTED_MODULE_0__.r)(e);(0,_disposables_js__WEBPACK_IMPORTED_MODULE_2__.k)().nextFrame((()=>{t&&!F(t.activeElement,0)&&h(e)}))}function h(e){null==e||e.focus({preventScroll:!0})}let w=["textarea","input"].join(",");function S(e,t=(r=>r)){return e.slice().sort(((r,l)=>{let o=t(r),s=t(l);if(null===o||null===s)return 0;let n=o.compareDocumentPosition(s);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function D(e,t){return O(d(),t,!0,e)}function O(e,t,r=!0,l=null){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?r?S(e):e:d(e);l=null!=l?l:o.activeElement;let u,n=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),E=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,s.indexOf(l))-1;if(4&t)return Math.max(0,s.indexOf(l))+1;if(8&t)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),x=32&t?{preventScroll:!0}:{},f=0,i=s.length;do{if(f>=i||f+i<=0)return 0;let a=E+f;if(16&t)a=(a+i)%i;else{if(a<0)return 3;if(a>=i)return 1}u=s[a],null==u||u.focus(x),f+=n}while(u!==o.activeElement);return 6&t&&function H(e){var t,r;return null!=(r=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,w))&&r}(u)&&u.select(),u.hasAttribute("tabindex")||u.setAttribute("tabindex","0"),2}},"./node_modules/@headlessui/react/dist/utils/match.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function u(r,n,...a){if(r in n){let e=n[r];return"function"==typeof e?e(...a):e}let t=new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,u),t}__webpack_require__.d(__webpack_exports__,{E:()=>u})},"./node_modules/@headlessui/react/dist/utils/micro-task.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function t(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((o=>setTimeout((()=>{throw o}))))}__webpack_require__.d(__webpack_exports__,{Y:()=>t})},"./node_modules/@headlessui/react/dist/utils/owner.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{r:()=>e});var _ssr_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/ssr.js");function e(r){return _ssr_js__WEBPACK_IMPORTED_MODULE_0__.s?null:r instanceof Node?r.ownerDocument:null!=r&&r.hasOwnProperty("current")&&r.current instanceof Node?r.current.ownerDocument:document}},"./node_modules/@headlessui/react/dist/utils/render.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{AN:()=>S,l4:()=>j,oA:()=>F,sY:()=>$,yV:()=>C});var e,a,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_match_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@headlessui/react/dist/utils/match.js"),S=((a=S||{})[a.None=0]="None",a[a.RenderStrategy=1]="RenderStrategy",a[a.Static=2]="Static",a),j=((e=j||{})[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e);function $({ourProps:r,theirProps:t,slot:e,defaultTag:a,features:o,visible:n=!0,name:l}){let s=T(t,r);if(n)return p(s,e,a,l);let u=null!=o?o:0;if(2&u){let{static:i=!1,...d}=s;if(i)return p(d,e,a,l)}if(1&u){let{unmount:i=!0,...d}=s;return(0,_match_js__WEBPACK_IMPORTED_MODULE_1__.E)(i?0:1,{0:()=>null,1:()=>p({...d,hidden:!0,style:{display:"none"}},e,a,l)})}return p(s,e,a,l)}function p(r,t={},e,a){let{as:o=e,children:n,refName:l="ref",...s}=m(r,["unmount","static"]),u=void 0!==r.ref?{[l]:r.ref}:{},i="function"==typeof n?n(t):n;s.className&&"function"==typeof s.className&&(s.className=s.className(t));let d={};if(t){let f=!1,y=[];for(let[h,g]of Object.entries(t))"boolean"==typeof g&&(f=!0),!0===g&&y.push(h);f&&(d["data-headlessui-state"]=y.join(" "))}if(o===react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&Object.keys(F(s)).length>0){if(!(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(i)||Array.isArray(i)&&i.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${a} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map((f=>` - ${f}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((f=>` - ${f}`)).join("\n")].join("\n"));return(0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(i,Object.assign({},T(i.props,F(m(s,["ref"]))),d,u,function w(...r){return{ref:r.every((t=>null==t))?void 0:t=>{for(let e of r)null!=e&&("function"==typeof e?e(t):e.current=t)}}}(i.ref,u.ref)))}return(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(o,Object.assign({},m(s,["ref"]),o!==react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&u,o!==react__WEBPACK_IMPORTED_MODULE_0__.Fragment&&d),i)}function T(...r){if(0===r.length)return{};if(1===r.length)return r[0];let t={},e={};for(let o of r)for(let n in o)n.startsWith("on")&&"function"==typeof o[n]?(null!=e[n]||(e[n]=[]),e[n].push(o[n])):t[n]=o[n];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(e).map((o=>[o,void 0]))));for(let o in e)Object.assign(t,{[o](n,...l){let s=e[o];for(let u of s){if((n instanceof Event||(null==n?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;u(n,...l)}}});return t}function C(r){var t;return Object.assign((0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(r),{displayName:null!=(t=r.displayName)?t:r.name})}function F(r){let t=Object.assign({},r);for(let e in t)void 0===t[e]&&delete t[e];return t}function m(r,t=[]){let e=Object.assign({},r);for(let a of t)a in e&&delete e[a];return e}},"./node_modules/@headlessui/react/dist/utils/ssr.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{s:()=>e});const e="undefined"==typeof window||"undefined"==typeof document},"./src/components/FeedbackButtons/FeedbackButtons.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,Dropdown:()=>Dropdown,Toggle:()=>Toggle,__namedExportsOrder:()=>__namedExportsOrder,default:()=>FeedbackButtons_stories});__webpack_require__("./node_modules/react/index.js");var FeedbackButtons=__webpack_require__("./src/components/FeedbackButtons/FeedbackButtons.tsx"),data=__webpack_require__("./src/mocks/data.ts"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),FeedbackButtons_FeedbackButtons=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/FeedbackButtons/FeedbackButtons.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(FeedbackButtons_FeedbackButtons.Z,options);FeedbackButtons_FeedbackButtons.Z&&FeedbackButtons_FeedbackButtons.Z.locals&&FeedbackButtons_FeedbackButtons.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const FeedbackButtons_stories={title:"Feedback Buttons",component:FeedbackButtons.Z,argTypes:{},parameters:{controls:{expanded:!0}},decorators:[Story=>(0,jsx_runtime.jsx)("div",{style:{textAlign:"right",padding:"0 3rem"},children:(0,jsx_runtime.jsx)(Story,{})})]},Template=args=>(0,jsx_runtime.jsx)(FeedbackButtons.Z,{...args});Template.displayName="Template";const Default=Template.bind({});Default.args={memori:data.jF,onNegativeClick:()=>{}};const Toggle=Template.bind({});Toggle.args={memori:data.jF,toggle:!0,onNegativeClick:()=>{}};const Dropdown=Template.bind({});Dropdown.args={memori:data.jF,dropdown:!0,onNegativeClick:()=>{}},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => ",...Default.parameters?.docs?.source}}},Toggle.parameters={...Toggle.parameters,docs:{...Toggle.parameters?.docs,source:{originalSource:"args => ",...Toggle.parameters?.docs?.source}}},Dropdown.parameters={...Dropdown.parameters,docs:{...Dropdown.parameters?.docs,source:{originalSource:"args => ",...Dropdown.parameters?.docs?.source}}};const __namedExportsOrder=["Default","Toggle","Dropdown"]},"./src/components/FeedbackButtons/FeedbackButtons.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Feedback.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const feedbackMsgs={"it-IT":"Non è quello che ti ho chiesto","fr-FR":"Ce n'est pas ce que je t'ai demandé","en-GB":"It's not what I asked"},feedbackMsgsHelpers={"it-IT":"La risposta non era corretta","fr-FR":"La réponse n'était pas correcte","en-GB":"The answer was not correct"},dislikeMsgs={"it-IT":"Non mi è piaciuta la risposta","fr-FR":"Je n'ai pas aimé la réponse","en-GB":"I didn't like the answer"},FeedbackButtons=({memori,className,onNegativeClick,toggle=!1,dropdown=!1})=>{const[clicked,setClicked]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),culture="it-IT"===memori.culture?"it-IT":"fr-FR"===memori.culture?"fr-FR":"en-GB",feedbackMsg=feedbackMsgs[culture],feedbackMsgHelper=feedbackMsgsHelpers[culture],dislikeMsg=dislikeMsgs[culture];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"memori-chat--feedback"+(className?` ${className}`:""),children:dropdown?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v,{as:"div",className:"memori-chat--feedback-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Button,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{ghost:!0,shape:"circle",title:"Feedback",className:"memori-chat--feedback-menu-button",disabled:!!clicked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Items,{className:"memori-chat--feedback-menu-items",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-chat--feedback-menu-items-container",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("up"===clicked&&toggle?void 0:"up")},children:dislikeMsg})},"ok"),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},children:feedbackMsgHelper})},"no")]})})})]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:"Feedback",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{title:"Feedback",onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},ghost:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})})})};FeedbackButtons.displayName="FeedbackButtons";const __WEBPACK_DEFAULT_EXPORT__=FeedbackButtons;try{FeedbackButtons.displayName="FeedbackButtons",FeedbackButtons.__docgenInfo={description:"",displayName:"FeedbackButtons",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},onNegativeClick:{defaultValue:null,description:"",name:"onNegativeClick",required:!0,type:{name:"(msg?: string | undefined) => void"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},toggle:{defaultValue:{value:"false"},description:"",name:"toggle",required:!1,type:{name:"boolean"}},dropdown:{defaultValue:{value:"false"},description:"",name:"dropdown",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"]={docgenInfo:FeedbackButtons.__docgenInfo,name:"FeedbackButtons",path:"src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Feedback.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Feedback=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"})]});Feedback.displayName="Feedback";const __WEBPACK_DEFAULT_EXPORT__=Feedback;try{Feedback.displayName="Feedback",Feedback.__docgenInfo={description:"",displayName:"Feedback",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Feedback.tsx#Feedback"]={docgenInfo:Feedback.__docgenInfo,name:"Feedback",path:"src/components/icons/Feedback.tsx#Feedback"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Tooltip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Tooltip=({content,className,align="right",disabled=!1,visible=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-tooltip",`memori-tooltip--align-${align}`,className,{"memori-tooltip--disabled":disabled,"memori-tooltip--visible":visible}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--content",children:content}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--trigger",children})]});Tooltip.displayName="Tooltip";const __WEBPACK_DEFAULT_EXPORT__=Tooltip;try{Tooltip.displayName="Tooltip",Tooltip.__docgenInfo={description:"",displayName:"Tooltip",props:{content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"Element | ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'},{value:'"topLeft"'},{value:'"topRight"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Tooltip.tsx#Tooltip"]={docgenInfo:Tooltip.__docgenInfo,name:"Tooltip",path:"src/components/ui/Tooltip.tsx#Tooltip"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={adminCount:3,config:{feedbackURL:"https://form.asana.com/?k=XC7S3JWQeIhnjipBuA3gbw&d=1199599736247413",name:"TwinCreator",requirePosition:!1,showNewUser:!0},creationTimestamp:"2023-05-31T14:32:48.885287Z",description:"TwinCreator",disableRegistration:!1,id:"app.twincreator.com",lastChangeTimestamp:"2023-05-31T14:32:48.885287Z",logoURL:"https://app.twincreator.com/images/twincreator/logo.png",maxAdmins:0,maxCompletions:0,maxCompletionsPerUser:0,maxFreeSessions:400,maxFreeSessionsPerUser:100,maxMemoriPerAdmin:0,maxMemoriPerUser:3,maxTotalMemori:0,maxUsers:0,memoriCount:0,name:"app.twincreator.com",nonFreeSessionCost:.02,paying:!0,tenantID:"96caa4b4-31a4-48e5-8163-dec61869a2a7",theme:"twincreator",userCount:0,usersCanAccessAPI:!1,usersCanCreateMemori:!1,usersCanEditDynamicIntents:!1,usersCanEditIntegrations:!1,usersCanEditMemoriChaining:!1,usersCanRunSnippets:!1},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}},"./node_modules/classnames/index.js":(module,exports)=>{var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";var hasOwn={}.hasOwnProperty;function classNames(){for(var classes=[],i=0;i{"use strict";var f=__webpack_require__("./node_modules/react/index.js"),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(c,a,g){var b,d={},e=null,h=null;for(b in void 0!==g&&(e=""+g),void 0!==a.key&&(e=""+a.key),void 0!==a.ref&&(h=a.ref),a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l,exports.jsx=q,exports.jsxs=q},"./node_modules/react/jsx-runtime.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";module.exports=__webpack_require__("./node_modules/react/cjs/react-jsx-runtime.production.min.js")}}]); \ No newline at end of file diff --git a/components-FeedbackButtons-FeedbackButtons-stories.d8b63a2d.iframe.bundle.js.LICENSE.txt b/components-FeedbackButtons-FeedbackButtons-stories.9a058457.iframe.bundle.js.LICENSE.txt similarity index 100% rename from components-FeedbackButtons-FeedbackButtons-stories.d8b63a2d.iframe.bundle.js.LICENSE.txt rename to components-FeedbackButtons-FeedbackButtons-stories.9a058457.iframe.bundle.js.LICENSE.txt diff --git a/components-Header-Header-stories.43ac48e7.iframe.bundle.js b/components-Header-Header-stories.b5def1a5.iframe.bundle.js similarity index 80% rename from components-Header-Header-stories.43ac48e7.iframe.bundle.js rename to components-Header-Header-stories.b5def1a5.iframe.bundle.js index 1e81ec60..9068cebb 100644 --- a/components-Header-Header-stories.43ac48e7.iframe.bundle.js +++ b/components-Header-Header-stories.b5def1a5.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[1314],{"./src/components/Header/Header.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,SpeakerMuted:()=>SpeakerMuted,WithClear:()=>WithClear,WithOngoingChat:()=>WithOngoingChat,WithPosition:()=>WithPosition,WithSettings:()=>WithSettings,WithShare:()=>WithShare,__namedExportsOrder:()=>__namedExportsOrder,default:()=>Header_stories});var react=__webpack_require__("./node_modules/react/index.js"),data=__webpack_require__("./src/mocks/data.ts"),Header=__webpack_require__("./src/components/Header/Header.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),Header_Header=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/Header/Header.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(Header_Header.Z,options);Header_Header.Z&&Header_Header.Z.locals&&Header_Header.Z.locals;var SettingsDrawer=__webpack_require__("./src/components/SettingsDrawer/SettingsDrawer.tsx"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const Header_stories={title:"Widget/Header",component:Header.Z,argTypes:{showShare:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},Template=args=>{const[speakerMuted,setSpeakerMuted]=react.useState(args.speakerMuted),[showSettingsDrawer,setShowSettingsDrawer]=react.useState(!1),[continuousSpeech,setContinuousSpeech]=react.useState(!0),[continuousSpeechTimeout,setContinuousSpeechTimeout]=react.useState(2);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(Header.Z,{...args,speakerMuted,setSpeakerMuted,showSettings:!0,setShowSettingsDrawer:()=>setShowSettingsDrawer(!0)}),(0,jsx_runtime.jsx)(SettingsDrawer.Z,{open:!!showSettingsDrawer,onClose:()=>setShowSettingsDrawer(!1),microphoneMode:"HOLD_TO_TALK",setMicrophoneMode:()=>{},continuousSpeechTimeout:2,setContinuousSpeechTimeout:()=>{},controlsPosition:"bottom",setControlsPosition:()=>{},hideEmissions:!1,setHideEmissions:()=>{}})]})},Default=Template.bind({});Default.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!1,showShare:!1,showSettings:!1};const WithPosition=Template.bind({});WithPosition.args={memori:{...data.jF,needsPosition:!0},history:data.m8,position:{placeName:"Berlin",latitude:52.520008,longitude:13.404954},setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!1,showShare:!1,showSettings:!1};const SpeakerMuted=Template.bind({});SpeakerMuted.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!0,hasUserActivatedSpeak:!1,showShare:!1,showSettings:!1};const WithShare=Template.bind({});WithShare.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!1,showShare:!0,showSettings:!1};const WithSettings=Template.bind({});WithSettings.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!1,showShare:!1,showSettings:!0};const WithClear=Template.bind({});WithClear.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!1,showShare:!1,showSettings:!1,showClear:!0};const WithOngoingChat=Template.bind({});WithOngoingChat.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!0,showShare:!1,showSettings:!1},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...Default.parameters?.docs?.source}}},WithPosition.parameters={...WithPosition.parameters,docs:{...WithPosition.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...WithPosition.parameters?.docs?.source}}},SpeakerMuted.parameters={...SpeakerMuted.parameters,docs:{...SpeakerMuted.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...SpeakerMuted.parameters?.docs?.source}}},WithShare.parameters={...WithShare.parameters,docs:{...WithShare.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...WithShare.parameters?.docs?.source}}},WithSettings.parameters={...WithSettings.parameters,docs:{...WithSettings.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...WithSettings.parameters?.docs?.source}}},WithClear.parameters={...WithClear.parameters,docs:{...WithClear.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...WithClear.parameters?.docs?.source}}},WithOngoingChat.parameters={...WithOngoingChat.parameters,docs:{...WithOngoingChat.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...WithOngoingChat.parameters?.docs?.source}}};const __namedExportsOrder=["Default","WithPosition","SpeakerMuted","WithShare","WithSettings","WithClear","WithOngoingChat"]},"./src/components/icons/Close.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Close=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"})});Close.displayName="Close";const __WEBPACK_DEFAULT_EXPORT__=Close;try{Close.displayName="Close",Close.__docgenInfo={description:"",displayName:"Close",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Close.tsx#Close"]={docgenInfo:Close.__docgenInfo,name:"Close",path:"src/components/icons/Close.tsx#Close"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Spin.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Spin=({spinning=!1,primary=!1,className,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-spin",className,{"memori-spin--spinning":spinning,"memori-spin--primary":primary}),children:[children,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-spin--spinner",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})})]});Spin.displayName="Spin";const __WEBPACK_DEFAULT_EXPORT__=Spin;try{Spin.displayName="Spin",Spin.__docgenInfo={description:"",displayName:"Spin",props:{spinning:{defaultValue:{value:"false"},description:"",name:"spinning",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Spin.tsx#Spin"]={docgenInfo:Spin.__docgenInfo,name:"Spin",path:"src/components/ui/Spin.tsx#Spin"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={id:"locahost:3000",theme:"twincreator",config:{name:"Memori",showNewUser:!0,requirePosition:!1,feedbackURL:"https://form.asana.com/"}},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[1314],{"./src/components/Header/Header.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,SpeakerMuted:()=>SpeakerMuted,WithClear:()=>WithClear,WithOngoingChat:()=>WithOngoingChat,WithPosition:()=>WithPosition,WithSettings:()=>WithSettings,WithShare:()=>WithShare,__namedExportsOrder:()=>__namedExportsOrder,default:()=>Header_stories});var react=__webpack_require__("./node_modules/react/index.js"),data=__webpack_require__("./src/mocks/data.ts"),Header=__webpack_require__("./src/components/Header/Header.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),Header_Header=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/Header/Header.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(Header_Header.Z,options);Header_Header.Z&&Header_Header.Z.locals&&Header_Header.Z.locals;var SettingsDrawer=__webpack_require__("./src/components/SettingsDrawer/SettingsDrawer.tsx"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const Header_stories={title:"Widget/Header",component:Header.Z,argTypes:{showShare:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},Template=args=>{const[speakerMuted,setSpeakerMuted]=react.useState(args.speakerMuted),[showSettingsDrawer,setShowSettingsDrawer]=react.useState(!1),[continuousSpeech,setContinuousSpeech]=react.useState(!0),[continuousSpeechTimeout,setContinuousSpeechTimeout]=react.useState(2);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(Header.Z,{...args,speakerMuted,setSpeakerMuted,showSettings:!0,setShowSettingsDrawer:()=>setShowSettingsDrawer(!0)}),(0,jsx_runtime.jsx)(SettingsDrawer.Z,{open:!!showSettingsDrawer,onClose:()=>setShowSettingsDrawer(!1),microphoneMode:"HOLD_TO_TALK",setMicrophoneMode:()=>{},continuousSpeechTimeout:2,setContinuousSpeechTimeout:()=>{},controlsPosition:"bottom",setControlsPosition:()=>{},hideEmissions:!1,setHideEmissions:()=>{}})]})},Default=Template.bind({});Default.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!1,showShare:!1,showSettings:!1};const WithPosition=Template.bind({});WithPosition.args={memori:{...data.jF,needsPosition:!0},history:data.m8,position:{placeName:"Berlin",latitude:52.520008,longitude:13.404954},setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!1,showShare:!1,showSettings:!1};const SpeakerMuted=Template.bind({});SpeakerMuted.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!0,hasUserActivatedSpeak:!1,showShare:!1,showSettings:!1};const WithShare=Template.bind({});WithShare.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!1,showShare:!0,showSettings:!1};const WithSettings=Template.bind({});WithSettings.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!1,showShare:!1,showSettings:!0};const WithClear=Template.bind({});WithClear.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!1,showShare:!1,showSettings:!1,showClear:!0};const WithOngoingChat=Template.bind({});WithOngoingChat.args={memori:data.jF,history:data.m8,setShowPositionDrawer:()=>{},setShowSettingsDrawer:()=>{},clearHistory:()=>{},speakerMuted:!1,hasUserActivatedSpeak:!0,showShare:!1,showSettings:!1},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...Default.parameters?.docs?.source}}},WithPosition.parameters={...WithPosition.parameters,docs:{...WithPosition.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...WithPosition.parameters?.docs?.source}}},SpeakerMuted.parameters={...SpeakerMuted.parameters,docs:{...SpeakerMuted.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...SpeakerMuted.parameters?.docs?.source}}},WithShare.parameters={...WithShare.parameters,docs:{...WithShare.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...WithShare.parameters?.docs?.source}}},WithSettings.parameters={...WithSettings.parameters,docs:{...WithSettings.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...WithSettings.parameters?.docs?.source}}},WithClear.parameters={...WithClear.parameters,docs:{...WithClear.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...WithClear.parameters?.docs?.source}}},WithOngoingChat.parameters={...WithOngoingChat.parameters,docs:{...WithOngoingChat.parameters?.docs,source:{originalSource:'args => {\n const [speakerMuted, setSpeakerMuted] = React.useState(args.speakerMuted);\n const [showSettingsDrawer, setShowSettingsDrawer] = React.useState(false);\n const [continuousSpeech, setContinuousSpeech] = React.useState(true);\n const [continuousSpeechTimeout, setContinuousSpeechTimeout] = React.useState(2);\n return <>\n
setShowSettingsDrawer(true)} />\n setShowSettingsDrawer(false)} microphoneMode="HOLD_TO_TALK" setMicrophoneMode={() => {}} continuousSpeechTimeout={2} setContinuousSpeechTimeout={() => {}} controlsPosition="bottom" setControlsPosition={() => {}} hideEmissions={false} setHideEmissions={() => {}} />\n ;\n}',...WithOngoingChat.parameters?.docs?.source}}};const __namedExportsOrder=["Default","WithPosition","SpeakerMuted","WithShare","WithSettings","WithClear","WithOngoingChat"]},"./src/components/icons/Close.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Close=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"})});Close.displayName="Close";const __WEBPACK_DEFAULT_EXPORT__=Close;try{Close.displayName="Close",Close.__docgenInfo={description:"",displayName:"Close",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Close.tsx#Close"]={docgenInfo:Close.__docgenInfo,name:"Close",path:"src/components/icons/Close.tsx#Close"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Spin.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Spin=({spinning=!1,primary=!1,className,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-spin",className,{"memori-spin--spinning":spinning,"memori-spin--primary":primary}),children:[children,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-spin--spinner",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})})]});Spin.displayName="Spin";const __WEBPACK_DEFAULT_EXPORT__=Spin;try{Spin.displayName="Spin",Spin.__docgenInfo={description:"",displayName:"Spin",props:{spinning:{defaultValue:{value:"false"},description:"",name:"spinning",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Spin.tsx#Spin"]={docgenInfo:Spin.__docgenInfo,name:"Spin",path:"src/components/ui/Spin.tsx#Spin"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={adminCount:3,config:{feedbackURL:"https://form.asana.com/?k=XC7S3JWQeIhnjipBuA3gbw&d=1199599736247413",name:"TwinCreator",requirePosition:!1,showNewUser:!0},creationTimestamp:"2023-05-31T14:32:48.885287Z",description:"TwinCreator",disableRegistration:!1,id:"app.twincreator.com",lastChangeTimestamp:"2023-05-31T14:32:48.885287Z",logoURL:"https://app.twincreator.com/images/twincreator/logo.png",maxAdmins:0,maxCompletions:0,maxCompletionsPerUser:0,maxFreeSessions:400,maxFreeSessionsPerUser:100,maxMemoriPerAdmin:0,maxMemoriPerUser:3,maxTotalMemori:0,maxUsers:0,memoriCount:0,name:"app.twincreator.com",nonFreeSessionCost:.02,paying:!0,tenantID:"96caa4b4-31a4-48e5-8163-dec61869a2a7",theme:"twincreator",userCount:0,usersCanAccessAPI:!1,usersCanCreateMemori:!1,usersCanEditDynamicIntents:!1,usersCanEditIntegrations:!1,usersCanEditMemoriChaining:!1,usersCanRunSnippets:!1},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file diff --git a/components-MemoriWidget-MemoriWidget-stories.dccd807e.iframe.bundle.js b/components-MemoriWidget-MemoriWidget-stories.fec9fcc5.iframe.bundle.js similarity index 65% rename from components-MemoriWidget-MemoriWidget-stories.dccd807e.iframe.bundle.js rename to components-MemoriWidget-MemoriWidget-stories.fec9fcc5.iframe.bundle.js index 36d56eaf..a6563679 100644 --- a/components-MemoriWidget-MemoriWidget-stories.dccd807e.iframe.bundle.js +++ b/components-MemoriWidget-MemoriWidget-stories.fec9fcc5.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[3829],{"./src/components/MemoriWidget/MemoriWidget.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,ShowClear:()=>ShowClear,ShowInstruct:()=>ShowInstruct,ShowOnlyLastMessages:()=>ShowOnlyLastMessages,ShowOnlyLastMessagesWithAnotherDefault:()=>ShowOnlyLastMessagesWithAnotherDefault,ShowSettings:()=>ShowSettings,ShowShare:()=>ShowShare,WithAzureSpeechKey:()=>WithAzureSpeechKey,WithCustomMediaRenderer:()=>WithCustomMediaRenderer,WithPosition:()=>WithPosition,WithPublicPageIntegration:()=>WithPublicPageIntegration,WithPublicPageIntegrationAndFullbodyAvatar:()=>WithPublicPageIntegrationAndFullbodyAvatar,WithPublicPageIntegrationAndNonDefaultLang:()=>WithPublicPageIntegrationAndNonDefaultLang,WithUserAvatar:()=>WithUserAvatar,WithUserAvatarAsElement:()=>WithUserAvatarAsElement,__namedExportsOrder:()=>__namedExportsOrder,default:()=>MemoriWidget_stories});__webpack_require__("./node_modules/react/index.js");var data=__webpack_require__("./src/mocks/data.ts"),MemoriWidget=__webpack_require__("./src/components/MemoriWidget/MemoriWidget.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),MemoriWidget_MemoriWidget=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/MemoriWidget/MemoriWidget.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(MemoriWidget_MemoriWidget.Z,options);MemoriWidget_MemoriWidget.Z&&MemoriWidget_MemoriWidget.Z.locals&&MemoriWidget_MemoriWidget.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const MemoriWidget_stories={title:"Widget/Default",component:MemoriWidget.Z,argTypes:{AZURE_COGNITIVE_SERVICES_TTS_KEY:{control:{type:"text"}},showShare:{control:{type:"boolean"}},showSettings:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0},layout:"fullscreen"}},Template=args=>(0,jsx_runtime.jsx)(MemoriWidget.Z,{...args});Template.displayName="Template";const Default=Template.bind({});Default.args={memori:data.jF,tenant:data.cm};const WithPosition=Template.bind({});WithPosition.args={memori:{...data.jF,needsPosition:!0},tenant:data.cm};const WithPublicPageIntegration=Template.bind({});WithPublicPageIntegration.args={memori:data.jF,tenant:data.cm,integration:{...data.WM,customData:JSON.stringify({...JSON.parse(data.WM.customData??"{}"),avatar:"readyplayerme",avatarURL:"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#"+new Date(Date.now()).getTime()})}};const WithPublicPageIntegrationAndFullbodyAvatar=Template.bind({});WithPublicPageIntegrationAndFullbodyAvatar.args={memori:data.jF,tenant:data.cm,integration:{...data.WM,customData:JSON.stringify({...JSON.parse(data.WM.customData??"{}"),avatar:"readyplayerme-full",avatarURL:"https://models.readyplayer.me/63b55751f17e295642bf07a2.glb#"+new Date(Date.now()).getTime()})}};const WithPublicPageIntegrationAndNonDefaultLang=Template.bind({});WithPublicPageIntegrationAndNonDefaultLang.args={memori:data.jF,tenant:data.cm,integration:{...data.WM,customData:JSON.stringify({...JSON.parse(data.WM.customData??"{}"),lang:"es"})}};const ShowInstruct=Template.bind({});ShowInstruct.args={memori:{...data.jF,isGiver:!0},tenant:data.cm,showInstruct:!0};const ShowShare=Template.bind({});ShowShare.args={memori:data.jF,tenant:data.cm,showShare:!0};const ShowSettings=Template.bind({});ShowSettings.args={memori:data.jF,tenant:data.cm,showSettings:!0};const ShowClear=Template.bind({});ShowClear.args={memori:data.jF,tenant:data.cm,showClear:!0};const ShowOnlyLastMessages=Template.bind({});ShowOnlyLastMessages.args={memori:data.jF,tenant:data.cm,showOnlyLastMessages:!0};const ShowOnlyLastMessagesWithAnotherDefault=Template.bind({});ShowOnlyLastMessagesWithAnotherDefault.args={memori:data.jF,tenant:data.cm,showOnlyLastMessages:!1,layout:"WEBSITE_ASSISTANT"};const WithAzureSpeechKey=Template.bind({});WithAzureSpeechKey.args={memori:data.jF,tenant:data.cm,AZURE_COGNITIVE_SERVICES_TTS_KEY:"provide your key here"};const WithCustomMediaRenderer=Template.bind({});WithCustomMediaRenderer.args={memori:data.jF,tenant:data.cm,customMediaRenderer:mimeType=>(0,jsx_runtime.jsx)("div",{style:{width:"100%",height:"100%",backgroundColor:"black",color:"white",display:"flex",justifyContent:"center",alignItems:"center"},children:mimeType})};const WithUserAvatar=Template.bind({});WithUserAvatar.args={memori:data.jF,tenant:data.cm,userAvatar:"https://picsum.photos/200"};const WithUserAvatarAsElement=Template.bind({});WithUserAvatarAsElement.args={memori:data.jF,tenant:data.cm,userAvatar:(0,jsx_runtime.jsx)("span",{children:"USER"})},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => ",...Default.parameters?.docs?.source}}},WithPosition.parameters={...WithPosition.parameters,docs:{...WithPosition.parameters?.docs,source:{originalSource:"args => ",...WithPosition.parameters?.docs?.source}}},WithPublicPageIntegration.parameters={...WithPublicPageIntegration.parameters,docs:{...WithPublicPageIntegration.parameters?.docs,source:{originalSource:"args => ",...WithPublicPageIntegration.parameters?.docs?.source}}},WithPublicPageIntegrationAndFullbodyAvatar.parameters={...WithPublicPageIntegrationAndFullbodyAvatar.parameters,docs:{...WithPublicPageIntegrationAndFullbodyAvatar.parameters?.docs,source:{originalSource:"args => ",...WithPublicPageIntegrationAndFullbodyAvatar.parameters?.docs?.source}}},WithPublicPageIntegrationAndNonDefaultLang.parameters={...WithPublicPageIntegrationAndNonDefaultLang.parameters,docs:{...WithPublicPageIntegrationAndNonDefaultLang.parameters?.docs,source:{originalSource:"args => ",...WithPublicPageIntegrationAndNonDefaultLang.parameters?.docs?.source}}},ShowInstruct.parameters={...ShowInstruct.parameters,docs:{...ShowInstruct.parameters?.docs,source:{originalSource:"args => ",...ShowInstruct.parameters?.docs?.source}}},ShowShare.parameters={...ShowShare.parameters,docs:{...ShowShare.parameters?.docs,source:{originalSource:"args => ",...ShowShare.parameters?.docs?.source}}},ShowSettings.parameters={...ShowSettings.parameters,docs:{...ShowSettings.parameters?.docs,source:{originalSource:"args => ",...ShowSettings.parameters?.docs?.source}}},ShowClear.parameters={...ShowClear.parameters,docs:{...ShowClear.parameters?.docs,source:{originalSource:"args => ",...ShowClear.parameters?.docs?.source}}},ShowOnlyLastMessages.parameters={...ShowOnlyLastMessages.parameters,docs:{...ShowOnlyLastMessages.parameters?.docs,source:{originalSource:"args => ",...ShowOnlyLastMessages.parameters?.docs?.source}}},ShowOnlyLastMessagesWithAnotherDefault.parameters={...ShowOnlyLastMessagesWithAnotherDefault.parameters,docs:{...ShowOnlyLastMessagesWithAnotherDefault.parameters?.docs,source:{originalSource:"args => ",...ShowOnlyLastMessagesWithAnotherDefault.parameters?.docs?.source}}},WithAzureSpeechKey.parameters={...WithAzureSpeechKey.parameters,docs:{...WithAzureSpeechKey.parameters?.docs,source:{originalSource:"args => ",...WithAzureSpeechKey.parameters?.docs?.source}}},WithCustomMediaRenderer.parameters={...WithCustomMediaRenderer.parameters,docs:{...WithCustomMediaRenderer.parameters?.docs,source:{originalSource:"args => ",...WithCustomMediaRenderer.parameters?.docs?.source}}},WithUserAvatar.parameters={...WithUserAvatar.parameters,docs:{...WithUserAvatar.parameters?.docs,source:{originalSource:"args => ",...WithUserAvatar.parameters?.docs?.source}}},WithUserAvatarAsElement.parameters={...WithUserAvatarAsElement.parameters,docs:{...WithUserAvatarAsElement.parameters?.docs,source:{originalSource:"args => ",...WithUserAvatarAsElement.parameters?.docs?.source}}};const __namedExportsOrder=["Default","WithPosition","WithPublicPageIntegration","WithPublicPageIntegrationAndFullbodyAvatar","WithPublicPageIntegrationAndNonDefaultLang","ShowInstruct","ShowShare","ShowSettings","ShowClear","ShowOnlyLastMessages","ShowOnlyLastMessagesWithAnotherDefault","WithAzureSpeechKey","WithCustomMediaRenderer","WithUserAvatar","WithUserAvatarAsElement"]},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={id:"locahost:3000",theme:"twincreator",config:{name:"Memori",showNewUser:!0,requirePosition:!1,feedbackURL:"https://form.asana.com/"}},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[3829],{"./src/components/MemoriWidget/MemoriWidget.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,ShowClear:()=>ShowClear,ShowInstruct:()=>ShowInstruct,ShowOnlyLastMessages:()=>ShowOnlyLastMessages,ShowOnlyLastMessagesWithAnotherDefault:()=>ShowOnlyLastMessagesWithAnotherDefault,ShowSettings:()=>ShowSettings,ShowShare:()=>ShowShare,WithAzureSpeechKey:()=>WithAzureSpeechKey,WithCustomMediaRenderer:()=>WithCustomMediaRenderer,WithPosition:()=>WithPosition,WithPublicPageIntegration:()=>WithPublicPageIntegration,WithPublicPageIntegrationAndFullbodyAvatar:()=>WithPublicPageIntegrationAndFullbodyAvatar,WithPublicPageIntegrationAndNonDefaultLang:()=>WithPublicPageIntegrationAndNonDefaultLang,WithUserAvatar:()=>WithUserAvatar,WithUserAvatarAsElement:()=>WithUserAvatarAsElement,__namedExportsOrder:()=>__namedExportsOrder,default:()=>MemoriWidget_stories});__webpack_require__("./node_modules/react/index.js");var data=__webpack_require__("./src/mocks/data.ts"),MemoriWidget=__webpack_require__("./src/components/MemoriWidget/MemoriWidget.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),MemoriWidget_MemoriWidget=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/MemoriWidget/MemoriWidget.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(MemoriWidget_MemoriWidget.Z,options);MemoriWidget_MemoriWidget.Z&&MemoriWidget_MemoriWidget.Z.locals&&MemoriWidget_MemoriWidget.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const MemoriWidget_stories={title:"Widget/Default",component:MemoriWidget.Z,argTypes:{AZURE_COGNITIVE_SERVICES_TTS_KEY:{control:{type:"text"}},showShare:{control:{type:"boolean"}},showSettings:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0},layout:"fullscreen"}},Template=args=>(0,jsx_runtime.jsx)(MemoriWidget.Z,{...args});Template.displayName="Template";const Default=Template.bind({});Default.args={memori:data.jF,tenant:data.cm};const WithPosition=Template.bind({});WithPosition.args={memori:{...data.jF,needsPosition:!0},tenant:data.cm};const WithPublicPageIntegration=Template.bind({});WithPublicPageIntegration.args={memori:data.jF,tenant:data.cm,integration:{...data.WM,customData:JSON.stringify({...JSON.parse(data.WM.customData??"{}"),avatar:"readyplayerme",avatarURL:"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#"+new Date(Date.now()).getTime()})}};const WithPublicPageIntegrationAndFullbodyAvatar=Template.bind({});WithPublicPageIntegrationAndFullbodyAvatar.args={memori:data.jF,tenant:data.cm,integration:{...data.WM,customData:JSON.stringify({...JSON.parse(data.WM.customData??"{}"),avatar:"readyplayerme-full",avatarURL:"https://models.readyplayer.me/63b55751f17e295642bf07a2.glb#"+new Date(Date.now()).getTime()})}};const WithPublicPageIntegrationAndNonDefaultLang=Template.bind({});WithPublicPageIntegrationAndNonDefaultLang.args={memori:data.jF,tenant:data.cm,integration:{...data.WM,customData:JSON.stringify({...JSON.parse(data.WM.customData??"{}"),lang:"es"})}};const ShowInstruct=Template.bind({});ShowInstruct.args={memori:{...data.jF,isGiver:!0},tenant:data.cm,showInstruct:!0};const ShowShare=Template.bind({});ShowShare.args={memori:data.jF,tenant:data.cm,showShare:!0};const ShowSettings=Template.bind({});ShowSettings.args={memori:data.jF,tenant:data.cm,showSettings:!0};const ShowClear=Template.bind({});ShowClear.args={memori:data.jF,tenant:data.cm,showClear:!0};const ShowOnlyLastMessages=Template.bind({});ShowOnlyLastMessages.args={memori:data.jF,tenant:data.cm,showOnlyLastMessages:!0};const ShowOnlyLastMessagesWithAnotherDefault=Template.bind({});ShowOnlyLastMessagesWithAnotherDefault.args={memori:data.jF,tenant:data.cm,showOnlyLastMessages:!1,layout:"WEBSITE_ASSISTANT"};const WithAzureSpeechKey=Template.bind({});WithAzureSpeechKey.args={memori:data.jF,tenant:data.cm,AZURE_COGNITIVE_SERVICES_TTS_KEY:"provide your key here"};const WithCustomMediaRenderer=Template.bind({});WithCustomMediaRenderer.args={memori:data.jF,tenant:data.cm,customMediaRenderer:mimeType=>(0,jsx_runtime.jsx)("div",{style:{width:"100%",height:"100%",backgroundColor:"black",color:"white",display:"flex",justifyContent:"center",alignItems:"center"},children:mimeType})};const WithUserAvatar=Template.bind({});WithUserAvatar.args={memori:data.jF,tenant:data.cm,userAvatar:"https://picsum.photos/200"};const WithUserAvatarAsElement=Template.bind({});WithUserAvatarAsElement.args={memori:data.jF,tenant:data.cm,userAvatar:(0,jsx_runtime.jsx)("span",{children:"USER"})},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => ",...Default.parameters?.docs?.source}}},WithPosition.parameters={...WithPosition.parameters,docs:{...WithPosition.parameters?.docs,source:{originalSource:"args => ",...WithPosition.parameters?.docs?.source}}},WithPublicPageIntegration.parameters={...WithPublicPageIntegration.parameters,docs:{...WithPublicPageIntegration.parameters?.docs,source:{originalSource:"args => ",...WithPublicPageIntegration.parameters?.docs?.source}}},WithPublicPageIntegrationAndFullbodyAvatar.parameters={...WithPublicPageIntegrationAndFullbodyAvatar.parameters,docs:{...WithPublicPageIntegrationAndFullbodyAvatar.parameters?.docs,source:{originalSource:"args => ",...WithPublicPageIntegrationAndFullbodyAvatar.parameters?.docs?.source}}},WithPublicPageIntegrationAndNonDefaultLang.parameters={...WithPublicPageIntegrationAndNonDefaultLang.parameters,docs:{...WithPublicPageIntegrationAndNonDefaultLang.parameters?.docs,source:{originalSource:"args => ",...WithPublicPageIntegrationAndNonDefaultLang.parameters?.docs?.source}}},ShowInstruct.parameters={...ShowInstruct.parameters,docs:{...ShowInstruct.parameters?.docs,source:{originalSource:"args => ",...ShowInstruct.parameters?.docs?.source}}},ShowShare.parameters={...ShowShare.parameters,docs:{...ShowShare.parameters?.docs,source:{originalSource:"args => ",...ShowShare.parameters?.docs?.source}}},ShowSettings.parameters={...ShowSettings.parameters,docs:{...ShowSettings.parameters?.docs,source:{originalSource:"args => ",...ShowSettings.parameters?.docs?.source}}},ShowClear.parameters={...ShowClear.parameters,docs:{...ShowClear.parameters?.docs,source:{originalSource:"args => ",...ShowClear.parameters?.docs?.source}}},ShowOnlyLastMessages.parameters={...ShowOnlyLastMessages.parameters,docs:{...ShowOnlyLastMessages.parameters?.docs,source:{originalSource:"args => ",...ShowOnlyLastMessages.parameters?.docs?.source}}},ShowOnlyLastMessagesWithAnotherDefault.parameters={...ShowOnlyLastMessagesWithAnotherDefault.parameters,docs:{...ShowOnlyLastMessagesWithAnotherDefault.parameters?.docs,source:{originalSource:"args => ",...ShowOnlyLastMessagesWithAnotherDefault.parameters?.docs?.source}}},WithAzureSpeechKey.parameters={...WithAzureSpeechKey.parameters,docs:{...WithAzureSpeechKey.parameters?.docs,source:{originalSource:"args => ",...WithAzureSpeechKey.parameters?.docs?.source}}},WithCustomMediaRenderer.parameters={...WithCustomMediaRenderer.parameters,docs:{...WithCustomMediaRenderer.parameters?.docs,source:{originalSource:"args => ",...WithCustomMediaRenderer.parameters?.docs?.source}}},WithUserAvatar.parameters={...WithUserAvatar.parameters,docs:{...WithUserAvatar.parameters?.docs,source:{originalSource:"args => ",...WithUserAvatar.parameters?.docs?.source}}},WithUserAvatarAsElement.parameters={...WithUserAvatarAsElement.parameters,docs:{...WithUserAvatarAsElement.parameters?.docs,source:{originalSource:"args => ",...WithUserAvatarAsElement.parameters?.docs?.source}}};const __namedExportsOrder=["Default","WithPosition","WithPublicPageIntegration","WithPublicPageIntegrationAndFullbodyAvatar","WithPublicPageIntegrationAndNonDefaultLang","ShowInstruct","ShowShare","ShowSettings","ShowClear","ShowOnlyLastMessages","ShowOnlyLastMessagesWithAnotherDefault","WithAzureSpeechKey","WithCustomMediaRenderer","WithUserAvatar","WithUserAvatarAsElement"]},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={adminCount:3,config:{feedbackURL:"https://form.asana.com/?k=XC7S3JWQeIhnjipBuA3gbw&d=1199599736247413",name:"TwinCreator",requirePosition:!1,showNewUser:!0},creationTimestamp:"2023-05-31T14:32:48.885287Z",description:"TwinCreator",disableRegistration:!1,id:"app.twincreator.com",lastChangeTimestamp:"2023-05-31T14:32:48.885287Z",logoURL:"https://app.twincreator.com/images/twincreator/logo.png",maxAdmins:0,maxCompletions:0,maxCompletionsPerUser:0,maxFreeSessions:400,maxFreeSessionsPerUser:100,maxMemoriPerAdmin:0,maxMemoriPerUser:3,maxTotalMemori:0,maxUsers:0,memoriCount:0,name:"app.twincreator.com",nonFreeSessionCost:.02,paying:!0,tenantID:"96caa4b4-31a4-48e5-8163-dec61869a2a7",theme:"twincreator",userCount:0,usersCanAccessAPI:!1,usersCanCreateMemori:!1,usersCanEditDynamicIntents:!1,usersCanEditIntegrations:!1,usersCanEditMemoriChaining:!1,usersCanRunSnippets:!1},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file diff --git a/components-ShareButton-ShareButton-stories.82885de2.iframe.bundle.js b/components-ShareButton-ShareButton-stories.82885de2.iframe.bundle.js new file mode 100644 index 00000000..2804499a --- /dev/null +++ b/components-ShareButton-ShareButton-stories.82885de2.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[2192],{"./src/components/ShareButton/ShareButton.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Alignment:()=>Alignment,Default:()=>Default,WithQrCode:()=>WithQrCode,WithQrCodeAndOtherTenant:()=>WithQrCodeAndOtherTenant,WithQrCodeAndTenant:()=>WithQrCodeAndTenant,__namedExportsOrder:()=>__namedExportsOrder,default:()=>ShareButton_stories});__webpack_require__("./node_modules/react/index.js");var ShareButton=__webpack_require__("./src/components/ShareButton/ShareButton.tsx"),data=__webpack_require__("./src/mocks/data.ts"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),ShareButton_ShareButton=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/ShareButton/ShareButton.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(ShareButton_ShareButton.Z,options);ShareButton_ShareButton.Z&&ShareButton_ShareButton.Z.locals&&ShareButton_ShareButton.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const ShareButton_stories={title:"Share Button",component:ShareButton.Z,argTypes:{url:{control:{type:"text"}},showQrCode:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},Template=args=>(0,jsx_runtime.jsx)(ShareButton.Z,{...args});Template.displayName="Template";const TemplateRight=args=>(0,jsx_runtime.jsx)("div",{style:{textAlign:"right"},children:(0,jsx_runtime.jsx)(ShareButton.Z,{...args})});TemplateRight.displayName="TemplateRight";const Default=Template.bind({});Default.args={url:"https://memori.ai",showQrCode:!1,align:"right"};const Alignment=TemplateRight.bind({});Alignment.args={url:"https://memori.ai",align:"left"};const WithQrCode=Template.bind({});WithQrCode.args={url:"https://memori.ai",showQrCode:!0,align:"right"};const WithQrCodeAndTenant=Template.bind({});WithQrCodeAndTenant.args={url:"https://memori.ai",showQrCode:!0,align:"right",tenant:data.cm};const WithQrCodeAndOtherTenant=Template.bind({});WithQrCodeAndOtherTenant.args={url:"https://memori.ai",showQrCode:!0,align:"right",tenant:{...data.cm,theme:"tailoor"}},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => ",...Default.parameters?.docs?.source}}},Alignment.parameters={...Alignment.parameters,docs:{...Alignment.parameters?.docs,source:{originalSource:"args =>
\n \n
",...Alignment.parameters?.docs?.source}}},WithQrCode.parameters={...WithQrCode.parameters,docs:{...WithQrCode.parameters?.docs,source:{originalSource:"args => ",...WithQrCode.parameters?.docs?.source}}},WithQrCodeAndTenant.parameters={...WithQrCodeAndTenant.parameters,docs:{...WithQrCodeAndTenant.parameters?.docs,source:{originalSource:"args => ",...WithQrCodeAndTenant.parameters?.docs?.source}}},WithQrCodeAndOtherTenant.parameters={...WithQrCodeAndOtherTenant.parameters,docs:{...WithQrCodeAndOtherTenant.parameters?.docs,source:{originalSource:"args => ",...WithQrCodeAndOtherTenant.parameters?.docs?.source}}};const __namedExportsOrder=["Default","Alignment","WithQrCode","WithQrCodeAndTenant","WithQrCodeAndOtherTenant"]},"./src/components/ShareButton/ShareButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_i18next__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_Facebook__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/icons/Facebook.tsx"),_icons_Twitter__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Twitter.tsx"),_icons_Linkedin__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Linkedin.tsx"),_icons_WhatsApp__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/WhatsApp.tsx"),_icons_Mail__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/icons/Mail.tsx"),_icons_Link__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/icons/Link.tsx"),_icons_Share__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/Share.tsx"),_icons_Download__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/icons/Download.tsx"),_icons_Telegram__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/components/icons/Telegram.tsx"),qrcode_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/qrcode.react/lib/esm/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./src/components/ui/Button.tsx"),classnames__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_12__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ShareButton=({tenant,url,title="",className,baseUrl,primary=!0,showQrCode=!0,align="right"})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_14__.$)(),[targetUrl,setTargetUrl]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(url),qrImageURL=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>tenant?.theme?`${baseUrl??"https://app.twincreator.com"}/images/${tenant.theme}/square_logo.png`:`${baseUrl??"https://app.twincreator.com"}/images/memori_logo.png`),[tenant,baseUrl]);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{url||setTargetUrl(window.location.href)}),[url]);const socialShare=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${targetUrl}`,icon:_icons_Facebook__WEBPACK_IMPORTED_MODULE_1__.default},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${targetUrl}`,icon:_icons_Twitter__WEBPACK_IMPORTED_MODULE_2__.default},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${title}&url=${targetUrl}`,icon:_icons_Linkedin__WEBPACK_IMPORTED_MODULE_3__.default},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${targetUrl}`,icon:_icons_WhatsApp__WEBPACK_IMPORTED_MODULE_4__.default},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${title}&url=${targetUrl}`,icon:_icons_Telegram__WEBPACK_IMPORTED_MODULE_9__.default},{id:"email",title:"Email",url:`mailto:?subject=${title?.length>0?title:url}&body=${targetUrl}`,icon:_icons_Mail__WEBPACK_IMPORTED_MODULE_5__.default}];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v,{as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-share-button",{"memori-share-button--align-left":"left"===align}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Button,{className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",className,{"memori-button--primary":primary}),title:t("widget.share")||void 0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Share__WEBPACK_IMPORTED_MODULE_7__.default,{})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_11__.Z,{className:"memori-share-button--link",ghost:!0,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Link__WEBPACK_IMPORTED_MODULE_6__.default,{}),onClick:()=>{targetUrl&&navigator.clipboard.writeText(targetUrl)},children:t("copyToClipboard")||void 0})},"copy"),socialShare.map((item=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("a",{className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:item.url??"",target:"_blank",rel:"noopener noreferrer",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(item.icon,{})}),item.title]})},item.id))),showQrCode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(qrcode_react__WEBPACK_IMPORTED_MODULE_10__.Qd,{id:"qr-canvas",value:targetUrl??"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:qrImageURL,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_11__.Z,{onClick:()=>{const canvas=document.getElementById("qr-canvas");if(!canvas)return;const link=document.createElement("a");link.href=canvas.toDataURL(),link.download=`memori-${title}-share.png`,document.body.appendChild(link),link.click(),document.body.removeChild(link)},icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Download__WEBPACK_IMPORTED_MODULE_8__.default,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};ShareButton.displayName="ShareButton";const __WEBPACK_DEFAULT_EXPORT__=ShareButton;try{ShareButton.displayName="ShareButton",ShareButton.__docgenInfo={description:"",displayName:"ShareButton",props:{tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},title:{defaultValue:{value:""},description:"",name:"title",required:!1,type:{name:"string"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},primary:{defaultValue:{value:"true"},description:"",name:"primary",required:!1,type:{name:"boolean"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},showQrCode:{defaultValue:{value:"true"},description:"",name:"showQrCode",required:!1,type:{name:"boolean"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'}]}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ShareButton/ShareButton.tsx#ShareButton"]={docgenInfo:ShareButton.__docgenInfo,name:"ShareButton",path:"src/components/ShareButton/ShareButton.tsx#ShareButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Download.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Download=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})});Download.displayName="Download";const __WEBPACK_DEFAULT_EXPORT__=Download;try{Download.displayName="Download",Download.__docgenInfo={description:"",displayName:"Download",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Download.tsx#Download"]={docgenInfo:Download.__docgenInfo,name:"Download",path:"src/components/icons/Download.tsx#Download"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Facebook.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Facebook=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-32 736H663.9V602.2h104l15.6-120.7H663.9v-77.1c0-35 9.7-58.8 59.8-58.8h63.9v-108c-11.1-1.5-49-4.8-93.2-4.8-92.2 0-155.3 56.3-155.3 159.6v89H434.9v120.7h104.3V848H176V176h672v672z"})});Facebook.displayName="Facebook";const __WEBPACK_DEFAULT_EXPORT__=Facebook;try{Facebook.displayName="Facebook",Facebook.__docgenInfo={description:"",displayName:"Facebook",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Facebook.tsx#Facebook"]={docgenInfo:Facebook.__docgenInfo,name:"Facebook",path:"src/components/icons/Facebook.tsx#Facebook"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Link.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Link=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})});Link.displayName="Link";const __WEBPACK_DEFAULT_EXPORT__=Link;try{Link.displayName="Link",Link.__docgenInfo={description:"",displayName:"Link",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Link.tsx#Link"]={docgenInfo:Link.__docgenInfo,name:"Link",path:"src/components/icons/Link.tsx#Link"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Linkedin.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const LinkedIn=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M847.7 112H176.3c-35.5 0-64.3 28.8-64.3 64.3v671.4c0 35.5 28.8 64.3 64.3 64.3h671.4c35.5 0 64.3-28.8 64.3-64.3V176.3c0-35.5-28.8-64.3-64.3-64.3zm0 736c-447.8-.1-671.7-.2-671.7-.3.1-447.8.2-671.7.3-671.7 447.8.1 671.7.2 671.7.3-.1 447.8-.2 671.7-.3 671.7zM230.6 411.9h118.7v381.8H230.6zm59.4-52.2c37.9 0 68.8-30.8 68.8-68.8a68.8 68.8 0 1 0-137.6 0c-.1 38 30.7 68.8 68.8 68.8zm252.3 245.1c0-49.8 9.5-98 71.2-98 60.8 0 61.7 56.9 61.7 101.2v185.7h118.6V584.3c0-102.8-22.2-181.9-142.3-181.9-57.7 0-96.4 31.7-112.3 61.7h-1.6v-52.2H423.7v381.8h118.6V604.8z"})});LinkedIn.displayName="LinkedIn";const __WEBPACK_DEFAULT_EXPORT__=LinkedIn;try{Linkedin.displayName="Linkedin",Linkedin.__docgenInfo={description:"",displayName:"Linkedin",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Linkedin.tsx#Linkedin"]={docgenInfo:Linkedin.__docgenInfo,name:"Linkedin",path:"src/components/icons/Linkedin.tsx#Linkedin"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Mail.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Mail=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0 0 68.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"})});Mail.displayName="Mail";const __WEBPACK_DEFAULT_EXPORT__=Mail;try{Mail.displayName="Mail",Mail.__docgenInfo={description:"",displayName:"Mail",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Mail.tsx#Mail"]={docgenInfo:Mail.__docgenInfo,name:"Mail",path:"src/components/icons/Mail.tsx#Mail"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Share.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Share=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M752 664c-28.5 0-54.8 10-75.4 26.7L469.4 540.8a160.68 160.68 0 0 0 0-57.6l207.2-149.9C697.2 350 723.5 360 752 360c66.2 0 120-53.8 120-120s-53.8-120-120-120-120 53.8-120 120c0 11.6 1.6 22.7 4.7 33.3L439.9 415.8C410.7 377.1 364.3 352 312 352c-88.4 0-160 71.6-160 160s71.6 160 160 160c52.3 0 98.7-25.1 127.9-63.8l196.8 142.5c-3.1 10.6-4.7 21.8-4.7 33.3 0 66.2 53.8 120 120 120s120-53.8 120-120-53.8-120-120-120zm0-476c28.7 0 52 23.3 52 52s-23.3 52-52 52-52-23.3-52-52 23.3-52 52-52zM312 600c-48.5 0-88-39.5-88-88s39.5-88 88-88 88 39.5 88 88-39.5 88-88 88zm440 236c-28.7 0-52-23.3-52-52s23.3-52 52-52 52 23.3 52 52-23.3 52-52 52z"})});Share.displayName="Share";const __WEBPACK_DEFAULT_EXPORT__=Share;try{Share.displayName="Share",Share.__docgenInfo={description:"",displayName:"Share",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Share.tsx#Share"]={docgenInfo:Share.__docgenInfo,name:"Share",path:"src/components/icons/Share.tsx#Share"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Telegram.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Telegram=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fill:"currentColor",d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm121.8 169.9l-40.7 191.8c-3 13.6-11.1 16.9-22.4 10.5l-62-45.7-29.9 28.8c-3.3 3.3-6.1 6.1-12.5 6.1l4.4-63.1 114.9-103.8c5-4.4-1.1-6.9-7.7-2.5l-142 89.4-61.2-19.1c-13.3-4.2-13.6-13.3 2.8-19.7l239.1-92.2c11.1-4 20.8 2.7 17.2 19.5z"})});Telegram.displayName="Telegram";const __WEBPACK_DEFAULT_EXPORT__=Telegram;try{Telegram.displayName="Telegram",Telegram.__docgenInfo={description:"",displayName:"Telegram",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Telegram.tsx#Telegram"]={docgenInfo:Telegram.__docgenInfo,name:"Telegram",path:"src/components/icons/Telegram.tsx#Telegram"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Twitter.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Twitter=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M928 254.3c-30.6 13.2-63.9 22.7-98.2 26.4a170.1 170.1 0 0 0 75-94 336.64 336.64 0 0 1-108.2 41.2A170.1 170.1 0 0 0 672 174c-94.5 0-170.5 76.6-170.5 170.6 0 13.2 1.6 26.4 4.2 39.1-141.5-7.4-267.7-75-351.6-178.5a169.32 169.32 0 0 0-23.2 86.1c0 59.2 30.1 111.4 76 142.1a172 172 0 0 1-77.1-21.7v2.1c0 82.9 58.6 151.6 136.7 167.4a180.6 180.6 0 0 1-44.9 5.8c-11.1 0-21.6-1.1-32.2-2.6C211 652 273.9 701.1 348.8 702.7c-58.6 45.9-132 72.9-211.7 72.9-14.3 0-27.5-.5-41.2-2.1C171.5 822 261.2 850 357.8 850 671.4 850 843 590.2 843 364.7c0-7.4 0-14.8-.5-22.2 33.2-24.3 62.3-54.4 85.5-88.2z"})});Twitter.displayName="Twitter";const __WEBPACK_DEFAULT_EXPORT__=Twitter;try{Twitter.displayName="Twitter",Twitter.__docgenInfo={description:"",displayName:"Twitter",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Twitter.tsx#Twitter"]={docgenInfo:Twitter.__docgenInfo,name:"Twitter",path:"src/components/icons/Twitter.tsx#Twitter"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/WhatsApp.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const WhatsApp=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M713.5 599.9c-10.9-5.6-65.2-32.2-75.3-35.8-10.1-3.8-17.5-5.6-24.8 5.6-7.4 11.1-28.4 35.8-35 43.3-6.4 7.4-12.9 8.3-23.8 2.8-64.8-32.4-107.3-57.8-150-131.1-11.3-19.5 11.3-18.1 32.4-60.2 3.6-7.4 1.8-13.7-1-19.3-2.8-5.6-24.8-59.8-34-81.9-8.9-21.5-18.1-18.5-24.8-18.9-6.4-.4-13.7-.4-21.1-.4-7.4 0-19.3 2.8-29.4 13.7-10.1 11.1-38.6 37.8-38.6 92s39.5 106.7 44.9 114.1c5.6 7.4 77.7 118.6 188.4 166.5 70 30.2 97.4 32.8 132.4 27.6 21.3-3.2 65.2-26.6 74.3-52.5 9.1-25.8 9.1-47.9 6.4-52.5-2.7-4.9-10.1-7.7-21-13z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M925.2 338.4c-22.6-53.7-55-101.9-96.3-143.3-41.3-41.3-89.5-73.8-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9-53.3 22.8-101.1 55.2-142 96.5-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9.3 69.4 16.9 138.3 48 199.9v152c0 25.4 20.6 46 46 46h152.1c61.6 31.1 130.5 47.7 199.9 48h2.1c59.9 0 118-11.6 172.7-34.3 53.5-22.3 101.6-54.3 142.8-95.2 41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"})]});WhatsApp.displayName="WhatsApp";const __WEBPACK_DEFAULT_EXPORT__=WhatsApp;try{WhatsApp.displayName="WhatsApp",WhatsApp.__docgenInfo={description:"",displayName:"WhatsApp",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/WhatsApp.tsx#WhatsApp"]={docgenInfo:WhatsApp.__docgenInfo,name:"WhatsApp",path:"src/components/icons/WhatsApp.tsx#WhatsApp"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/mocks/data.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Eu:()=>historyWithMedia,Gs:()=>dialogState,I_:()=>historyWithAIGeneratedMessages,M9:()=>sessionID,WM:()=>integration,cm:()=>tenant,jF:()=>memori,m8:()=>history});const sessionID="131165be-9d1a-42fb-a3ce-e8f86d40c88f",tenant={adminCount:3,config:{feedbackURL:"https://form.asana.com/?k=XC7S3JWQeIhnjipBuA3gbw&d=1199599736247413",name:"TwinCreator",requirePosition:!1,showNewUser:!0},creationTimestamp:"2023-05-31T14:32:48.885287Z",description:"TwinCreator",disableRegistration:!1,id:"app.twincreator.com",lastChangeTimestamp:"2023-05-31T14:32:48.885287Z",logoURL:"https://app.twincreator.com/images/twincreator/logo.png",maxAdmins:0,maxCompletions:0,maxCompletionsPerUser:0,maxFreeSessions:400,maxFreeSessionsPerUser:100,maxMemoriPerAdmin:0,maxMemoriPerUser:3,maxTotalMemori:0,maxUsers:0,memoriCount:0,name:"app.twincreator.com",nonFreeSessionCost:.02,paying:!0,tenantID:"96caa4b4-31a4-48e5-8163-dec61869a2a7",theme:"twincreator",userCount:0,usersCanAccessAPI:!1,usersCanCreateMemori:!1,usersCanEditDynamicIntents:!1,usersCanEditIntegrations:!1,usersCanEditMemoriChaining:!1,usersCanRunSnippets:!1},memori={memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",engineMemoriID:"66b4e161-2431-4b21-9b70-d8c27de730ca",name:"Memori",memoriConfigurationID:"MemoriCloud-it_IT",description:"Lorem ipsum.",voiceType:"male",isGiver:!0,isReceiver:!1,privacyType:"PUBLIC",needsPosition:!1,culture:"it-IT",categories:[],publishedInTheMetaverse:!0,exposed:!0,enableCompletions:!0,nsfw:!1,ageRestriction:14,contentQualityIndex:66.6,contentQualityIndexTimestamp:"2021-03-01T12:00:00.000Z",ownerUserName:"username",ownerTenantName:"app.twincreator.com",ownerUserID:"97c42d18-ffe4-47e1-a3c7-e42729f1e6a3",metaverseEnvironment:"synthwave",secretToken:"awanagana",giverPIN:"1234",giverTag:"🧑‍💻",avatarURL:"https://app.twincreator.com/images/twincreator/square_logo.png",coverURL:"https://app.twincreator.com/images/twincreator/og-image.png"},history=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],historyWithMedia=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Mi dispiace, le mie risposte sono limitate. Devi farmi le domande giuste. C'è altro che vuoi sapere?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui delle cose per te.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai/en",mimeType:"text/html",title:"Link Memori Srl"},{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efce",url:"https://rawmaterial.it/en",mimeType:"text/html",title:"Link RawMaterial"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:"text/html",title:"Introducing Plone Remix | Vimeo",url:"https://vimeo.com/766468314"},{mediumID:"95226d7e-7bae-465e-8b80-995587bb5969",mimeType:"text/html",title:"A sustainable web: is it possible? - Nicola Zambello | YouTube",url:"https://www.youtube.com/watch?v=feH26j3rBz8"},...Array.from({length:3},((_,i)=>({mediumID:`95226d7e-7bae-465e-8b80-995587bb597${i}`,mimeType:"image/png",title:`Image ${i}`,url:`https://picsum.photos/${i%2?"200":"300"}/${i%3?"300":"200"}?random=${i}`})))],timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z"}],historyWithAIGeneratedMessages=[{text:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Prova",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Sa. Sa. Prova",timestamp:"2021-03-01T12:00:00.000Z"},{text:"Come faccio a fare delle cose con questa cosa?",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Ecco qui come.",media:[{mediumID:"c6851968-5d4d-409a-ae75-f22ec077efcd",url:"https://memori.ai",mimeType:"text/html",title:"Link"}],timestamp:"2021-03-01T12:00:00.000Z",generatedByAI:!0,contextVars:{TEST:"test"}},{text:"Ah, grazie! Ciao!",fromUser:!0,timestamp:"2021-03-01T12:00:00.000Z"},{text:"Arrivederci.",timestamp:"2021-03-01T12:00:00.000Z",contextVars:{TEST:"test"}}],dialogState={state:"R1",previousState:"I0",stateName:"WaitingForReceiverQuestion",confidence:1,knownTags:{"☠️":"test","😎":"Ciccio"},emission:"Ciao, io sono test, c'è qualcosa che vorresti chiedermi?",hints:["Va bene","No grazie"],media:[],acceptsTimeout:!0,acceptsAbort:!1,acceptsMedia:!1,acceptsDate:!1,acceptsPlace:!1,acceptsTag:!1,giverID:"c832e2dc-403c-4baf-a3b7-2374e100dbcf",contextVars:{}},integration={integrationID:"cb3c4776-7f0b-4f97-a773-c32a5d7a3bf1",memoriID:"25ced51c-3520-41af-8bbe-222d861b8e32",type:"LANDING_EXPERIENCE",state:"NEW",deviceEmails:[],customData:'{"textColor":"#2a2a2a","buttonBgColor":"#823ce1","buttonTextColor":"#ffffff","name":"Web","globalBackground":"https://assets.memori.ai/api/v2/asset/364e498c-11da-42d5-9e32-19e5d137d4b8.jpeg","blurBackground":true,"innerBgColor":"light","innerBgAlpha":0.8,"multilanguage":true,"avatar":"readyplayerme","avatarURL":"https://assets.memori.ai/api/v2/asset/b791f77c-1a94-4272-829e-eca82fcc62b7.glb#1669663599444"}',resources:[],publish:!0,creationTimestamp:"2022-06-11T14:13:45.685038Z",lastChangeTimestamp:"2022-06-11T14:13:45.685038Z"}}}]); \ No newline at end of file diff --git a/components-ShareButton-ShareButton-stories.be621fc5.iframe.bundle.js b/components-ShareButton-ShareButton-stories.be621fc5.iframe.bundle.js deleted file mode 100644 index a8da118e..00000000 --- a/components-ShareButton-ShareButton-stories.be621fc5.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[2192],{"./src/components/ShareButton/ShareButton.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Alignment:()=>Alignment,Default:()=>Default,WithQrCode:()=>WithQrCode,__namedExportsOrder:()=>__namedExportsOrder,default:()=>ShareButton_stories});__webpack_require__("./node_modules/react/index.js");var ShareButton=__webpack_require__("./src/components/ShareButton/ShareButton.tsx"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),ShareButton_ShareButton=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/ShareButton/ShareButton.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(ShareButton_ShareButton.Z,options);ShareButton_ShareButton.Z&&ShareButton_ShareButton.Z.locals&&ShareButton_ShareButton.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const ShareButton_stories={title:"Share Button",component:ShareButton.Z,argTypes:{url:{control:{type:"text"}},showQrCode:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},Template=args=>(0,jsx_runtime.jsx)(ShareButton.Z,{...args});Template.displayName="Template";const TemplateRight=args=>(0,jsx_runtime.jsx)("div",{style:{textAlign:"right"},children:(0,jsx_runtime.jsx)(ShareButton.Z,{...args})});TemplateRight.displayName="TemplateRight";const Default=Template.bind({});Default.args={url:"https://memori.ai",showQrCode:!1,align:"right"};const WithQrCode=Template.bind({});WithQrCode.args={url:"https://memori.ai",showQrCode:!0,align:"right"};const Alignment=TemplateRight.bind({});Alignment.args={url:"https://memori.ai",align:"left"},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => ",...Default.parameters?.docs?.source}}},WithQrCode.parameters={...WithQrCode.parameters,docs:{...WithQrCode.parameters?.docs,source:{originalSource:"args => ",...WithQrCode.parameters?.docs?.source}}},Alignment.parameters={...Alignment.parameters,docs:{...Alignment.parameters?.docs,source:{originalSource:"args =>
\n \n
",...Alignment.parameters?.docs?.source}}};const __namedExportsOrder=["Default","WithQrCode","Alignment"]},"./src/components/ShareButton/ShareButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_i18next__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_Facebook__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/icons/Facebook.tsx"),_icons_Twitter__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Twitter.tsx"),_icons_Linkedin__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Linkedin.tsx"),_icons_WhatsApp__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/WhatsApp.tsx"),_icons_Mail__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/icons/Mail.tsx"),_icons_Link__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/icons/Link.tsx"),_icons_Share__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/Share.tsx"),_icons_Download__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/icons/Download.tsx"),_icons_Telegram__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/components/icons/Telegram.tsx"),qrcode_react__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/qrcode.react/lib/esm/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./src/components/ui/Button.tsx"),classnames__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_12__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ShareButton=({url,title="",className,baseUrl,primary=!0,showQrCode=!0,align="right"})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_14__.$)(),[targetUrl,setTargetUrl]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(url);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{url||setTargetUrl(window.location.href)}),[url]);const socialShare=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${targetUrl}`,icon:_icons_Facebook__WEBPACK_IMPORTED_MODULE_1__.default},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${targetUrl}`,icon:_icons_Twitter__WEBPACK_IMPORTED_MODULE_2__.default},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${title}&url=${targetUrl}`,icon:_icons_Linkedin__WEBPACK_IMPORTED_MODULE_3__.default},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${targetUrl}`,icon:_icons_WhatsApp__WEBPACK_IMPORTED_MODULE_4__.default},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${title}&url=${targetUrl}`,icon:_icons_Telegram__WEBPACK_IMPORTED_MODULE_9__.default},{id:"email",title:"Email",url:`mailto:?subject=${title?.length>0?title:url}&body=${targetUrl}`,icon:_icons_Mail__WEBPACK_IMPORTED_MODULE_5__.default}];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v,{as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-share-button",{"memori-share-button--align-left":"left"===align}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Button,{className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",className,{"memori-button--primary":primary}),title:t("widget.share")||void 0,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Share__WEBPACK_IMPORTED_MODULE_7__.default,{})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_11__.Z,{className:"memori-share-button--link",ghost:!0,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Link__WEBPACK_IMPORTED_MODULE_6__.default,{}),onClick:()=>{targetUrl&&navigator.clipboard.writeText(targetUrl)},children:t("copyToClipboard")||void 0})},"copy"),socialShare.map((item=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("a",{className:classnames__WEBPACK_IMPORTED_MODULE_12___default()("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:item.url??"",target:"_blank",rel:"noopener noreferrer",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(item.icon,{})}),item.title]})},item.id))),showQrCode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_15__.v.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(qrcode_react__WEBPACK_IMPORTED_MODULE_10__.Qd,{id:"qr-canvas",value:targetUrl??"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:`${baseUrl||"https://app.twincreator.com"}/images/memori_logo.png`,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_11__.Z,{onClick:()=>{const canvas=document.getElementById("qr-canvas");if(!canvas)return;const link=document.createElement("a");link.href=canvas.toDataURL(),link.download=`memori-${title}-share.png`,document.body.appendChild(link),link.click(),document.body.removeChild(link)},icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_icons_Download__WEBPACK_IMPORTED_MODULE_8__.default,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};ShareButton.displayName="ShareButton";const __WEBPACK_DEFAULT_EXPORT__=ShareButton;try{ShareButton.displayName="ShareButton",ShareButton.__docgenInfo={description:"",displayName:"ShareButton",props:{url:{defaultValue:null,description:"",name:"url",required:!1,type:{name:"string"}},title:{defaultValue:{value:""},description:"",name:"title",required:!1,type:{name:"string"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},primary:{defaultValue:{value:"true"},description:"",name:"primary",required:!1,type:{name:"boolean"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},showQrCode:{defaultValue:{value:"true"},description:"",name:"showQrCode",required:!1,type:{name:"boolean"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'}]}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ShareButton/ShareButton.tsx#ShareButton"]={docgenInfo:ShareButton.__docgenInfo,name:"ShareButton",path:"src/components/ShareButton/ShareButton.tsx#ShareButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Download.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Download=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})});Download.displayName="Download";const __WEBPACK_DEFAULT_EXPORT__=Download;try{Download.displayName="Download",Download.__docgenInfo={description:"",displayName:"Download",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Download.tsx#Download"]={docgenInfo:Download.__docgenInfo,name:"Download",path:"src/components/icons/Download.tsx#Download"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Facebook.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Facebook=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-32 736H663.9V602.2h104l15.6-120.7H663.9v-77.1c0-35 9.7-58.8 59.8-58.8h63.9v-108c-11.1-1.5-49-4.8-93.2-4.8-92.2 0-155.3 56.3-155.3 159.6v89H434.9v120.7h104.3V848H176V176h672v672z"})});Facebook.displayName="Facebook";const __WEBPACK_DEFAULT_EXPORT__=Facebook;try{Facebook.displayName="Facebook",Facebook.__docgenInfo={description:"",displayName:"Facebook",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Facebook.tsx#Facebook"]={docgenInfo:Facebook.__docgenInfo,name:"Facebook",path:"src/components/icons/Facebook.tsx#Facebook"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Link.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Link=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})});Link.displayName="Link";const __WEBPACK_DEFAULT_EXPORT__=Link;try{Link.displayName="Link",Link.__docgenInfo={description:"",displayName:"Link",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Link.tsx#Link"]={docgenInfo:Link.__docgenInfo,name:"Link",path:"src/components/icons/Link.tsx#Link"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Linkedin.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const LinkedIn=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M847.7 112H176.3c-35.5 0-64.3 28.8-64.3 64.3v671.4c0 35.5 28.8 64.3 64.3 64.3h671.4c35.5 0 64.3-28.8 64.3-64.3V176.3c0-35.5-28.8-64.3-64.3-64.3zm0 736c-447.8-.1-671.7-.2-671.7-.3.1-447.8.2-671.7.3-671.7 447.8.1 671.7.2 671.7.3-.1 447.8-.2 671.7-.3 671.7zM230.6 411.9h118.7v381.8H230.6zm59.4-52.2c37.9 0 68.8-30.8 68.8-68.8a68.8 68.8 0 1 0-137.6 0c-.1 38 30.7 68.8 68.8 68.8zm252.3 245.1c0-49.8 9.5-98 71.2-98 60.8 0 61.7 56.9 61.7 101.2v185.7h118.6V584.3c0-102.8-22.2-181.9-142.3-181.9-57.7 0-96.4 31.7-112.3 61.7h-1.6v-52.2H423.7v381.8h118.6V604.8z"})});LinkedIn.displayName="LinkedIn";const __WEBPACK_DEFAULT_EXPORT__=LinkedIn;try{Linkedin.displayName="Linkedin",Linkedin.__docgenInfo={description:"",displayName:"Linkedin",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Linkedin.tsx#Linkedin"]={docgenInfo:Linkedin.__docgenInfo,name:"Linkedin",path:"src/components/icons/Linkedin.tsx#Linkedin"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Mail.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Mail=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0 0 68.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"})});Mail.displayName="Mail";const __WEBPACK_DEFAULT_EXPORT__=Mail;try{Mail.displayName="Mail",Mail.__docgenInfo={description:"",displayName:"Mail",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Mail.tsx#Mail"]={docgenInfo:Mail.__docgenInfo,name:"Mail",path:"src/components/icons/Mail.tsx#Mail"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Share.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Share=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M752 664c-28.5 0-54.8 10-75.4 26.7L469.4 540.8a160.68 160.68 0 0 0 0-57.6l207.2-149.9C697.2 350 723.5 360 752 360c66.2 0 120-53.8 120-120s-53.8-120-120-120-120 53.8-120 120c0 11.6 1.6 22.7 4.7 33.3L439.9 415.8C410.7 377.1 364.3 352 312 352c-88.4 0-160 71.6-160 160s71.6 160 160 160c52.3 0 98.7-25.1 127.9-63.8l196.8 142.5c-3.1 10.6-4.7 21.8-4.7 33.3 0 66.2 53.8 120 120 120s120-53.8 120-120-53.8-120-120-120zm0-476c28.7 0 52 23.3 52 52s-23.3 52-52 52-52-23.3-52-52 23.3-52 52-52zM312 600c-48.5 0-88-39.5-88-88s39.5-88 88-88 88 39.5 88 88-39.5 88-88 88zm440 236c-28.7 0-52-23.3-52-52s23.3-52 52-52 52 23.3 52 52-23.3 52-52 52z"})});Share.displayName="Share";const __WEBPACK_DEFAULT_EXPORT__=Share;try{Share.displayName="Share",Share.__docgenInfo={description:"",displayName:"Share",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Share.tsx#Share"]={docgenInfo:Share.__docgenInfo,name:"Share",path:"src/components/icons/Share.tsx#Share"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Telegram.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Telegram=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fill:"currentColor",d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm121.8 169.9l-40.7 191.8c-3 13.6-11.1 16.9-22.4 10.5l-62-45.7-29.9 28.8c-3.3 3.3-6.1 6.1-12.5 6.1l4.4-63.1 114.9-103.8c5-4.4-1.1-6.9-7.7-2.5l-142 89.4-61.2-19.1c-13.3-4.2-13.6-13.3 2.8-19.7l239.1-92.2c11.1-4 20.8 2.7 17.2 19.5z"})});Telegram.displayName="Telegram";const __WEBPACK_DEFAULT_EXPORT__=Telegram;try{Telegram.displayName="Telegram",Telegram.__docgenInfo={description:"",displayName:"Telegram",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Telegram.tsx#Telegram"]={docgenInfo:Telegram.__docgenInfo,name:"Telegram",path:"src/components/icons/Telegram.tsx#Telegram"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Twitter.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Twitter=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M928 254.3c-30.6 13.2-63.9 22.7-98.2 26.4a170.1 170.1 0 0 0 75-94 336.64 336.64 0 0 1-108.2 41.2A170.1 170.1 0 0 0 672 174c-94.5 0-170.5 76.6-170.5 170.6 0 13.2 1.6 26.4 4.2 39.1-141.5-7.4-267.7-75-351.6-178.5a169.32 169.32 0 0 0-23.2 86.1c0 59.2 30.1 111.4 76 142.1a172 172 0 0 1-77.1-21.7v2.1c0 82.9 58.6 151.6 136.7 167.4a180.6 180.6 0 0 1-44.9 5.8c-11.1 0-21.6-1.1-32.2-2.6C211 652 273.9 701.1 348.8 702.7c-58.6 45.9-132 72.9-211.7 72.9-14.3 0-27.5-.5-41.2-2.1C171.5 822 261.2 850 357.8 850 671.4 850 843 590.2 843 364.7c0-7.4 0-14.8-.5-22.2 33.2-24.3 62.3-54.4 85.5-88.2z"})});Twitter.displayName="Twitter";const __WEBPACK_DEFAULT_EXPORT__=Twitter;try{Twitter.displayName="Twitter",Twitter.__docgenInfo={description:"",displayName:"Twitter",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Twitter.tsx#Twitter"]={docgenInfo:Twitter.__docgenInfo,name:"Twitter",path:"src/components/icons/Twitter.tsx#Twitter"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/WhatsApp.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const WhatsApp=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M713.5 599.9c-10.9-5.6-65.2-32.2-75.3-35.8-10.1-3.8-17.5-5.6-24.8 5.6-7.4 11.1-28.4 35.8-35 43.3-6.4 7.4-12.9 8.3-23.8 2.8-64.8-32.4-107.3-57.8-150-131.1-11.3-19.5 11.3-18.1 32.4-60.2 3.6-7.4 1.8-13.7-1-19.3-2.8-5.6-24.8-59.8-34-81.9-8.9-21.5-18.1-18.5-24.8-18.9-6.4-.4-13.7-.4-21.1-.4-7.4 0-19.3 2.8-29.4 13.7-10.1 11.1-38.6 37.8-38.6 92s39.5 106.7 44.9 114.1c5.6 7.4 77.7 118.6 188.4 166.5 70 30.2 97.4 32.8 132.4 27.6 21.3-3.2 65.2-26.6 74.3-52.5 9.1-25.8 9.1-47.9 6.4-52.5-2.7-4.9-10.1-7.7-21-13z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M925.2 338.4c-22.6-53.7-55-101.9-96.3-143.3-41.3-41.3-89.5-73.8-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9-53.3 22.8-101.1 55.2-142 96.5-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9.3 69.4 16.9 138.3 48 199.9v152c0 25.4 20.6 46 46 46h152.1c61.6 31.1 130.5 47.7 199.9 48h2.1c59.9 0 118-11.6 172.7-34.3 53.5-22.3 101.6-54.3 142.8-95.2 41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"})]});WhatsApp.displayName="WhatsApp";const __WEBPACK_DEFAULT_EXPORT__=WhatsApp;try{WhatsApp.displayName="WhatsApp",WhatsApp.__docgenInfo={description:"",displayName:"WhatsApp",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/WhatsApp.tsx#WhatsApp"]={docgenInfo:WhatsApp.__docgenInfo,name:"WhatsApp",path:"src/components/icons/WhatsApp.tsx#WhatsApp"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}}}]); \ No newline at end of file diff --git a/components-StartPanel-StartPanel-stories.dede71ea.iframe.bundle.js b/components-StartPanel-StartPanel-stories.e9aa0184.iframe.bundle.js similarity index 89% rename from components-StartPanel-StartPanel-stories.dede71ea.iframe.bundle.js rename to components-StartPanel-StartPanel-stories.e9aa0184.iframe.bundle.js index 2b8d5154..0e77ac17 100644 --- a/components-StartPanel-StartPanel-stories.dede71ea.iframe.bundle.js +++ b/components-StartPanel-StartPanel-stories.e9aa0184.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[9367],{"./src/components/StartPanel/StartPanel.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,Instruct:()=>Instruct,PositionRequired:()=>PositionRequired,WithAllTheBadges:()=>WithAllTheBadges,WithCompletionProviderDown:()=>WithCompletionProviderDown,WithCompletionsEnabled:()=>WithCompletionsEnabled,WithGamificationLevel:()=>WithGamificationLevel,WithIntegration:()=>WithIntegration,WithNSFWFlag:()=>WithNSFWFlag,__namedExportsOrder:()=>__namedExportsOrder,default:()=>StartPanel_stories});__webpack_require__("./node_modules/react/index.js");var data=__webpack_require__("./src/mocks/data.ts"),StartPanel=__webpack_require__("./src/components/StartPanel/StartPanel.tsx"),injectStylesIntoStyleTag=(__webpack_require__("./src/i18n.ts"),__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js")),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),StartPanel_StartPanel=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/StartPanel/StartPanel.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(StartPanel_StartPanel.Z,options);StartPanel_StartPanel.Z&&StartPanel_StartPanel.Z.locals&&StartPanel_StartPanel.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const StartPanel_stories={title:"Widget/Start panel",component:StartPanel.Z,argTypes:{showShare:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},integrationConfig={...JSON.parse(data.WM.customData??"{}"),avatarURL:JSON.parse(data.WM.customData??"{}").avatarURL?.split("#")?.[0]+"#"+new Date(Date.now()).getTime()},integrationProperties={"--memori-chat-bubble-bg":"#fff",...integrationConfig?.buttonBgColor?{"--memori-button-bg":integrationConfig.buttonBgColor,"--memori-primary":integrationConfig.buttonBgColor}:{},...integrationConfig?.buttonTextColor?{"--memori-button-text":integrationConfig.buttonTextColor,"--memori-text-color":integrationConfig.buttonTextColor}:{},...integrationConfig?.blurBackground?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...integrationConfig?.innerBgColor?{"--memori-inner-bg":`rgba(${"dark"===integrationConfig.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${integrationConfig.innerBgAlpha??.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===integrationConfig.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${integrationConfig?.innerBgAlpha??.4})`}:{"--memori-inner-content-pad":"0px"}},integrationStylesheet=`\n #root, .memori-widget {\n ${Object.entries(integrationProperties).map((([key,value])=>`${key}: ${value};`)).join("\n")}\n }\n `,Template=args=>(0,jsx_runtime.jsxs)("div",{style:{maxWidth:"600px",margin:"auto"},children:[args.integrationConfig&&(0,jsx_runtime.jsx)("style",{dangerouslySetInnerHTML:{__html:integrationStylesheet}}),(0,jsx_runtime.jsx)(StartPanel.Z,{...args})]});Template.displayName="Template";const Default=Template.bind({});Default.args={memori:{...data.jF,enableCompletions:!1},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithGamificationLevel=Template.bind({});WithGamificationLevel.args={memori:{...data.jF,enableCompletions:!1},tenant:data.cm,gamificationLevel:{points:61,pointsForCurrentBadge:60,badge:"🌍"},language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithCompletionsEnabled=Template.bind({});WithCompletionsEnabled.args={memori:{...data.jF,enableCompletions:!0},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithNSFWFlag=Template.bind({});WithNSFWFlag.args={memori:{...data.jF,nsfw:!0,enableCompletions:!1},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithAllTheBadges=Template.bind({});WithAllTheBadges.args={memori:{...data.jF,enableCompletions:!0,nsfw:!0},gamificationLevel:{points:61,pointsForCurrentBadge:60,badge:"🌍"},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const Instruct=Template.bind({});Instruct.args={memori:data.jF,tenant:data.cm,gamificationLevel:{points:61,pointsForCurrentBadge:60,badge:"🌍"},language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!0,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const PositionRequired=Template.bind({});PositionRequired.args={memori:{...data.jF,needsPosition:!0},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!0,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithIntegration=Template.bind({});WithIntegration.args={memori:data.jF,tenant:data.cm,integrationConfig,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithCompletionProviderDown=Template.bind({});WithCompletionProviderDown.args={memori:{...data.jF,enableCompletions:!1,completionProvider:"OpenAI"},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{},_TEST_forceProviderStatus:"major"},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args =>
\n {args.integrationConfig &&