1import{p as T,r,j as a,u as z,A as W,P as _,L as U,O as se,d as Z,_ as N,N as ue,e as ce,f as I,F as le,R as ie,D as de,i as J,g as fe,k as Ce,l as pe,M as he}from"./index.85281fd4.js";import{a as w,u as M,A as ge,m as me}from"./proxy.df7207fe.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="10793d71-514b-4360-af35-a421cd62b0cc",e._sentryDebugIdIdentifier="sentry-dbid-10793d71-514b-4360-af35-a421cd62b0cc")}catch{}})();async function be(e){return await T("/chat/login",e)}const Fe=async e=>await T("/chat/auth/line/callback",e),_e=async e=>await T(`/check-token/${e}`,null),Ee=async e=>await T("/chat/register",e),rt=async e=>{await T("/reset-password-chatbot",e)},ot=async e=>{await T("/change-password-chatbot",e)},Y=r.exports.createContext(null),Q=()=>{const e=r.exports.useContext(Y);if(e===null)throw new Error("useAppContext must be used within an AppProvider");return e};function Ae({children:e,agentId:o,agent:t,pUrl:n,lineOAuthCallback:s,onLineOAuthCallbackHandled:C}){const i=r.exports.useMemo(()=>({agentId:o,agent:t,pUrl:n,lineOAuthCallback:s,onLineOAuthCallbackHandled:C}),[o,t,n,s,C]);return a(Y.Provider,{value:i,children:e})}const X=r.exports.createContext({agentId:"",isAuthenticated:!1,isLoading:!0,isAgentConfigReady:!1,isLoginRequired:!0,error:null,login:async()=>{},loginLine:async()=>{},register:async()=>{},logout:()=>{},clearError:()=>{}}),$=()=>r.exports.useContext(X);function xe({children:e}){const[o,t]=r.exports.useState(!1),[n,s]=r.exports.useState(!0),[C,i]=r.exports.useState(!1),[h,g]=r.exports.useState(!0),[m,c]=r.exports.useState(null),y=z(),E=r.exports.useCallback(p=>{localStorage.setItem(W,JSON.stringify(p))},[]),{agentId:d,agent:F,lineOAuthCallback:f,onLineOAuthCallbackHandled:L}=Q();r.exports.useEffect(()=>{const p=()=>{t(!1),y("/",{replace:!0})};return window.addEventListener("auth:logout",p),()=>{window.removeEventListener("auth:logout",p)}},[y]);const B=r.exports.useCallback(async()=>{if(!(f?.code&&f?.state))try{s(!0),c(null);const p=F?.chat_login_flag!==void 0?F.chat_login_flag:!0;if(g(p),!p){t(!0);return}if(!JSON.parse(localStorage.getItem(W)||"{}").access_token){t(!1);return}(await _e(d)).status==="success"&&t(!0)}catch{c("\u8A8D\u8A3C\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u78BA\u8A8D\u306B\u5931\u6557\u3057\u307E\u3057\u305F"),g(!0)}finally{s(!1)}},[f?.code,f?.state,F.chat_login_flag,d]);
1r.exports.useEffect(()=>{d&&!n&&i(!0)},[d,n]),r.exports.useEffect(()=>{d&&B()},[d,B]);const D=r.exports.useCallback(async(p,v)=>{if(!d)throw new Error("\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8ID\u304C\u5FC5\u8981\u3067\u3059\u3002");s(!0),c(null);try{const P=await be({email:p,agent_id:d,password:v});return E(P),t(!0),P}catch(b){throw c("\u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u30E6\u30FC\u30B6\u30FC\u540D\u307E\u305F\u306F\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u9593\u9055\u3063\u3066\u3044\u307E\u3059\u3002"),b}finally{s(!1)}},[d,E]),S=r.exports.useCallback(async(p,v)=>{if(!F.line_return_uri)throw s(!1),new Error("\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8URI\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002");s(!0),c(null);try{const b=await Fe({code:p,state:v,agent_id:d,redirect_uri:F.line_return_uri});return E(b),t(!0),b}catch(b){throw c("LINE\u30ED\u30B0\u30A4\u30F3\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u518D\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"),b}finally{s(!1)}},[d,F.line_return_uri,E]);r.exports.useEffect(()=>{if(!f?.code||!f?.state)return;let p=!1;return(async()=>{try{await S(f.code,f.state),p||(y(_.CHAT,{replace:!0}),L())}catch{p||L()}})(),()=>{p=!0}},[f,S,L,y]);const O=r.exports.useCallback(async(p,v)=>{s(!0),c(null);try{const b=await Ee({email:p,password:v,agent_id:d});return E(b),t(!0),b}catch(b){throw c("\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u4F5C\u6210\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002"),b}finally{s(!1)}},[d,E]),H=r.exports.useCallback(()=>{t(!1),localStorage.clear()},[]),G=r.exports.useMemo(()=>({agentId:d,isAuthenticated:o,isLoading:n,isAgentConfigReady:C,isLoginRequired:h,error:m,login:D,loginLine:S,register:O,logout:H,clearError:()=>c(null)}),[d,o,n,C,h,m,D,S,O,H]);return a(X.Provider,{value:G,children:e})}function ve(){const{isAgentConfigReady:e}=$();return e?a("main",{className:"w-screen h-screen flex items-center justify-center main-page relative",children:a(se,{})}):a(U,{className:"w-screen h-screen"})}function k({children:e}){const{isLoginRequired:o,isAuthenticated:t,isLoading:n,isAgentConfigReady:s}=$(),C=Z(),i=z();if(r.exports.useEffect(()=>{if(!n){const g=C.pathname===_.CHAT;(t||!o)&&!g&&i(_.CHAT,{replace:!0}),!t&&o&&g&&i("/",{replace:!0})}},[t,o,n,C.pathname,i]),!s)return a(U,{className:"w-screen h-screen"});if(n)return e;const h=C.pathname===_.CHAT;return e}const we=r.exports.lazy(()=>N(()=>import("./Login.3d2a0682.js"),["assets/Login.3d2a0682.js","assets/types.b04618c0.js","assets/index.85281fd4.js","assets/index.4dd665eb.js","assets/index.166a8e81.js","assets/InputField.20e95524.js","assets/useCloseModal.8479ff66.js","assets/proxy.df7207fe.js"])),ye=r.exports.lazy(()=>N(()=>import("./Register.5def0c4e.js"),["assets/Register.5def0c4e.js","assets/types.b04618c0.js","assets/index.85281fd4.js","assets/index.166a8e81.js","assets/InputField.20e95524.js","assets/useCloseModal.8479ff66.js","assets/proxy.df7207fe.js"])),ke=r.exports.lazy(()=>N(()=>import("./ChooseRegister.9d036258.js"),["assets/ChooseRegister.9d036258.js","assets/index.4dd665eb.js","assets/index.85281fd4.js","assets/useAuth.4b8312de.js","assets/index.166a8e81.js","assets/useCloseModal.8479ff66.js","assets/proxy.df7207fe.js"])),Le=r.exports.lazy(()=>N(()=>import("./MainChat.9beb32cd.js"),["assets/MainChat.9beb32cd.js","assets/MainChat.839d42ed.css","assets/index.85281fd4.js","assets/lodash.7c0d2fce.js","assets/proxy.df7207fe.js","assets/useCloseModal.8479ff66.js"])),Re=r.exports.lazy(()=>N(()=>import("./Start.f3f5b5b4.js"),["assets/Start.f3f5b5b4.js","assets/index.85281fd4.js","assets/index.4dd665eb.js","assets/useAuth.4b8312de.js","assets/useCloseModal.8479ff66.js","assets/proxy.df7207fe.js"])),Ie=r.exports.lazy(()=>N(()=>import("./ResetPassword.eb286e93.js"),["assets/ResetPassword.eb286e93.js","assets/types.b04618c0.js","assets/index.85281fd4.js","assets/index.166a8e81.js","assets/InputField.20e95524.js","assets/useCloseModal.8479ff66.js","assets/proxy.df7207fe.js"])),Ne=r.exports.lazy(()=>N(()=>import("./ChangePassword.71654a0b.js"),["assets/ChangePassword.71654a0b.js","assets/types.b04618c0.js","assets/index.85281fd4.js","assets/InputField.20e95524.js","assets/useCloseModal.8479ff66.js","assets/proxy.df7207fe.js"])),Te=[{path:"/",element:a(ve,{}),children:[{index:!0,element:a(k,{children:a(Re,{})})},{path:_.LOGIN,element:a(k,{children:a(we,{})})}
1,{path:_.CHOOSE_REGISTER,element:a(k,{children:a(ke,{})})},{path:_.REGISTER,element:a(k,{children:a(ye,{})})},{path:_.RESET_PASSWORD,element:a(k,{children:a(Ie,{})})},{path:_.CHANGE_PASSWORD,element:a(k,{children:a(Ne,{})})}]},{path:_.CHAT,element:a(k,{children:a(Le,{})})},{path:"*",element:a(k,{children:a(ue,{to:"/",replace:!0})})}];function Se(){const e=ce(Te),{isAuthenticated:o,isLoading:t}=$(),n=z(),s=Z();return r.exports.useEffect(()=>{!t&&o&&s.pathname==="/"&&n(_.CHAT,{replace:!0})},[t,o,s.pathname,n]),a(r.exports.Suspense,{fallback:a(U,{className:"w-screen h-screen"}),children:e})}const Pe="https://pitaliy-1.onrender.com/assets/default-avatar.82111095.png";function Me({color:e}){return I("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[I("g",{clipPath:"url(#clip0_9407_82316)",children:[a("path",{d:"M21.5261 8.74629C21.4876 5.72135 19.0237 3.28125 15.9897 3.28125H8.01145C4.95331 3.28125 2.47418 5.76038 2.47418 8.81852V12.0639C2.47418 14.4132 3.93714 16.4202 6.00153 17.2249C6.44306 17.397 6.80159 17.7326 6.99469 18.1653L8.033 20.493C8.16552 20.7904 8.58434 20.7988 8.72909 20.5073L9.67945 18.5932C9.98118 17.9856 10.601 17.6012 11.2793 17.6012H15.9897C19.0237 17.6012 21.4874 15.1611 21.5261 12.1365C21.5261 12.1123 21.5267 12.0881 21.5267 12.0639V8.81852C21.5267 8.79434 21.5264 8.77046 21.5261 8.74629Z",stroke:e,strokeWidth:"1.80692",strokeLinecap:"round",strokeLinejoin:"round"}),a("path",{d:"M8.27771 9.74316C8.89668 9.74316 9.39873 10.2453 9.3988 10.8643C9.3988 11.4833 8.89672 11.9854 8.27771 11.9854C7.65876 11.9853 7.15662 11.4832 7.15662 10.8643C7.15669 10.2454 7.65881 9.74324 8.27771 9.74316Z",fill:e,stroke:"white",strokeWidth:"0.0301153"}),a("path",{d:"M12.054 9.74316C12.673 9.74316 13.175 10.2453 13.1751 10.8643C13.1751 11.4833 12.673 11.9854 12.054 11.9854C11.4351 11.9853 10.9329 11.4832 10.9329 10.8643C10.933 10.2454 11.4351 9.74324 12.054 9.74316Z",fill:e,stroke:"white",strokeWidth:"0.0301153"}),a("path",{d:"M15.7241 9.74512C16.3431 9.74512 16.8451 10.2473 16.8452 10.8662C16.8452 11.4852 16.3431 11.9873 15.7241 11.9873C15.1052 11.9872 14.603 11.4852 14.603 10.8662C14.6031 10.2473 15.1052 9.74519 15.7241 9.74512Z",fill:e,stroke:"white",strokeWidth:"0.0301153"})]}),a("defs",{children:a("clipPath",{id:"clip0_9407_82316",children:a("rect",{width:"20.8",height:"19.1873",fill:e,transform:"translate(1.60034 2.40625)"})})})]})}const V=[{value:"default",label:"\u30D6\u30EB\u30FC\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8\uFF09",color:"#3770FF"},{value:"red_rose",label:"\u30EC\u30C3\u30C9",color:"#FF5230"},{value:"pink_blossom",label:"\u30D4\u30F3\u30AF",color:"#FF85D4"},{value:"forest_green",label:"\u30B0\u30EA\u30FC\u30F3",color:"#1AB525"},{value:"mountain_green",label:"\u30A8\u30E1\u30E9\u30EB\u30C9",color:"#00B0A8"},{value:"brown",label:"\u30D6\u30E9\u30A6\u30F3",color:"#B58F60"},{value:"custom",label:"\u8272\u6307\u5B9A",color:""}],Be={value:"default",label:"\u30D6\u30EB\u30FC\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8\uFF09",color:"#3770FF"};var l=(e=>(e.ICON="icon",e.ICON_LIGHT="icon_light",e.ICON_DARK="icon_dark",e.BUTTON_THEME="button_theme",e.BUTTON_LIGHT="button_light",e.BUTTON_DARK="button_dark",e.AVATAR="avatar",e.BANNER="banner",e))(l||{}),K=(e=>(e.RIGHT="right",e.LEFT="left",e))(K||{}),ee=(e=>(e.CHARACTER="character",e.CHAT="chat",e))(ee||{}),te=(e=>(e.ICON_AND_NAME="icon_and_name",e.IMAGE="image",e))(te||{}),j=(e=>(e.FULL_SCREEN="full_screen",e.SMALL_SCREEN="small_screen",e))(j||{}),x=(e=>(e.OPEN="open",e.CLOSE="close",e))(x||{});const at=w("ja");w(!1);w(!1);const nt=w({agent_name:"",description:"",email:"",created_at:"",chat_settings_id:"",dark_mode:!1,theme_color:"",font_family:"",button_theme:"",image_url:null,display_mode:ee.CHARACTER,header_display_option:te.ICON_AND_NAME,header_image:void 0,background_pc:void 0,background_sp:void 0,desktop_view_option:j.SMALL_SCREEN,character_position:0,talking_character_position:0,talking_character_size:0,design_option:l.ICON,banner_pc:void 0,banner_sp:void 0,display_position_option:K.RIGHT,line_client_id:null,line_return_uri:"",line_link_flag:!1,chat_login_flag:!1,voice_mode_flag:!1,voice_mode_greeting:null,remaining_conversation:0,quick_reply_messages:[],first_fixed_message:"",model_streaming:!1,use_form:!1,faq_flag:!1,faq_tags:[],max_conversation:0,link_settings:[],gif_datas:[],knowledge_data_store_id:"",forms_generals:[]}),st=w(""),ut=w(""),re=w(0),De=w(x.CLOSE),oe=w("'Noto Sans JP', sans-serif"),ct=w(null),q={system:{bgColor:"!bg-[#3770FF]",textColor:"!text-white",iconColor:"white"},dark:{bgColor:"!bg-[#292929]",textColor:"!text-white",iconColor:"white"},light:{bgColor:"!bg-white",textColor:"!text-black",iconColor:"black"}};function Oe({designOption:e,avatarSrc:o,characterUrl:t,bannerPc:n,bannerSp:s,fontFamily:C,onClick:i}){const[h]=M(re),g=r.exports.useMemo(()=>{switch(e){case l.ICON:case l.BUTTON_THEME:return q.system;case l.ICON_LIGHT:case l.BUTTON_LIGHT:return q.light;
1case l.ICON_DARK:case l.BUTTON_DARK:return q.dark;default:return q.system}},[e]),m=r.exports.useMemo(()=>[l.ICON,l.ICON_LIGHT,l.ICON_DARK].includes(e),[e]);return I(le,{children:[![l.AVATAR,l.BANNER].includes(e)&&I("button",{type:"button",onClick:i,onKeyDown:c=>c.key==="Enter"&&i?.(),tabIndex:0,className:`animate-fadeIn flex gap-1 items-center justify-center w-full h-[37px] max-w-[144px] rounded-[100px] shadow-lg hover:opacity-80 transition-opacity duration-300 ${g?.textColor} ${e===l.ICON||e===l.BUTTON_THEME?"":g?.bgColor}`,style:e===l.ICON||e===l.BUTTON_THEME?{backgroundColor:"var(--user-bubble-bg)"}:void 0,"aria-label":"Support Chat Button",children:[m?a("img",{src:o||Pe,alt:"Avatar",className:"w-6 h-6 border-[#EEEEEE] rounded-full object-cover"}):a(Me,{color:g?.iconColor}),a("span",{style:{fontFamily:C},className:"!text-sm !font-bold",children:"\u30C1\u30E3\u30C3\u30C8\u3067\u8CEA\u554F"})]}),e===l.AVATAR&&t&&a("div",{onClick:i,onKeyDown:c=>c.key==="Enter"&&i?.(),role:"button",tabIndex:0,className:"animate-fadeIn","aria-label":"Open chat with character",children:a("img",{src:t,alt:"Character",loading:"lazy",className:"!w-[64px] !h-[91px] max-[990px]:!w-[100px] max-[990px]:!h-[142px] cursor-pointer object-contain"})}),e===l.BANNER&&a("div",{onClick:i,onKeyDown:c=>c.key==="Enter"&&i?.(),role:"button",tabIndex:0,className:"animate-fadeIn cursor-pointer",children:a("picture",{children:a("img",{src:h>990?n:s||"",alt:"Support Banner",className:`${h>990?"w-full h-auto":"w-[480px] h-[50px]"} object-cover object-center`})})})]})}const He={light:{"--theme-background":"#FFFFFF","--theme-color":"#1C1C1C","--input-border-color":"#D9D9D9","--input-background":"#FFFFFF","--input-color":"#1E1E1E","--email-area-background":"#F2EEF4","--email-area-color":"#575757","--bot-bubble-background":"#FFFFFF","--bot-bubble-footer-background":"#F0F0F0","--bot-bubble-color":"#1C1C1C","--terms-background":"#F4F4F4","--terms-color":"#1C1C1C","--txt-color":"#333333","--form-description-color":"#3E3E3E","--label-color":"#5E6366","--label-placeholder-color":"#ABAFB1","--form-border-color":"#CFD3D4","--select-icon-color":"#5E6366","--form-field-background":"#FFFFFF","--label-uncheck-color":"#83898C","--label-checked-color":"#2B2F32","--calendar-icon-color":"#5E6366","--calendar-header-color":"#5E6366","--calendar-title-color":"#5E6366","--calendar-day-color":"#000000","--option-hover-background":"#f5f5f5","--option-selected-background":"#e6f7ff","--option-selected-color":"#5e6366","--faq-search-background":"#F5F5F5","--faq-search-border":"#E4E3EA","--faq-divider-color":"#E4E3EA","--faq-suggestion-background":"#F5F5F5","--faq-tag-background":"#F5F5F5","--faq-tag-background-hover":"#e9e9e9","--faq-tag-text-color":"#666666","--faq-item-background":"#F5F5F5","--faq-item-background-hover":"#EBEBEB","--faq-content-color":"#666666","--subtitle-background":"rgba(255, 255, 255, 0.4)","--button-menu-voice-mode-background-hover":"background: rgba(0, 0, 0, 0.05)","--border-tooltip":"#E4E3EA","--search-icon-hover":"rgba(0, 0, 0, 0.05)"},dark:{"--theme-background":"#101010","--theme-color":"#FFFFFF","--input-border-color":"#828088","--input-background":"#292929","--input-color":"#FFFFFF","--email-area-background":"#292929","--email-area-color":"#FFFFFF","--bot-bubble-background":"#292929","--bot-bubble-footer-background":"#292929","--bot-bubble-color":"#FFFFFF","--terms-background":"#292929","--terms-color":"#FFFFFF","--txt-color":"#FFFFFF","--form-description-color":"#E4E3EA","--label-color":"#FFFFFF","--label-placeholder-color":"#828088","--form-border-color":"#828088","--select-icon-color":"#E4E3EA","--form-field-background":"#292929","--label-uncheck-color":"#A5A4AA","--label-checked-color":"#FFFFFF","--calendar-icon-color":"#E4E3EA","--calendar-header-color":"#FFFFFF","--calendar-title-color":"#828088","--calendar-day-color":"#FFFFFF","--option-hover-background":"#333333","--option-selected-background":"#828088","--option-selected-color":"#FFFFFF","--faq-search-background":"#292929","--faq-search-border":"#FFFFFF80","--faq-divider-color":"#FFFFFF4D","--faq-suggestion-background":"rgba(255, 255, 255, 0.1)","--faq-tag-background":"rgba(255, 255, 255, 0.1)","--faq-tag-background-hover":"#3b3b3b","--faq-tag-text-color":"#FFFFFF","--faq-item-background":"rgba(255, 255, 255, 0.1)","--faq-item-background-hover":"rgba(255, 255, 255, 0.15)","--faq-content-color":"#FFFFFF","--subtitle-background":"rgba(0, 0, 0, 0.4)","--button-menu-voice-mode-background-hover":"rgba(255, 255, 255, 0.05)","--border-tooltip":"#A2A2A2","--search-icon-hover":"rgba(255, 255, 255, 0.05)"}},qe=e=>r.exports.useMemo(()=>He[e?"dark":"light"],[e]),je=e=>{if(!e)return V[0];const o=V.find(s=>s.value===e);if(o)return o;const t=e.match(/^custom\((.+)\)$/),n=t?t[1]:null;return n?{value:"custom",label:e,color:n}:V[0]},ze=e=>{if(e&&e.startsWith("#")){const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(o)return{r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)}}return null},Ge=(e,o,t)=>`#${[e,o,t].map(n=>n.toString(16).padStart(2,"0")).join("")}`,Ve=e=>e?e.includes("rgb(")&&e.includes(")"):!1,Ue=e=>r.exports.useMemo(()=>
1{if(!e?.color)return"";if(Ve(e.color))return e.color;const t=ze(e.color);return t?Ge(t.r,t.g,t.b):e.color},[e]);function Ze({width:e=14,height:o=14,color:t="#A5A4AA"}){return a("svg",{width:e,height:o,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M5.00003 5.93288L1.73337 9.19954C1.61114 9.32177 1.45559 9.38288 1.2667 9.38288C1.07781 9.38288 0.922255 9.32177 0.800032 9.19954C0.67781 9.07732 0.616699 8.92177 0.616699 8.73288C0.616699 8.54399 0.67781 8.38843 0.800032 8.26621L4.0667 4.99954L0.800032 1.73288C0.67781 1.61066 0.616699 1.4551 0.616699 1.26621C0.616699 1.07732 0.67781 0.921766 0.800032 0.799544C0.922255 0.677322 1.07781 0.616211 1.2667 0.616211C1.45559 0.616211 1.61114 0.677322 1.73337 0.799544L5.00003 4.06621L8.2667 0.799544C8.38892 0.677322 8.54448 0.616211 8.73337 0.616211C8.92226 0.616211 9.07781 0.677322 9.20003 0.799544C9.32225 0.921766 9.38337 1.07732 9.38337 1.26621C9.38337 1.4551 9.32225 1.61066 9.20003 1.73288L5.93337 4.99954L9.20003 8.26621C9.32225 8.38843 9.38337 8.54399 9.38337 8.73288C9.38337 8.92177 9.32225 9.07732 9.20003 9.19954C9.07781 9.32177 8.92226 9.38288 8.73337 9.38288C8.54448 9.38288 8.38892 9.32177 8.2667 9.19954L5.00003 5.93288Z",fill:t})})}function $e({darkMode:e=!1}){return a("svg",{width:"28",height:"25",viewBox:"0 0 28 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e?a("path",{d:"M15.732 1.19727L27.244 21.1359C27.4195 21.44 27.5119 21.7848 27.5119 22.1359C27.5119 22.487 27.4195 22.8319 27.244 23.1359C27.0685 23.4399 26.816 23.6924 26.512 23.868C26.2079 24.0435 25.8631 24.1359 25.512 24.1359H2.48799C2.13692 24.1359 1.79204 24.0435 1.488 23.868C1.18397 23.6924 0.931504 23.4399 0.755974 23.1359C0.580443 22.8319 0.488035 22.487 0.488037 22.1359C0.488039 21.7848 0.580452 21.44 0.755986 21.1359L12.268 1.19727C13.0373 -0.136068 14.9613 -0.136068 15.732 1.19727ZM14 16.9999C13.6464 16.9999 13.3072 17.1404 13.0572 17.3905C12.8071 17.6405 12.6667 17.9796 12.6667 18.3333C12.6667 18.6869 12.8071 19.026 13.0572 19.2761C13.3072 19.5261 13.6464 19.6666 14 19.6666C14.3536 19.6666 14.6927 19.5261 14.9428 19.2761C15.1928 19.026 15.3333 18.6869 15.3333 18.3333C15.3333 17.9796 15.1928 17.6405 14.9428 17.3905C14.6927 17.1404 14.3536 16.9999 14 16.9999ZM14 7.6666C13.6734 7.66664 13.3582 7.78654 13.1142 8.00355C12.8701 8.22056 12.7142 8.5196 12.676 8.84393L12.6667 8.99993V14.3333C12.667 14.6731 12.7972 15 13.0305 15.2471C13.2637 15.4942 13.5826 15.6429 13.9218 15.6628C14.2611 15.6827 14.5952 15.5724 14.8558 15.3542C15.1164 15.1361 15.2838 14.8267 15.324 14.4893L15.3333 14.3333V8.99993C15.3333 8.64631 15.1928 8.30717 14.9428 8.05712C14.6927 7.80708 14.3536 7.6666 14 7.6666Z",fill:"#FF5249"}):a("path",{d:"M15.732 1.19727L27.244 21.1359C27.4195 21.44 27.5119 21.7848 27.5119 22.1359C27.5119 22.487 27.4195 22.8319 27.244 23.1359C27.0685 23.4399 26.816 23.6924 26.512 23.868C26.2079 24.0435 25.8631 24.1359 25.512 24.1359H2.48799C2.13692 24.1359 1.79204 24.0435 1.488 23.868C1.18397 23.6924 0.931504 23.4399 0.755974 23.1359C0.580443 22.8319 0.488035 22.487 0.488037 22.1359C0.488039 21.7848 0.580452 21.44 0.755986 21.1359L12.268 1.19727C13.0373 -0.136068 14.9613 -0.136068 15.732 1.19727ZM14 16.9999C13.6464 16.9999 13.3072 17.1404 13.0572 17.3905C12.8071 17.6405 12.6667 17.9796 12.6667 18.3333C12.6667 18.6869 12.8071 19.026 13.0572 19.2761C13.3072 19.5261 13.6464 19.6666 14 19.6666C14.3536 19.6666 14.6927 19.5261 14.9428 19.2761C15.1928 19.026 15.3333 18.6869 15.3333 18.3333C15.3333 17.9796 15.1928 17.6405 14.9428 17.3905C14.6927 17.1404 14.3536 16.9999 14 16.9999ZM14 7.6666C13.6734 7.66664 13.3582 7.78654 13.1142 8.00355C12.8701 8.22056 12.7142 8.5196 12.676 8.84393L12.6667 8.99993V14.3333C12.667 14.6731 12.7972 15 13.0305 15.2471C13.2637 15.4942 13.5826 15.6429 13.9218 15.6628C14.2611 15.6827 14.5952 15.5724 14.8558 15.3542C15.1164 15.1361 15.2838 14.8267 15.324 14.4893L15.3333 14.3333V8.99993C15.3333 8.64631 15.1928 8.30717 14.9428 8.05712C14.6927 7.80708 14.3536 7.6666 14 7.6666Z",fill:"#FF5249"})})}function Ke({width:e=28,height:o=28,color:t="#C395EB"}){return a("svg",{width:e,height:o,viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M13.9998 20.667C14.3776 20.667 14.6945 20.539 14.9505 20.283C15.2065 20.027 15.3341 19.7105 15.3332 19.3337V14.0003C15.3332 13.6225 15.2052 13.3061 14.9492 13.051C14.6932 12.7959 14.3767 12.6679 13.9998 12.667C13.6229 12.6661 13.3065 12.7941 13.0505 13.051C12.7945 13.3079 12.6665 13.6243 12.6665 14.0003V19.3337C12.6665 19.7114 12.7945 20.0283 13.0505 20.2843C13.3065 20.5403 13.6229 20.6679 13.9998 20.667ZM13.9998 10.
10003C14.3776 10.0003 14.6945 9.87233 14.9505 9.61633C15.2065 9.36033 15.3341 9.04388 15.3332 8.66699C15.3323 8.2901 15.2043 7.97366 14.9492 7.71766C14.6941 7.46166 14.3776 7.33366 13.9998 7.33366C13.6221 7.33366 13.3056 7.46166 13.0505 7.71766C12.7954 7.97366 12.6674 8.2901 12.6665 8.66699C12.6656 9.04388 12.7936 9.36077 13.0505 9.61766C13.3074 9.87455 13.6238 10.0021 13.9998 10.0003ZM13.9998 27.3337C12.1554 27.3337 10.4221 26.9834 8.79984 26.283C7.17762 25.5825 5.76651 24.6328 4.56651 23.4337C3.36651 22.2345 2.41673 20.8234 1.71717 19.2003C1.01762 17.5772 0.667394 15.8439 0.666506 14.0003C0.665617 12.1568 1.01584 10.4234 1.71717 8.80033C2.41851 7.17722 3.36828 5.7661 4.56651 4.56699C5.76473 3.36788 7.17584 2.4181 8.79984 1.71766C10.4238 1.01721 12.1572 0.666992 13.9998 0.666992C15.8425 0.666992 17.5758 1.01721 19.1998 1.71766C20.8238 2.4181 22.235 3.36788 23.4332 4.56699C24.6314 5.7661 25.5816 7.17722 26.2838 8.80033C26.9861 10.4234 27.3358 12.1568 27.3332 14.0003C27.3305 15.8439 26.9803 17.5772 26.2825 19.2003C25.5847 20.8234 24.635 22.2345 23.4332 23.4337C22.2314 24.6328 20.8203 25.583 19.1998 26.2843C17.5794 26.9857 15.8461 27.3354 13.9998 27.3337ZM13.9998 24.667C16.9776 24.667 19.4998 23.6337 21.5665 21.567C23.6332 19.5003 24.6665 16.9781 24.6665 14.0003C24.6665 11.0225 23.6332 8.50033 21.5665 6.43366C19.4998 4.36699 16.9776 3.33366 13.9998 3.33366C11.0221 3.33366 8.49984 4.36699 6.43317 6.43366C4.36651 8.50033 3.33317 11.0225 3.33317 14.0003C3.33317 16.9781 4.36651 19.5003 6.43317 21.567C8.49984 23.6337 11.0221 24.667 13.9998 24.667Z",fill:t})})}const ae=r.exports.createContext(null),lt=()=>{const e=r.exports.useContext(ae);if(!e)throw new Error("useMessage must be used within MessageProvider");return e};function We({children:e}){const[o]=M(oe),[t,n]=r.exports.useState(null),[s,C]=r.exports.useState(null),{agent:i}=Q(),h=r.exports.useMemo(()=>i?.dark_mode||!1,[i]),g=r.exports.useRef(window.innerHeight),m=r.exports.useRef(null),c=r.exports.useCallback((F,f=3e3,L)=>{m.current&&clearTimeout(m.current),g.current=window.innerHeight,n(F),C(L||a(Ke,{color:"var(--user-bubble-bg)"})),m.current=setTimeout(()=>n(null),f)},[]),y=r.exports.useCallback((F,f=3e3)=>{c(F,f,a($e,{darkMode:h}))},[h,c]),E=()=>n(null),d=r.exports.useCallback(()=>{t&&window.innerHeight!==g.current&&(m.current&&(clearTimeout(m.current),m.current=null),n(null))},[t]);return r.exports.useEffect(()=>(window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)),[d,t]),r.exports.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),I(ae.Provider,{value:r.exports.useMemo(()=>({showMessage:c,showError:y}),[c,y]),children:[e,ie.createPortal(a(ge,{children:t&&a(me.div,{initial:{y:-100,opacity:0},animate:{y:0,opacity:1},exit:{y:-100,opacity:0},transition:{duration:.4,ease:[.25,1,.5,1]},className:"absolute top-3 left-1/2 !-translate-x-1/2 z-[1001] w-max max-w-full break-words",children:I("div",{className:"flex items-center h-14 roun
1ded-2xl shadow-[0px_8px_16px_8px_rgba(0,0,0,0.05)] px-4 py-2",style:{backgroundColor:"var(--theme-background)"},children:[s,a("div",{className:"ml-2 mr-4 text-base font-medium",style:{color:"var(--txt-color)",fontFamily:o},children:t}),a("button",{type:"button",className:"w-8 h-8 flex items-center justify-center rounded-full text-[#A5A4AA] hover:text-black focus:outline-none",onClick:E,"aria-label":"Close message",children:a(Ze,{})})]})})}),document.body)]})}const Je=r.exports.createContext(void 0);function Ye({theme:e,userBackgroundColor:o,children:t}){r.exports.useEffect(()=>{const s=document.documentElement;return Object.entries(e).forEach(([C,i])=>{s.style.setProperty(C,i)}),s.style.setProperty("--user-bubble-bg",o),()=>{Object.keys(e).forEach(C=>{s.style.removeProperty(C)}),s.style.removeProperty("--user-bubble-bg")}},[e,o]);const n=r.exports.useMemo(()=>({theme:e,userBackgroundColor:o}),[e,o]);return a(Je.Provider,{value:n,children:t})}function it(e=32){const o=new Uint8Array(e);return window.crypto.getRandomValues(o),Array.from(o,t=>`0${(t%36).toString(36)}`.slice(-1)).join("")}const dt=(e,o,t)=>{if(!o||!t)throw new Error("Line client ID or redirect URI is not set");const n=new URL("https://access.line.me/oauth2/v2.1/authorize");return n.searchParams.set("response_type","code"),n.searchParams.set("client_id",o),n.searchParams.set("redirect_uri",t),n.searchParams.set("state",e),n.searchParams.set("scope","profile openid email phone gender birthdate"),n.searchParams.set("bot_prompt","aggressive"),n.toString()},ft=e=>{const o=e?.response?.data?.detail;return typeof o=="string"?o:null},Ct=(e,o)=>{if(!e)return null;try{return new URL(e).searchParams.get(o)}catch{return null}},Qe=e=>e===de?J:e||J;function Xe({agentId:e,parentWidth:o,agent:t,receivedUrl:n,lineOAuthCallback:s,onLineOAuthCallbackHandled:C}){const[,i]=M(oe),[h,g]=M(De),[,m]=M(re),[c,y]=r.exports.useState(0),E=z(),d=Z(),F=r.exports.useMemo(()=>{const u=fe(n);return u?Ce(u):!1},[n]);r.exports.useEffect(()=>{s?.code&&s?.state&&g(x.OPEN)},[s,g]),r.exports.useEffect(()=>{if(n){const u=new URL(n).searchParams.get("return_url");if(!u)return;const A=Object.values(_).find(R=>`/${u}`===R);A&&A!==d.pathname&&E(A)}},[d.pathname,E,n]),r.exports.useEffect(()=>{m(o)},[o,m]),r.exports.useEffect(()=>{i(Qe(t?.font_family))},[t?.font_family,i]),r.exports.useEffect(()=>{F&&h!==x.OPEN&&g(x.OPEN)},[F,h,g]);const f=r.exports.useMemo(()=>t?t.gif_datas.filter(u=>u.is_waiting_enable):[],[t]);r.exports.useEffect(()=>{if(f.length<=1)return;const u=setInterval(()=>{y(A=>{let R;do R=Math.floor(Math.random()*f.length);while(R===A&&f.length>1);return R})},5e3);return()=>clearInterval(u)},[f]);const L=r.exports.useMemo(()=>je(t?.theme_color||Be.value),[t]),B=r.exports.useMemo(()=>t?.dark_mode||!1,[t]),D=qe(B),O=Ue(L)||"#3770ff",H=r.exports.useMemo(()=>t?f.length>0?f[c]?.gif_url??"":t.gif_datas.find(A=>A.emotion_state==="\u5F85\u6A5F")?.gif_url??"":void 0,[t,f,c]),G=r.exports.useCallback((u,A)=>{const R=A===l.AVATAR||A===l.BANNER,ne=A===l.BANNER&&o<=990;return{visibility:u?"visible":"hidden",position:u?"relative":"absolute",pointerEvents:u?"auto":"none",opacity:u?1:0,transition:u?"opacity 0.3s ease-out 0.3s":"opacity 0.3s ease-out",overflow:"hidden",...R&&{height:"100%",display:"flex",alignItems:"flex-end"},...ne&&{justifyContent:"center"}}},[o]),p=r.exports.useCallback(u=>({visibility:u?"visible":"hidden",position:u?"relative":"absolute",pointerEvents:u?"auto":"none",opacity:u?1:0,width:u?"100%":0,height:u?"100%":0,transition:u?"opacity 0.3s ease-out 0.3s":"opacity 0.3s ease-out",overflow:"hidden",borderRadius:t?.desktop_view_option===j.SMALL_SCREEN&&o>990?"24px":""}),[t?.desktop_view_option,o]);if(pe({frameView:t?.desktop_view_option||j.SMALL_SCREEN,iframeState:h,displayPosition:t?.display_position_option||K.RIGHT,designOption:t?.design_option||l.ICON,type:he.FRAME_VIEW,timestamp:Date.now(),lastIframeStateData:!0}),!e||!t)return null;const v=h===x.OPEN||h===x.CLOSE?h:x.CLOSE,b=v===x.CLOSE&&!F,P=v===x.OPEN;return a(Ye,{theme:D,userBackgroundColor:O,children:a(Ae,{agentId:e,agent:t,pUrl:n,lineOAuthCallback:s,onLineOAuthCallbackHandled:C,children:a(xe,{children:I(We,{children:[a("div",{style:G(b,t.design_option),children:a(Oe,{designOption:t.design_option,bannerPc:t.banner_pc?.url,bannerSp:t.banner_sp?.url,avatarSrc:t.image_url,characterUrl:H,fontFamily:t.font_family,onClick:()=>g(x.OPEN)})}),a("div",{style:p(P),children:a(Se,{})})]})})})})}const pt=Object.freeze(Object.defineProperty({__proto__:null,default:Xe},Symbol.toStringTag,{value:"Module"}));
1export{Ze as C,ee as D,$e as E,x as I,Ke as W,lt as a,Q as b,it as c,dt as d,Pe as e,oe as f,ft as g,nt as h,De as i,re as j,j as k,st as l,ct as m,Ct as n,Qe as o,ut as p,at as q,rt as r,ot as s,pt as t,$ as u}; 2//# sourceMappingURL=css-entry.5eb05cce.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.