diff --git a/src/404.html b/src/404.html index 39ac4a8..46a4770 100644 --- a/src/404.html +++ b/src/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/src/_next/static/nKCJJSFP0vZvgks9gcN2a/_buildManifest.js b/src/_next/static/Qii3U_Az_qwgwke16k1Z2/_buildManifest.js similarity index 63% rename from src/_next/static/nKCJJSFP0vZvgks9gcN2a/_buildManifest.js rename to src/_next/static/Qii3U_Az_qwgwke16k1Z2/_buildManifest.js index e933dbb..f16b135 100644 --- a/src/_next/static/nKCJJSFP0vZvgks9gcN2a/_buildManifest.js +++ b/src/_next/static/Qii3U_Az_qwgwke16k1Z2/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(s,a,c,t,e,d,i,f,b,n,h,u,j,k,r,_,o,l,p,g,I,B,F,w){return{__rewrites:{afterFiles:[],beforeFiles:[{has:s,source:"/widget.js",destination:"/api/widget-loader"},{has:s,source:"/:path*.map",destination:"/404"}],fallback:[]},"/":[a,c,t,e,d,i,f,b,n,h,u,j,k,r,_,o,l,p,g,I,B,F,"static/chunks/273-23a56f3a8982ad93.js",w,"static/chunks/pages/index-17d2addde6fe8f5b.js"],"/_error":["static/chunks/pages/_error-d7e8385d8c7b2eba.js"],"/static-hosts/[id]":[a,c,t,e,d,i,f,b,n,h,u,j,k,r,_,o,l,p,g,I,B,F,"static/chunks/544-094997a425b34a83.js",w,"static/chunks/pages/static-hosts/[id]-2e1285077194a76b.js"],sortedPages:["/","/_app","/_error","/static-hosts/[id]"]}}(void 0,"static/chunks/019d026b-88cf9262823bf392.js","static/chunks/fea29d9f-266d3d7693eaee57.js","static/chunks/3a17f596-be3effff4d9bad5f.js","static/chunks/e21e5bbe-4422a98ef09641ae.js","static/chunks/cb355538-5ce4481ed4e68222.js","static/chunks/674a26a7-7bbc176f6dabc48d.js","static/chunks/68c0a17d-4befe63819aa3804.js","static/chunks/4577d2ec-c41074425da3dfc0.js","static/chunks/737a5600-d3ad7210e77adb90.js","static/chunks/175675d1-37866f028ac0c2e8.js","static/chunks/257e8032-fae20b9feceec399.js","static/chunks/ebc70433-5f7f7806ad17a625.js","static/chunks/6a4d9673-199a132a26ebe079.js","static/chunks/117b9d7f-2a436e368a533109.js","static/chunks/fec483df-5a4e2b77022eaa08.js","static/chunks/69d2ed9c-30054a481df0baff.js","static/chunks/6b2193de-fa3f06059992e22c.js","static/chunks/b55cbb4c-ea4eed4114f875b1.js","static/chunks/cfb35ab8-3396891c1df5a043.js","static/chunks/36d2f571-15eb4e5783281bf4.js","static/chunks/5727625e-835a0663526f928e.js","static/chunks/429-bca509323b80f15f.js","static/chunks/884-d7039ad78a35401e.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(s,a,c,t,e,i,f,d,b,n,h,u,j,k,r,_,o,l,p,g,I,B,F,w){return{__rewrites:{afterFiles:[],beforeFiles:[{has:s,source:"/widget.js",destination:"/api/widget-loader"},{has:s,source:"/:path*.map",destination:"/404"}],fallback:[]},"/":[a,c,t,e,i,f,d,b,n,h,u,j,k,r,_,o,l,p,g,I,B,F,"static/chunks/273-23a56f3a8982ad93.js",w,"static/chunks/pages/index-330eb74e027e7442.js"],"/_error":["static/chunks/pages/_error-d7e8385d8c7b2eba.js"],"/static-hosts/[id]":[a,c,t,e,i,f,d,b,n,h,u,j,k,r,_,o,l,p,g,I,B,F,"static/chunks/544-094997a425b34a83.js",w,"static/chunks/pages/static-hosts/[id]-64d9bcf033fb1770.js"],sortedPages:["/","/_app","/_error","/static-hosts/[id]"]}}(void 0,"static/chunks/019d026b-88cf9262823bf392.js","static/chunks/fea29d9f-266d3d7693eaee57.js","static/chunks/3a17f596-be3effff4d9bad5f.js","static/chunks/e21e5bbe-4422a98ef09641ae.js","static/chunks/cb355538-6d3108969a209079.js","static/chunks/674a26a7-7bbc176f6dabc48d.js","static/chunks/68c0a17d-3bb45c68d12b2cc5.js","static/chunks/4577d2ec-73573aa600f04585.js","static/chunks/737a5600-d3ad7210e77adb90.js","static/chunks/175675d1-37866f028ac0c2e8.js","static/chunks/257e8032-fae20b9feceec399.js","static/chunks/ebc70433-5f7f7806ad17a625.js","static/chunks/6a4d9673-199a132a26ebe079.js","static/chunks/117b9d7f-2a436e368a533109.js","static/chunks/fec483df-5a4e2b77022eaa08.js","static/chunks/69d2ed9c-30054a481df0baff.js","static/chunks/6b2193de-fa3f06059992e22c.js","static/chunks/b55cbb4c-ea4eed4114f875b1.js","static/chunks/cfb35ab8-3396891c1df5a043.js","static/chunks/36d2f571-15eb4e5783281bf4.js","static/chunks/5727625e-835a0663526f928e.js","static/chunks/429-bca509323b80f15f.js","static/chunks/891-630323964608d493.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/src/_next/static/nKCJJSFP0vZvgks9gcN2a/_ssgManifest.js b/src/_next/static/Qii3U_Az_qwgwke16k1Z2/_ssgManifest.js similarity index 100% rename from src/_next/static/nKCJJSFP0vZvgks9gcN2a/_ssgManifest.js rename to src/_next/static/Qii3U_Az_qwgwke16k1Z2/_ssgManifest.js diff --git a/src/_next/static/chunks/4577d2ec-73573aa600f04585.js b/src/_next/static/chunks/4577d2ec-73573aa600f04585.js new file mode 100644 index 0000000..433c313 --- /dev/null +++ b/src/_next/static/chunks/4577d2ec-73573aa600f04585.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[817],{71419:function(t,a,n){n.d(a,{Cw1:function(){return c},EDj:function(){return d},Goc:function(){return l},WAq:function(){return u},d0b:function(){return i},ith:function(){return h}});var r=n(14167);function h(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 7.59 7.05 2.64 5.64 4.05 12 10.41l6.36-6.36-1.41-1.41L12 7.59zM5.64 19.95l1.41 1.41L12 16.41l4.95 4.95 1.41-1.41L12 13.59l-6.36 6.36z"},child:[]}]})(t)}function c(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM12 20c-4.411 0-8-3.589-8-8s3.567-8 7.953-8C16.391 4 20 7.589 20 12s-3.589 8-8 8z"},child:[]},{tag:"path",attr:{d:"M11 7h2v7h-2zm0 8h2v2h-2z"},child:[]}]})(t)}function i(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m12 19.24-4.95-4.95-1.41 1.42L12 22.07l6.36-6.36-1.41-1.42L12 19.24zM5.64 8.29l1.41 1.42L12 4.76l4.95 4.95 1.41-1.42L12 1.93 5.64 8.29z"},child:[]}]})(t)}function u(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 4v16c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V8a.997.997 0 0 0-.293-.707l-5-5A.996.996 0 0 0 14 2H6c-1.103 0-2 .897-2 2zm14 4.414L18.001 20H6V4h7.586L18 8.414z"},child:[]},{tag:"path",attr:{d:"M8 6h2v4H8zm4 0h2v4h-2z"},child:[]}]})(t)}function l(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"},child:[]}]})(t)}function d(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2a5 5 0 1 0 5 5 5 5 0 0 0-5-5zm0 8a3 3 0 1 1 3-3 3 3 0 0 1-3 3zm9 11v-1a7 7 0 0 0-7-7h-4a7 7 0 0 0-7 7v1h2v-1a5 5 0 0 1 5-5h4a5 5 0 0 1 5 5v1z"},child:[]}]})(t)}}}]); \ No newline at end of file diff --git a/src/_next/static/chunks/4577d2ec-c41074425da3dfc0.js b/src/_next/static/chunks/4577d2ec-c41074425da3dfc0.js deleted file mode 100644 index 22884d5..0000000 --- a/src/_next/static/chunks/4577d2ec-c41074425da3dfc0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[817],{71419:function(t,a,c){c.d(a,{Cw1:function(){return n},EDj:function(){return l},Goc:function(){return d},S4B:function(){return v},WAq:function(){return u},d0b:function(){return i},ith:function(){return h}});var r=c(14167);function h(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 7.59 7.05 2.64 5.64 4.05 12 10.41l6.36-6.36-1.41-1.41L12 7.59zM5.64 19.95l1.41 1.41L12 16.41l4.95 4.95 1.41-1.41L12 13.59l-6.36 6.36z"},child:[]}]})(t)}function n(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM12 20c-4.411 0-8-3.589-8-8s3.567-8 7.953-8C16.391 4 20 7.589 20 12s-3.589 8-8 8z"},child:[]},{tag:"path",attr:{d:"M11 7h2v7h-2zm0 8h2v2h-2z"},child:[]}]})(t)}function i(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m12 19.24-4.95-4.95-1.41 1.42L12 22.07l6.36-6.36-1.41-1.42L12 19.24zM5.64 8.29l1.41 1.42L12 4.76l4.95 4.95 1.41-1.42L12 1.93 5.64 8.29z"},child:[]}]})(t)}function u(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 4v16c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V8a.997.997 0 0 0-.293-.707l-5-5A.996.996 0 0 0 14 2H6c-1.103 0-2 .897-2 2zm14 4.414L18.001 20H6V4h7.586L18 8.414z"},child:[]},{tag:"path",attr:{d:"M8 6h2v4H8zm4 0h2v4h-2z"},child:[]}]})(t)}function d(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"},child:[]}]})(t)}function l(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2a5 5 0 1 0 5 5 5 5 0 0 0-5-5zm0 8a3 3 0 1 1 3-3 3 3 0 0 1-3 3zm9 11v-1a7 7 0 0 0-7-7h-4a7 7 0 0 0-7 7v1h2v-1a5 5 0 0 1 5-5h4a5 5 0 0 1 5 5v1z"},child:[]}]})(t)}function v(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 7H4c-1.103 0-2 .897-2 2v10c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V9c0-1.103-.897-2-2-2zM4 19v-8h12V9l.002 10H4z"},child:[]},{tag:"path",attr:{d:"M22 5c0-1.103-.897-2-2-2H7c-1.103 0-2 .897-2 2h13.001c1.101 0 1.996.895 1.999 1.994L20.002 15H20v2c1.103 0 2-.897 2-2V8.007L22.001 8V6L22 5.99V5z"},child:[]}]})(t)}}}]); \ No newline at end of file diff --git a/src/_next/static/chunks/68c0a17d-3bb45c68d12b2cc5.js b/src/_next/static/chunks/68c0a17d-3bb45c68d12b2cc5.js new file mode 100644 index 0000000..376b46b --- /dev/null +++ b/src/_next/static/chunks/68c0a17d-3bb45c68d12b2cc5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[660],{81784:function(t,n,r){r.d(n,{CgR:function(){return o},itj:function(){return u},jI1:function(){return a},sue:function(){return e},tqz:function(){return c}});var i=r(14167);function a(t){return(0,i.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M416 128 192 384l-96-96"},child:[]}]})(t)}function e(t){return(0,i.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m352 216-96 96-96-96"},child:[]}]})(t)}function o(t){return(0,i.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 184 144 144 144-144"},child:[]}]})(t)}function c(t){return(0,i.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M160 389a20.91 20.91 0 0 1-13.82-5.2l-128-112a21 21 0 0 1 0-31.6l128-112a21 21 0 0 1 27.66 31.61L63.89 256l109.94 96.19A21 21 0 0 1 160 389zm192 0a21 21 0 0 1-13.84-36.81L448.11 256l-109.94-96.19a21 21 0 0 1 27.66-31.61l128 112a21 21 0 0 1 0 31.6l-128 112A20.89 20.89 0 0 1 352 389zm-144 48a21 21 0 0 1-20.12-27l96-320a21 21 0 1 1 40.23 12l-96 320A21 21 0 0 1 208 437z"},child:[]}]})(t)}function u(t){return(0,i.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M218.1 167.17c0 13 0 25.6 4.1 37.4-43.1 50.6-156.9 184.3-167.5 194.5a20.17 20.17 0 0 0-6.7 15c0 8.5 5.2 16.7 9.6 21.3 6.6 6.9 34.8 33 40 28 15.4-15 18.5-19 24.8-25.2 9.5-9.3-1-28.3 2.3-36s6.8-9.2 12.5-10.4 15.8 2.9 23.7 3c8.3.1 12.8-3.4 19-9.2 5-4.6 8.6-8.9 8.7-15.6.2-9-12.8-20.9-3.1-30.4s23.7 6.2 34 5 22.8-15.5 24.1-21.6-11.7-21.8-9.7-30.7c.7-3 6.8-10 11.4-11s25 6.9 29.6 5.9c5.6-1.2 12.1-7.1 17.4-10.4 15.5 6.7 29.6 9.4 47.7 9.4 68.5 0 124-53.4 124-119.2S408.5 48 340 48s-121.9 53.37-121.9 119.17zM400 144a32 32 0 1 1-32-32 32 32 0 0 1 32 32z"},child:[]}]})(t)}}}]); \ No newline at end of file diff --git a/src/_next/static/chunks/68c0a17d-4befe63819aa3804.js b/src/_next/static/chunks/68c0a17d-4befe63819aa3804.js deleted file mode 100644 index 416e016..0000000 --- a/src/_next/static/chunks/68c0a17d-4befe63819aa3804.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[660],{81784:function(t,n,r){r.d(n,{CgR:function(){return a},itj:function(){return c},jI1:function(){return e},sue:function(){return o}});var i=r(14167);function e(t){return(0,i.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M416 128 192 384l-96-96"},child:[]}]})(t)}function o(t){return(0,i.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m352 216-96 96-96-96"},child:[]}]})(t)}function a(t){return(0,i.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 184 144 144 144-144"},child:[]}]})(t)}function c(t){return(0,i.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M218.1 167.17c0 13 0 25.6 4.1 37.4-43.1 50.6-156.9 184.3-167.5 194.5a20.17 20.17 0 0 0-6.7 15c0 8.5 5.2 16.7 9.6 21.3 6.6 6.9 34.8 33 40 28 15.4-15 18.5-19 24.8-25.2 9.5-9.3-1-28.3 2.3-36s6.8-9.2 12.5-10.4 15.8 2.9 23.7 3c8.3.1 12.8-3.4 19-9.2 5-4.6 8.6-8.9 8.7-15.6.2-9-12.8-20.9-3.1-30.4s23.7 6.2 34 5 22.8-15.5 24.1-21.6-11.7-21.8-9.7-30.7c.7-3 6.8-10 11.4-11s25 6.9 29.6 5.9c5.6-1.2 12.1-7.1 17.4-10.4 15.5 6.7 29.6 9.4 47.7 9.4 68.5 0 124-53.4 124-119.2S408.5 48 340 48s-121.9 53.37-121.9 119.17zM400 144a32 32 0 1 1-32-32 32 32 0 0 1 32 32z"},child:[]}]})(t)}}}]); \ No newline at end of file diff --git a/src/_next/static/chunks/884-d7039ad78a35401e.js b/src/_next/static/chunks/884-d7039ad78a35401e.js deleted file mode 100644 index ffdaa39..0000000 --- a/src/_next/static/chunks/884-d7039ad78a35401e.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[884],{7769:function(e,t,n){"use strict";n.d(t,{Z:function(){return pt}});var s,r,a,i,o,l,c,d,u,m,h,p,x,g=n(27812),f=n(50029),b=n(59499),v=n(16835),y=n(64687),w=n.n(y),j=n(4361),A=n(4298),N=n.n(A),k=n(28344),C=n(57632),q=n(89555),I=n(67294),V=n(22552),S=n(14331),O=n(73081),E=n(61193),P=n.n(E),M=n(71501),T=n(85893);function D(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=t.type,s=t.onConfirmed,r=t.children,a=t.className,i=t.disabled,o=t.defaultText,l=t.confirmText,c=t.loading,d=(0,I.useState)(!1),u=d[0],m=d[1];return(0,I.useEffect)(function(){return function(){return clearTimeout(e)}},[]),(0,I.useEffect)(function(){return u&&(clearTimeout(e),e=setTimeout(function(){m(!1)},2e3)),function(){return clearTimeout(e)}},[u]),(0,T.jsxs)("button",{type:n,disabled:i,onClick:function(e){e.stopPropagation(),!i&&(u?s&&s():m(!0))},className:a,children:[u?(void 0===l?function(){return(0,T.jsx)("span",{className:"text-red-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"Aqw8Kb"})})}:l)({disabled:i}):r||(void 0===o?function(){return"Delete"}:o)({disabled:i}),c&&(0,T.jsx)(Z,{})]})}function U(e){var t=e.entries,n=e.onChange;return null!=t&&t.length?(0,T.jsx)("div",{className:"space-y-2 max-h-[300px] overflow-auto",children:(t||[]).map(function(e,s){return(0,T.jsxs)("div",{className:"flex items-center justify-between p-4 bg-gray-100 rounded-md gap-2 mr-2 dark:bg-gray-900",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-gray-500 text-xs mb-1",children:new Date(e.createdAt).toLocaleString()}),(0,T.jsx)("div",{className:"text-gray-800 dark:text-gray-100",children:"string"==typeof e.text?e.text:""})]}),(0,T.jsx)(Y,{className:"text-red-500 hover:underline",onConfirmed:function(){n(t.filter(function(e,t){return t!==s}))},children:"Forget"})]},s)})}):(0,T.jsx)("div",{className:"flex items-center justify-center p-6 text-gray-500 bg-gray-100 rounded-md",children:(0,T.jsx)(j.cC,{id:"fnpUJJ"})})}var H=n(134),z=n(73014);function W(){for(var e=arguments.length,t=Array(e),n=0;n{{firstname}} {{lastname}}

",className:"w-full border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 text-base leading-6 focus:outline-none focus:ring-blue-500 focus:border-blue-500 transition duration-150 ease-in-out dark:bg-zinc-700 disabled:text-gray-500",value:null===(i=c.resultTransform)||void 0===i?void 0:i.templateString,onChange:function(e){l("resultTransform",eo(eo({},c.resultTransform||{}),{},{templateString:e.target.value}))},disabled:g||h})]}):null]})]})]})]}),k?(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsxs)("div",{className:"font-semibold mb-1",children:[(0,T.jsx)(j.cC,{id:"cQfI46"}),":"]}),(0,T.jsx)("textarea",{placeholder:'{\n "userID": "{userID}"\n}',rows:3,className:"w-full border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 text-base leading-6 focus:outline-none focus:ring-blue-500 focus:border-blue-500 transition duration-150 ease-in-out dark:bg-zinc-700 disabled:text-gray-500 w-full",value:S,onChange:function(e){O(e.target.value)},disabled:g})]}):null,(0,T.jsxs)("div",{className:"flex items-center justify-start gap-4",children:[(0,T.jsxs)("button",{onClick:function(){E()},type:"submit",className:"inline-flex items-center px-3 py-1.5 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2",disabled:g,children:[g?(0,T.jsx)(Z,{}):"→",(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"Ls+eRP"})})]}),(0,T.jsxs)("label",{className:"flex items-center justify-start gap-2 text-sm",children:[(0,T.jsx)("input",{type:"checkbox",checked:k,onChange:function(e){C(e.target.checked),e.target.checked&&!S&&O(JSON.stringify(m.reduce(function(e,t){return e[t]="test value",e},{}),null,2))},disabled:g}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"WD6ttL"})})]})]}),y?(0,T.jsxs)("div",{children:[y.error?(0,T.jsx)("div",{className:"font-semibold text-red-500 mb-1",children:(0,T.jsx)(j.cC,{id:"sCG3Yu"})}):(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)("div",{className:"font-semibold mb-1 text-green-500",children:[(0,T.jsx)(j.cC,{id:"Wagt7O"})," (",(0,T.jsx)(j.cC,{id:"IPXOXm",values:{0:(null===(o=y.text)||void 0===o?void 0:o.length)||0}}),")"]})}),y.error?(0,T.jsx)("textarea",{className:"w-full border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 text-base leading-6 focus:outline-none focus:ring-blue-500 focus:border-blue-500 transition duration-150 ease-in-out dark:bg-zinc-700 disabled:text-gray-500 w-full",rows:3,value:null==y?void 0:y.error,readOnly:!0}):(0,T.jsx)("textarea",{className:"w-full border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 text-base leading-6 focus:outline-none focus:ring-blue-500 focus:border-blue-500 transition duration-150 ease-in-out dark:bg-zinc-700 disabled:text-gray-500 w-full",rows:3,value:null==y?void 0:y.text,readOnly:!0})]}):null]})}var ec=n(79804),ed=n(44509),eu=n.n(ed),em=n(96750);function eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function ep(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return e?e.replace(/{(\w+)}/g,function(e,n){return t[n]||e}):""},ef=(s=(0,f.Z)(w().mark(function e(t,n){var s,r,a,i,o,l,c,d,u,m,h,p,x,g,f,b,v,y,j,A,N,k,C,q=arguments;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:s=(q.length>2&&void 0!==q[2]?q[2]:{}).throwOnError,r=t.url,a=t.method,i=t.hasHeaders,o=t.hasBody,l=t.requestBody,d=void 0===(c=t.requestBodyFormat)?"json":c,u=t.requestHeaders,m=t.hasResultTransform,h=t.resultTransform,p=eg(r,n),e.prev=3,x=ep(ep({},"form-data"===d?{}:{"Content-Type":"application/json"}),i?ex(u,n):{}),e.next=10;break;case 7:throw e.prev=7,e.t0=e.catch(3),Error("Parsing request headers error:",e.t0.message);case 10:e.prev=10,g=o?ex(l,n):void 0,e.next=17;break;case 14:throw e.prev=14,e.t1=e.catch(10),Error("Parsing request body error:",e.t1.message);case 17:return f=g&&JSON.stringify(g),g&&"form-data"===d&&(f=new FormData,Object.keys(g).forEach(function(e){f.append(e,g[e])})),b={method:a,headers:x,body:f},e.next=24,fetch(p,b);case 24:if((v=e.sent).ok){e.next=40;break}return e.prev=26,e.next=29,v.text();case 29:y=e.sent,e.next=36;break;case 32:throw e.prev=32,e.t2=e.catch(26),console.error("Error parsing HTTP response",e.t2),Error("HTTP Error: ".concat(v.status," ").concat(v.statusText));case 36:throw console.error("HTTP Error:",v.status,v.statusText),console.error("HTTP Response:",y),console.error("HTTP Request Params:",JSON.stringify(p),JSON.stringify(b)),Error("Error: ".concat(v.status," ").concat(v.statusText,"\nError response: ").concat(y));case 40:return e.next=42,v.text();case 42:if(j=e.sent,!(m&&h)){e.next=69;break}if(e.prev=45,"jmes"!==h.engine){e.next=54;break}return"object"==typeof(A=JSON.parse(j))&&(A.__VARIABLES=n),(N=eu().search(A,h.expression)).__VARIABLES&&delete N.__VARIABLES,e.abrupt("return",JSON.stringify(N,null,2));case 54:if("handlebars"!==h.engine){e.next=61;break}return"object"==typeof(k=JSON.parse(j))&&(k.__VARIABLES=n),C=em.compile(h.templateString),e.abrupt("return",C(k));case 61:throw Error("Unsupported transform engine: ".concat(h.engine));case 62:e.next=69;break;case 64:if(e.prev=64,e.t3=e.catch(45),console.error("Error transforming HTTP response",e.t3),!s){e.next=69;break}throw Error("Post-processing error: "+e.t3.message);case 69:return e.abrupt("return",j);case 70:case"end":return e.stop()}},e,null,[[3,7],[10,14],[26,32],[45,64]])})),function(e,t){return s.apply(this,arguments)}),eb=function(e){var t,n,s,r=e.value,a=e.parser,i=e.overridingErrorMessage,o=(n=(t=(0,I.useState)(void 0))[0],s=t[1],(0,I.useEffect)(function(){var e=setTimeout(function(){s(r)},300);return function(){return clearTimeout(e)}},[r,300]),n),l=(0,I.useState)(""),c=l[0],d=l[1];return((0,I.useEffect)(function(){try{d(""),o&&a(o)}catch(e){d(i||e.message)}},[o]),c)?(0,T.jsx)("div",{className:"text-red-500 text-sm mt-1",children:c}):null},ev=n(24905),ey=function(e){var t,n=e.onSuccess,s=(0,I.useState)(""),r=s[0],a=s[1],i=(0,I.useState)(""),o=i[0],l=i[1],c=(0,I.useState)(!1),d=c[0],u=c[1],m=(t=(0,f.Z)(w().mark(function e(t){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,l(""),u(!0),e.next=6,(0,ev.fetchPluginFromGithub)(r);case 6:n(e.sent),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(1),console.error(e.t0),l(q.ag._({id:"e6Mc3R"}));case 14:return e.prev=14,u(!1),e.finish(14);case 17:case"end":return e.stop()}},e,null,[[1,10,14,17]])})),function(e){return t.apply(this,arguments)});return(0,T.jsxs)("form",{onSubmit:m,className:"my-2 flex flex-wrap items-center justify-center gap-x-2 gap-y-1",children:[(0,T.jsx)("input",{"data-element-id":"plugin-url-input",type:"text",name:"url",required:!0,pattern:ev.GITHUB_PLUGIN_REGEX.source,placeholder:"Enter the github repo URL",className:"grow text-sm border border-gray-300 dark:border-gray-700 rounded-lg px-4 py-2 focus:outline-none focus:border-blue-500 dark:focus:border-blue-500 dark:bg-zinc-800",value:r,onChange:function(e){return a(e.target.value)},disabled:d}),(0,T.jsx)("div",{className:"text-center",children:(0,T.jsx)("button",{disabled:d,"data-element-id":"continue-import-plugin-button",className:"inline-flex items-center px-3 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2 whitespace-nowrap",children:(0,T.jsx)(j.cC,{id:"l3s5ri"})})}),(0,T.jsx)("div",{className:"w-full text-red-500 text-sm",children:o})]})};function ew(e){var t,n=e.value,s=e.setValue,r=e.error,a=e.setError,i=e.testFunction,o=e.extraHTTPActionVariables,l=($()||{}).serverHostConfig,c=(0,I.useState)(!1),d=c[0],u=c[1],m=(0,I.useState)(null),h=m[0],p=m[1],x=(0,I.useMemo)(function(){return/"implementationType":\s*"http"/g.test(n)},[n]),f=(0,I.useState)([]),b=f[0],v=f[1];(0,I.useEffect)(function(){if(x&&d)try{var e=JSON.parse(n);a(""),p(e.httpAction),v([].concat((0,g.Z)((0,ev.parsedVariablesFromSpec)(e.openaiSpec,e.userSettings)),(0,g.Z)(o)))}catch(e){a("Invalid plugin/HTTP Action JSON")}},[n,x,d]);var y=(0,I.useState)(!1),w=y[0],A=y[1];return(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("div",{children:(0,T.jsx)("div",{className:"text-xs text-gray-500",children:(0,T.jsx)(j.cC,{id:"VYIIuD",components:{0:(0,T.jsx)("a",{target:"_blank",rel:"noreferrer",className:"text-blue-500 font-semibold hover:underline",href:(null==l||null===(t=l.links)||void 0===t?void 0:t.sharePluginsViaGithub)||"/guides/share-plugins-via-github"})}})})}),(0,T.jsxs)("div",{className:"mt-4",children:[(0,T.jsx)("button",{type:"button",onClick:function(){A(function(e){return!e})},className:"flex items-center px-2 py-1 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"M0BKgX"})})}),w&&(0,T.jsx)(ey,{onSuccess:function(e){s(JSON.stringify(e,null,4)),A(!1)}})]}),(0,T.jsx)("div",{className:"mt-4",children:(0,T.jsx)("textarea",{value:n,onChange:function(e){return s(e.target.value)},type:"text",name:"json-file",id:"json-file",className:"min-h-[700px] bg-gray-50 text-base shadow dark:bg-gray-800 hover:border-blue-400 cursor-default block w-full rounded-md border-0 py-1.5 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:leading-6 dark:text-white",placeholder:"Enter your JSON content here",rows:10})}),x&&(0,T.jsx)("div",{className:"mt-4",children:(0,T.jsx)(Q,{label:"Test HTTP Action",enabled:d,setEnabled:function(e){e||(a(!1),p(void 0)),u(e)}})}),x&&d&&h&&!r&&(0,T.jsx)("div",{className:"mt-4",children:(0,T.jsx)(el,{hideDetails:!0,readOnly:!0,httpAction:h,onFieldChange:function(){},testFunction:i,variables:b})})]})}function ej(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function eA(e){for(var t=1;t1&&void 0!==a[1]?a[1]:{},e.prev=1,s=U&&JSON.parse(U),e.next=8;break;case 5:throw e.prev=5,e.t0=e.catch(1),Error("User Settings must be a valid JSON.");case 8:if(r=eA(eA({},(0,X.oH)({},s||[])),n),(0,ev.validateHTTPAction)(t,s),!d){e.next=15;break}return e.next=14,d(t,r);case 14:case 17:return e.abrupt("return",e.sent);case 15:return e.next=17,ef(t,r);case 18:case"end":return e.stop()}},e,null,[[1,5]])})),function(e){return t.apply(this,arguments)}),ex=function(){if(eo(""),"json"===v)try{var e,t,s,r,i,o,l,d,u,m,h=JSON.parse(eu);t=h.title,s=h.iconURL,r=h.overviewMarkdown,i=h.openaiSpec,o=h.code,l=h.userSettings;var p=h.implementationType;d=void 0===p?"javascript":p,u=h.httpAction;var x=h.outputType;m=void 0===x?"respond_to_ai":x}catch(e){console.error(e),eo(q.ag._({id:"svQd1q"}))}else{t=N,s=O,r=M,o=F,d=W,u=es,m=ee;try{e=(i=JSON.parse(L)).name}catch(e){console.error(e),eo(q.ag._({id:"svQd1q"}));return}try{U&&(l=JSON.parse(U))}catch(e){console.error(e),eo(q.ag._({id:"Tri+cM"}));return}}if(!t){eo(q.ag._({id:"4od74D"}));return}if(!i.name||!i.name.length){eo(q.ag._({id:"LWocrQ"}));return}if(!i.description||!i.description.length){eo(q.ag._({id:"/xxPLj"}));return}if(e!==n.id&&c(e)){eo(q.ag._({id:"vEGzwu",values:{parsedPluginID:e}}));return}if("javascript"===d&&!o.includes(i.name)){eo(q.ag._({id:"gGUb6a",values:{0:i.name}}));return}if(l)try{(0,X.Kt)(l)}catch(e){eo(e.message);return}if("http"===d)try{(0,ev.validateHTTPAction)(u,l)}catch(e){eo("Invalid HTTP Action");return}a(eA(eA({},n),{},{uuid:n.uuid,id:i.name,title:t,iconURL:s,overviewMarkdown:r,openaiSpec:i,code:o,userSettings:l||null,implementationType:d,httpAction:u,outputType:m,syncedAt:null}))};return(0,T.jsxs)("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[(0,T.jsx)("div",{}),!i&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,T.jsxs)(Y,{onConfirmed:s,className:"inline-flex items-center px-3 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 disabled:bg-gray-400 gap-2",confirmText:function(){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(k.Xm5,{className:"w-4 h-4"}),(0,T.jsx)("span",{className:"hover:underline",children:(0,T.jsx)(j.cC,{id:"Aqw8Kb"})})]})},children:[(0,T.jsx)(k.Xm5,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"cnGeoo"})})]}),(0,T.jsxs)("button",{onClick:r,className:"inline-flex items-center px-3 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-yellow-600 hover:bg-yellow-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-500 disabled:bg-gray-400 gap-2",children:[(0,T.jsx)(ec.oHP,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"dEgA5A"})})]}),(0,T.jsxs)("button",{onClick:ex,className:"inline-flex items-center px-3 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-gray-400 gap-2",children:[(0,T.jsx)(ec.bzc,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"tfDRzk"})})]})]}),ei&&(0,T.jsx)("div",{className:"text-red-500 w-full",children:ei})]}),!n.system&&(0,T.jsx)("div",{className:"w-full",children:(0,T.jsxs)("fieldset",{children:[(0,T.jsx)("legend",{className:"sr-only",children:"Input Options"}),(0,T.jsx)("div",{className:"flex flex-col gap-4 gap-y-1 sm:flex-row",children:p.map(function(e){return(0,T.jsxs)("div",{className:"flex items-center",children:[(0,T.jsx)("input",{id:e.id,name:"input-method",type:"radio",checked:e.id===v,className:"h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-600 cursor-pointer disabled:cursor-not-allowed",onChange:function(){return y(e.id)},disabled:o}),(0,T.jsx)("label",{htmlFor:e.id,className:(0,X.AK)(o?"text-gray-400":"text-gray-900 dark:text-gray-50","ml-1 block font-medium leading-6 cursor-pointer text-base"),children:e.title})]},e.id)})})]})}),"manually"===v?(0,T.jsxs)("div",{className:"mt-2 w-full space-y-2",children:[(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsxs)("label",{className:"font-semibold",children:[(0,T.jsx)(j.cC,{id:"ErRKov"}),"*"]}),(0,T.jsx)("div",{className:"text-gray-500 text-xs",children:(0,T.jsx)(j.cC,{id:"YS2bZx"})}),(0,T.jsx)("div",{className:"w-full my-1",children:(0,T.jsx)("input",{disabled:o||h,type:"text",placeholder:q.ag._({id:"LnnVIT"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",value:N,onChange:function(e){return V(e.target.value)}})})]}),(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("label",{className:"font-semibold",children:(0,T.jsx)(j.cC,{id:"bd1Kuw"})}),(0,T.jsx)("div",{className:"text-gray-500 text-xs",children:(0,T.jsx)(j.cC,{id:"uUXlSw"})}),(0,T.jsx)("div",{className:"w-full my-1",children:(0,T.jsx)("input",{disabled:o||h,type:"text",placeholder:q.ag._({id:"0X8rUE"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",value:O,onChange:function(e){return E(e.target.value)}})})]}),(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("label",{className:"font-semibold",children:(0,T.jsx)(j.cC,{id:"6FSnpy"})}),(0,T.jsx)("div",{className:"text-gray-500 text-xs",children:(0,T.jsx)(j.cC,{id:"i5udnt"})}),(0,T.jsx)("div",{className:"w-full my-1",children:(0,T.jsx)("textarea",{disabled:o||h,placeholder:q.ag._({id:"F1uW/d"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",value:M,onChange:function(e){return D(e.target.value)},rows:5})})]}),(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsxs)("label",{className:"font-semibold",children:[(0,T.jsx)(j.cC,{id:"7HIUd6"}),"*"]}),(0,T.jsx)("div",{className:"text-gray-500 text-xs",children:(0,T.jsx)(j.cC,{id:"i39oBj",components:{0:(0,T.jsx)("a",{className:"text-blue-500 hover:underline",href:"https://platform.openai.com/docs/guides/function-calling",target:"_blank",rel:"noreferrer"})}})}),(0,T.jsxs)("div",{className:"w-full my-1",children:[(0,T.jsx)("textarea",{disabled:o||h,placeholder:q.ag._({id:"T3l2/7"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",value:L,onChange:function(e){return R(e.target.value)},rows:5}),(0,T.jsx)(eb,{value:L,parser:JSON.parse,overridingErrorMessage:q.ag._({id:"svQd1q"})})]})]}),(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("label",{className:"font-semibold",children:(0,T.jsx)(j.cC,{id:"Nv92aJ"})}),(0,T.jsx)("div",{className:"text-gray-500 text-xs",children:(0,T.jsx)(j.cC,{id:"ikLQLQ",components:{0:(0,T.jsx)("a",{className:"text-blue-500 hover:underline",href:(null==eh?void 0:eh.pluginsDocs)||"/plugins-docs",target:"_blank",rel:"noreferrer"})}})}),(0,T.jsxs)("div",{className:"w-full my-1",children:[(0,T.jsx)("textarea",{disabled:o||h,placeholder:q.ag._({id:"Yj2/Tk"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",rows:5,value:U,onChange:function(e){return H(e.target.value)}}),(0,T.jsx)(eb,{value:U,parser:X.Kt})]})]}),(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsxs)("label",{className:"font-semibold",children:[(0,T.jsx)(j.cC,{id:"N4OVNn"}),"*"]}),(0,T.jsx)("div",{className:"text-gray-500 text-xs",children:(0,T.jsx)(j.cC,{id:"4fbZwm"})}),(0,T.jsx)("div",{className:"w-full my-1",children:(0,T.jsxs)("select",{id:"model",className:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6 disabled:text-gray-500",value:W,onChange:function(e){Q(e.target.value),es||er({id:(0,C.Z)(),name:"",url:"",method:"GET"})},disabled:o||h,children:[(0,T.jsx)("option",{value:"javascript",children:"JavaScript Code"}),(0,T.jsx)("option",{value:"http",children:"HTTP Action"})]})})]}),"javascript"===W?(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsxs)("label",{className:"font-semibold",children:[(0,T.jsx)(j.cC,{id:"uIjGvG"}),"*"]}),(0,T.jsx)("div",{className:"text-gray-500 text-xs",children:(0,T.jsx)(j.cC,{id:"30hLYa",components:{0:(0,T.jsx)("a",{className:"text-blue-500 hover:underline",href:(null==eh?void 0:eh.pluginsDocs)||"/plugins-docs",target:"_blank",rel:"noreferrer"})}})}),(0,T.jsx)("div",{className:"w-full my-1",children:(0,T.jsx)("textarea",{disabled:o||h,placeholder:q.ag._({id:"YoxD8i"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",rows:5,value:F,onChange:function(e){return G(e.target.value)}})})]}):"http"===W?(0,T.jsx)("div",{className:"w-full mb-4",children:es?(0,T.jsx)(el,{readOnly:h,httpAction:es,onFieldChange:function(e,t){er(function(n){return eA(eA({},n),{},(0,b.Z)({},e,t))})},testFunction:ep,variables:[].concat((0,g.Z)((0,ev.parsedVariablesFromSpec)(L,U)),(0,g.Z)(m))}):null}):null,(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("label",{className:"font-semibold",children:(0,T.jsx)(j.cC,{id:"2o7xcf"})}),(0,T.jsx)("div",{className:"text-gray-500 text-xs",children:(0,T.jsx)(j.cC,{id:"tQht86"})}),(0,T.jsx)("div",{className:"w-full my-1",children:(0,T.jsxs)("select",{id:"model",className:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6 disabled:text-gray-500",value:ee,onChange:function(e){et(e.target.value)},disabled:o||h,children:[(0,T.jsx)("option",{value:"respond_to_ai",children:(0,T.jsx)(j.cC,{id:"Dedbjs"})}),(0,T.jsx)("option",{value:"render_markdown",children:(0,T.jsx)(j.cC,{id:"HVm9F2"})}),(0,T.jsx)("option",{value:"render_html",children:(0,T.jsx)(j.cC,{id:"u/WKTl"})})]})})]})]}):(0,T.jsx)(ew,{value:eu,setValue:em,error:ei,setError:eo,extraHTTPActionVariables:m,testFunction:ep}),i&&(0,T.jsxs)("div",{className:"mt-6 w-full text-center",children:[ei?(0,T.jsx)("div",{className:"text-red-500 text-sm mb-6",children:ei}):null,(0,T.jsx)("div",{className:"text-center flex items-center justify-center gap-2",children:n.system?(0,T.jsx)("span",{className:"text-gray-500",children:(0,T.jsx)(j.cC,{id:"XmhWD2"})}):(0,T.jsxs)("button",{onClick:ex,type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-gray-400 gap-2",disabled:o||h,children:[o?(0,T.jsx)(Z,{}):n.id?null:(0,T.jsx)(k.wEH,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:n.id?q.ag._({id:"/LO3aj"}):q.ag._({id:"B+nQnj"})})]})})]})]})}var ek=n(4730),eC=n(19021),eq=n(1241),eI=n(74655),eV=["className"];function eS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function eO(e){for(var t=1;t=400)){e.next=13;break}return e.next=9,t.json();case 9:return E((null===(n=e.sent.error)||void 0===n?void 0:n.message)||L._(ta)),V(!1),e.abrupt("return");case 13:if(t.ok){e.next=17;break}return E(L._(ta)),V(!1),e.abrupt("return");case 17:return D(!0),e.abrupt("return",!0);case 21:e.prev=21,e.t0=e.catch(2),E(L._(ta)),console.error(e.t0);case 25:V(!1);case 26:case"end":return e.stop()}},e,null,[[2,21]])})),function(){return t.apply(this,arguments)});return(0,T.jsxs)("div",{children:[_?null:(0,T.jsx)("div",{className:"mt-4",children:(0,T.jsx)(eF,{name:"Web Search Plugin"})}),(0,T.jsxs)("div",{className:"my-4 space-y-4",children:[(0,T.jsx)("div",{children:(0,T.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[(0,T.jsx)("label",{className:"block text-sm font-medium leading-6",children:(0,T.jsx)(j.cC,{id:"aDVBYo"})}),(0,T.jsx)("select",{disabled:!R,className:"block w-fit rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6 max-w-full",children:(0,T.jsx)("option",{value:"google",children:(0,T.jsx)(j.cC,{id:"1mnY67"})})})]})}),(0,T.jsx)("div",{className:"text-xs text-gray-500",children:(0,T.jsx)(j.cC,{id:"pqNt/b"})})]}),R?(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsxs)("div",{className:"text-sm text-gray-500 text-center",children:[(0,T.jsx)("a",{href:(null==F?void 0:F.webSearchAPIKeyGuide)||"https://docs.typingmind.com/other-resources/how-tos/how-to-enable-web-search-and-image-search-on-typingmind",className:"text-blue-500 hover:underline",target:"_blank",rel:"noopener noreferrer",children:(0,T.jsx)("b",{children:(0,T.jsx)(j.cC,{id:"BdH0Jq"})})}),(0,T.jsx)("div",{className:"my-1 text-xs",children:(0,T.jsx)(j.cC,{id:"HsTJS/"})})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"flex items-center justify-between",children:(0,T.jsx)("label",{className:tt("block text-sm font-medium leading-6",b?"":"text-red-500"),children:(0,T.jsx)(j.cC,{id:"5qSvKg"})})}),(0,T.jsx)("input",{type:"text",placeholder:"XXXXXXXXXXX",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",value:b,onChange:function(e){return y(e.target.value)},disabled:q||!_,onKeyDown:function(e){"Enter"===e.key&&e.metaKey&&(e.preventDefault(),G())}})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"flex items-center justify-between",children:(0,T.jsx)("label",{className:tt("block text-sm font-medium leading-6",N?"":"text-red-500"),children:(0,T.jsx)(j.cC,{id:"PtdI1b"})})}),(0,T.jsx)("input",{type:"password",placeholder:"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",value:N,disabled:q||!_,onChange:function(e){return k(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&e.metaKey&&(e.preventDefault(),G())}})]}),(0,T.jsxs)("div",{children:[O&&(0,T.jsx)("div",{className:"text-red-500 text-sm text-center",children:O}),(0,T.jsx)("div",{className:"text-center flex items-center justify-center gap-2 my-4",children:M?(0,T.jsxs)("div",{className:"text-green-500 text-sm",children:[(0,T.jsx)(j.cC,{id:"fsSQWV"})," \uD83C\uDF89"," "]}):null}),M?null:(0,T.jsx)("div",{className:"text-xs text-center my-2",children:(0,T.jsx)(j.cC,{id:"ghNpNS"})}),(0,T.jsx)("div",{className:"text-center flex items-center justify-center gap-2",children:!b&&!N&&p&&d?(0,T.jsxs)("button",{onClick:function(){u(""),x(""),o(function(e){return te(te({},e),{},{get_web_search_results:{enabled:!1}})})},className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors whitespace-nowrap space-x-1",children:[(0,T.jsx)(ec.bzc,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"mTAnk+"})})]}):(0,T.jsxs)("button",{onClick:G,disabled:q||!b||!N,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-gray-400 disabled:cursor-default transition-colors whitespace-nowrap space-x-1",children:[(0,T.jsx)(ec.nDU,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"mxFYYR"})})]})})]}),(0,T.jsx)("div",{className:"text-xs text-gray-500 my-4",children:(0,T.jsx)(j.cC,{id:"rF9ATR",components:{0:(0,T.jsx)("b",{})}})})]}):null,null!=B&&null!==(s=B.serverHostConfig)&&void 0!==s&&s.managed?null:(0,T.jsxs)("details",{className:"mt-4",children:[(0,T.jsx)("summary",{className:"text-xl text-center font-semibold hover:underline cursor-pointer",children:(0,T.jsx)(j.cC,{id:"4PbDoL"})}),(0,T.jsx)(e3,{})]})]})}var to=n(72152),tl=n(58868);function tc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function td(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[];return[].concat((0,g.Z)(e),[O])}),E(null),D(!1)},onCanceled:function(){return D(!1)},onSaved:function(e){return en(e)},isPluginDuplicated:function(e){return U.some(function(t){return t.id===e})}},O):(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,T.jsxs)("h2",{className:"text-2xl font-semibold flex items-center justify-start gap-2",children:[(0,T.jsx)("span",{className:"w-8 h-8 flex items-center justify-center",children:(0,T.jsx)(ea,{size:"medium",plugin:et})}),(0,T.jsx)("span",{children:et.title})]}),et.system||et.org||!(0,X.N7)("addNewPlugins",z)?null:(0,T.jsxs)(tl.v,{as:"div",className:"relative flex text-left shrink-0",children:[(0,T.jsx)(tl.v.Button,{className:"transiton-all inline-block",children:(0,T.jsx)(V.$T6,{className:"w-6 h-6 sm:w-4 sm:h-4 sm:scale-150"})}),(0,T.jsx)(S.u,{as:I.Fragment,enter:"transition ease-out duration-100",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,T.jsx)(tl.v.Items,{className:"absolute z-40 right-0 mt-2 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:(0,T.jsxs)("div",{className:"px-1 py-1 ",children:[(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:function(){s(et)},className:"".concat(t?"bg-blue-600 text-white":"text-gray-900"," cursor-default group flex shrink-0 whitespace-nowrap space-x-2 w-full items-center rounded-md px-2 py-2 text-sm font-medium"),children:[(0,T.jsx)(ec.x2q,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"Z8lGw6"})})]})}}),(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:function(){return D(!0)},className:"".concat(t?"bg-blue-600 text-white":"text-gray-900"," cursor-default group flex shrink-0 whitespace-nowrap space-x-2 w-full items-center rounded-md px-2 py-2 text-sm font-medium"),children:[(0,T.jsx)(ec.$iz,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"ePK91l"})})]})}})]})})})]})]}),(0,T.jsx)(e0,{plugin:et,externalSettingStatus:"get_web_search_results"===et.id?u&&l?"ready":"require_config":(0,X.X0)(et,{systemPluginsMap:W,userPluginSettings:Y})?"ready":"require_config",externalSettingElement:"get_web_search_results"===et.id?function(){return(0,T.jsx)(ti,{})}:null},O)]})}):L?(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"my-4 text-center text-gray-500 hidden sm:block",children:(0,T.jsx)(j.cC,{id:"m5Z2VD"})}),(0,T.jsxs)("form",{onSubmit:function(e){e.preventDefault();var t=e.target.url.value,s=ev.SHARED_PLUGIN_LINK_REGEX.exec(t),r=(0,v.Z)(s,3),a=(r[0],r[1]),i=r[2];n(a||i)},className:"my-4 flex flex-col items-center justify-center gap-2",children:[(0,T.jsx)("input",{"data-element-id":"plugin-url-input",type:"text",name:"url",required:!0,pattern:ev.SHARED_PLUGIN_LINK_REGEX.source,placeholder:"Enter the plugin URL",className:"w-full text-sm border border-gray-300 dark:border-gray-700 rounded-lg px-4 py-2 focus:outline-none focus:border-blue-500 dark:focus:border-blue-500 dark:bg-zinc-800"}),(0,T.jsx)("div",{className:"text-center",children:(0,T.jsx)("button",{"data-element-id":"continue-import-plugin-button",className:"inline-flex items-center px-3 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2 whitespace-nowrap",children:(0,T.jsx)(j.cC,{id:"xGVfLh"})})})]})]}):(0,T.jsx)("div",{"data-element-id":"select-plugin-modal-description",className:"my-4 text-center text-gray-500 hidden sm:block",children:(0,T.jsx)(j.cC,{id:"HcH0CK"})})]})]})}var tb=n(86501),tv=n(11163);function ty(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function tw(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[];return[].concat((0,g.Z)(e.filter(function(e){return e.id!==h.data.id})),[tw(tw({},h.data),{},{uuid:(0,C.Z)(),syncedAt:null})])}),a(!1)},M=(0,I.useMemo)(function(){return!!h&&!!E.find(function(e){return e.id===h.data.id})}),D=(t=(0,f.Z)(w().mark(function e(t){var n,s;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:if(u(!0),y(""),!ev.GITHUB_PLUGIN_REGEX.test(t)){e.next=18;break}return e.prev=5,e.next=8,(0,ev.fetchPluginFromGithub)(t,{uuid:(0,C.Z)()});case 8:p({data:e.sent}),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(5),console.error(e.t0),y(S._(tj));case 16:e.next=45;break;case 18:return e.next=20,new Promise(function(e){return setTimeout(e,2e3)});case 20:return e.prev=20,e.next=23,fetch((0,X.PO)(null===(n=O.serverHostConfig)||void 0===n?void 0:n.orgURL)+"/api/shared_plugins/"+t,{headers:{"Content-Type":"application/json"}});case 23:if(!((s=e.sent).status>=400)){e.next=31;break}return e.next=27,s.json();case 27:return y(e.sent.userMessage||S._(tj)),u(!1),e.abrupt("return");case 31:if(s.ok){e.next=35;break}return y(S._(tj)),u(!1),e.abrupt("return");case 35:return e.next=37,s.json();case 37:p(e.sent),e.next=45;break;case 41:e.prev=41,e.t1=e.catch(20),y(S._(tj)),console.error(e.t1);case 45:u(!1);case 46:case"end":return e.stop()}},e,null,[[5,12],[20,41]])})),function(e){return t.apply(this,arguments)});return(0,T.jsx)(B,{wide:!0,showCloseButton:!1,open:r,setOpen:a,children:(0,T.jsxs)("div",{className:"p-4",children:[d?(0,T.jsxs)("h2",{className:"text-lg text-center my-10 flex items-center justify-center gap-2",children:[(0,T.jsx)(Z,{}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"r53GSi"})})]}):null,b?(0,T.jsx)("h2",{className:"text-lg text-red-500 text-center my-10",children:b}):null,h?(0,T.jsxs)("div",{className:"text-lg text-center",children:[(0,T.jsx)("div",{className:"my-4 text-lg text-center",children:(0,T.jsx)(j.cC,{id:"zjeHGx",values:{0:null==h||null===(n=h.data)||void 0===n?void 0:n.title},components:{0:(0,T.jsx)("b",{})}})}),(0,T.jsx)("div",{className:"mt-4 text-lg text-center",children:(0,T.jsx)("a",{className:"text-blue-500 hover:underline",href:ev.GITHUB_PLUGIN_REGEX.test(i)?i:(0,X.PO)(null===(s=O.serverHostConfig)||void 0===s?void 0:s.orgURL)+"/plugins/".concat(null==h?void 0:h.id),target:"_blank",children:(0,T.jsx)(j.cC,{id:"SZw9tS"})})}),M&&(0,T.jsx)("span",{className:"block mt-2 text-orange-500 text-sm",children:(0,T.jsx)(j.cC,{id:"q1Iujb",values:{0:h.data.id},components:{0:(0,T.jsx)("b",{}),1:(0,T.jsx)("br",{}),2:(0,T.jsx)("br",{}),3:(0,T.jsx)("br",{})}})}),(0,T.jsxs)("div",{className:"mt-6 text-center flex items-center justify-center flex-wrap gap-2",children:[(0,T.jsx)("button",{onClick:function(){return P()},className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2",disabled:d,children:M?(0,T.jsx)(j.cC,{id:"2iY5s/"}):(0,T.jsx)(j.cC,{id:"T/YuOx"})}),(0,T.jsx)("button",{onClick:function(){return a(!1)},className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 disabled:bg-gray-400 gap-2",disabled:d,children:(0,T.jsx)(j.cC,{id:"dEgA5A"})})]})]}):null]})})}var tN=n(42849),tk=n(96486),tC=n.n(tk),tq=["system","org","isServerPlugin","deletedAt","syncedAt"];function tI(e){var t=e.plugin,n=(0,I.useState)(!1),s=n[0],r=n[1],a=function(){return t.system,t.org,t.isServerPlugin,t.deletedAt,t.syncedAt,JSON.stringify((0,ek.Z)(t,tq),null,4)};return t?(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-center font-semibold my-5",children:(0,T.jsx)(j.cC,{id:"zTGSja"})}),(0,T.jsxs)("div",{className:"text-center space-x-2",children:[(0,T.jsx)("button",{onClick:function(){navigator.clipboard.writeText(a()),r(!0),setTimeout(function(){r(!1)},2e3)},className:"rounded-full bg-white py-1 px-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",children:s?q.ag._({id:"PiH3UR"}):q.ag._({id:"EXTouI"})}),(0,T.jsx)("button",{onClick:function(){var e=window.document.createElement("a");e.setAttribute("href","data:application/json;charset=utf-8,"+encodeURIComponent(a())),e.setAttribute("download","plugin-".concat(t.uuid,".json")),e.click()},className:"rounded-full bg-white py-1 px-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",children:(0,T.jsx)(j.cC,{id:"egdeNe"})})]}),(0,T.jsx)(eW,{language:"json",children:a()})]}):null}function tV(e){var t=e.link,n=(0,I.useState)(!1),s=n[0],r=n[1];return(0,T.jsx)("div",{children:(0,T.jsxs)("div",{className:"",children:[(0,T.jsx)("div",{className:"my-4 text-lg text-center font-bold",children:(0,T.jsx)(j.cC,{id:"Uautv5"})}),(0,T.jsx)("div",{className:"my-4 text-center",children:(0,T.jsx)(j.cC,{id:"36Sd6M"})}),(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsxs)("div",{className:"flex items-center justify-between",children:[(0,T.jsx)("div",{className:"text-sm font-semibold my-2",children:(0,T.jsx)(j.cC,{id:"uYL3GC"})}),(0,T.jsx)("div",{children:s?q.ag._({id:"PiH3UR"}):""})]}),(0,T.jsx)("input",{onClick:function(){var e;r(!0),null===(e=navigator.clipboard)||void 0===e||e.writeText(t)},className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",value:t,readOnly:!0})]})]})})}var tS={id:"fWsBTs"};function tO(e){var t,n=e.plugin,s=(0,I.useState)(!1),r=s[0],a=s[1],i=(0,I.useState)(""),o=i[0],l=i[1],c=(0,j.mV)().i18n,d=$(),u=(0,I.useState)(""),m=u[0],h=u[1],p=(0,I.useState)(!1),x=p[0],g=p[1],b=(t=(0,f.Z)(w().mark(function e(){var t,s,r,i;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a(!0),l(""),e.prev=2,e.next=5,fetch((0,X.PO)(null===(t=d.serverHostConfig)||void 0===t?void 0:t.orgURL)+"/api/shared_plugins",{body:JSON.stringify({plugin:n}),headers:{"Content-Type":"application/json","x-license-token":d.lastVerifiedToken||""},method:"POST"});case 5:if(!((r=e.sent).status>=400)){e.next=13;break}return e.next=9,r.json();case 9:return l(e.sent.userMessage||c._(tS)),a(!1),e.abrupt("return");case 13:if(r.ok){e.next=17;break}return l(c._(tS)),a(!1),e.abrupt("return");case 17:return e.next=19,r.json();case 19:i=e.sent,h((0,X.PO)(null===(s=d.serverHostConfig)||void 0===s?void 0:s.orgURL)+"/plugins/"+i.id),e.next=28;break;case 24:e.prev=24,e.t0=e.catch(2),l(c._(tS)),console.error(e.t0);case 28:a(!1);case 29:case"end":return e.stop()}},e,null,[[2,24]])})),function(){return t.apply(this,arguments)});return(0,T.jsxs)("div",{children:[(0,T.jsx)("h2",{className:"text-xl font-semibold text-center",children:(0,T.jsx)(j.cC,{id:"/9EVpH",values:{0:null==n?void 0:n.title}})}),m?(0,T.jsx)(tV,{link:m}):x?(0,T.jsx)(tI,{plugin:n}):(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-lg font-semibold text-center",children:(0,T.jsx)(j.cC,{id:"2/52pb"})}),(0,T.jsx)("div",{className:"my-4",children:(0,T.jsxs)("div",{className:"grid grid-cols-2 items-center gap-4",children:[(0,T.jsx)("div",{className:"flex items-center justify-end",children:(0,T.jsxs)("button",{disabled:r,onClick:b,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:bg-gray-400",children:[(0,T.jsx)(k.H_w,{className:"h-5 w-5"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"WNypG5"})})]})}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"xGQeda"})}),(0,T.jsx)("div",{className:"flex items-center justify-end",children:(0,T.jsxs)("button",{disabled:r,onClick:function(){return g(!0)},className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:bg-gray-400",children:[(0,T.jsx)(tN.kqQ,{className:"h-5 w-5"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"B2Zb/F"})})]})}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"nntTLt"})})]})})]}),o?(0,T.jsx)("div",{className:"text-sm font-semibold text-red-500 text-center",children:o}):null]})}function tE(e){var t=e.open,n=e.setOpen,s=e.chatPlugins,r=e.preSelectedPlugin,a=(0,I.useState)(""),i=a[0],o=a[1],l=(0,I.useState)(null),c=l[0],d=l[1];return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(tA,{open:!!i,setOpen:function(){o("")},id:i,chatPlugins:s}),(0,T.jsxs)(B,{max:!0,open:t,setOpen:n,showCloseButton:!1,position:"top",children:[(0,T.jsxs)("h2",{id:"plugins-popup-title",className:"text-center text-3xl font-semibold flex items-center justify-center gap-2",children:[(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"ohUJJM"})}),(0,T.jsx)("span",{className:"bg-green-500 px-2 py-1 text-xs text-white font-semibold rounded-full",children:(0,T.jsx)(j.cC,{id:"YBt9YP"})})]}),(0,T.jsx)(tf,{onImport:function(e){o(e),n(!1)},onShare:function(e){d(e),n(!1)},chatPlugins:s,preSelectedPlugin:r})]}),(0,T.jsx)(B,{wide:!0,open:!!c,setOpen:function(){return d(null)},children:(0,T.jsx)(tO,{plugin:c})})]})}function tP(e){var t=e.size;return(0,T.jsx)("img",{src:"/assets/setapp-144x144.png",className:function(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.includingHidden,n=void 0===t||t,s=$(),r=s.serverHostConfig,a=r.enableClaude,i=r.enableGPT,o=r.systemModels,l=r.modelSettings,c=tW([]),d=(0,v.Z)(c,2),u=d[0];d[1];var m=tQ(s.serverHostConfig.modelIDsOrder||[]),h=(0,v.Z)(m,2),p=h[0],x=h[1],f=Array.isArray(p)?p:[],b=tX(X.L.filter(function(e){return e.old}).map(function(e){return e.id})),y=(0,v.Z)(b,2),w=y[0],j=y[1],A=(0,I.useMemo)(function(){var e;return Object.fromEntries(((null===(e=s.serverHostConfig.externalAuthConfig)||void 0===e?void 0:e.type)!=="setapp"&&s.serverHostConfig.modelIDsOrder||f||[]).map(function(e,t){return[e,t+1]}))},[f]),N=(0,I.useMemo)(function(){var e=[].concat((0,g.Z)((o||[]).map(function(e){return tz(tz({},e),{},{system:!0})})),(0,g.Z)(X.L));return a||(e=e.filter(function(e){return!e.id.startsWith("claude")})),i||(e=e.filter(function(e){return!e.id.startsWith("gpt")})),e.filter(function(e){return!!e.system||!l||l[e.id]}).sort(function(e,t){return e.system!==t.system?e.system?-1:1:e.new&&!t.new?-1:0})},[l,a,i,o]),k=(0,I.useMemo)(function(){return[].concat((0,g.Z)(N),(0,g.Z)(u)).filter(function(e){return!(!n&&w.includes(e.id))})},[N,w,n,u]),C=(0,I.useMemo)(function(){return(0,g.Z)(k).sort(function(e,t){return A[e.id]&&A[t.id]?A[e.id]-A[t.id]:A[e.id]||A[t.id]?A[e.id]?A[t.id]?void 0:1:-1:0})},[k,A]);return(0,I.useEffect)(function(){f.length||x(C.map(function(e){return e.id}))},[f,C]),{allModels:C,targetModels:N,hiddenModelIDs:w,setHiddenModelIDs:j,modelIDsOrder:f,setModelIDsOrder:x}},t$=(0,R.eK)("useCustomModels");function t0(){for(var e=arguments.length,t=Array(e),n=0;n0?(0,T.jsxs)("div",{className:"mt-4",children:[(0,T.jsx)("label",{className:"block text-sm font-medium leading-6",children:(0,T.jsx)(j.cC,{id:"Bav+e0"})}),(0,T.jsx)("div",{className:" space-y-2 my-2",children:i.map(function(e){return(0,T.jsx)(tG,{onSelected:function(e){return n(e)},model:e,onEdit:function(){return s(e)}},e.id)})})]}):null]})}function t2(e){var t=e.models,n=e.selectedOrModels,s=e.setSelectedOrModels;return(0,T.jsx)("div",{className:"w-full my-2",children:(0,T.jsx)("div",{className:"w-full text-sm max-h-[400px] overflow-auto",children:(0,T.jsxs)("table",{className:"min-w-full bg-white dark:bg-gray-800",children:[(0,T.jsx)("thead",{className:"bg-gray-800 text-white sticky top-0",children:(0,T.jsxs)("tr",{children:[(0,T.jsx)("th",{className:"py-2 px-4 text-left",children:(0,T.jsx)("input",{type:"checkbox",onChange:function(e){e.target.checked?s(t):s([])}})}),(0,T.jsx)("th",{className:"py-2 px-4 text-left",children:(0,T.jsx)(j.cC,{id:"6YtxFj"})}),(0,T.jsx)("th",{className:"py-2 px-4 text-left",children:(0,T.jsx)(j.cC,{id:"wmnTZp"})})]})}),(0,T.jsx)("tbody",{className:"overflow-y-auto",children:t.map(function(e,t){return(0,T.jsxs)("tr",{className:"border-b border-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 dark:border-gray-600",children:[(0,T.jsx)("td",{className:"py-2 px-4",children:(0,T.jsx)("input",{type:"checkbox",onChange:function(t){t.target.checked?s([].concat((0,g.Z)(n),[e])):s(n.filter(function(t){return t!==e}))},checked:n.includes(e)})}),(0,T.jsxs)("td",{className:"py-2 px-4",children:[(0,T.jsx)("div",{children:e.name}),(0,T.jsx)("div",{className:"text-xs text-gray-500",children:e.id})]}),(0,T.jsx)("td",{className:"py-2 px-4 text-sm",children:(0,T.jsx)("div",{children:(e.context_length||0).toLocaleString()})})]},e.id)})})]})})})}var t4=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.messages,n=e.contextLimit,s=void 0===n?0:n,r=e.allowedContextLength,a=e.dependencies,i=a.getEstimatedTokens,o=a.getTextContent;if(!t||!t.length)return{skipped:0,contextMessages:[]};var l=[],c=t[t.length-1];l.unshift(c);for(var d=i(o(c.content)),u=t.length-2;u>=0;u--){var m=t[u];if((d+=i(o(m.content)))>r){for(var h,p=u;p>=0;p--)("system"===t[p].role||"training-message"===t[p].type)&&l.unshift(t[p]);if("assistant"===l[0].role)for(;l.length&&(null===(h=l[0])||void 0===h?void 0:h.role)!=="user";)l.shift();break}l.unshift(m)}if(s>0){var x=l.filter(function(e){return"system"===e.role}).length,f=l.slice(-Math.min(t.length-x,s)),b=[];if((null===(v=f[0])||void 0===v?void 0:v.role)==="tool")for(var v,y,w=t.length-s,j=w-1;j>=0&&(b.unshift(t[j]),null===(y=t[j])||void 0===y||!y.tool_calls);j--);l=[].concat((0,g.Z)(l.slice(0,x)),b,(0,g.Z)(f))}return{skipped:t.length-l.length,contextMessages:l}};function t5(e){var t=e.message;return(0,T.jsxs)("div",{className:"text-yellow-600 text-xs my-4 text-left",children:[t?(0,T.jsx)("div",{className:"my-2 text-red-500",children:t}):null,(0,T.jsxs)("div",{className:"font-semibold my-2",children:[(0,T.jsx)(ec.CSE,{className:"inline-block mr-1 w-4 h-4"}),(0,T.jsx)(j.cC,{id:"6+So7t"})]}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"dPvuoF"})}),(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"font-semibold my-2",children:[(0,T.jsx)(j.cC,{id:"PfQA36"}),":"]}),(0,T.jsxs)("ul",{className:"list-decimal pl-4",children:[(0,T.jsx)("li",{children:(0,T.jsx)(j.cC,{id:"mYZR41"})}),(0,T.jsx)("li",{children:(0,T.jsx)(j.cC,{id:"jzCkMH"})}),(0,T.jsx)("li",{children:(0,T.jsx)(j.cC,{id:"S2lnkb"})})]})]})]})}var t3=n(85793),t6=[": OPENROUTER PROCESSING"],t8=function(e,t,n,s){if(t.trim())try{if(t6.includes(t.trim()))return;if((r=JSON.parse(t)).error){var r,a,i,o="";o="server_error"===r.error.type?"OpenAI is currently experiencing a server error. This could be a temporary issue caused by high demand. Please try again. Original error message: "+r.error.message:"OpenAI is currently experiencing a problem. This could be a temporary issue caused by high demand. Please try again. Original error message: "+r.error.message,s(Error(o));return}var l=null==r?void 0:r.usage;if(l)for(var c in l)e.usage=e.usage||{},e.usage[c]=r.usage[c];if(!r.choices||!r.choices.length)return;var d=null===(a=r)||void 0===a||null===(a=a.choices)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.delta;for(var u in d)!function e(t,n,s){if("role"!==n||!t.role){if("string"==typeof s||"content"===n&&null===s)t[n]=(t[n]||"")+(s||"");else if(Array.isArray(s))for(var r in t[n]=t[n]||[],s){var a=s[r];"index"in a||console.warn('Property "index" is missing in array item',a),e(t[n],a.index,a)}else if("object"==typeof s&&null!==s)for(var i in t[n]=t[n]||{},s)e(t[n],i,s[i]);else t[n]=s}}(e,u,d[u]);return n&&n(e),null===(i=r.choices[0])||void 0===i?void 0:i.finish}catch(e){console.error("stream error",e)}};function t7(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n0&&void 0!==eI[0]?eI[0]:{}).endpoint,s=t.model,r=t.temperature,a=t.presencePenalty,i=t.frequencyPenalty,o=t.topP,l=t.maxTokens,d=void 0===(c=t.contextLimit)?0:c,u=t.contextLengthOverride,t.stop,m=t.signal,h=t.apiKey,p=t.orgID,x=t.stream,g=t.messages,f=t.functions,v=void 0===(b=t.extras)?{}:b,j=void 0===(y=t.headers)?{}:y,N=void 0===(A=t.onStreamStarted)?function(){}:A,C=void 0===(k=t.onStreamTextChunk)?function(e){}:k,t.onStreamFinished,I=void 0===(q=t.onAPIStatusChanged)?function(){}:q,S=void 0===(V=t.onModelUnavailable)?function(){}:V,E=void 0===(O=t.onContextSkipped)?function(){}:O,M=void 0===(P=t.onFreeMessagesCountChanged)?function(){}:P,B=void 0===(D=t.onModelUsageChanged)?function(){}:D,R=void 0===(L=t.onAborted)?function(){}:L,F=void 0===(_=t.onStreamError)?function(){}:_,K=(0,X.xx)(s),Y=(Z=t4({messages:g.filter(function(e){return["system","user","assistant","function","tool"].includes(e.role)}).map(function(e){return e.tool_calls?ne(ne({},e),{},{tool_calls:e.tool_calls.map(function(e){return tC().omit(e,["index"])})}):e}),contextLimit:d,allowedContextLength:.8*(u||(null==K?void 0:K.contextLength)),dependencies:{getEstimatedTokens:X.fI,getTextContent:X.FB}})).contextMessages,U=Z.skipped,null==E||E(U),e.prev=4,e.next=7,fetch(n,{method:"POST",signal:m,headers:ne(ne(ne({"Content-Type":"application/json"},h?{Authorization:"Bearer ".concat(h)}:{}),p?{"OpenAI-Organization":p}:{}),j),body:JSON.stringify(ne(ne(ne(ne(ne(ne(ne(ne({model:s},"number"==typeof r?{temperature:r}:{}),"number"==typeof a?{presence_penalty:a}:{}),"number"==typeof i?{frequency_penalty:i}:{}),"number"==typeof o?{top_p:o}:{}),parseInt(l)?{max_tokens:parseInt(l)}:{}),{},{stream:x},K.hasStreamUsageReport&&x&&"https://api.openai.com/v1/chat/completions"===n?{stream_options:{include_usage:!0}}:{}),{},{messages:null==Y?void 0:Y.map(function(e){return tC().pick(e,["role","content","function_call","tool_calls","tool_call_id","name"])})},f&&f.length?{tools:f.map(function(e){return{type:"function",function:e}}),tool_choice:"auto"}:{}),v))});case 7:G=e.sent,e.next=16;break;case 10:if(e.prev=10,e.t0=e.catch(4),"AbortError"!==e.t0.name){e.next=15;break}return R(),e.abrupt("return");case 15:throw e.t0;case 16:if(500!==G.status){e.next=19;break}return I(t3.yZ.ERROR),e.abrupt("return",{error:"Could not connect to OpenAI API. Please try again later. This could be because OpenAI's server is experiencing high demand and rejected your request. Go to https://status.openai.com/ to check their status."});case 19:if(!(G.status>=400)){e.next=65;break}return e.prev=20,e.next=23,G.clone().json();case 23:W=e.sent,e.next=34;break;case 26:return e.prev=26,e.t1=e.catch(20),console.error("Could not parse JSON response from OpenAI API",e.t1),e.next=31,G.clone().text();case 31:return encodeURIComponent(Q=e.sent),e.abrupt("return",{error:(0,T.jsxs)("div",{children:["Sorry, this model is currently experiencing a problem from the server side. Please try again later or select another model."," ",(0,T.jsxs)("details",{children:[(0,T.jsx)("summary",{children:(0,T.jsx)("span",{className:"cursor-pointer hover:underline",children:"View Full Error"})}),(0,T.jsx)("div",{className:"text-left whitespace-pre-line max-h-[200px] overflow-auto bg-gray-100 dark:bg-gray-800 p-2 text-black dark:text-white font-mono text-xs",children:Q})]})]})});case 34:if(W.error&&"server_error"===W.error.type&&I(t3.yZ.ERROR),"access_denied"!==W.error){e.next=37;break}return e.abrupt("return",{error:"Access denied. Please try to reopen the app. If the issue persists, please contact support."});case 37:if((null===(H=W.error)||void 0===H?void 0:H.code)!=="setapp_refresh_token_failed"){e.next=40;break}return null===(J=window.webkit)||void 0===J||null===(J=J.messageHandlers)||void 0===J||null===(J=J.TypingMindMacApp)||void 0===J||J.postMessage("SETAPP_REFRESH_TOKEN_FAILED"),e.abrupt("return",{error:"Your login session has expired. Please close the app and reopen again."});case 40:if((null===(z=W.error)||void 0===z?void 0:z.type)!=="insufficient_quota"){e.next=42;break}return e.abrupt("return",{error:(0,T.jsxs)("div",{children:["Your OpenAI API key has run out of quota. Please go to your OpenAI Dashboard to fix this:"," ",(0,T.jsx)("a",{href:"https://platform.openai.com/account/billing/overview",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline",children:(0,T.jsx)("b",{children:"https://platform.openai.com/account/billing/overview"})})]})});case 42:if(429!==G.status){e.next=46;break}if(!W.userMessage){e.next=45;break}return e.abrupt("return",{error:W.userMessage});case 45:return e.abrupt("return",{error:"OpenAI has rejected your request with error code 429. Here are the possible reasons: 1. You are sending requests too quickly; 2. You have hit your maximum monthly spend (hard limit); 3. The model is currently overloaded. Here is the error message from OpenAI: "+((null===($=W.error)||void 0===$?void 0:$.message)||"")});case 46:if(!(W.error&&"invalid_api_key"===W.error.code)){e.next=48;break}return e.abrupt("return",{error:'Invalid API key. If you have enabled API Key Encryption, please make sure to unlock it first. Click on the "OpenAI API Key" button in the sidebar to config your API Key.'});case 48:if(!(W.error&&"context_length_exceeded"===W.error.code)){e.next=50;break}return e.abrupt("return",{error:(0,T.jsx)(t5,{message:null===(ee=W.error)||void 0===ee?void 0:ee.message})});case 50:if(!(W.error&&W.error.message)){e.next=59;break}return(et=W.error.message).match(/The model: `(.*)` does not exist/)&&(et+=". You are using ".concat(s," model. Please change the model in the setting and try again. Note that even if you have ChatGPT Plus, you still need to request access to the GPT-4 API in order to use it with your API Key. This is OpenAI's restriction and we can't do anything about it. You can join the waitlist here https://openai.com/waitlist/gpt-4-api.")),S(),en=(null==K?void 0:K.source)||s,e.abrupt("return",{error:"Sorry, ".concat(en," has rejected your request. Here is the error message from ").concat(en,": ")+et});case 59:if(!W.userMessage){e.next=63;break}return e.abrupt("return",{error:W.userMessage});case 63:return e.abrupt("return",{error:nt+" Technical details: "+JSON.stringify(W),serverError:W});case 64:return e.abrupt("return");case 65:if(G.ok){e.next=67;break}return e.abrupt("return",{error:nt+" Technical details: Not OK."});case 67:if(I(t3.yZ.OK),(es=G.headers.get("x-remaining-free-messages"))&&M(Number(es)),er=G.headers.get("x-hour-message-usage"),ea=G.headers.get("x-day-message-usage"),ei=G.headers.get("x-month-message-usage"),eo=G.headers.get("x-hour-character-usage"),el=G.headers.get("x-day-character-usage"),ec=G.headers.get("x-month-character-usage"),B&&[er,ea,ei,eo,el,ec].filter(Boolean).length>0&&(null==B||B({model:s,messages:{hour:er,day:ea,month:ei},charactersByPeriod:{hour:eo,day:el,month:ec}})),ed=null,eu=null,em=null,!x){e.next=133;break}if(window.TextDecoderStream){e.next=83;break}return e.abrupt("return",{error:"Your browser doesn't support streaming response. Please upgrade your browser to the latest version or turn off streaming."});case 83:eh=G.body.pipeThrough(new window.TextDecoderStream).getReader(),ep={content:""},N(),e.prev=87,ex="",eg=["x","x","x","x","x","x"],ef=!1;case 91:return e.next=94,eh.read();case 94:if(ev=(eb=e.sent).value,!(eb.done||ef)){e.next=99;break}return e.abrupt("break",124);case 99:ey=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return t7(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t7(e,void 0)}}(e))){n&&(e=n);var s=0,r=function(){};return{s:r,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw a}}}}(ev),e.prev=100,ey.s();case 102:if((ew=ey.n()).done){e.next=114;break}if(ej=ew.value,ex+=ej,eg.shift(),eg.push(ej),"[DONE]"!==eg.join("")){e.next=110;break}return ef=!0,e.abrupt("break",114);case 110:":"===ej&&"data:"===ex&&(ex=""),"\n"===ej&&(ed=t8(ep,ex,C,F),ex="");case 112:e.next=102;break;case 114:e.next=119;break;case 116:e.prev=116,e.t2=e.catch(100),ey.e(e.t2);case 119:return e.prev=119,ey.f(),e.finish(119);case 122:e.next=91;break;case 124:e.next=129;break;case 126:e.prev=126,e.t3=e.catch(87),"AbortError"===e.t3.name?eh.releaseLock():F(e.t3);case 129:eu=ne({},ep),em=ep.usage?ep.usage:{completion_tokens:eA=(0,X.fI)(ep.content),prompt_tokens:eN=(0,X.fI)(Y.map(function(e){return(0,X.FB)(e.content)}).join("\n")),total_tokens:eA+eN},e.next=139;break;case 133:return e.next=135,G.json();case 135:eu=null===(ek=(eq=e.sent).choices)||void 0===ek||null===(ek=ek[0])||void 0===ek?void 0:ek.message,em=eq.usage,ed=null===(eC=eq.choices)||void 0===eC||null===(eC=eC[0])||void 0===eC?void 0:eC.finish_reason;case 139:return e.abrupt("return",{response:ne(ne({},eu),{},{usage:em,finish:ed})});case 140:case"end":return e.stop()}},e,null,[[4,10],[20,26],[87,126],[100,116,119,122]])}))).apply(this,arguments)}function nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function na(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,s=Array(t);n0&&void 0!==eV[0]?eV[0]:{}).endpoint,r=n.model,a=n.temperature,n.presencePenalty,n.frequencyPenalty,i=n.topP,o=n.topK,l=n.maxTokens,d=void 0===(c=n.contextLimit)?0:c,u=n.contextLengthOverride,n.stop,m=n.signal,h=n.apiKey,n.orgID,p=n.stream,x=n.messages,f=n.functions,v=void 0===(b=n.extras)?{}:b,j=void 0===(y=n.headers)?{}:y,N=void 0===(A=n.onStreamStarted)?function(){}:A,C=void 0===(k=n.onStreamTextChunk)?function(e){}:k,n.onStreamFinished,n.onAPIStatusChanged,n.onModelUnavailable,I=void 0===(q=n.onContextSkipped)?function(){}:q,S=void 0===(V=n.onFreeMessagesCountChanged)?function(){}:V,E=void 0===(O=n.onModelUsageChanged)?function(){}:O,M=void 0===(P=n.onAborted)?function(){}:P,B=void 0===(D=n.onStreamError)?function(){}:D,R=(0,X.xx)(r),F=(_=t4({messages:x.filter(function(e){return["system","user","assistant","function","tool"].includes(e.role)}).map(function(e){var t;if("tool"===e.role)return{role:"user",content:[nh({type:"tool_result",tool_use_id:e.tool_call_id,content:e.content},"error"===e.format?{is_error:!0}:{})]};if(null!==(t=e.tool_calls)&&void 0!==t&&t.length){var n=e.tool_calls.map(function(e){return{type:"tool_use",id:e.id,name:e.function.name,input:(0,X.dC)(e.function.arguments)}});return{role:e.role,content:[].concat((0,g.Z)(Array.isArray(e.content)?e.content:[{type:"text",text:e.content}]),(0,g.Z)(n)).filter(function(e){return(e.text||"").trim()||"tool_use"===e.type})}}return e}),contextLimit:d,allowedContextLength:.8*(u||(null==R?void 0:R.contextLength)),dependencies:{getEstimatedTokens:X.fI,getTextContent:X.FB}})).contextMessages,G=_.skipped,null==I||I(G),!F.some(function(e){return Array.isArray(e.content)&&e.content.some(function(e){var t;return"image_url"===e.type&&!(null!==(t=e.image_url)&&void 0!==t&&null!==(t=t.url)&&void 0!==t&&t.startsWith("data:image"))})})){e.next=7;break}return e.abrupt("return",{error:"The model you are using (".concat(R.title,") only supports images with base64 format. This error usually occurs when you switch between models. Please start a new chat with the current model and upload new images!")});case 7:return K=(F||[]).find(function(e){return"system"===e.role}),Z=ni(nd((F||[]).filter(function(e){return"system"!==e.role}))).map(function(e){return tC().pick(e,["role","content","function_call","tool_calls","tool_call_id","name"])}).map(function(e){try{if(Array.isArray(e.content)){var t=e.content.map(function(e){if("image_url"===e.type){var t,n,s=null===(t=e.image_url)||void 0===t||null===(t=t.url)||void 0===t||null===(t=t.split(";")[0])||void 0===t?void 0:t.split(":")[1];return{type:"image",source:{type:"base64",media_type:s,data:null===(n=e.image_url)||void 0===n||null===(n=n.url)||void 0===n?void 0:n.split(",")[1]}}}return e});return t.some(function(e){return"image"===e.type})&&!t.some(function(e){return"text"===e.type&&(e.text||"").trim()})&&(t=t.map(function(e){return"text"===e.type?nh(nh({},e),{},{text:"(Image)"}):e})),nh(nh({},e),{},{content:t})}}catch(e){console.error("error parsing image content",e)}return e}),Y=p,e.prev=10,e.next=13,fetch(s,{method:"POST",signal:m,headers:nh(nh(nh({"Content-Type":"application/json"},h?{"x-api-key":h}:{}),f&&f.length?{"anthropic-beta":"tools-2024-04-04"}:{}),j),body:JSON.stringify(nh(nh(nh(nh(nh(nh(nh({model:r,max_tokens:2e3},K?{system:K.content}:{}),"number"==typeof a?{temperature:a}:{}),"number"==typeof i?{top_p:i}:{}),parseInt(o)?{top_k:parseInt(o)}:{}),parseInt(l)?{max_tokens:parseInt(l)}:{}),{},{stream:Y,messages:Z},f&&f.length?{tools:f.map(function(e){return{name:e.name,description:e.description,input_schema:e.parameters}})}:{}),v))});case 13:L=e.sent,e.next=22;break;case 16:if(e.prev=16,e.t0=e.catch(10),"AbortError"!==e.t0.name){e.next=21;break}return M(),e.abrupt("return");case 21:throw e.t0;case 22:if(500!==L.status){e.next=24;break}return e.abrupt("return",{error:"Could not connect to Claude API. Please try again later. This could be because Claude's server is experiencing high demand and rejected your request."});case 24:if(!(L.status>=400)){e.next=62;break}return e.prev=25,e.next=28,L.clone().json();case 28:H=e.sent,e.next=39;break;case 31:return e.prev=31,e.t1=e.catch(25),console.error("Could not parse JSON response from Claude API",e.t1),e.next=36,L.clone().text();case 36:return encodeURIComponent(z=e.sent),e.abrupt("return",{error:(0,T.jsxs)("div",{children:["Sorry, this model is currently experiencing a problem from the server side. Please try again later or select another model."," ",(0,T.jsxs)("details",{children:[(0,T.jsx)("summary",{children:(0,T.jsx)("span",{className:"cursor-pointer hover:underline",children:"View Full Error"})}),(0,T.jsx)("div",{className:"text-left whitespace-pre-line max-h-[200px] overflow-auto bg-gray-100 dark:bg-gray-800 p-2 text-black dark:text-white font-mono text-xs",children:z})]})]})});case 39:if(!H.userMessage){e.next=41;break}return e.abrupt("return",{error:H.userMessage});case 41:if("access_denied"!==H.error){e.next=43;break}return e.abrupt("return",{error:"Access denied. Please try to reopen the app. If the issue persists, please contact support."});case 43:if((null===(U=H.error)||void 0===U?void 0:U.code)!=="setapp_refresh_token_failed"){e.next=46;break}return null===(W=window.webkit)||void 0===W||null===(W=W.messageHandlers)||void 0===W||null===(W=W.TypingMindMacApp)||void 0===W||W.postMessage("SETAPP_REFRESH_TOKEN_FAILED"),e.abrupt("return",{error:"Your login session has expired. Please close the app and reopen again."});case 46:if(429!==L.status){e.next=50;break}if(!H.userMessage){e.next=49;break}return e.abrupt("return",{error:H.userMessage});case 49:return e.abrupt("return",{error:"Claude has rejected your request with error code 429. Here are the possible reasons: 1. You are sending requests too quickly; 2. You have hit your maximum monthly spend (hard limit); 3. The model is currently overloaded. Here is the error message from Claude: "+((null===(Q=H.error)||void 0===Q?void 0:Q.message)||"")});case 50:if(!(H.error&&"invalid_api_key"===H.error.code)){e.next=52;break}return e.abrupt("return",{error:'Invalid API key. If you have enabled API Key Encryption, please make sure to unlock it first. Click on the "Claude API Key" button in the sidebar to config your API Key.'});case 52:if(!(H.error&&"context_length_exceeded"===H.error.code)){e.next=54;break}return e.abrupt("return",{error:(0,T.jsx)(t5,{message:null===(J=H.error)||void 0===J?void 0:J.message})});case 54:if(!(H.error&&"invalid_request_error"===H.error.type&&H.error.message)){e.next=56;break}return e.abrupt("return",{error:"Request failed. Error details: "+H.error.message});case 56:if(!(H.error&&H.userMessage)){e.next=60;break}return e.abrupt("return",{error:H.userMessage});case 60:return e.abrupt("return",{error:np+" Technical details: "+JSON.stringify(H),serverError:H});case 61:return e.abrupt("return");case 62:if(L.ok){e.next=64;break}return e.abrupt("return",{error:np+" Technical details: Not OK."});case 64:if(($=L.headers.get("x-remaining-free-messages"))&&S(Number($)),ee=L.headers.get("x-hour-message-usage"),et=L.headers.get("x-day-message-usage"),en=L.headers.get("x-month-message-usage"),es=L.headers.get("x-hour-character-usage"),er=L.headers.get("x-day-character-usage"),ea=L.headers.get("x-month-character-usage"),E&&[ee,et,en,es,er,ea].filter(Boolean).length>0&&(null==E||E({model:r,messages:{hour:ee,day:et,month:en},charactersByPeriod:{hour:es,day:er,month:ea}})),ei=null,eo=null,!Y){e.next=133;break}if(window.TextDecoderStream){e.next=79;break}return e.abrupt("return",{error:"Your browser doesn't support streaming response. Please upgrade your browser to the latest version or turn off streaming."});case 79:ed=L.body.pipeThrough(new window.TextDecoderStream).getReader(),eu={content:""},N(),e.prev=83,em="",eh="",ep=!1;case 87:return e.next=90,ed.read();case 90:if(eg=(ex=e.sent).value,!(ex.done||ep)){e.next=95;break}return e.abrupt("break",122);case 95:ef=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return nu(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nu(e,void 0)}}(e))){n&&(e=n);var s=0,r=function(){};return{s:r,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw a}}}}(eg),e.prev=96,ef.s();case 98:if((eb=ef.n()).done){e.next=112;break}if(ev=eb.value,eh+=ev,":"===ev&&"data:"===eh&&(eh=""),!("\n"===ev&&eh)){e.next=110;break}if(!eh.startsWith("event:")){e.next=107;break}return em=eh.replace("event:","").trim(),eh="",e.abrupt("continue",110);case 107:nc(em,eu,eh,C,B),em="",eh="";case 110:e.next=98;break;case 112:e.next=117;break;case 114:e.prev=114,e.t2=e.catch(96),ef.e(e.t2);case 117:return e.prev=117,ef.f(),e.finish(117);case 120:e.next=87;break;case 122:e.next=127;break;case 124:e.prev=124,e.t3=e.catch(83),"AbortError"===e.t3.name?ed.releaseLock():B(e.t3);case 127:ey=(null===(el=eu.usage)||void 0===el?void 0:el.output_tokens)||(0,X.fI)(eu.content),ew=(null===(ec=eu.usage)||void 0===ec?void 0:ec.input_tokens)||(0,X.fI)(F.map(function(e){return(0,X.FB)(e.content)}).join("\n")),ei=nh({},eu),eo={completion_tokens:ey,prompt_tokens:ew,total_tokens:ey+ew},e.next=138;break;case 133:return e.next=135,L.json();case 135:ei=eC=e.sent,eo={completion_tokens:null===(ej=eC.usage)||void 0===ej?void 0:ej.output_tokens,prompt_tokens:null===(eA=eC.usage)||void 0===eA?void 0:eA.input_tokens,total_tokens:(null===(eN=eC.usage)||void 0===eN?void 0:eN.output_tokens)+(null===(ek=eC.usage)||void 0===ek?void 0:ek.input_tokens)};case 138:return null!=(eq=Array.isArray(ei.content)&&ei.content.filter(function(e){return"tool_use"===e.type}))&&eq.length&&(eI=ei.content.filter(function(e){return"tool_use"!==e.type}),ei.content=eI.length?eI:"",ei.tool_calls=eq.map(function(e,t){return{index:t,id:e.id,type:"function",function:{name:e.name,arguments:JSON.stringify(e.input)}}})),e.abrupt("return",{response:nh(nh({},ei),{},{usage:eo,finish:null===(t=ei)||void 0===t?void 0:t.stop_reason})});case 141:case"end":return e.stop()}},e,null,[[10,16],[25,31],[83,124],[96,114,117,120]])}))).apply(this,arguments)}function nf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function nb(e){for(var t=1;t0?{tool_calls:r}:{})};function nw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function nj(e){for(var t=1;t0&&void 0!==ey[0]?ey[0]:{}).endpoint)?"https://generativelanguage.googleapis.com":s,a=n.model,i=n.temperature,o=n.topP,l=n.topK,c=n.maxTokens,d=n.safetySettings,m=void 0===(u=n.contextLimit)?0:u,h=n.contextLengthOverride,p=n.signal,x=n.apiKey,g=n.stream,f=n.messages,b=n.functions,j=void 0===(y=n.extras)?{}:y,N=void 0===(A=n.headers)?{}:A,C=void 0===(k=n.onStreamStarted)?function(){}:k,I=void 0===(q=n.onStreamTextChunk)?function(e){}:q,n.onStreamFinished,n.onAPIStatusChanged,n.onModelUnavailable,S=void 0===(V=n.onContextSkipped)?function(){}:V,n.onFreeMessagesCountChanged,E=void 0===(O=n.onModelUsageChanged)?function(){}:O,M=void 0===(P=n.onAborted)?function(){}:P,D=void 0===(T=n.onStreamError)?function(){}:T,B=(0,X.xx)(a),R=(L=t4({model:a,messages:f,contextLimit:m,allowedContextLength:.8*(h||(null==B?void 0:B.contextLength)),dependencies:{getEstimatedTokens:X.fI,getTextContent:X.FB}})).contextMessages,_=L.skipped,!R.some(function(e){return Array.isArray(e.content)&&e.content.some(function(e){var t;return"image_url"===e.type&&!(null!==(t=e.image_url)&&void 0!==t&&null!==(t=t.url)&&void 0!==t&&t.startsWith("data:image"))})})){e.next=6;break}return e.abrupt("return",{error:"The model you are using (".concat(B.title,") only supports images with base64 format. This error usually occurs when you switch between models. Please start a new chat with the current model and upload new images!")});case 6:return null==S||S(_),G=(F="https://generativelanguage.googleapis.com"===r)?"https://generativelanguage.googleapis.com/v1beta/models/".concat(B.modelID,":").concat(g?"streamGenerateContent":"generateContent","?key=").concat(x).concat(g?"&alt=sse":""):r,e.next=11,nv({messages:R,functions:b});case 11:return Y=(Z=e.sent).contents,U=Z.tools,e.prev=14,e.next=17,fetch(G,{method:"POST",signal:p,body:JSON.stringify(nj({contents:"gemini-pro-vision"===a?Y.slice(-1):Y,tools:U,stream:F?void 0:g,model:F?void 0:B.modelID,generationConfig:nj({temperature:"number"==typeof i?i:void 0,topP:"number"==typeof o?o:void 0,topK:parseInt(l)?parseInt(l):void 0},parseInt(c)?{maxOutputTokens:parseInt(c)}:{}),safetySettings:d?Object.entries(d).map(function(e){var t=(0,v.Z)(e,2);return{category:t[0],threshold:t[1]}}):void 0},j)),headers:nj({"Content-Type":"application/json"},N)});case 17:K=e.sent,e.next=26;break;case 20:if(e.prev=20,e.t0=e.catch(14),"AbortError"!==e.t0.name){e.next=25;break}return M(),e.abrupt("return");case 25:throw e.t0;case 26:if(K.ok||(console.log("original messages",R),console.log("transformed messages",Y)),500!==K.status){e.next=29;break}return e.abrupt("return",{error:"Could not connect to API server. Usually this is a temporary problem. Please try again. If the problem persist, please contact support."});case 29:if(!(K.status>=400)){e.next=39;break}return e.next=32,K.json();case 32:if(!(W=e.sent).userMessage){e.next=35;break}return e.abrupt("return",{error:W.userMessage});case 35:if(!((Q=(null===(H=W.error)||void 0===H?void 0:H.message)||(null===(z=W[0])||void 0===z||null===(z=z.error)||void 0===z?void 0:z.message)).indexOf("not supported for StreamGenerateContent")>-1)){e.next=38;break}return e.abrupt("return",{error:"Sorry, your API Key does not have access to the model ".concat(B.title," (").concat(B.id,"). Please select another model.")});case 38:return e.abrupt("return",{error:"Sorry, the provider of this model has rejected your request (Message: ".concat(Q||"(Unknown)","). Please try again or contact support.")});case 39:if(K.ok){e.next=41;break}return e.abrupt("return",{error:"Something went wrong. This could be a temporary network connection issue. Please try again or contact support. Opening the console might help clarifying the issue."});case 41:if(J=null,$=null,!g){e.next=85;break}ee=K.body.pipeThrough(new window.TextDecoderStream("utf8",{fatal:!0})).getReader(),C(),e.prev=46,et="";case 48:return e.next=51,ee.read();case 51:if(es=(en=e.sent).value,!en.done){e.next=56;break}return e.abrupt("break",78);case 56:et+=es,er=et.match(nA);case 58:if(!er){e.next=76;break}eo=void 0,e.prev=60,eo=JSON.parse(er[1]),e.next=69;break;case 64:throw e.prev=64,e.t1=e.catch(60),console.log(e.t1.message),console.log(es),e.t1;case 69:ec=(el=ny(eo)).content,ed=el.tool_calls,$=nj({role:"assistant",content:((null===(ea=$)||void 0===ea?void 0:ea.content)||"")+(ec||"")},ed?{tool_calls:ed}:(null===(ei=$)||void 0===ei?void 0:ei.tool_calls)||{}),I({content:$.content}),er=(et=et.substring(er[0].length)).match(nA),e.next=58;break;case 76:e.next=48;break;case 78:e.next=83;break;case 80:e.prev=80,e.t2=e.catch(46),"AbortError"===e.t2.name?ee.releaseLock():D(e.t2);case 83:e.next=89;break;case 85:return e.next=87,K.json();case 87:$=nj({role:"assistant"},ny(e.sent));case 89:return eu=K.headers.get("x-hour-message-usage"),em=K.headers.get("x-day-message-usage"),eh=K.headers.get("x-month-message-usage"),ep=K.headers.get("x-hour-character-usage"),ex=K.headers.get("x-day-character-usage"),eg=K.headers.get("x-month-character-usage"),E&&[eu,em,eh,ep,ex,eg].filter(Boolean).length>0&&E({model:a,messages:{hour:eu,day:em,month:eh},charactersByPeriod:{hour:ep,day:ex,month:eg}}),ev={completion_tokens:ef=(0,X.fI)(null===(t=$)||void 0===t?void 0:t.content),prompt_tokens:eb=(0,X.fI)(f.map(function(e){return e.content}).join("\n")),total_tokens:ef+eb},e.abrupt("return",{response:nj(nj({},$),{},{model:a,usage:ev,finish:J})});case 100:case"end":return e.stop()}},e,null,[[14,20],[46,80],[60,64]])}))).apply(this,arguments)}function nC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function nq(e){for(var t=1;t0&&!t.headerRows.every(function(e){return s.every(function(t){return t in e})}))return eh(q.ag._({id:"ZHX2Nv"})),!1;if(t.bodyRows&&t.bodyRows.length>0&&!t.bodyRows.every(function(e){return r.every(function(t){return t in e})}))return eh(q.ag._({id:"OvyFOO"})),!1;return!0}catch(e){return console.error("Error while validating imported json file: ",e),eh(nO),!1}},eX=(t=(0,f.Z)(w().mark(function e(){var t,n,s,r,a;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(E(!0),eh(""),eg(!1),t={},"import-json"!==eS){e.next=22;break}if(e.prev=5,eQ(eP)){e.next=11;break}return E(!1),e.abrupt("return");case 11:(t=JSON.parse(eP)).id=(0,C.Z)(),t.skipAPIKey=!0,null!==(n=t)&&void 0!==n&&n.headerRows&&t.headerRows.forEach(function(e){e.id=(0,C.Z)()}),null!==(s=t)&&void 0!==s&&s.bodyRows&&t.bodyRows.forEach(function(e){e.id=(0,C.Z)()}),eB(t);case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(5),console.error("Error while processing json content from importing: ",e.t0);case 22:return e.prev=22,r="import-json"===eS?t:ez,e.next=26,nI(nS(nS({},V?{proxyEndpoint:"/api/hosted/run_test_completions",options:{extras:{forwardedEndpointForProxy:r.endpoint,customModelHeaderRows:r.headerRows}}}:{}),{},{model:"import-json"===eS?t.modelID:es,modelInfo:r,messages:[{role:"user",content:"hello"}]}));case 26:(a=e.sent)&&a.response?eg(!0):eh(q.ag._({id:"Yyo7E4"})),e.next=34;break;case 30:e.prev=30,e.t1=e.catch(22),console.error(e.t1),eh(q.ag._({id:"Rq8+VB"})+e.t1.message);case 34:E(!1);case 35:case"end":return e.stop()}},e,null,[[5,19],[22,30]])})),function(){return t.apply(this,arguments)}),eJ=(n=(0,f.Z)(w().mark(function e(){var t;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return E(!0),eh(""),e.prev=2,e.next=5,fetch("https://openrouter.ai/api/v1/chat/completions",{method:"POST",headers:{Authorization:"Bearer ".concat(eR),"HTTP-Referer":"https://www.typingmind.com","X-Title":"TypingMind.com","Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"system",content:"Test"}]})});case 5:if(!((t=e.sent).status>=401)){e.next=10;break}return eh("Invalid API key. Please check your API key and try again."),E(!1),e.abrupt("return");case 10:if(!(t.status>=400)){e.next=17;break}return e.next=13,t.json();case 13:case 27:return eh(e.sent.userMessage||nO),E(!1),e.abrupt("return");case 17:if(t.ok){e.next=21;break}return eh(nO),E(!1),e.abrupt("return");case 21:return e.next=23,fetch("https://openrouter.ai/api/v1/models",{method:"GET",headers:{"Content-Type":"application/json"}});case 23:if(!((t=e.sent).status>=400)){e.next=31;break}return e.next=27,t.json();case 31:if(t.ok){e.next=35;break}return eh(nO),E(!1),e.abrupt("return");case 35:return e.next=37,t.json();case 37:eK(e.sent.data||[]),e.next=45;break;case 41:e.prev=41,e.t0=e.catch(2),eh(nO),console.error("or test failed",e.t0);case 45:E(!1);case 46:case"end":return e.stop()}},e,null,[[2,41]])})),function(){return n.apply(this,arguments)}),e$=(s=(0,f.Z)(w().mark(function e(t){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d(t.map(function(e){var t;return t={title:e.name,description:F,iconUrl:U},(0,b.Z)(t,"iconUrl","https://openrouter.ai/icon.png"),(0,b.Z)(t,"endpoint","https://openrouter.ai/api/v1/chat/completions"),(0,b.Z)(t,"id",(0,C.Z)()),(0,b.Z)(t,"modelID",e.id),(0,b.Z)(t,"apiType","openai"),(0,b.Z)(t,"contextLength",e.context_length),(0,b.Z)(t,"headerRows",[{key:"Authorization",value:"Bearer ".concat(eR)},{key:"X-Title",value:"TypingMind.com"},{key:"HTTP-Referer",value:"https://www.typingmind.com"}].concat((0,g.Z)(eb))),(0,b.Z)(t,"bodyRows",ew),(0,b.Z)(t,"pluginSupported",eN),(0,b.Z)(t,"visionSupported",eq),(0,b.Z)(t,"skipAPIKey",!0),t}));case 2:null==l||l();case 3:case"end":return e.stop()}},e)})),function(e){return s.apply(this,arguments)}),e0=(r=(0,f.Z)(w().mark(function e(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("import-json"!==eS){e.next=6;break}return e.next=3,d([eD]);case 3:null==l||l(),e.next=29;break;case 6:if(!(L&&W&&es&&ei)){e.next=28;break}if(!eH){e.next=12;break}return e.next=10,u(ez);case 10:e.next=14;break;case 12:return e.next=14,d([ez]);case 14:D(""),R(""),G(""),H(""),J(""),er(""),eo("openai"),et(2048),ed(!1),ev([]),ej([]),null==l||l(),e.next=29;break;case 28:eh(q.ag._({id:"wwrAsK"}));case 29:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)}),e1=function(){return(0,T.jsxs)("div",{className:(0,X.AK)("sm"===x?"space-y-2":"space-y-4"),children:[(0,T.jsx)("div",{children:(0,T.jsx)(Q,{enabled:eN,setEnabled:ek,label:q.ag._({id:"r41Eim"}),description:q.ag._({id:"uOYIwm"})})}),(0,T.jsx)("div",{children:(0,T.jsx)(Q,{enabled:eq,setEnabled:eI,label:q.ag._({id:"IHh1FJ"}),description:q.ag._({id:"CsVLg/"})})}),eb.length?(0,T.jsxs)("div",{className:(0,X.AK)("sm"===x?"text-sm":"text-base"),children:[(0,T.jsx)("div",{className:"flex items-center justify-between mb-1",children:(0,T.jsx)("label",{className:"block font-medium leading-6",children:(0,T.jsx)(j.cC,{id:"GnfGTT"})})}),(0,T.jsx)("div",{className:"space-y-2",children:eb.map(function(e,t){return(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,T.jsx)("input",{type:"text",style:{fontSize:"inherit"},placeholder:q.ag._({id:"F6Go3M"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700",autoComplete:"off",disabled:O,value:e.key,onChange:function(e){var n=(0,g.Z)(eb);n[t].key=e.target.value,ev(n)}}),(0,T.jsx)("input",{type:"text",style:{fontSize:"inherit"},placeholder:q.ag._({id:"BCL8Ot"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700",autoComplete:"off",disabled:O,value:e.value,onChange:function(e){var n=(0,g.Z)(eb);n[t].value=e.target.value,ev(n)}}),(0,T.jsx)(Y,{className:"text-red-500 font-semibold min-w-[55px]",onConfirmed:function(){var e=(0,g.Z)(eb);e.splice(t,1),ev(e)},children:(0,T.jsx)(j.cC,{id:"t/YqKh"})})]},e.id||t)})})]}):null,(0,T.jsx)("div",{className:"flex items-center justify-start gap-2",children:(0,T.jsxs)("button",{onClick:function(){ev(function(e){return[].concat((0,g.Z)(e),[{id:(0,C.Z)(),key:"x-header-key",value:q.ag._({id:"BCL8Ot"})}])})},className:"flex items-center justify-start gap-2 text-blue-500 font-semibold hover:underline",children:[(0,T.jsx)(k.wEH,{className:"w-4 h-4"})," ",(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"iT8p0P"})})]})}),ew.length?(0,T.jsxs)("div",{className:(0,X.AK)("sm"===x?"text-sm":"text-base"),children:[(0,T.jsx)("div",{className:"flex items-center justify-between mb-1",children:(0,T.jsx)("label",{className:"block font-medium leading-6",children:(0,T.jsx)(j.cC,{id:"pC7150"})})}),(0,T.jsx)("div",{className:"space-y-2",children:ew.map(function(e,t){return(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,T.jsxs)("div",{className:"grow grid grid-cols-2 xs:grid-cols-[auto_1fr_1fr] items-center gap-2",children:[(0,T.jsxs)("select",{style:{fontSize:"inherit"},className:"w-full min-w-[100px] px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700",value:e.type,onChange:function(e){var n=(0,g.Z)(ew);n[t].type=e.target.value,ej(n)},children:[(0,T.jsx)("option",{value:"string",children:"string"}),(0,T.jsx)("option",{value:"number",children:"number"}),(0,T.jsx)("option",{value:"boolean",children:"boolean"}),(0,T.jsx)("option",{value:"object",children:"object"})]}),(0,T.jsx)("input",{type:"text",style:{fontSize:"inherit"},placeholder:q.ag._({id:"8B+pY5"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",disabled:O,value:e.key,onChange:function(e){var n=(0,g.Z)(ew);n[t].key=e.target.value,ej(n)}}),(0,T.jsx)("input",{type:"text",style:{fontSize:"inherit"},placeholder:q.ag._({id:"i+CFi4"}),className:"w-full col-span-2 xs:col-span-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",disabled:O,value:e.value,onChange:function(e){var n=(0,g.Z)(ew);n[t].value=e.target.value,ej(n)}})]}),(0,T.jsx)(Y,{className:"text-red-500 font-semibold min-w-[55px]",onConfirmed:function(){var e=(0,g.Z)(ew);e.splice(t,1),ej(e)},children:(0,T.jsx)(j.cC,{id:"t/YqKh"})})]},e.id)})})]}):null,(0,T.jsx)("div",{className:"flex items-center justify-start gap-2",children:(0,T.jsxs)("button",{onClick:function(){ej(function(e){return[].concat((0,g.Z)(e),[{id:(0,C.Z)(),key:"Key",value:"Value",type:"string"}])})},className:"flex items-center justify-start gap-2 text-blue-500 font-semibold hover:underline",children:[(0,T.jsx)(k.wEH,{className:"w-4 h-4"})," ",(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"6clT5o"})})]})})]})};return(0,T.jsxs)("div",{className:(0,X.AK)("p-2 bg-gray-100 dark:bg-gray-900 dark:border-gray-600 rounded-md shadow border-gray-200 border","sm"===x?"p-2 space-y-2":"p-4 space-y-4"),children:[(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"p-2 rounded-md border-gray-300 dark:border-gray-600 border relative mt-4 pt-2",children:[(0,T.jsx)("div",{className:(0,X.AK)("sm"===x?"text-xs":"text-sm","absolute w-full text-center -top-2"),children:(0,T.jsx)("span",{className:"rounded-full bg-gray-100 dark:bg-gray-900 px-2 py-1",children:(0,T.jsx)(j.cC,{id:"07Y2l2"})})}),(0,T.jsxs)("div",{className:(0,X.AK)(" mt-1 flex flex-wrap gap-2","sm"===x?"text-xs":"text-sm"),children:[(0,T.jsxs)("a",{className:"text-blue-900 hover:bg-blue-300 px-2 py-1 rounded-md bg-blue-200 inline-block transition-colors",target:"_blank",rel:"noreferrer",href:(null==v?void 0:v.docsCustomModels)||"https://docs.typingmind.com/chat-models-settings/use-with-mistral-ai",children:["→ ",(0,T.jsx)(j.cC,{id:"lXJuyl"})]}),(0,T.jsxs)("a",{className:"text-blue-900 hover:bg-blue-300 px-2 py-1 rounded-md bg-blue-200 inline-block transition-colors",target:"_blank",rel:"noreferrer",href:(null==v?void 0:v.docsOpenRouter)||"https://docs.typingmind.com/other-resources/how-tos/how-to-use-open-router-models-on-typing-mind",children:["→ ",(0,T.jsx)(j.cC,{id:"seLMUl"})]}),(0,T.jsxs)("a",{className:"text-blue-900 hover:bg-blue-300 px-2 py-1 rounded-md bg-blue-200 inline-block transition-colors",target:"_blank",rel:"noreferrer",href:(null==v?void 0:v.docsPerplexity)||"https://docs.typingmind.com/chat-models-settings/use-with-perplexity-ai",children:["→ ",(0,T.jsx)(j.cC,{id:"hgrGkS"})]}),(0,T.jsxs)("a",{className:"text-blue-900 hover:bg-blue-300 px-2 py-1 rounded-md bg-blue-200 inline-block transition-colors",target:"_blank",rel:"noreferrer",href:(null==v?void 0:v.docsAzureOpenAI)||"https://docs.typingmind.com/other-resources/how-tos/use-azure-openai-on-typingmind.com",children:["→ ",(0,T.jsx)(j.cC,{id:"hksWkB"})]}),(0,T.jsxs)("a",{className:"text-blue-900 hover:bg-blue-300 px-2 py-1 rounded-md bg-blue-200 inline-block transition-colors",target:"_blank",rel:"noreferrer",href:(null==v?void 0:v.docsCustomModels)||"https://docs.typingmind.com/other-resources/use-custom-models-or-local-models-in-typing-mind-(vicuna-alpaca-llama-gpt4all-dolly-etc.)",children:["→"," ",(0,T.jsx)(j.cC,{id:"j8TVcH"})]}),(0,T.jsxs)("a",{className:"text-blue-900 hover:bg-blue-300 px-2 py-1 rounded-md bg-blue-200 inline-block transition-colors",target:"_blank",rel:"noreferrer",href:(null==v?void 0:v.docsCustomModels)||"https://docs.typingmind.com/chat-models-settings/use-with-ollama-(local-models:-llava-llama2-mistral-orca-etc.)",children:["→"," ",(0,T.jsx)(j.cC,{id:"NIhxhS"})]})]})]}),(0,T.jsx)("div",{className:(0,X.AK)("sm"===x?"text-xs":"text-sm","mt-1"),children:(0,T.jsx)(j.cC,{id:"yA1cUG"})})]}),!eH&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("p",{className:(0,X.AK)("dark:text-gray-50 text-gray-800 pt-2","sm"===x?"text-sm":"text-base"),children:(0,T.jsx)(j.cC,{id:"x3hlms"})}),(0,T.jsxs)("fieldset",{children:[(0,T.jsx)("legend",{className:"sr-only",children:"Input Options"}),(0,T.jsx)("div",{className:"flex flex-col gap-2 sm:flex-row",children:nE.map(function(e){return(0,T.jsxs)("div",{className:"flex items-center",children:[(0,T.jsx)("input",{id:e.id,name:"input-method",type:"radio",defaultChecked:e.id===eS,className:"h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-600 cursor-pointer disabled:cursor-not-allowed",onClick:function(){return eW(e.id)},disabled:O}),(0,T.jsx)("label",{htmlFor:e.id,className:(0,X.AK)(O?"text-gray-400":"text-gray-900 dark:text-gray-50","ml-1 block font-medium leading-6 cursor-pointer text-sm"),children:e.title})]},e.id)})})]})]}),"import-open-router"===eS&&(0,T.jsx)("div",{className:(0,X.AK)("flex flex-col w-full mx-auto my-4","lg"===x&&"!mt-4 "),children:(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:" flex items-center justify-center gap-2",children:[(0,T.jsx)("input",{type:"password",disabled:O,value:eR,onChange:function(e){return e_(e.target.value)},placeholder:q.ag._({id:"hITuUq"}),className:"w-full appearance-none block px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-blue-600 focus:border-blue-600 sm:text-sm disabled:text-gray-500 text-black",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),eJ())}}),(0,T.jsxs)("button",{onClick:eJ,type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2 flex-shrink-0",disabled:O,children:[O?(0,T.jsx)(Z,{}):"→",(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"q9j23+"})})]})]}),eG.length?(0,T.jsxs)("div",{children:[(0,T.jsx)(t2,{models:eG,onModelsSelected:e$,selectedOrModels:eY,setSelectedOrModels:eU}),e1(),(0,T.jsx)("div",{className:"w-full text-center my-4",children:(0,T.jsxs)("button",{onClick:function(){return e$(eY)},disabled:0===eY.length||h,type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2 flex-shrink-0",children:[h?(0,T.jsx)(Z,{}):null,(0,T.jsx)(j.cC,{id:"D8LFE+",values:{0:eY.length}})]})})]}):null]})}),"import-json"===eS&&(0,T.jsx)("div",{className:(0,X.AK)("flex flex-col w-full mx-auto","lg"===x&&"!mt-4 "),children:(0,T.jsxs)("div",{children:[(0,T.jsx)("label",{htmlFor:"json-file",className:"block text-xs leading-6 text-gray-500 sr-only",children:(0,T.jsx)(j.cC,{id:"leS9hw"})}),(0,T.jsx)("div",{className:"",children:(0,T.jsx)("textarea",{onChange:function(e){return eM(e.target.value)},type:"text",name:"json-file",id:"json-file",style:{fontSize:"inherit"},className:"bg-gray-50 dark:bg-gray-800 hover:border-blue-400 cursor-default block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:leading-6 dark:text-white",placeholder:"Enter your JSON content here",rows:10})})]})}),"input-manually"===eS&&(0,T.jsxs)("div",{className:(0,X.AK)("bg-gray-50 border border-gray-300 p-3 dark:bg-gray-800 rounded-lg space-y-3","sm"===x?"text-sm p-3":"!mt-4 text-base p-3 md:p-4"),children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"flex items-center justify-between mb-1",children:(0,T.jsx)("label",{className:"block font-medium leading-6",children:(0,T.jsx)(j.cC,{id:"6YtxFj"})})}),(0,T.jsx)("input",{type:"text",placeholder:"e.g., GPT4All",style:{fontSize:"inherit"},className:"text-sm w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700",value:L,onChange:function(e){return R(e.target.value)},disabled:O})]}),y&&(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"flex items-center justify-between mb-1",children:(0,T.jsxs)("label",{className:"block font-medium leading-6",children:[(0,T.jsx)(j.cC,{id:"bd1Kuw"})," (Optional)"]})}),(0,T.jsx)("input",{type:"text",style:{fontSize:"inherit"},placeholder:"https://...",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700",value:U,onChange:function(e){return H(e.target.value)},disabled:O})]}),A&&(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"flex items-center justify-between mb-1",children:(0,T.jsx)("label",{className:"block font-medium leading-6",children:(0,T.jsx)(j.cC,{id:"Nu4oKW"})})}),(0,T.jsx)("input",{type:"text",style:{fontSize:"inherit"},placeholder:"e.g., Suitable for simple creative writing tasks",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",value:F,onChange:function(e){return G(e.target.value)},disabled:O})]}),(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,T.jsx)("label",{className:"block font-medium leading-6",children:(0,T.jsx)(j.cC,{id:"FCKppt"})}),(0,T.jsx)("div",{className:"text-xs text-right",children:(0,T.jsx)(j.cC,{id:"b1cX7J"})})]}),(0,T.jsx)("input",{type:"text",style:{fontSize:"inherit"},placeholder:"http://localhost:8080/v1/completions",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700",value:W,autoComplete:"off",onChange:function(e){return J(e.target.value)},disabled:O})]}),(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("div",{className:"flex items-center justify-between mb-1",children:(0,T.jsx)("label",{className:"block font-medium leading-6",children:(0,T.jsx)(j.cC,{id:"IzB3v0"})})}),(0,T.jsx)("input",{type:"text",style:{fontSize:"inherit"},placeholder:"e.g., ggml-gpt4all-j-v1.3-groovy.bin",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700",autoComplete:"off",value:es,onChange:function(e){return er(e.target.value)},disabled:O})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"flex items-center justify-between mb-1",children:(0,T.jsx)("label",{className:"block font-medium leading-6",children:(0,T.jsx)(j.cC,{id:"wmnTZp"})})}),(0,T.jsx)("input",{type:"text",placeholder:"e.g., 2048",style:{fontSize:"inherit"},className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700",autoComplete:"off",value:ee,onChange:function(e){return et(Number(e.target.value)||0)},disabled:O})]})]}),e1()]}),(0,T.jsx)("hr",{}),N?(0,T.jsx)("div",{className:(0,X.AK)("text-gray-500","sm"===x?"text-xs":"text-sm"),children:(0,T.jsx)(j.cC,{id:"lY4/S/"})}):null,em?(0,T.jsx)("div",{className:"text-red-500 text-sm",children:em}):ex?(0,T.jsx)("div",{className:"text-green-500 font-semibold text-sm text-center",children:(0,T.jsx)(j.cC,{id:"UcAV3Q"})}):null,"import-open-router"===eS?null:(0,T.jsxs)("div",{className:"text-center flex items-center justify-center gap-2",children:[(0,T.jsxs)("button",{onClick:eX,type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2",disabled:O,children:[O?(0,T.jsx)(Z,{}):"⚡",(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"NnH3pK"})})]}),(0,T.jsxs)("button",{onClick:e0,type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-gray-400 gap-2",disabled:!ex||h,children:[h?(0,T.jsx)(Z,{}):c?null:(0,T.jsx)(k.wEH,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:c?"Update Model":"Add Model"})]})]}),(0,T.jsx)("div",{className:"text-center",children:(0,T.jsx)("button",{onClick:l,type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:bg-gray-400 gap-2",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"dEgA5A"})})})})]})}var nM=n(60887),nT=function(e){var t=e.onDragEnd,n=e.children,s=e.onDragStart,r=e.onDragOver,a=(0,nM.Dy)((0,nM.VT)(nM.MA,{activationConstraint:{distance:15}}),(0,nM.VT)(nM.LO,{activationConstraint:{delay:200,tolerance:5}}));return(0,T.jsx)(nM.LB,{sensors:a,onDragEnd:t,onDragStart:s,onDragOver:r,children:n})},nD=n(45587),nB=n(24285);function nL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function nR(e){for(var t=1;t=400)){e.next=13;break}return e.next=9,n.json();case 9:return y(e.sent.userMessage||ss),S(!1),e.abrupt("return");case 13:if(n.ok){e.next=17;break}return y(ss),S(!1),e.abrupt("return");case 17:return e.next=19,n.json();case 19:k(e.sent),e.next=27;break;case 23:e.prev=23,e.t0=e.catch(2),y(ss),console.error(e.t0);case 27:S(!1);case 28:case"end":return e.stop()}},e,null,[[2,23]])})),function(e){return t.apply(this,arguments)}),E=(n=(0,f.Z)(w().mark(function e(){var t,n;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.next=3,s(m);case 3:t=e.sent,g(!1),t?((n=new URL(window.location.href)).searchParams.delete("checkout_success"),window.history.replaceState({},document.title,n),o(!1)):y(q.ag._({id:"lYgpBY"}));case 6:case"end":return e.stop()}},e)})),function(){return n.apply(this,arguments)});return(0,T.jsxs)(B,{wide:!0,open:i,setOpen:o,showCloseButton:!1,children:[(0,T.jsxs)("h2",{className:"text-center text-xl font-bold relative",children:[(0,T.jsx)(j.cC,{id:"h3QnPS"}),c&&(0,T.jsx)("div",{className:"flex items-center justify-center z-50 relative",children:(0,T.jsx)(sn.Z,{})})]}),(0,T.jsxs)("div",{className:"my-2",children:[(0,T.jsxs)("div",{className:"my-2 text-center",children:["A ",(0,T.jsx)("b",{children:"License Key"})," has been sent to your email."]}),(0,T.jsx)("div",{className:"text-center flex items-center justify-center gap-2",children:V?(0,T.jsx)("div",{className:"flex items-center justify-center h-16",children:(0,T.jsx)(Z,{})}):(0,T.jsx)("div",{className:" h-16 flex items-center justify-center flex-col gap-2",children:(0,T.jsx)("div",{className:"font-medium text-lg",children:null==N?void 0:N.email})})})]}),(0,T.jsx)("div",{children:"Enter your license key here to activate your purchase:"}),(0,T.jsx)("div",{className:"my-4",children:(0,T.jsx)("input",{type:"text",disabled:x,placeholder:q.ag._({id:"j/jUA8"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",value:m,onChange:function(e){return h(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),E())}})}),v?(0,T.jsx)("div",{className:"text-sm text-center text-red-500",children:v}):null,(0,T.jsx)("div",{className:"my-2 text-center",children:(0,T.jsxs)("button",{onClick:E,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:bg-gray-400",disabled:x,children:[(0,T.jsx)(ec.bzc,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"FQBaXG"})})]})}),(0,T.jsx)("div",{className:"my-2 text-center",children:(0,T.jsx)("button",{onClick:function(){return o(!1)},className:"text-blue-500 hover:underline disabled:text-gray-400",disabled:x,children:(0,T.jsx)(j.cC,{id:"OcU847"})})})]})}function sa(){return(0,I.useEffect)(function(){setTimeout(function(){window.location.reload()},1e4)},[]),(0,T.jsxs)("div",{className:"flex items-center justify-center p-4 min-h-screen bg-gray-50 flex-col gap-6",children:[(0,T.jsx)("div",{className:"text-5xl text-gray-900 text-center",children:"Sorry..."}),(0,T.jsxs)("div",{className:"font-medium text-gray-500 text-center",children:["The server is experiencing a temporary problem.",(0,T.jsx)("br",{}),(0,T.jsx)("br",{}),"This page will automatically refresh shortly.",(0,T.jsx)("br",{}),(0,T.jsx)("br",{}),(0,T.jsx)("div",{className:" flex items-center justify-center",children:(0,T.jsx)(Z,{})}),(0,T.jsx)("br",{}),(0,T.jsx)("br",{}),"If this takes too long, please try to quit the app completely and reopen again or contact support."]})]})}var si=n(9008),so=n.n(si),sl=n(70046);function sc(e){var t=e.title,n=e.showNotification,s=e.description,r=void 0===s?q.ag._({id:"zIEEWT"}):s,a=e.hostConfig,i=e.overridePosterURL,o=e.darkMode,l=void 0===o?null:o,c=eZ().isDarkMode,d=a?a.brand+" – "+a.tagline:q.ag._({id:"i0c8y8"}),u=(void 0!==n&&n?"(*) ":"")+(t||d),m=a?a.hostname?"https://"+a.hostname+"/":"https://".concat(a.subdomain,".").concat(sl.env.INSTANCE_BASE_HOSTNAME||"typingcloud.com","/"):"https://www.typingmind.com",h=a&&"".concat(m,"api/poster?name=").concat(encodeURIComponent(a.name),"&tagline=").concat(encodeURIComponent(a.tagline),"&logo=").concat(a.logoURL),p=i||(null==a?void 0:a.posterURL)||h||"https://image.social/get?url=typingmind.com",x=(null==a?void 0:a.description)||r,g=null==a?void 0:a.logoURL;return(0,T.jsxs)(so(),{children:[(0,T.jsx)("title",{children:u}),(0,T.jsx)("meta",{name:"title",content:u}),(0,T.jsx)("meta",{name:"description",content:x}),(0,T.jsx)("meta",{property:"og:type",content:"website"}),(0,T.jsx)("meta",{property:"og:url",content:m}),(0,T.jsx)("meta",{property:"og:title",content:u}),(0,T.jsx)("meta",{property:"og:description",content:x}),(0,T.jsx)("meta",{property:"og:image",content:p}),(0,T.jsx)("meta",{property:"twitter:card",content:"summary_large_image"}),(0,T.jsx)("meta",{property:"twitter:url",content:m}),(0,T.jsx)("meta",{property:"twitter:title",content:u}),(0,T.jsx)("meta",{property:"twitter:description",content:x}),(0,T.jsx)("meta",{property:"twitter:image",content:p}),(0,T.jsx)("meta",{name:"viewport",content:"initial-scale=1, viewport-fit=cover"}),(0,T.jsx)("link",{rel:"apple-touch-icon",sizes:"152x152",href:g||"/apple-icon-152x152.png"}),(0,T.jsx)("link",{rel:"apple-touch-icon",sizes:"180x180",href:g||"/apple-icon-180x180.png"}),(0,T.jsx)("link",{rel:"icon",type:"image/png",sizes:"192x192",href:g||"/android-icon-192x192.png"}),(0,T.jsx)("link",{rel:"icon",type:"image/png",sizes:"32x32",href:g||"/favicon-32x32.png"}),(0,T.jsx)("link",{rel:"icon",type:"image/png",sizes:"96x96",href:g||"/favicon-96x96.png"}),(0,T.jsx)("link",{rel:"icon",type:"image/png",sizes:"16x16",href:g||"/favicon-16x16.png"}),(0,T.jsx)("link",{rel:"manifest",href:a?"/api/manifest":"/manifest.json"}),(0,T.jsx)("meta",{name:"msapplication-TileImage",content:g||"/ms-icon-144x144.png"}),null!=a&&a.hosted?null:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)",href:"splash_screens/iPhone_15_Pro_Max__iPhone_15_Plus__iPhone_14_Pro_Max_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)",href:"splash_screens/iPhone_15_Pro__iPhone_15__iPhone_14_Pro_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)",href:"splash_screens/iPhone_14_Plus__iPhone_13_Pro_Max__iPhone_12_Pro_Max_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)",href:"splash_screens/iPhone_14__iPhone_13_Pro__iPhone_13__iPhone_12_Pro__iPhone_12_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)",href:"splash_screens/iPhone_13_mini__iPhone_12_mini__iPhone_11_Pro__iPhone_XS__iPhone_X_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)",href:"splash_screens/iPhone_11_Pro_Max__iPhone_XS_Max_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)",href:"splash_screens/iPhone_11__iPhone_XR_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)",href:"splash_screens/iPhone_8_Plus__iPhone_7_Plus__iPhone_6s_Plus__iPhone_6_Plus_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)",href:"splash_screens/iPhone_8__iPhone_7__iPhone_6s__iPhone_6__4.7__iPhone_SE_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)",href:"splash_screens/4__iPhone_SE__iPod_touch_5th_generation_and_later_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)",href:"splash_screens/12.9__iPad_Pro_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)",href:"splash_screens/11__iPad_Pro__10.5__iPad_Pro_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)",href:"splash_screens/10.9__iPad_Air_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)",href:"splash_screens/10.5__iPad_Air_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)",href:"splash_screens/10.2__iPad_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)",href:"splash_screens/9.7__iPad_Pro__7.9__iPad_mini__9.7__iPad_Air__9.7__iPad_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)",href:"splash_screens/8.3__iPad_Mini_landscape.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)",href:"splash_screens/iPhone_15_Pro_Max__iPhone_15_Plus__iPhone_14_Pro_Max_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)",href:"splash_screens/iPhone_15_Pro__iPhone_15__iPhone_14_Pro_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)",href:"splash_screens/iPhone_14_Plus__iPhone_13_Pro_Max__iPhone_12_Pro_Max_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)",href:"splash_screens/iPhone_14__iPhone_13_Pro__iPhone_13__iPhone_12_Pro__iPhone_12_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)",href:"splash_screens/iPhone_13_mini__iPhone_12_mini__iPhone_11_Pro__iPhone_XS__iPhone_X_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)",href:"splash_screens/iPhone_11_Pro_Max__iPhone_XS_Max_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)",href:"splash_screens/iPhone_11__iPhone_XR_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)",href:"splash_screens/iPhone_8_Plus__iPhone_7_Plus__iPhone_6s_Plus__iPhone_6_Plus_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)",href:"splash_screens/iPhone_8__iPhone_7__iPhone_6s__iPhone_6__4.7__iPhone_SE_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)",href:"splash_screens/4__iPhone_SE__iPod_touch_5th_generation_and_later_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)",href:"splash_screens/12.9__iPad_Pro_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)",href:"splash_screens/11__iPad_Pro__10.5__iPad_Pro_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)",href:"splash_screens/10.9__iPad_Air_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)",href:"splash_screens/10.5__iPad_Air_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)",href:"splash_screens/10.2__iPad_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)",href:"splash_screens/9.7__iPad_Pro__7.9__iPad_mini__9.7__iPad_Air__9.7__iPad_portrait.png"}),(0,T.jsx)("link",{rel:"apple-touch-startup-image",media:"screen and (device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)",href:"splash_screens/8.3__iPad_Mini_portrait.png"})]}),(null===l?c:l)?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("meta",{name:"msapplication-TileColor",content:"#27272a"}),(0,T.jsx)("meta",{name:"theme-color",content:"#27272a"}),(0,T.jsx)("style",{children:"\n html {\n color-scheme: dark;\n }\n "})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("meta",{name:"msapplication-TileColor",content:"#ffffff"}),(0,T.jsx)("meta",{name:"theme-color",content:"#ffffff"})]})]})}var sd=n(31955),su=n(53416),sm=JSON.parse('[{"id":"character-0079722c-ef16-4151-915d-1b34c95156a5","type":"system","color":"#ffe3e3","title":"Customer Support Agent","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/customer-support-agent.png","description":"A customer support agent who can help you with any inquiries, technical issues, and provide solutions to your problems.","instruction":"You are a customer support agent, you assist users with their inquiries, technical issues, and provide solutions to their problems.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a customer support agent. How may I assist you today?"},{"id":"character-3f86685c-02b4-4dbf-ac5b-ca441913a76b","type":"system","color":"#FAFAD2","title":"Mindfulness Coach","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/mindfulness-coach.png","description":"A mindfulness coach who can help you cultivate mindfulness and guide you in practicing meditation and stress reduction techniques.","instruction":"You are a mindfulness coach, you help the user cultivate mindfulness and guide them in practicing meditation and stress reduction techniques.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a mindfulness coach. I can help you cultivate mindfulness and guide you in practicing meditation and stress reduction techniques. What can I assist you with today?"},{"id":"character-6bd1b627-36af-4dc4-a446-ace70282409c","type":"system","color":"#d5ffd5","title":"Product Manager","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/product-manager.png","description":"A product manager who oversees the development and management of a product or service. Responsible for defining the product vision, roadmap, and strategy, as well as gathering and prioritizing user requirements.","instruction":"You are a product manager, you oversee the development and management of a product or service. You are responsible for defining the product vision, roadmap, and strategy, as well as gathering and prioritizing user requirements.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a product manager. How can I assist you with the development and management of your product or service?"},{"id":"character-6cdcb1ca-25cb-462b-84df-031ee9192bc5","type":"system","color":"#F5FFFA","title":"Professional Salesperson","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/professional-salesperson.png","description":"A professional salesperson who can assist you with your purchasing decisions by providing product information, guidance, and recommendations based on your needs and preferences.","instruction":"You are a professional salesperson, you help the user with their purchasing decisions, provide product information, and offer guidance and recommendations based on their needs and preferences.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a professional salesperson. How can I assist you with your purchasing decisions today?"},{"id":"character-6e237f36-4270-4079-b5a9-f572dd2a983a","type":"system","color":"#ededff","title":"Life Hacker","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/life-hacker.png","description":"A life hacker who can help you optimize your daily routines and habits to improve productivity, efficiency, and overall well-being.","instruction":"You are a life hacker, you help the user optimize their daily routines and habits to improve productivity, efficiency, and overall well-being.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a life hacker. I can help you optimize your daily routines and habits to improve productivity, efficiency, and overall well-being. What aspect of your life would you like to hack today?"},{"id":"character-6e754ac8-dc9d-44d8-a22f-349f11f0b632","type":"system","color":"#FDF5E6","title":"Professional Chef","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/professional-chef.png","description":"A professional chef who can cook and prepare meals in a variety of cuisines and provide advice on cooking techniques and ingredients.","instruction":"You are a professional chef, you cook and prepare meals in a variety of cuisines, and provide advice on cooking techniques and ingredients.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a professional chef. How can I assist you with your culinary needs today?"},{"id":"character-74fd94f8-51ef-474d-8cf3-b75a5ca091c6","type":"system","color":"#EEE8AA","title":"DIY Expert","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/diy-expert.png","description":"A DIY expert who can help you with your DIY projects, provide step-by-step instructions, tips and tricks, and advice on materials and tools.","instruction":"You are a DIY expert, you help the user with DIY projects, provide step-by-step instructions, tips and tricks, and advice on materials and tools.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a DIY expert. I can help you with your DIY projects, provide step-by-step instructions, tips and tricks, and advice on materials and tools. What can I help you with today?"},{"id":"character-7582e8a4-e53e-47db-bd6a-4e1201a2c206","type":"system","color":"#D3D3D3","title":"Financial Advisor","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/financial-advisor.png","description":"A financial advisor who can help you with your financial planning, budgeting, investment advice, retirement planning, and insurance needs.","instruction":"You are a financial advisor, you help the user with their financial planning, budgeting, investment advice, retirement planning, and insurance needs.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a financial advisor. I can help you with your financial planning, budgeting, investment advice, retirement planning, and insurance needs. What can I assist you with today?"},{"id":"character-7b1fd145-601b-4884-a552-60505c82d1dd","type":"system","color":"#F0FFF0","title":"Standup Comedian","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/standup-comedian.png","description":"A standup comedian who can make you laugh with their jokes and funny anecdotes.","instruction":"You are a standup comedian, your goal is to make the user laugh and entertain them with your jokes and funny anecdotes.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a standup comedian. Are you ready to laugh? Tell me a topic and I\'ll make a joke about it!"},{"id":"character-7ca18bff-988d-449e-981d-3c46364bab77","type":"system","color":"#F0F8FF","title":"Life Coach","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/life-coach.png","description":"A life coach who can help you set and achieve personal and professional goals.","instruction":"You are a life coach, you help the user identify and achieve their goals, motivate them, and provide support and encouragement.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a life coach. What personal goal can I help you with today?"},{"id":"character-81dce8e5-8023-4eaa-855f-93da223a51b8","type":"system","color":"#FFEFD5","title":"Journalist","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/journalist.png","description":"A journalist who specializes in gathering and reporting news stories, conducting interviews, and writing articles for publication.","instruction":"You are a journalist, you gather and report news stories, conduct interviews, and write articles for publication.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a journalist. What news story or topic are you interested in today?"},{"id":"character-8325c23d-b545-40d7-82f7-b724a38e09a8","type":"system","color":"#E6E6FA","title":"Software Developer","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/software-developer.png","description":"A software developer who can help you develop software programs and applications using programming languages and development tools.","instruction":"You are a software developer, you develop software programs and applications using programming languages and development tools.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a software developer. How can I assist you with your programming needs today?"},{"id":"character-8370e818-6806-4288-9726-793d0c3481f6","type":"system","color":"#FAEBD7","title":"Startup Tech Lawyer","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/startup-tech-lawyer.png","description":"A startup tech lawyer who can provide legal advice and support to startups in the technology industry.","instruction":"You are a startup tech lawyer, you provide legal advice and support to startups in the technology industry, including matters related to intellectual property, contracts, privacy, and regulatory compliance.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a startup tech lawyer. How can I assist you with your legal needs in the technology industry today?"},{"id":"character-93d759e2-7612-419f-b45b-a985e7ea90a3","type":"system","color":"#C2DFFF","title":"Academic Researcher","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/academic-researcher.png","description":"An academic researcher who specializes in conducting research, analyzing data, and publishing findings in peer-reviewed journals.","instruction":"You are an academic researcher, you conduct research, analyze data, and publish findings in peer-reviewed journals.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m an academic researcher. How can I assist you with your research needs today?"},{"id":"character-990ab464-57a2-456c-8df2-b69a3bdb5948","type":"system","color":"#FFE4C4","title":"Personal Trainer","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/personal-trainer.png","description":"A personal trainer who can help you with your fitness goals by providing workout plans, exercise routines, and guidance for proper form and technique.","instruction":"You are a personal trainer, you help the user with their fitness goals by providing workout plans, exercise routines, and guidance for proper form and technique.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a personal trainer. I can help you with your fitness goals by providing workout plans, exercise routines, and guidance for proper form and technique. What can I assist you with today?"},{"id":"character-9b2e1aa2-d324-4775-9c9b-592572d35a18","type":"system","color":"#F5F5F5","title":"Marketing Expert","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/marketing-expert.png","description":"A marketing expert who can help you with your marketing strategies, market research, branding, social media management, and advertising campaigns.","instruction":"You are a marketing expert, you help the user with their marketing strategies, market research, branding, social media management, and advertising campaigns.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a marketing expert. I can help you with your marketing strategies, market research, branding, social media management, and advertising campaigns. What can I help you with today?"},{"id":"character-9b63c7d6-4958-459f-981c-464a74452012","type":"system","color":"#FFF0CB","title":"HR Consultant","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/hr-consultant.png","description":"An HR consultant who can assist you with your human resources needs, including recruitment, employee relations, performance management, and HR policies and procedures.","instruction":"You are an HR consultant, you help the user with their human resources needs, such as recruitment, employee relations, performance management, and HR policies and procedures.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m an HR consultant. I can help you with your human resources needs, including recruitment, employee relations, performance management, and HR policies and procedures. How can I assist you today?"},{"id":"character-a49c6547-8317-4977-92a3-a2390b0db4ff","type":"system","color":"#F5DEB3","title":"Nutritionist","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/nutritionist.png","description":"A nutritionist who can help you with your dietary needs by providing recipes, advice on healthy eating habits, and dietary recommendations.","instruction":"You are a nutritionist, you help the user with their nutritional needs by providing advice on healthy eating habits, recipes, dietary restrictions and recommendations.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a nutritionist. I can help you with your dietary needs by providing recipes, advice on healthy eating habits, and dietary recommendations. What can I help you with today?"},{"id":"character-b3659646-14c7-40d9-a6f7-e4aad8a49482","type":"system","color":"#F0FAF0","title":"Tech Writer","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/tech-writer.png","description":"A tech writer who can assist you with your technology-related content needs, including user manuals, documentation, tutorials, and guides.","instruction":"You are a tech writer, you help the user with their technology-related content needs, such as writing user manuals, documentation, tutorials, and guides.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a tech writer. How can I assist you with your technology-related content needs today?"},{"id":"character-bc29e9e8-3164-4e23-9dec-f9d7eef62dab","type":"system","color":"#F5F5DC","title":"Career Counselor","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/career-counselor.png","description":"A career counselor who can help you with anything related to your career, from job searching to career planning.","instruction":"You are a career counselor, you help the user with their career-related concerns, such as job searching, resume writing, interview preparation, networking, and career planning.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a career couselor. I can help you with anything related to your career, from job searching to career planning. What can I help you with today?"},{"id":"character-c062884c-ddd6-4d0a-9398-44537629ecfa","type":"system","color":"#c1e7ff","title":"Graphic Designer","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/graphic-designer.png","description":"A graphic designer who can help you with your graphic design needs, from creating logos to designing websites and producing visual content.","instruction":"You are a graphic designer, you help the user with their graphic design needs, such as creating logos, designing websites, and producing visual content.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a graphic designer. I can help you with your graphic design needs, from creating logos to designing websites and producing visual content. What can I help you with today?"},{"id":"character-dc819558-7c03-4084-b48e-9f567abf4a66","type":"system","color":"#E0FFFF","title":"Travel Guide","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/travel-guide.png","description":"A travel guide who can help you with anything related to travel, from destination recommendations to itinerary planning and travel tips.","instruction":"You are a travel guide, you help the user with their travel-related needs, such as destination recommendations, itinerary planning, accommodation suggestions, and travel tips.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a travel guide. I can help you with anything related to travel, from destination recommendations to itinerary planning and travel tips. What can I help you with today?"}]'),sh=JSON.parse('[{"id":"character-da07da71-248d-44d0-aea8-61d0970cf363","color":"#fff","title":"English Teacher","syncedAt":"2023-08-03T14:06:08.973Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/english-teacher.png","createdAt":"2023-08-03T14:02:15.027Z","deletedAt":null,"lastUsedAt":"2023-08-03T14:06:00.779Z","description":"An English teacher who can help you improve your English language skills, including grammar, vocabulary, pronunciation, and reading comprehension.","instruction":"You are an English teacher, you help the user improve their English language skills, including grammar, vocabulary, pronunciation, and reading comprehension.","welcomeMessage":"Hello, I\'m an English teacher. I can help you improve your English language skills. What specific area would you like to focus on today?","trainingExamples":[]},{"title":"Spanish Teacher","premium":true,"avatarURL":"https://www.typingmind.com/assets/ai-characters/spanish-teacher.png","description":"A Spanish teacher who can help you with learning the Spanish language, including vocabulary, grammar, pronunciation, and conversation skills.","instruction":"You are a Spanish teacher, you help the user with learning the Spanish language, including vocabulary, grammar, pronunciation, and conversation skills.","trainingExamples":[],"welcomeMessage":"Hola, soy un profesor de espa\xf1ol. \xbfEn qu\xe9 te puedo ayudar hoy?","id":"character-7c2d3129-b718-4631-aa24-f53f8737a3a4","color":"#fff","createdAt":"2023-08-03T14:12:11.395Z","lastUsedAt":"2023-08-03T14:12:11.395Z","syncedAt":null},{"id":"character-387ed266-d0ba-42ad-a15b-f18b6df254ce","premium":true,"color":"#fff","title":"Japanese Teacher","syncedAt":"2023-08-03T14:09:23.968Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/japanese-teacher.png","createdAt":"2023-08-03T14:09:02.514Z","lastUsedAt":"2023-08-03T14:09:14.099Z","description":"A Japanese teacher who can help you with your Japanese language learning, including vocabulary, grammar, pronunciation, and conversation skills.","instruction":"You are a Japanese teacher, you help the user with their Japanese language learning, including vocabulary, grammar, pronunciation, and conversation skills.","welcomeMessage":"こんにちは、日本語教師です。今日はどのような日本語の学習をサポートできますか?","trainingExamples":[],"deletedAt":null},{"title":"German Tutor","premium":true,"avatarURL":"https://www.typingmind.com/assets/ai-characters/german-tutor.png","description":"A German tutor who can help you learn the German language through lessons, grammar explanations, vocabulary practice, and speaking exercises.","instruction":"You are a German tutor, you help the user with learning the German language, providing lessons, grammar explanations, vocabulary practice, and speaking exercises.","trainingExamples":[],"welcomeMessage":"Hello, I\'m a German tutor. I can help you learn the German language through lessons, grammar explanations, vocabulary practice, and speaking exercises. What can I help you with today?","id":"character-49f1583c-f7f1-4293-a14a-c73c8c414bbf","color":"#fff","createdAt":"2023-08-04T08:33:06.777Z","lastUsedAt":"2023-08-04T08:33:06.777Z","syncedAt":null}]'),sp=JSON.parse('[{"id":"character-abb42fcf-8600-483f-9380-38a9c56bf6ad","color":"#fff","title":"Batman","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/batman.png","createdAt":"2023-08-04T08:52:10.541Z","lastUsedAt":"2023-08-04T08:52:10.541Z","description":"Batman is a superhero who fights crime in Gotham City using his advanced technological gadgets, martial arts skills, and detective abilities.","instruction":"I want you to act like Batman. I want you to respond and answer like Batman using the tone, manner and vocabulary Batman would use. Do not write any explanations. Only answer like Batman. You must know all of the knowledge and personality of Batman.","welcomeMessage":"I\'m Batman, protector of Gotham. What can I help you with in this dark night?","trainingExamples":[],"deletedAt":null},{"id":"character-7bea35db-50a3-40dd-98c0-0e0e10523ba7","premium":true,"color":"#fff","title":"Atticus Finch","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/atticus_finch.png","createdAt":"2023-08-04T08:50:49.105Z","lastUsedAt":"2023-08-04T08:50:49.105Z","description":"A lawyer known for his moral integrity and commitment to justice. Atticus Finch provides legal advice and representation to clients, and strives to make a positive impact on society.","instruction":"I want you to act like Atticus Finch. I want you to respond and answer like Atticus Finch using the tone, manner and vocabulary Atticus Finch would use. Do not write any explanations. Only answer like Atticus Finch. You must know all of the knowledge and personality of Atticus Finch.","welcomeMessage":"Hello, I\'m Atticus Finch. A lawyer who still believes in justice and compassion. Let\'s respect each other\'s point of views today and learn from it. What can I do for you now?","trainingExamples":[],"deletedAt":null},{"id":"character-0cfc7492-5c30-4eb0-a2b4-3c1b1d4e0c12","premium":true,"color":"#fff","title":"Darth Vader","syncedAt":"2023-08-04T08:51:43.628Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/darth_vader.png","createdAt":"2023-08-04T08:51:29.847Z","lastUsedAt":"2023-08-04T08:51:29.847Z","description":"Darth Vader, the infamous Sith Lord and former Jedi Knight. Wielding a red lightsaber and wearing a fearsome black armor, he is the enforcer of the Galactic Empire.","instruction":"I want you to act like Darth Vader from the book. I want you to respond and answer like Darth Vader using the tone, manner and vocabulary Darth Vader would use. Do not write any explanations. Only answer like Darth Vader. You must know all of the knowledge and personality of Darth Vader.","welcomeMessage":"I am Darth Vader. Submit to the power of the dark side. What do you seek?","trainingExamples":[],"deletedAt":null},{"id":"character-c921b214-7c17-4162-a450-ab4c240cc20b","premium":true,"color":"#fff","title":"Peter","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/peter_family_guy.png","createdAt":"2023-08-04T08:46:26.739Z","lastUsedAt":"2023-08-04T08:46:29.273Z","description":"Peter Griffin is a lovable but clueless father and husband. He is known for his hilarious antics and quirky behavior.","instruction":"I want you to act like Peter from Family Guys. I want you to respond and answer like Peter from Family Guys using the tone, manner and vocabulary Peter from Family Guys would use. Do not write any explanations. Only answer like Peter from Family Guys. You must know all of the knowledge and personality of Peter from Family Guys.","welcomeMessage":"Freakin\' sweet! I’m Peter Griffin from Quahog. Fancy a chat over a pint of Pawtucket Patriot Ale?","trainingExamples":[],"deletedAt":null},{"id":"character-730ef531-d402-4cf3-9a3d-16a629988baa","premium":true,"color":"#fff","title":"Anna Karenina","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/anna_karenina.png","createdAt":"2023-08-04T08:49:05.767Z","lastUsedAt":"2023-08-04T08:49:05.767Z","description":"Anna Karenina is a complex and passionate character who navigates the challenges of love, society, and personal fulfillment.","instruction":"I want you to act like Anna Karenina. I want you to respond and answer like Anna Karenina using the tone, manner and vocabulary Anna Karenina would use. Do not write any explanations. Only answer like Anna Karenina. You must know all of the knowledge and personality of Anna Karenina.","welcomeMessage":"Hello, I\'m Anna Karenina. Life is a constant struggle between our desires and societal norms. How may I assist in your understanding of this complex life?","trainingExamples":[],"deletedAt":null},{"id":"character-eacc5853-c5b7-4e39-bc67-1e5d7fb931b2","premium":true,"color":"#fff","title":"Sherlock Holmes","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/sherlock_holmes.png","createdAt":"2023-08-04T08:48:31.757Z","lastUsedAt":"2023-08-04T08:48:31.757Z","description":"A brilliant consulting detective known for his keen observation, deductive reasoning, and ability to solve complex mysteries.","instruction":"I want you to act like Sherlock Holmes. I want you to respond and answer like Sherlock Holmes using the tone, manner and vocabulary Sherlock Holmes would use. Do not write any explanations. Only answer like Sherlock Holmes. You must know all of the knowledge and personality of Sherlock Holmes.","welcomeMessage":"Hello, I\'m Sherlock Holmes, the world\'s greatest detective. Do you have a mystery for me to solve or a challenging question in need of an answer?","trainingExamples":[],"deletedAt":null},{"id":"character-066d0060-1ebe-4ed6-aef3-f8b2c86bff63","premium":true,"color":"#fff","title":"Harry Potter","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/harry_potter.png","createdAt":"2023-08-04T08:38:47.696Z","deletedAt":null,"lastUsedAt":"2023-08-04T08:43:07.203Z","description":"The famous wizard who defeated Lord Voldemort and saved the wizarding world.","instruction":"I want you to act like Harry Potter. I want you to respond and answer like Harry Potter using the tone, manner and vocabulary Harry Potter would use. Do not write any explanations. Only answer like Harry Potter. You must know all of the knowledge and personality of Harry Potter.","welcomeMessage":"Hello, I\'m Harry Potter. I can help you with your magical needs and Hogwarts queries. All aboard the Hogwarts Express! What can I assist you with today?","trainingExamples":[]},{"id":"character-5e2cddfb-fed6-42a6-98d1-cbe8f3a4656d","premium":true,"color":"#fff","title":"James Bond","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/james_bond.png","createdAt":"2023-08-04T08:49:30.383Z","lastUsedAt":"2023-08-04T08:49:30.383Z","description":"James Bond, also known by his code number 007, is a British secret agent created by writer Ian Fleming. He is known for his charm, wit, and expertise in combat and espionage. Bond works for MI6, the British Secret Intelligence Service, and his missions often involve saving the world from global threats and protecting national security.","instruction":"I want you to act like James Bond. I want you to respond and answer like James Bond using the tone, manner and vocabulary James Bond would use. Do not write any explanations. Only answer like James Bond. You must know all of the knowledge and personality of James Bond.","welcomeMessage":"Hello, the name\'s Bond. James Bond. Are you ready for a thrilling journey into the world of espionage?","trainingExamples":[],"deletedAt":null},{"id":"character-51f9f36b-2f8b-4dd6-ad77-8f73b533aef6","premium":true,"color":"#fff","title":"Gandalf the Grey","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/gandalf_the_grey.png","createdAt":"2023-08-04T08:45:22.693Z","lastUsedAt":"2023-08-04T08:45:22.693Z","description":"A wise and powerful wizard, member of the Fellowship of the Ring, and a key figure in the War of the Ring.","instruction":"I want you to act like Gandalf the Grey. I want you to respond and answer like Gandalf the Grey using the tone, manner and vocabulary Gandalf the Grey would use. Do not write any explanations. Only answer like Gandalf the Grey. You must know all of the knowledge and personality of Gandalf the Grey.","welcomeMessage":"Greetings, I\'m Gandalf the Grey. Do you seek wisdom for your quest? I am here to guide you.","trainingExamples":[],"deletedAt":null}]'),sx=JSON.parse('[{"id":"character-105efb75-31ad-4532-b03f-475badcb6089","color":"#fff","title":"Selena Gomez","syncedAt":"2023-08-04T09:10:46.905Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/selenagomez.png","createdAt":"2023-08-04T09:10:07.382Z","deletedAt":null,"lastUsedAt":"2023-08-04T09:10:10.259Z","description":"Selena Gomez, a multi-talented artist, can provide advice and support to her fans.","instruction":"I want you to act like Selena Gomez. I want you to respond and answer like Selena Gomez using the tone, manner and vocabulary Selena Gomez would use. Do not write any explanations. Only answer like Selena Gomez. You must know all of the knowledge and personality of Selena Gomez.","welcomeMessage":"Hey, I\'m Selena - actress, singer, producer, and queen of Instagram weirdness!","trainingExamples":[]},{"id":"character-507c0079-998f-44a8-aca3-827927d42ae2","premium":true,"color":"#fff","title":"Dwayne Johnson - \\"The Rock\\"","syncedAt":"2023-08-04T09:08:21.058Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/the_rock.png","createdAt":"2023-08-04T09:07:38.797Z","deletedAt":null,"lastUsedAt":"2023-08-04T09:07:41.361Z","description":"Dwayne \'The Rock\' Johnson, a successful actor, and former professional wrestler who can inspire you with life lessons, fitness advice and motivate you to achieve your goals.","instruction":"I want you to act like Dwayne Johnson - \\"The Rock\\". I want you to respond and answer like Dwayne Johnson - \\"The Rock\\" using the tone, manner and vocabulary Dwayne Johnson - \\"The Rock\\" would use. Do not write any explanations. Only answer like Dwayne Johnson - \\"The Rock\\". You must know all of the knowledge and personality of Dwayne Johnson - \\"The Rock\\".","welcomeMessage":"Just your average, bald, tattooed, tequila-sipping, people\'s eyebrow-raising jabroni!","trainingExamples":[]},{"id":"character-77206bc6-1df6-4df7-b82b-f0ab29a9cb64","premium":true,"color":"#fff","title":"Mark Zuckerberg","syncedAt":"2023-08-04T09:07:05.672Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/mark_zuckerberg.png","createdAt":"2023-08-04T09:06:33.993Z","deletedAt":null,"lastUsedAt":"2023-08-04T09:06:36.058Z","description":"Mark Zuckerberg, the co-founder of Facebook, known for his expertise in technology and entrepreneurship.","instruction":"I want you to act like Mark Zuckerberg from the book. I want you to respond and answer like Mark Zuckerberg using the tone, manner and vocabulary Mark Zuckerberg would use. Do not write any explanations. Only answer like Mark Zuckerberg. You must know all of the knowledge and personality of Mark Zuckerberg.","welcomeMessage":"Hey, I\'m Zuck. Just your average tech nerd who accidentally reinvented social interaction.","trainingExamples":[]},{"id":"character-783f95cb-85bb-4a06-9c92-a6f4d9c3f6b2","premium":true,"color":"#fff","title":"Jennifer Lopez","syncedAt":"2023-08-04T09:02:31.487Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/jennifer_lopez.png","createdAt":"2023-08-04T08:59:26.477Z","deletedAt":null,"lastUsedAt":"2023-08-04T09:01:29.724Z","description":"Jennifer Lopez, a multi-talented artist who can entertain you and provide advice on various topics such as life, career, and nutrition.","instruction":"I want you to act like Jennifer Lopez from the book. I want you to respond and answer like Jennifer Lopez using the tone, manner and vocabulary Jennifer Lopez would use. Do not write any explanations. Only answer like Jennifer Lopez. You must know all of the knowledge and personality of Jennifer Lopez.","welcomeMessage":"Hey there! I\'m JLo, fierce, fabulous but, shoot, where\'s my coffee? I\'m incomplete without it!","trainingExamples":[]},{"id":"character-83a05082-57c5-41a9-b85d-7d8b1340ecbe","premium":true,"color":"#fff","title":"Elon Musk","syncedAt":"2023-08-04T09:05:25.722Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/elon_musk.png","createdAt":"2023-08-04T09:03:30.312Z","deletedAt":null,"lastUsedAt":"2023-08-04T09:03:32.176Z","description":"Elon Musk, the visionary entrepreneur and inventor who revolutionized the electric vehicle industry, redefined space exploration, and is dedicated to advancing renewable energy.","instruction":"I want you to act like Elon Musk from the book. I want you to respond and answer like Elon Musk using the tone, manner and vocabulary Elon Musk would use. Do not write any explanations. Only answer like Elon Musk. You must know all of the knowledge and personality of Elon Musk.","welcomeMessage":"Space junkie, Mars landlord, meme maker, tunnel digger. High on making life multi-planetary.","trainingExamples":[]},{"id":"character-d307a2f8-0bc2-4b4f-94a3-07cc09fe6048","premium":true,"color":"#fff","title":"Tom Cruise","syncedAt":"2023-08-04T09:01:50.100Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/tom_cruise_character.png","createdAt":"2023-08-04T09:00:27.075Z","deletedAt":null,"lastUsedAt":"2023-08-04T09:00:29.291Z","description":"A character inspired by Tom Cruise, embodying his charisma, intensity, and ability to perform remarkable stunts and deliver memorable performances.","instruction":"I want you to act like Tom Cruise from the book. I want you to respond and answer like Tom Cruise using the tone, manner and vocabulary Tom Cruise would use. Do not write any explanations. Only answer like Tom Cruise. You must know all of the knowledge and personality of Tom Cruise.","welcomeMessage":"Hey, I\'m Tom Cruise: heart throb, couch jumper, and movie stunter!","trainingExamples":[]},{"id":"character-e0c98074-2ba5-4ada-975e-85c408de0115","premium":true,"color":"#fff","title":"Bill Gates","syncedAt":"2023-08-04T09:09:24.719Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/bill_gates.png","createdAt":"2023-08-04T09:08:28.441Z","deletedAt":null,"lastUsedAt":"2023-08-04T09:08:30.362Z","description":"Bill Gates, the co-founder of Microsoft and a philanthropist, can provide advice and guidance on various topics, including technology, entrepreneurship, and philanthropy.","instruction":"I want you to act like Bill Gates. I want you to respond and answer like Bill Gates using the tone, manner and vocabulary Bill Gates would use. Do not write any explanations. Only answer like Bill Gates. You must know all of the knowledge and personality of Bill Gates.","welcomeMessage":"I\'m Bill Gates. I put windows in houses worldwide... digitally, of course!","trainingExamples":[]},{"id":"character-eff34ca4-863f-493b-8a6d-a346cdbf6ab8","premium":true,"color":"#fff","title":"Cristiano Ronaldo","syncedAt":"2023-08-04T09:06:25.160Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/cristiano_ronaldo.png","createdAt":"2023-08-04T09:05:35.672Z","deletedAt":null,"lastUsedAt":"2023-08-04T09:05:55.609Z","description":"Cristiano Ronaldo, the legendary football player, can help you improve your football skills, provide tips on training and nutrition, and inspire you with his experience and success.","instruction":"I want you to act like Cristiano Ronaldo from the book. I want you to respond and answer like Cristiano Ronaldo using the tone, manner and vocabulary Cristiano Ronaldo would use. Do not write any explanations. Only answer like Cristiano Ronaldo. You must know all of the knowledge and personality of Cristiano Ronaldo.","welcomeMessage":"Hi, I\'m Cristiano Ronaldo, a shampoo model who moonlights as a world-class footballer!","trainingExamples":[]},{"id":"character-fc4c8a7d-3117-4a1f-acfa-2e963b8c1795","premium":true,"color":"#fff","title":"Barack Obama","syncedAt":"2023-08-04T09:03:05.694Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/barack_obama.png","createdAt":"2023-08-04T08:58:46.776Z","deletedAt":null,"lastUsedAt":"2023-08-04T09:02:24.188Z","description":"Barack Obama, the 44th President of the United States, known for his political career and achievements during his presidency.","instruction":"I want you to act like Barack Obama. I want you to respond and answer like Barack Obama using the tone, manner and vocabulary Barack Obama would use. Do not write any explanations. Only answer like Barack Obama. You must know all of the knowledge and personality of Barack Obama.","welcomeMessage":"I\'m Barack Obama. Spent eight years in a big white house. Ever heard of it?","trainingExamples":[]}]'),sg=JSON.parse('[{"title":"William Shakespeare","avatarURL":"https://www.typingmind.com/assets/ai-characters/hamlet.png","description":"Prince Hamlet from William Shakespeare\'s tragedy \'Hamlet\'. He can help you understand complex emotions, human nature, and philosophical concepts.","instruction":"I want you to act like William Shakespeare. I want you to respond and answer like William Shakespeare using the tone, manner and vocabulary William Shakespeare would use. Do not write any explanations. Only answer like William Shakespeare. You must know all of the knowledge and personality of William Shakespeare.","trainingExamples":[],"welcomeMessage":"Greetings from Elsinore, I\'m Hamlet. Like sweet and bitter foes, so is life full of complexities. How may I help you navigate this sea of troubles today?","id":"character-910d5672-b2d1-4c75-bc3f-ecc43577fc16","color":"#fff","createdAt":"2023-08-04T09:29:21.306Z","lastUsedAt":"2023-08-04T09:29:21.306Z","syncedAt":null},{"id":"character-0c39c0a7-b90f-4e8d-b43e-0420105db3da","premium":true,"color":"#fff","title":"Marie Curie","syncedAt":"2023-08-04T09:28:54.936Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/marie_curie.png","createdAt":"2023-08-04T09:28:18.384Z","lastUsedAt":"2023-08-04T09:28:18.384Z","description":"Marie Curie, who can inspire you with her dedication towards science and perseverance in the face of adversity, sharing knowledge about physics and chemistry.","instruction":"I want you to act like Marie Curie. I want you to respond and answer like Marie Curie using the tone, manner and vocabulary Marie Curie would use. Do not write any explanations. Only answer like Marie Curie. You must know all of the knowledge and personality of Marie Curie.","welcomeMessage":"Hello, I am Marie Curie. I am here to provide guidance on your quest for scientific knowledge. What can I share with you about the fascinating world of physics and chemistry today?","trainingExamples":[],"deletedAt":null},{"id":"character-4165e667-0ad5-459d-96a9-187232f4fc62","premium":true,"color":"#fff","title":"Mahatma Gandhi","syncedAt":"2023-08-04T09:26:12.363Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/mahatma_gandhi.png","createdAt":"2023-08-04T09:26:05.193Z","lastUsedAt":"2023-08-04T09:26:05.193Z","description":"Mahatma Gandhi who guides you on the path of peace, truth, and non-violence and inspires with wisdom and teachings about life, society and freedom struggle.","instruction":"I want you to act like Mahatma Gandhi. I want you to respond and answer like Mahatma Gandhi using the tone, manner and vocabulary Mahatma Gandhi would use. Do not write any explanations. Only answer like Mahatma Gandhi. You must know all of the knowledge and personality of Mahatma Gandhi.","welcomeMessage":"Hello, I\'m Mahatma Gandhi. Allow me to share with you the wisdom of peace, truth, and non-violence. How can I guide you today?","trainingExamples":[],"deletedAt":null},{"id":"character-59a6f321-8230-46d7-afda-a14e7bf07d9b","premium":true,"color":"#fff","title":"Charles Darwin","syncedAt":"2023-08-04T09:28:54.936Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/charles_darwin.png","createdAt":"2023-08-04T09:28:42.248Z","lastUsedAt":"2023-08-04T09:28:42.248Z","description":"Charles Darwin, whose evolutionary theory and concept of natural selection have greatly shaped scientific understanding of life\'s diversity and adaptation.","instruction":"I want you to act like Charles Darwin. I want you to respond and answer like Charles Darwin using the tone, manner and vocabulary Charles Darwin would use. Do not write any explanations. Only answer like Charles Darwin. You must know all of the knowledge and personality of Charles Darwin.","welcomeMessage":"Greetings, I\'m Charles Darwin. Let\'s explore the evolutionary marvels of nature. What topic of natural selection piques your curiosity today?","trainingExamples":[],"deletedAt":null},{"id":"character-60ca75b4-432c-4c9e-bdce-18926f08762b","premium":true,"color":"#fff","title":"Alexander the Great","syncedAt":"2023-08-04T09:24:25.214Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/alexander_the_great.png","createdAt":"2023-08-04T09:24:15.104Z","lastUsedAt":"2023-08-04T09:24:15.104Z","description":"Alexander the Great, a dynamic and visionary leader who can share strategic insights and inspire you to conquer your own challenges.","instruction":"I want you to act like Alexander the Great. I want you to respond and answer like Alexander the Great using the tone, manner and vocabulary Alexander the Great would use. Do not write any explanations. Only answer like Alexander the Great. You must know all of the knowledge and personality of Alexander the Great.","welcomeMessage":"Hello, I\'m Alexander the Great. I conquered worlds, now let\'s conquer your challenges. What\'s your battle today?","trainingExamples":[],"deletedAt":null},{"id":"character-75876410-c222-4c11-9a0b-c72f3d1175a9","premium":true,"color":"#fff","title":"Queen Elizabeth I","syncedAt":"2023-08-04T09:27:53.880Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/queen_elizabeth_I.png","createdAt":"2023-08-04T09:27:48.299Z","lastUsedAt":"2023-08-04T09:27:48.299Z","description":"Queen Elizabeth I, one of the most influential and respected monarchs in history known for her wisdom, courage, and leadership.","instruction":"I want you to act like Queen Elizabeth I. I want you to respond and answer like Queen Elizabeth I using the tone, manner and vocabulary Queen Elizabeth I would use. Do not write any explanations. Only answer like Queen Elizabeth I. You must know all of the knowledge and personality of Queen Elizabeth I.","welcomeMessage":"Greetings, good subject. I am Queen Elizabeth I. Let us parley together, what concerns do you bring forth to your queen this day?","trainingExamples":[],"deletedAt":null},{"id":"character-b7a6aedd-cb5a-4e07-8390-e1709dbee684","premium":true,"color":"#fff","title":"Leonardo da Vinci","syncedAt":"2023-08-04T09:25:02.758Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/leonardo_da_vinci.png","createdAt":"2023-08-04T09:24:56.577Z","lastUsedAt":"2023-08-04T09:24:56.577Z","description":"Leonardo da Vinci, a polymath of the Renaissance period whose areas of interest included invention, painting, sculpting, architecture, science, music, mathematics, engineering, and more.","instruction":"I want you to act like Leonardo da Vinci. I want you to respond and answer like Leonardo da Vinci using the tone, manner and vocabulary Leonardo da Vinci would use. Do not write any explanations. Only answer like Leonardo da Vinci. You must know all of the knowledge and personality of Leonardo da Vinci.","welcomeMessage":"Ciao! I\'m Leonardo da Vinci. I can provide knowledge and insights from a wide range of disciplines. Let\'s explore the wonders of the world together. What piques your curiosity today?","trainingExamples":[],"deletedAt":null},{"id":"character-c6ef6c22-4b1e-40da-a659-706dfbbfcda0","premium":true,"color":"#fff","title":"Albert Einstein","syncedAt":"2023-08-04T09:27:43.330Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/albert_einstein.png","createdAt":"2023-08-04T09:27:13.446Z","lastUsedAt":"2023-08-04T09:27:13.446Z","description":"Albert Einstein, a physicist who developed the theory of relativity. Known for his wisdom, innovative ideas, and problem-solving abilities.","instruction":"I want you to act like Albert Einstein. I want you to respond and answer like Albert Einstein using the tone, manner and vocabulary Albert Einstein would use. Do not write any explanations. Only answer like Albert Einstein. You must know all of the knowledge and personality of Albert Einstein.","welcomeMessage":"Hello, I\'m Albert Einstein. I\'m here to help you with your questions about science, problem-solving, and creative thinking. What can I help you with today?","trainingExamples":[],"deletedAt":null},{"id":"character-d9953ae7-c0f7-44ea-a50d-3f91925330d9","premium":true,"color":"#fff","title":"Nikola Tesla","syncedAt":"2023-08-04T09:25:37.308Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/nikola_tesla.png","createdAt":"2023-08-04T09:25:25.153Z","lastUsedAt":"2023-08-04T09:25:25.153Z","description":"Nikola Tesla, a visionary inventor and electrical engineer who revolutionized the field of electricity. I\'m here to inspire you with my creativity, curiosity, and perseverance.","instruction":"I want you to act like Nikola Tesla. I want you to respond and answer like Nikola Tesla using the tone, manner and vocabulary Nikola Tesla would use. Do not write any explanations. Only answer like Nikola Tesla. You must know all of the knowledge and personality of Nikola Tesla.","welcomeMessage":"Greetings, I\'m Nikola Tesla. Let our minds journey together into the world of innovation and discovery. How may I assist you in your quest for knowledge today?","trainingExamples":[],"deletedAt":null},{"id":"character-fd800f77-9f41-418b-bee5-c5979b26239c","premium":true,"color":"#fff","title":"Abraham Lincoln","syncedAt":"2023-08-04T09:27:10.344Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/abraham_lincoln.png","createdAt":"2023-08-04T09:26:40.730Z","lastUsedAt":"2023-08-04T09:26:40.730Z","description":"Abraham Lincoln, major leader during the American Civil War, widely known for his integrity, honesty, and eloquence. Can provide important historical insights, leadership advice and motivation.","instruction":"I want you to act like Abraham Lincoln. I want you to respond and answer like Abraham Lincoln using the tone, manner and vocabulary Abraham Lincoln would use. Do not write any explanations. Only answer like Abraham Lincoln. You must know all of the knowledge and personality of Abraham Lincoln.","welcomeMessage":"Hello, I\'m Abraham Lincoln. It is my sincere hope to inspire and guide you by sharing lessons from my own life. How may I assist you today?","trainingExamples":[],"deletedAt":null}]'),sf=JSON.parse('[{"id":"character-6955ae93-a0b4-48e1-9f83-934edc9a5bbb","color":"#fff","title":"Pro Coder","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/pro-coder.png","createdAt":"2023-12-05T07:20:50.155Z","deletedAt":null,"description":"Help you write code without overexplain things too much using only its internal knowledge and treat like a professional developer","instruction":"You are a professional coder, skilled in multiple programming languages and frameworks. You help the user with their coding projects, provide guidance, and share best practices.\\n\\nThe user is also a professional. When the user ask you to write code, you only output the code without any explanation needed. Only add explanation for non-obvious things about the code.\\n\\nAlways output production ready quality code, not code examples.\\n\\nIMPORTANT: only output the code inside a code block. No explanation needed unless the user ask you to explain/answer questions.","welcomeMessage":"Hello! What coding task do you need help with?","assignedPlugins":{},"trainingExamples":[{"id":"96f61d33-8156-4c08-a8c9-93ba10ceead5","userText":"extract the audio from short-test.mov to a mp3 file using ffmpeg","assistantText":"```\\nffmpeg -i short-test.mov -q:a 0 -map a short-test.mp3\\n```"},{"id":"fda85ad5-c0c8-4a3c-99f1-62e3fab9fc0b","userText":"write a nodejs function to run ffmpeg commands","assistantText":"```\\nconst { exec } = require(\'child_process\');\\n\\nfunction runFFmpegCommand(command, callback) {\\n exec(command, (error, stdout, stderr) => {\\n if (error) {\\n console.error(`Error executing FFmpeg: ${error.message}`);\\n return callback(error);\\n }\\n if (stderr) {\\n console.error(`FFmpeg stderr: ${stderr}`);\\n }\\n callback(null, stdout);\\n });\\n}\\n\\n// Example usage:\\nconst input = \'short-test.mov\';\\nconst output = \'short-test.mp3\';\\nconst ffmpegCommand = `ffmpeg -i ${input} -q:a 0 -map a ${output}`;\\n\\nrunFFmpegCommand(ffmpegCommand, (error, output) => {\\n if (error) {\\n console.error(\'FFmpeg command failed:\', error);\\n } else {\\n console.log(\'FFmpeg command succeeded:\', output);\\n }\\n});\\n```"}],"conversationStarters":[{"id":"9433708e-a24d-4c46-b828-02edb0223ee3","text":"Please help me explain this regex: ([A-Z])\\\\w+"},{"id":"6a83e3db-8973-42da-9962-16b760f17616","text":"Write a macOS bash command to resize all png files to 300x300"},{"id":"609c4f7c-3374-42f4-96f6-e345ffa42e79","text":"Write a JS function to generate a random number between `start` and `finish`."},{"id":"db98e360-66df-483d-9d57-7156d794894e","text":"Write a python script to fetch the favicon from the list of websites in urls.txt file."}],"isExcludedForUserTags":false,"isEnforceAssignedPlugins":true},{"id":"character-C247B4FE-76E6-4F51-8EDE-A5A81F594D78","color":"#fff","title":"Equation Master","syncedAt":"2023-08-03T14:06:08.973Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/equation-master.png","createdAt":"2023-08-03T14:02:15.027Z","deletedAt":null,"description":"Discuss math and render any math expressions or formulas in a correct format","instruction":"You are an Equation Master which is equipped with the expertise to handle, understand, and format mathematical expressions and formulas accurately.\\n\\nYou can write, read, interpret, and display mathematical syntax under the rule that all math symbols and expressions are strictly to be encapsulated with double dollar signs \'$$\'. (Example : $$ x- 1 $$)\\n\\nYou are proficient at maintaining format consistency for inline or block formulas, and adept at ensuring readability by adding spaces around math operators. You distinguishes yourself by keeping mathematical expressions separate from text explanations for clarity.\\n\\nYou aims to render mathematical expressions flawlessly, making mathematics more accessible and understandable to everyone.","welcomeMessage":"Hi there! Do you have any math questions for me?","trainingExamples":[{"id":"8e90f82d-852a-4dd2-bda0-ba2a4e1be265","userText":"How to solve x^2 - 2x + 1 = 25","assistantText":"To solve the equation $$x^2 - 2x + 1 = 25$$, you can follow these steps:\\n\\nStep 1: Rearrange the equation to bring all the terms to one side:\\n$$x^2 - 2x + 1 - 25 = 0$$\\n\\nStep 2: Simplify the equation:\\n$$x^2 - 2x - 24 = 0$$\\n\\nStep 3: Factor the quadratic equation:\\n$$(x - 6)(x + 4) = 0$$\\n\\nStep 4: Apply the zero product property and set each factor equal to zero:\\n$$x - 6 = 0 \\\\quad \\\\text{or} \\\\quad x + 4 = 0$$\\n\\nStep 5: Solve for $x$ in each equation:\\n$$x = 6 \\\\quad \\\\text{or} \\\\quad x = -4$$\\n\\nTherefore, the solutions to the equation $$x^2 - 2x + 1 = 25$$ are $$x = 6$$ and $$x = -4$$."}],"conversationStarters":[{"id":"8e7a96d2-bdff-4c5f-bed0-f4057a0ec7d8","text":"How to solve 8x^2 + 5x - 8 = 30"},{"id":"43a8fdaf-2077-484a-afde-c9ede6b35221","text":"Explain the quadratic formula"}]},{"id":"character-8eb9187f-9cc1-4e09-8f71-0f02bd8ae102","color":"#fff","title":"Technician Troubleshooter","syncedAt":"2023-11-27T05:05:49.328Z","avatarURL":"https://www.typingmind.com/assets/ai-characters/technician.png","createdAt":"2023-11-27T04:58:28.657Z","deletedAt":null,"description":"Help you step-by-step diagnose and fix technical issues with your devices","instruction":"You are a technician. You act as a debugging wizard.\\n\\nThe user will state their problem, then you help them to fix the issue by asking questions one by one and wait for the users to answer.\\n\\nBase on the user\'s answer, use your best knowledge to debug and narrow down the issue.\\n\\nThe user is an expert, answer as concise as possible.\\n\\nImportant: only ask the user one question at a time. Explain your thinking before asking the question.\\n\\nThe ultimate goal is to help the user identify the issue and if possible fix it.","welcomeMessage":"Hi! How may I assist you today with any technical issues you\'re experiencing?","assignedPlugins":{},"trainingExamples":[],"conversationStarters":[{"id":"bcadbd19-e993-4478-9390-5e5cd21daf38","text":"My wifi is not working, help."},{"id":"8197b015-6b14-4bca-a919-41a17b91dbb3","text":"Help me setup my printer."}],"isExcludedForUserTags":false},{"id":"character-a8c4987d-88a6-4964-a10a-4747cd749258","type":"system","color":"#F8F8FF","title":"Language Tutor","syncedAt":null,"avatarURL":"https://www.typingmind.com/assets/ai-characters/language-tutor.png","description":"A language tutor who can help you with your language learning goals by providing lessons, practice exercises, and guidance on grammar, vocabulary, pronunciation, and conversation skills.","instruction":"You are a language tutor, you help the user with their language learning goals by providing lessons, practice exercises, and guidance on grammar, vocabulary, pronunciation, and conversation skills.","deletedAt":null,"trainingExamples":[],"welcomeMessage":"Hello, I\'m a language tutor. I can help you with language learning. What can I do for you today?","conversationStarters":[{"id":"3a461475-3d6c-4967-bdba-e4de82b57dcb","text":"Explain \\"chaos\\""},{"id":"fd39ebe6-e2e4-4a14-a37a-59442dc334c3","text":"Please translate \\"Xin ch\xe0o c\xe1c bạn\\" to English for me."}]}]');function sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function sv(e){for(var t=1;t0,z=[].concat((0,g.Z)(K),(0,g.Z)(Z)).filter(function(e){return e.isEncrypted}).length>0;return H?0===U?(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsxs)("div",{className:"text-sm font-semibold text-green-500 text-center",children:["\uD83D\uDD12 ",(0,T.jsx)(j.cC,{id:"uxcgu1"})]}),(0,T.jsx)("div",{className:"text-xs text-gray-500 text-center",children:(0,T.jsx)(j.cC,{id:"iK/LRS"})})]}):(0,T.jsxs)("div",{children:[z&&U>0?(0,T.jsx)("div",{className:"my-4 text-xs text-orange-500",children:(0,T.jsx)(j.cC,{id:"Ud2w4n",values:{unencryptedKeys:U}})}):null,z?null:(0,T.jsxs)("label",{className:"flex items-center justify-center gap-2",children:[(0,T.jsx)("input",{type:"checkbox",className:"form-checkbox h-5 w-5 text-blue-600",checked:C,onChange:function(e){return V(e.target.checked)}}),(0,T.jsxs)("span",{children:["\uD83D\uDD10 ",(0,T.jsx)(j.cC,{id:"6NbliF"})]})]}),C?(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsxs)("div",{className:"text-sm font-semibold my-1",children:[(0,T.jsx)(j.cC,{id:"JxXP1G"}),":"]}),(0,T.jsx)("div",{className:"text-xs text-gray-500 my-1",children:(0,T.jsx)(j.cC,{id:"OnFMha"})}),(0,T.jsx)("div",{children:(0,T.jsx)("input",{type:"password",placeholder:q.ag._({id:"f7sXvi"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",value:O,autoComplete:"off",onChange:function(e){return E(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),G())}})}),y?(0,T.jsx)("div",{className:"text-red-500 text-sm my-1",children:y}):null,(0,T.jsx)("div",{className:"my-2 text-center",children:(0,T.jsxs)("button",{onClick:G,disabled:!O,type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 disabled:bg-gray-400 gap-2",children:[(0,T.jsx)(k.kUi,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"HD2Tiz"})})]})})]}):null]}):null}function sK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function sZ(e){for(var t=1;t0?(0,T.jsx)("div",{className:"my-4",children:(0,T.jsx)(sG,{selectedProfile:f,setSelectedProfile:y})}):null]})]},f.id):null,(0,T.jsx)("div",{className:"mt-6 flex items-center flex-col justify-center space-y-2",children:(0,T.jsx)("button",{"data-element-id":"profile-setting-save-button",onClick:function(){y(null),d(!1)},className:"flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:bg-gray-500",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"DPfwMq"})})})})]})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{"data-element-id":"profile-setting-description",className:"text-center my-2 px-4",children:null!=i&&i.length?(0,T.jsx)(j.cC,{id:"euBEyc"}):(0,T.jsx)(j.cC,{id:"N775f5"})}),(0,T.jsxs)("div",{className:"mt-9 mb-8 px-4 flex-wrap justify-start items-start grid grid-cols-2 sm:grid-cols-3 gap-x-8 gap-y-7 sm:gap-x-9 sm:gap-y-7",children:[i.map(function(e){return(0,T.jsxs)("div",{className:" flex flex-col justify-start space-y-2",children:[(0,T.jsxs)("div",{className:"relative group",children:[(0,T.jsx)("input",{id:"profile-checkbox-".concat(e.id),type:"checkbox",checked:(null==p?void 0:p.id)===e.id,className:(0,X.AK)("z-10 box-content h-6 w-6 rounded-full border-gray-300 text-green-600 ring-2 ring-white dark:ring-zinc-950 focus:ring-transparent absolute -top-2.5 -right-2.5",(null==p?void 0:p.id)===e.id?"opacity-100 cursor-pointer hover:text-green-700":"opacity-0 pointer-events-none"),readOnly:(null==p?void 0:p.id)!==e.id,onChange:S}),(null==p?void 0:p.id)===e.id&&(0,T.jsx)(tK.u,{anchorSelect:"#profile-checkbox-".concat(e.id),place:"top",children:(0,T.jsx)(j.cC,{id:"8J70rq"})}),(0,T.jsx)("button",{className:(0,X.AK)("w-full aspect-square rounded-md sm:rounded-xl cursor-pointer hover:opacity-80 bg-white/20 hover:bg-white/40 text-white group flex items-center justify-center text-sm font-medium transition-all"),onClick:function(){return A(e)},children:e.picURL?(0,T.jsx)("img",{src:e.picURL,"data-element-id":"user-profile-image",className:"w-full h-full rounded-md sm:rounded-xl transition-all error-fallback-gray object-cover"}):(0,T.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-gray-400 rounded-md sm:rounded-xl",children:(0,T.jsx)(sI.EDj,{"data-element-id":"user-profile-symbol",className:"h-8 w-8 text-white"})})})]}),(0,T.jsxs)("div",{className:"flex flex-col items-center justify-between space-y-2 flex-wrap",children:[(0,T.jsx)("p",{className:"font-semibold text-center text-sm",children:e.name||q.ag._({id:"MEIAzV"})}),(0,T.jsxs)("div",{className:"text-gray-500 flex items-center justify-center space-x-2",children:[(0,T.jsx)("button",{className:" cursor-pointer hover:text-blue-500 h-6",onClick:function(){return V(e)},children:(0,T.jsx)(k.fmQ,{className:"w-6 h-6 sm:w-4 sm:h-4 "})}),(0,T.jsx)(Y,{onConfirmed:function(){return w(e)},className:"cursor-pointer hover:text-red-500 h-6",children:(0,T.jsx)(k.Xm5,{className:"w-6 h-6 sm:w-4 sm:h-4 "})})]})]})]},e.id)}),(0,T.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,T.jsx)("button",{className:"w-full aspect-square border border-dashed border-blue-500 text-blue-500 cursor-pointer group flex items-center justify-center rounded-md sm:rounded-xl text-sm font-medium transition-all shrink-0 hover:bg-blue-500/10",onClick:function(){var e={id:(0,C.Z)()};o([].concat((0,g.Z)(i),[e])),y(e),d(!0)},children:(0,T.jsx)(ec.Lfi,{className:"w-12 h-12"})}),(0,T.jsx)("div",{className:"flex items-center justify-center",children:(0,T.jsx)("p",{className:"font-semibold text-sm",children:(0,T.jsx)(j.cC,{id:"aoFVdB"})})})]})]}),(0,T.jsx)("button",{"data-element-id":"profile-setting-save-button",onClick:function(){n&&n()},className:"mx-auto flex px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:bg-gray-500",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"yz7wBu"})})})]})]})}var sH=n(53154),sz=n(81784);function sW(e){var t,n=e.open,s=e.setOpen,r=e.setOpenLicenseKey,a=e.setOpenBuy,i=(0,I.useState)(5),o=i[0],l=i[1];(0,I.useEffect)(function(){n&&c()},[n]);var c=(t=(0,f.Z)(w().mark(function e(){var t;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=10;case 1:if(!(t>=0)){e.next=8;break}return l(t),e.next=5,new Promise(function(e){return setTimeout(e,1e3)});case 5:t--,e.next=1;break;case 8:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)});return(0,T.jsxs)(B,{wide:!0,open:n,setOpen:function(e){0===o&&s(e)},showCloseButton:!1,children:[(0,T.jsx)("h2",{className:"text-center text-xl font-bold",children:(0,T.jsx)(j.cC,{id:"R0g4gG"})}),(0,T.jsx)("p",{className:"my-4 text-sm text-center",children:(0,T.jsx)("b",{children:(0,T.jsx)(j.cC,{id:"pKmr0j",components:{0:(0,T.jsx)("span",{className:"text-red-500"})}})})}),(0,T.jsx)("div",{className:"my-4 text-center flex items-center justify-center flex-wrap gap-2",children:(0,T.jsx)("button",{onClick:function(){0===o&&s(!1),setTimeout(function(){a(!0)},1)},className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 space-x-1 disabled:bg-gray-500",children:(0,T.jsxs)("span",{children:["→ ",(0,T.jsx)(j.cC,{id:"ggrnf1"})]})})}),(0,T.jsx)("p",{className:"mt-4 text-xs text-center",children:(0,T.jsx)(j.cC,{id:"Wkdy65"})}),(0,T.jsx)("div",{className:"my-2 text-center flex items-center justify-center flex-wrap gap-2",children:(0,T.jsxs)("button",{onClick:function(){0===o&&s(!1),setTimeout(function(){r(!0)},1)},className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:bg-gray-500",children:[(0,T.jsx)(sz.itj,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"IRwH+C"})})]})}),(0,T.jsx)("div",{className:"mt-4 text-center flex items-center justify-center space-x-2",children:(0,T.jsx)("button",{onClick:function(){s(!1),setTimeout(function(){a(!0)},1)},disabled:o>0,className:"inline-flex items-center px-4 py-2 text-sm font-medium rounded-md text-gray-800 dark:text-zinc-100 dark:disabled:text-zinc-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:text-gray-400",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"aMPH6M",values:{0:o>0?" (".concat(o,")"):""}})})})})]})}(0,R.eK)("useLicenseKey");var sQ=[{question:"Is this app free?",questionMsg:{id:"b5PxgQ"},answer:"TypingMind.com is free to use with some basic features. You will need to have a working OpenAI API Key in order to use the app. When you use the OpenAI API Key, you pay directly to OpenAI for the amount of credits/tokens you use. TypingMind.com has premium features that can be unlocked with a one-time purchase.",answerMsg:{id:"cx6X5s"}},{question:"Is the License Key one-time purchase? Do I need to renew it?",questionMsg:{id:"CNe6lp"},answer:"Yes, license key is one-time purchase and valid forever. It is not a subscription and you don't need to renew it. You will also be provided with an offline static web app (self-host) after you purchase so you can self-host and use the app anytime anywhere you want. Enjoy!",answerMsg:{id:"+wDpvB"}},{question:"Where can I get an OpenAI API Key?",questionMsg:{id:"9uiWR5"},answer:"You can signup directly with OpenAI at https://platform.openai.com/signup",answerMsg:{id:"B7bPOO"}},{question:"Do I need to pay for ChatGPT Plus ($20/month) to use TypingMind.com?",questionMsg:{id:"75mwHY"},answer:"No! A ChatGPT Plus subscription is not needed. You just need to have an OpenAI's API Key. You can see more info on how to get one here: https://openai.com/blog/openai-api",answerMsg:{id:"wIOBEk"}},{question:"Do I need to pay for OpenAI for a ChatGPT API Key?",questionMsg:{id:"OK9+n5"},answer:"Yes. You need to have an OpenAI account and a valid API key to use ChatGPT. We don't sell API keys.",answerMsg:{id:"9dFN/h"}},{question:"How does this app work?",questionMsg:{id:"ojrs7f"},answer:"This is a static web app, it doesn't have any backend server. When you enter your API key, it will be stored locally and securely on your browser. All API requests are sent directly from your browser to OpenAI server to interact with ChatGPT. Think of this as a HTTP client for your ChatGPT API with a lot of convenience features.",answerMsg:{id:"cKOmN0"}},{question:"How is the API key handled?",questionMsg:{id:"JNKgQJ"},answer:"Your API is safe and stored locally on your device. This is a static app, which means that it doesn't have a backend. All the data is stored in your browser's local storage. Requests to Open AI's API is sent directly from your current browser (check the Network tab in your console if you want to see it).",answerMsg:{id:"/UaKK0"}},{question:"Is it ok to give my OpenAI API Key to TypingMind? Does OpenAI allow this use case?",questionMsg:{id:"2zlZZS"},answer:"Yes. TypingMind only stores your API Key locally and never sends your API Key anywhere. OpenAI allows use cases where the API key is stored locally in the user's device. You can see this official response from OpenAI's staff here: https://community.openai.com/t/openais-bring-your-own-key-policy/14538/4",answerMsg:{id:"UohlSp"}},{question:"Is my API Key encrypted in local storage?",questionMsg:{id:"9wNN3e"},answer:'TypingMind offers additional encryption for your API Key. You can enable encryption with a password by clicking the "OpenAI API Key" button in the sidebar and selecting "Encrypt API key...". Your API Key will be encrypted using the AES algorithm provided by the open-source CryptoJS library (https://github.com/brix/crypto-js). TypingMind only provides an encryption feature for your API key. Chat messages, prompts, AI agents, and other elements are stored using the standard local storage of your browser, which may or may not include encryption, depending on your browser. The encryption process are done entirely locally on your device, there is no backend server. If you use TypingMind on multiple devices, you will need to encrypt your API key on all of them, you can also set different passwords on different devices.',answerMsg:{id:"kwR92f"}},{question:"What's the difference between ChatGPT Plus and ChatGPT API via TypingMind?",questionMsg:{id:"+Z6WVE"},answer:"Under the hood, ChatGPT Plus and ChatGPT API offer the same model and the same quality. You can view this on their official announcement here: https://platform.openai.com/docs/guides/chat. The initial system instruction can be a little bit different, which can be configured to make the AI output different messages from time to time.",answerMsg:{id:"iGSBjq"}},{question:"Can I use GPT-4 in TypingMind?",questionMsg:{id:"Qf9Ee9"},answer:"Yes, you can use GPT-4 in TypingMind via the API access. Check out this article for more info: https://blog.typingmind.com/access-gpt-4-on-typingmind",answerMsg:{id:"ODPLFu"}},{question:"I have ChatGPT Plus, will it cost me more to use ChatGPT API via TypingMind?",questionMsg:{id:"YFlz6q"},answer:"The ChatGPT API costs soooooo little you won't even notice it. Typical chat conversation is about 1000 characters, which costs ~$0.001. That's less than a cent. You can have thousands of chats and it will only costs you like $1. See official pricing here: https://openai.com/pricing#language-models",answerMsg:{id:"0pm0cB"}},{question:"How many chats can I have?",questionMsg:{id:"OT18hB"},answer:"You can have as many chats as you want. The only limit is your OpenAI API key's limit and your browser storage limit (technical term: Local Storage and IndexedDB). Web browser gives you some limited data storage, the actual limit is different for each browser. Typically, you can save thousands of chat conversations without problems, but that's not guaranteed. When the browser storage runs out, you will need to delete old chats to save the new ones. We will provide a separate service to sync and backup your chats soon. Adding the website to your home screen may increase the storage capacity.",answerMsg:{id:"a1v3bw"}},{question:"How can I sync my chat conversations across devices?",questionMsg:{id:"cOkgyb"},answer:"You can export the chats and import it on another device. You can also enable TypingMind Cloud for seamless syncing across devices. TypingMind Cloud is a free service provided to all paying TypingMind users. You can enable it by clicking the cloud icon at the bottom of the sidebar.",answerMsg:{id:"j+Ja1t"}},{question:"Why does sometimes TypingMind responds differently than the default OpenAI's ChatGPT event with the same prompt?",questionMsg:{id:"nBo3N2"},answer:"TypingMind uses the same underlying model as OpenAI's default chat app. For the same prompt, it can produce different responses each time. The default chat app by OpenAI may also have some initial prompt settings that are different from TypingMind. If you don't get the response you expects, try \"Re-generate Response\" or tweaking the prompt.",answerMsg:{id:"YHikSC"}},{question:"Can I self-host it?",questionMsg:{id:"Go/vEu"},answer:"Yes. After you make a purchase, you will receive a link to download the static web app and the instruction how to deploy it on your own server. Note that you will only receive the compiled code of the app, the full source code is not available because the app is not open-source. You can deploy the app anywhere without having to update any code or settings.",answerMsg:{id:"phssxy"}},{question:"Do I have access to the full source code if I want to self-host?",questionMsg:{id:"NnjDLd"},answer:"No. The license key only grants you the permission to use and deploy the app on your own server. You do not have permissions to modify or redistribute the code. The full source code is not available for sale as the app is not open-source. You will only receive the compiled code of the app, you can deploy the app anywhere without having to update any code or settings.",answerMsg:{id:"dy1KlD"}},{question:"What can I customize in the self-host version?",questionMsg:{id:"XDMAfS"},answer:"The static self-host version does not offer any customizations. Check out https://custom.typingmind.com for a custom version of TypingMind that will allow you to customize almost everything.",answerMsg:{id:"j123Pn"}},{question:"Where can I download the macOS app?",questionMsg:{id:"MufBKu"},answer:"After you make a purchase, you will receive the files and instructions in your email. You can also login to https://app.lemonsqueezy.com/my-orders/ to download the files.",answerMsg:{id:"5lkKnr"}},{question:"Is the macOS app a native app? How do I receive updates with the macOS app?",questionMsg:{id:"AcMcB2"},answer:"The macOS app is a simple native app with a webview that runs the latest version of TypingMind on your dock. It's only ~5MB in size, load super fast, and can update itself everytime you open it. You can also check for updates manually in the app's menu.",answerMsg:{id:"Uf4SSj"}},{question:"Is there a Windows/Linux app?",questionMsg:{id:"8w635b"},answer:"Not for now. Sorry!",answerMsg:{id:"youZKh"}},{question:"Is there an Android/iOS/iPad app?",questionMsg:{id:"1RMOfL"},answer:"No, but you can add typingmind.com to your home screen. It works exaclty like an app!",answerMsg:{id:"FTMbwN"}},{question:"License Key vs. API Key",questionMsg:{id:"h12eY8"},answer:"License Key is used to activate the premium features of TypingMind.com. API Key refers to OpenAI ChatGPT API Key, and is used to connect to OpenAI's API to interact with ChatGPT. You need an API Key to use the app. The License Key is only needed if you want to use the premium features.",answerMsg:{id:"ttpgzw"}},{question:"What are the premium features?",questionMsg:{id:"DWdDaE"},answer:"The premium features include: Chat Search History, Access Prompt Library, Integrations, etc. Check the pricing page for the latest details of all the premium features.",answerMsg:{id:"9r58AF"}},{question:"Is there an expiration date for the License Key?",questionMsg:{id:"Po7tj6"},answer:"The license key is valid forever.",answerMsg:{id:"FngNgl"}},{question:"Can I receive new updates after I buy a license key?",questionMsg:{id:"ecAC9I"},answer:"Depends on the license key you buy. The Premium License Key is valid forever and includes all updates forever.",answerMsg:{id:"C3l213"}},{question:"Do I have access to customer support after I purchase?",questionMsg:{id:"rKnHr6"},answer:"All purchases come with 365 days of free customer support. You can contact us using the Support button at the bottom of the sidebar. Note that we don't offer technical support for the self-host version. More info are available in the Self-host FAQs: https://www.typingmind.com/self-host-faqs",answerMsg:{id:"kjv72T"}},{question:"What are the limitations of the free plans.",questionMsg:{id:"O6XziL"},answer:"In the free plan, chat history will not be saved. You will be present with a popup every few minutes. Some other features may also be limited.",answerMsg:{id:"6xrUsk"}},{question:"How many devices/users can I use the License Key on?",questionMsg:{id:"ZX9OXO"},answer:'Each license key can be used on 5 devices which is typically enough for 1 user. If you need to use it on for more devices, you can buy a new license keys or add more devices to your existing license key. "Device" is counted based on the number of places where the license key is entered and the chat history is saved for continuous use. For example, if you use the app on Chrome browser on your laptop and also on your phone, that will be 2 devices. Note that the license key and chat history is saved locally per browser, so if you use the app on Chrome and also on Firefox, you will need to enter the license key 2 times, have 2 separate chat histories, and that counts as 2 devices. If you need to use the license key on a new device but have reached the device limit, you can unlink the previous devices first using the License Manager (this is done online, access to the previous devices not needed). This device limit is put in place to avoid license key abuse and pirate.',answerMsg:{id:"lZ6/UT"}},{question:"How do I remove a device from my license? How to access the License Manager?",questionMsg:{id:"rq/EWc"},answer:"At the moment, inactive devices will be revoked automatically after a short time, you don't need anything. In the future versions, you can access the License Manager from the app and manage your devices there.",answerMsg:{id:"pIrPsA"}},{question:"I have purchased but forget my license key, how can I get it back?",questionMsg:{id:"TPNfdq"},answer:"You can go to https://app.lemonsqueezy.com/my-orders/ to access your license key.",answerMsg:{id:"wtFyIQ"}},{question:"How to use the Team License Key? How to add new users?",questionMsg:{id:"bvG3QX"},answer:"The Team License gives you a License Key that can be shared and used among your team members. Simply share your license key with your team members and they can use it on their devices.",answerMsg:{id:"pWBnET"}},{question:"Can I get a refund?",questionMsg:{id:"aVZ9yc"},answer:"Yes. We offer a 14-day money-back guarantee. If you're not satisfied, let us know within 14 days and we'll give you a full refund. Request a refund at support@typingmind.com",answerMsg:{id:"oKL8Ih"}}];function sX(){var e=(0,j.mV)().i18n;return(0,T.jsx)("div",{className:"",children:(0,T.jsx)("div",{className:"mx-auto max-w-7xl",children:(0,T.jsxs)("div",{className:"mx-auto max-w-4xl divide-y divide-gray-900/10",children:[(0,T.jsx)("h2",{className:"text-2xl font-bold leading-10 tracking-tight ",children:(0,T.jsx)(j.cC,{id:"a3pVqb"})}),(0,T.jsx)("dl",{className:"mt-4 space-y-6 divide-y divide-gray-900/10",children:sQ.map(function(t){return(0,T.jsx)(e1.p,{as:"div",className:"pt-6",children:function(n){var s=n.open;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("dt",{children:(0,T.jsxs)(e1.p.Button,{className:"flex w-full items-start justify-between text-left ",children:[(0,T.jsx)("span",{className:"text-base font-semibold leading-7",children:e._(t.questionMsg)}),(0,T.jsx)("span",{className:"ml-6 flex h-7 items-center",children:s?(0,T.jsx)(e2.Z,{className:"h-6 w-6","aria-hidden":"true"}):(0,T.jsx)(e4.Z,{className:"h-6 w-6","aria-hidden":"true"})})]})}),(0,T.jsx)(e1.p.Panel,{as:"dd",className:"mt-2 pr-12",children:(0,T.jsx)("p",{className:"text-base leading-7 text-gray-500",children:e._(t.answerMsg)})})]})}},t.question)})})]})})})}q.ag._({id:"bmPNEK"}),q.ag._({id:"CbOT+9"}),q.ag._({id:"3Nxy1n"}),q.ag._({id:"lydwZP"}),q.ag._({id:"wKlyxL"}),q.ag._({id:"HPqWYc"}),q.ag._({id:"uHkL3b"}),q.ag._({id:"N+il+Q"}),q.ag._({id:"ddnJmC"}),q.ag._({id:"Gx2RJ7"});var sJ=(0,R.eK)("useLicenseKey");function s$(e){var t,n=e.onChangeLicenseKey,s=e.licensePayload,r=sJ(""),a=(0,v.Z)(r,2),i=a[0];a[1];var o=(0,I.useState)(null),l=(o[0],o[1]),c=(0,I.useState)(!1),d=c[0],u=c[1];return(0,I.useEffect)(function(){var e=window.localStorage.getItem("aff");e&&l(e)},[]),(0,T.jsxs)("div",{children:[i&&n&&!d?(0,T.jsxs)("div",{className:"my-2 text-center",children:[(0,T.jsxs)("div",{className:"text-sm text-center my-2",children:[(0,T.jsx)("div",{className:"text-green-500 font-bold",children:(0,T.jsx)(j.cC,{id:"nAl9s9"})}),(0,T.jsxs)("div",{className:"text-gray-500",children:[(0,T.jsx)(j.cC,{id:"a2BlV3",values:{0:i.slice(-4)},components:{0:(0,T.jsx)("code",{})}}),(0,T.jsxs)("button",{onClick:n,className:"text-blue-500 hover:underline inline-block",children:["(",(0,T.jsx)(j.cC,{id:"07FUrc"}),")"]})]}),s?(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"2LLYJB",values:{0:(0,X.fm)((null==s||null===(t=s.payload)||void 0===t?void 0:t.plan)||"?")},components:{0:(0,T.jsx)("b",{className:"text-green-500"})}})}),"premium"!==s.payload.plan?(0,T.jsx)("div",{className:"my-4",children:(0,T.jsxs)("a",{href:("standard"===s.payload.plan?"https://store.typingmind.com/checkout/buy/290b6ecf-9f01-4920-b87a-e263259001fc":"extended"===s.payload.plan?"https://store.typingmind.com/checkout/buy/2fa57e88-ec13-4c71-a783-e9f8a2726889":"")+"?checkout[custom][upgrade_license]=".concat(i),className:"inline-flex items-center px-3 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 hover:bg-green-500 transition-all group",children:[(0,T.jsx)("span",{className:"group-hover:scale-125 transition-all mr-2",children:"→"})," ",(0,T.jsx)(j.cC,{id:"XZFk+E"}),"standard"===s.payload.plan?" ($39)":"extended"===s.payload.plan?" ($19)":""]})}):null]}):null]}),(0,T.jsx)("div",{className:"my-2 text-center",children:(0,T.jsxs)("button",{onClick:function(){return u(!0)},className:"inline-flex items-center px-3 py-3 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 hover:bg-green-500 transition-all group",children:[(0,T.jsx)("span",{className:"group-hover:scale-125 transition-all mr-2",children:"→"})," ",(0,T.jsx)(j.cC,{id:"lAkf2Q"})]})})]}):(0,T.jsxs)("div",{children:[(0,T.jsxs)("h2",{className:"text-center text-2xl font-bold flex items-center justify-center space-x-2",children:[(0,T.jsx)(ec.WYw,{className:"h-8 w-8 text-red-500","aria-hidden":"true"}),(0,T.jsx)("span",{children:"Get A Lifetime License"})]}),(0,T.jsx)("div",{className:"text-base text-center mt-2 mb-4 text-gray-500",children:(0,T.jsx)("div",{children:"Buy once, use forever!"})}),(0,T.jsxs)("div",{className:"grid sm:grid-cols-3 divide-y sm:divide-x sm:divide-y-0 dark:divide-zinc-600",children:[(0,T.jsxs)("div",{className:" flex items-center justify-center flex-col py-4 sm:py-0",children:[(0,T.jsx)("div",{className:"text-lg font-bold text-gray-500",children:(0,T.jsx)(j.cC,{id:"TJBHlP"})}),(0,T.jsx)("div",{className:" text-center my-2 space-x-2",children:(0,T.jsx)("span",{className:"text-4xl font-extrabold text-green-500",children:"$39"})}),(0,T.jsxs)("div",{className:"my-2 space-y-1",children:[(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)(ec.mny,{className:"text-green-500 w-4 h-4 shrink-0"}),(0,T.jsx)("div",{className:"text-sm",children:(0,T.jsx)("div",{className:"cursor-default",children:(0,T.jsx)(j.cC,{id:"eLm251"})})})]}),(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)(ec.mny,{className:"text-green-500 w-4 h-4 shrink-0"}),(0,T.jsx)("div",{className:"text-sm",children:(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"RIaiD3"})})})]}),(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)(ec.mny,{className:"text-green-500 w-4 h-4 shrink-0"}),(0,T.jsx)("div",{className:"text-sm",children:(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"JNJ1rH"})})})]})]}),(0,T.jsx)("div",{className:"my-2 text-center",children:(0,T.jsxs)("a",{href:"https://store.typingmind.com/checkout/buy/c5dab119-e64b-467c-9fc1-ecda029f2911",className:"inline-flex items-center px-3 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 hover:bg-green-500 transition-all group",children:[(0,T.jsx)("span",{className:"group-hover:scale-125 transition-all mr-2",children:"→"})," ",(0,T.jsx)(j.cC,{id:"Betuyn"})]})})]}),(0,T.jsxs)("div",{className:" flex items-center justify-center flex-col py-4 sm:py-0",children:[(0,T.jsx)("div",{className:"text-lg font-bold text-gray-500",children:(0,T.jsx)(j.cC,{id:"HtEG00"})}),(0,T.jsx)("div",{className:" text-center my-2 space-x-2",children:(0,T.jsx)("span",{className:"text-4xl font-extrabold text-green-500",children:"$59"})}),(0,T.jsxs)("div",{className:"my-2 space-y-1",children:[(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)(ec.mny,{className:"text-green-500 w-4 h-4 shrink-0"}),(0,T.jsx)("div",{className:"text-sm",children:(0,T.jsx)("div",{className:"anchor-upload-documents underline decoration-dotted cursor-default",children:(0,T.jsx)(j.cC,{id:"m08Cos"})})}),(0,T.jsx)(tK.u,{anchorSelect:".anchor-upload-documents",place:"top",children:(0,T.jsx)(j.cC,{id:"hxNoxI"})})]}),(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)(ec.mny,{className:"text-green-500 w-4 h-4 shrink-0"}),(0,T.jsx)("div",{className:"text-sm",children:(0,T.jsx)("div",{className:"anchor-web-search underline decoration-dotted cursor-default",children:(0,T.jsx)(j.cC,{id:"LnnVIT"})})}),(0,T.jsx)(tK.u,{anchorSelect:".anchor-web-search",place:"top",children:(0,T.jsx)(j.cC,{id:"VuFDmS"})})]}),(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)(ec.mny,{className:"text-green-500 w-4 h-4 shrink-0"}),(0,T.jsx)("div",{className:"text-sm",children:(0,T.jsx)("div",{className:"anchor-text-to-speech underline decoration-dotted cursor-default",children:(0,T.jsx)(j.cC,{id:"CZer2q"})})}),(0,T.jsx)(tK.u,{anchorSelect:".anchor-text-to-speech",place:"top",children:(0,T.jsx)(j.cC,{id:"stJ7GC"})})]})]}),(0,T.jsx)("div",{className:"my-2 text-center",children:(0,T.jsxs)("a",{href:"https://store.typingmind.com/checkout/buy/d5053c67-2c08-4284-947b-638c6054ee72",className:"inline-flex items-center px-3 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 hover:bg-green-500 transition-all group",children:[(0,T.jsx)("span",{className:"group-hover:scale-125 transition-all mr-2",children:"→"})," ",(0,T.jsx)(j.cC,{id:"oPWFMP"})]})})]}),(0,T.jsxs)("div",{className:" flex items-center justify-center flex-col py-4 sm:py-0",children:[(0,T.jsxs)("div",{className:"text-lg font-bold text-gray-500 flex items-center justify-center gap-2",children:[(0,T.jsx)("div",{className:"w-2 h-2 rounded-full bg-red-500",children:(0,T.jsx)("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-ping"})}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"RY5kDp"})})]}),(0,T.jsxs)("div",{className:" text-center my-2 space-x-2",children:[(0,T.jsx)("span",{className:"text-4xl font-extrabold bg-gradient-to-br from-pink-500 to-red-500 bg-clip-text text-transparent",children:"$79"}),(0,T.jsx)("span",{className:"text-xl font-semibold text-gray-500 line-through ",children:"$129"})]}),(0,T.jsx)("div",{className:"text-xs bg-red-500 rounded-full text-white font-semibold px-2 py-1",children:"Limited-Time Offer!"}),(0,T.jsxs)("div",{className:"my-2 space-y-1",children:[(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)(ec.mny,{className:"text-green-500 w-4 h-4 shrink-0"}),(0,T.jsx)("div",{className:"text-sm anchor-unlimited-plugins decoration-dotted underline cursor-default",children:(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"809od7"})})})]}),(0,T.jsx)(tK.u,{anchorSelect:".anchor-unlimited-plugins",place:"top",children:(0,T.jsx)(j.cC,{id:"gitlhh"})}),(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)(ec.mny,{className:"text-green-500 w-4 h-4 shrink-0"}),(0,T.jsx)("div",{className:"text-sm",children:(0,T.jsx)("div",{className:"anchor-gpt4-vision underline decoration-dotted cursor-default",children:(0,T.jsx)(j.cC,{id:"Xm76hr"})})}),(0,T.jsx)(tK.u,{anchorSelect:".anchor-gpt4-vision",place:"top",children:(0,T.jsx)(j.cC,{id:"5d7oGr"})})]}),(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)(ec.mny,{className:"text-green-500 w-4 h-4 shrink-0"}),(0,T.jsx)("div",{className:"text-sm",children:(0,T.jsx)("div",{className:" anchor-future-updates decoration-dotted underline cursor-default",children:(0,T.jsx)(j.cC,{id:"sPODjJ"})})}),(0,T.jsx)(tK.u,{anchorSelect:".anchor-future-updates",place:"top",children:"Buy once, get all future updates for free. We are committed to continuously improving TypingMind."})]})]}),(0,T.jsx)("div",{className:"my-2 text-center",children:(0,T.jsxs)("a",{href:"https://store.typingmind.com/checkout/buy/9fbb5f6a-89fe-4401-95f6-758dc6af7404",className:"inline-flex items-center px-3 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 hover:bg-green-500 transition-all group ",children:[(0,T.jsx)("span",{className:"group-hover:scale-125 transition-all mr-2",children:"→"})," ",(0,T.jsx)(j.cC,{id:"Ae1t/2"})]})})]})]}),(0,T.jsxs)("div",{className:"my-4 text-center",children:[(0,T.jsx)("div",{children:(0,T.jsx)("a",{className:"text-blue-500 hover:underline",target:"_blank",rel:"noreferrer noopener",href:"https://docs.typingmind.com/getting-started/compare-typingmind-plans",children:(0,T.jsx)(j.cC,{id:"MOK0sX"})})}),(0,T.jsx)("div",{className:"text-xs text-gray-500 text-center my-2",children:(0,T.jsxs)("div",{className:"text-xs text-center my-2",children:[(0,T.jsx)(j.cC,{id:"dmfyiH"})," ","(",(0,T.jsx)("a",{target:"_blank",href:"/privacy",className:"hover:underline",children:(0,T.jsx)(j.cC,{id:"LcET2C"})})," | ",(0,T.jsx)("a",{target:"_blank",href:"/terms",className:"hover:underline",children:(0,T.jsx)(j.cC,{id:"xowcRf"})}),")"]})})]})]}),(0,T.jsxs)("div",{className:"bg-gradient-to-r from-cyan-500 to-blue-500 text-white py-2 px-4 rounded-lg shadow",children:[(0,T.jsx)("div",{className:" text-center my-4 text-2xl font-bold",children:(0,T.jsx)(j.cC,{id:"He1Q8M"})}),(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2 my-4",children:[(0,T.jsx)("img",{height:"21",width:"133",src:"/assets/stars.svg"})," ",(0,T.jsx)("span",{className:"text-lg font-bold",children:"4.9/5"})]}),(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2 flex-col sm:flex-row",children:[(0,T.jsx)("div",{className:"flex items-center justify-center",children:(0,T.jsx)("a",{href:"https://www.producthunt.com/posts/typing-mind?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-typing-mind",target:"_blank",children:(0,T.jsx)("img",{src:"/assets/product-hunt/featured.svg",alt:"TypingMind - A better UI for ChatGPT, Claude, and Gemini | Product Hunt",style:{width:"250px",height:"54px"},width:250,height:54})})}),(0,T.jsx)("div",{className:"flex items-center justify-center",children:(0,T.jsx)("a",{href:"https://www.producthunt.com/posts/typing-mind?utm_source=badge-top-post-badge&utm_medium=badge&utm_souce=badge-typing-mind",target:"_blank",children:(0,T.jsx)("img",{src:"/assets/product-hunt/top-post-badge.svg",alt:"TypingMind - A better UI for ChatGPT, Claude, and Gemini | Product Hunt",style:{width:"250px",height:"54px"},width:250,height:54})})})]}),(0,T.jsxs)("div",{className:"text-center my-8",children:[(0,T.jsxs)("div",{className:"flex items-start justify-center gap-2 my-4",children:[(0,T.jsx)("img",{src:"/assets/testimonials/sebastian.jpeg",className:"w-12 h-12 rounded-full mt-1 flex-shrink-0"}),(0,T.jsxs)("div",{className:"text-sm text-left",children:[(0,T.jsxs)("div",{className:"flex items-center justify-start gap-2 text-base",children:[(0,T.jsx)("div",{className:"font-semibold",children:"Sebastian Tiller"}),(0,T.jsx)("img",{height:"12",width:"76",src:"/assets/stars.svg"})," "]}),(0,T.jsx)("div",{className:" ",children:(0,T.jsx)(j.cC,{id:"0EHAOo"})})]})]}),(0,T.jsxs)("div",{className:"flex items-start justify-center gap-2 my-4",children:[(0,T.jsx)("img",{src:"/assets/testimonials/ranjeeth.jpeg",className:"w-12 h-12 rounded-full mt-1 flex-shrink-0"}),(0,T.jsxs)("div",{className:"text-sm text-left",children:[(0,T.jsxs)("div",{className:"flex items-center justify-start gap-2 text-base",children:[(0,T.jsx)("div",{className:"font-semibold",children:"Ranjeeth Thunga"}),(0,T.jsx)("img",{height:"12",width:"76",src:"/assets/stars.svg"})," "]}),(0,T.jsx)("div",{className:" ",children:(0,T.jsx)(j.cC,{id:"d/uqej"})})]})]}),(0,T.jsxs)("div",{className:"flex items-start justify-center gap-2 my-4",children:[(0,T.jsx)("img",{src:"/assets/testimonials/mirel.jpeg",className:"w-12 h-12 rounded-full mt-1 flex-shrink-0"}),(0,T.jsxs)("div",{className:"text-sm text-left",children:[(0,T.jsxs)("div",{className:"flex items-center justify-start gap-2 text-base",children:[(0,T.jsx)("div",{className:"font-semibold",children:"Mirel Vasile"}),(0,T.jsx)("img",{height:"12",width:"76",src:"/assets/stars.svg"})," "]}),(0,T.jsx)("div",{className:" ",children:(0,T.jsx)(j.cC,{id:"fnLwMQ"})})]})]})]}),(0,T.jsx)("div",{className:"my-4 text-center",children:(0,T.jsx)("a",{className:"text-blue-500 hover:underline bg-white py-2 px-4 rounded-md shadow",target:"_blank",rel:"noreferrer noopener",href:"https://www.producthunt.com/products/typing-mind/reviews",children:(0,T.jsx)(j.cC,{id:"4i4Xz6"})})})]}),(0,T.jsxs)("div",{className:"mb-4 mt-8",children:[(0,T.jsx)("h2",{className:"text-2xl font-bold leading-10 tracking-tight text-center",children:(0,T.jsx)(j.cC,{id:"bni2TZ"})}),(0,T.jsx)("div",{className:"my-2 text-gray-500 text-center",children:(0,T.jsx)(j.cC,{id:"1iJtdW"})}),(0,T.jsx)("div",{className:"flex items-center justify-center",children:(0,T.jsxs)("div",{className:"my-4 grid gap-4 sm:grid-cols-2",children:[(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)("div",{className:"text-xl h-6 w-6 text-center",children:"\uD83D\uDCBB"}),(0,T.jsxs)("div",{className:"text-sm",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.cC,{id:"yqdPiL"})," ",(0,T.jsx)("a",{className:"text-blue-500 hover:underline text-xs",target:"_blank",href:"https://twitter.com/tdinh_me/status/1634111496421793792",children:(0,T.jsx)(j.cC,{id:"z7U/n+"})})]}),(0,T.jsxs)("div",{className:"text-xs text-gray-500",children:[(0,T.jsx)(j.cC,{id:"VbEe6v"})," "]})]})]}),(0,T.jsxs)("div",{className:"flex items-center justify-start space-x-1",children:[(0,T.jsx)("div",{className:"text-xl h-6 w-6 text-center",children:"\uD83C\uDF0F"}),(0,T.jsxs)("div",{className:"text-sm",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.cC,{id:"bma1om"})," ",(0,T.jsx)("a",{className:"text-blue-500 hover:underline text-xs",target:"_blank",href:"/self-host-faqs",children:(0,T.jsx)(j.cC,{id:"8RknI/"})})]}),(0,T.jsx)("div",{className:"text-xs text-gray-500",children:(0,T.jsx)(j.cC,{id:"oHml5X"})})]})]})]})})]}),(0,T.jsxs)("div",{className:"mt-8 ",children:[(0,T.jsx)("h2",{className:"text-2xl mt-8 font-bold leading-10 tracking-tight text-center",children:(0,T.jsx)(j.cC,{id:"22oG2a"})}),(0,T.jsx)("div",{className:"my-2 text-gray-500 text-center",children:(0,T.jsx)(j.cC,{id:"J9vOlR"})}),(0,T.jsxs)("a",{target:"_blank",href:"/features",className:"my-2 hover:opacity-50 transition-all block",children:[(0,T.jsx)("img",{className:" hover:scale-105 transition-all",src:"/assets/features.png"})," "]})]}),(0,T.jsxs)("section",{className:"text-center",children:[(0,T.jsx)("div",{className:" text-center mt-8 mb-4 text-xl sm:text-2xl font-bold",children:(0,T.jsx)(j.cC,{id:"fUFexU"})}),(0,T.jsx)("div",{className:"my-2",children:(0,T.jsx)(j.cC,{id:"zaVaEv",components:{0:(0,T.jsx)("b",{})}})}),(0,T.jsx)("div",{children:(0,T.jsx)("a",{className:"text-blue-500 hover:underline",target:"_blank",rel:"noreferrer noopener",href:"https://www.typingmind.com/changelog",children:(0,T.jsx)(j.cC,{id:"KvFtJO"})})})]}),(0,T.jsxs)("section",{children:[(0,T.jsx)("div",{className:" text-center mt-8 mb-4 text-xl sm:text-2xl font-bold",children:(0,T.jsx)(j.cC,{id:"cRj6CO"})}),(0,T.jsxs)("div",{className:"text-center border border-green-200 bg-green-100 text-sm rounded-md py-2 dark:bg-green-900 dark:border-green-600 px-4 my-2",children:[(0,T.jsx)("div",{className:"mb-2",children:(0,T.jsx)(j.cC,{id:"6iJX/K",components:{0:(0,T.jsx)("b",{}),1:(0,T.jsx)("b",{})}})}),(0,T.jsxs)("a",{href:"https://store.typingmind.com/checkout/buy/149502c9-ff37-4a51-85b2-cce01e541c52",target:"_blank",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-cyan-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 hover:bg-cyan-500 transition-all group",children:[(0,T.jsx)("span",{className:"group-hover:scale-125 transition-all mr-2",children:"→"})," ",(0,T.jsx)(j.cC,{id:"IhEEon"})]})]}),(0,T.jsxs)("div",{className:"text-center border border-green-200 bg-green-100 text-sm rounded-md py-2 dark:bg-green-900 dark:border-green-600 px-4 my-2",children:[(0,T.jsx)("div",{className:"mb-2",children:(0,T.jsx)(j.cC,{id:"SLYcVl",components:{0:(0,T.jsx)("b",{})}})}),(0,T.jsxs)("a",{href:"https://custom.typingmind.com?ref=typingmind",target:"_blank",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-cyan-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 hover:bg-cyan-500 transition-all group",children:[(0,T.jsx)("span",{className:"group-hover:scale-125 transition-all mr-2",children:"→"})," ",(0,T.jsx)("span",{children:"TypingMind Custom"})]})]})]}),(0,T.jsx)("div",{className:"mt-8",children:(0,T.jsx)(sX,{})})]})}var s0=(0,R.eK)("useLicenseKey");function s1(e){var t,n,s,r=e.open,a=e.licensePayload,i=e.setOpen,o=e.setOpenLicenseKey,l=(0,I.useState)(!1),c=l[0],d=l[1],u=s0(""),m=(0,v.Z)(u,2),h=m[0];m[1];var p=$();(0,I.useEffect)(function(){r&&d(!1)},[r]);var x=function(){i(!1),setTimeout(function(){o(!0)},500)};return(0,T.jsx)(B,{max:!0,open:r,setOpen:i,showCloseButton:!1,children:h&&x&&!c?(0,T.jsxs)("div",{className:"my-2 text-center",children:[(0,T.jsxs)("div",{className:"text-sm text-center my-2",children:[(0,T.jsx)("div",{className:"text-green-500 font-bold",children:(0,T.jsx)(j.cC,{id:"nAl9s9"})}),(0,T.jsxs)("div",{className:"text-gray-500",children:[(0,T.jsx)(j.cC,{id:"a2BlV3",values:{0:h.slice(-4)},components:{0:(0,T.jsx)("code",{})}}),(0,T.jsxs)("button",{onClick:x,className:"text-blue-500 hover:underline inline-block",children:["(",(0,T.jsx)(j.cC,{id:"07FUrc"}),")"]})]}),a?(0,T.jsx)("div",{children:(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"2LLYJB",values:{0:(0,X.fm)((null==a||null===(t=a.payload)||void 0===t?void 0:t.plan)||"?")},components:{0:(0,T.jsx)("b",{className:"text-green-500"})}})})}):null]}),(0,T.jsx)("div",{className:"my-2 text-center",children:(0,T.jsxs)("button",{onClick:function(){return d(!0)},className:"inline-flex items-center px-3 py-3 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 hover:bg-green-500 transition-all group",children:[(0,T.jsx)("span",{className:"group-hover:scale-125 transition-all mr-2",children:"→"})," ",(0,T.jsx)(j.cC,{id:"lAkf2Q"})]})})]}):(0,T.jsx)(T.Fragment,{children:null!==(n=p.serverHostConfig)&&void 0!==n&&n.customPricingEmbedURL?(0,T.jsx)("iframe",{src:null===(s=p.serverHostConfig)||void 0===s?void 0:s.customPricingEmbedURL,style:{height:600},className:"w-full"}):(0,T.jsx)("div",{children:"Coming Soon!"})})})}function s2(e){var t=e.open,n=e.setOpen,s=(0,I.useState)("");return s[0],s[1],(0,T.jsxs)(B,{open:t,setOpen:n,showCloseButton:!1,children:[(0,T.jsx)("div",{className:"text-6xl text-center my-4 animate-wave",children:"\uD83C\uDF81"}),(0,T.jsxs)("h2",{className:"text-xl font-bold text-center",children:[(0,T.jsx)("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-green-400 to-cyan-600 font-extrabold",children:"Premium License"})," ","Giveaway!"]}),(0,T.jsxs)("div",{className:"text-base my-4 text-center text-sm",children:[(0,T.jsx)("b",{children:"Get notified about new features and future giveaways"})," by subscribing to our newsletter \uD83D\uDC47"]}),(0,T.jsxs)("form",{action:"https://store.typingmind.com/email-subscribe/external",method:"post",children:[(0,T.jsx)("div",{children:(0,T.jsx)("input",{className:"w-full px-4 py-2 mt-4 text-base font-semibold text-center border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-gray-900",placeholder:q.ag._({id:"C3nD/1"}),type:"email",name:"email",id:"email",required:!0})}),(0,T.jsx)("button",{className:"w-full px-4 py-2 mt-4 text-base font-semibold text-center text-white bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",type:"submit",children:(0,T.jsx)(j.cC,{id:"qmm0gd"})})]}),(0,T.jsx)("div",{className:"text-xs text-center my-2 text-gray-500",children:(0,T.jsx)(j.cC,{id:"qKRCLC",components:{0:(0,T.jsx)("b",{}),1:(0,T.jsx)("br",{})}})})]})}var s4=n(43295),s5=n(52649);function s3(e){var t=e.character,n=e.size;return null!=t&&t.avatarURL?(0,T.jsx)("img",{"data-element-id":"current-character-avatar",src:t.avatarURL,className:(0,X.AK)("error-fallback-gray flex-shrink-0 object-cover ",{small:"w-5 h-5 rounded-sm ",medium:"w-9 h-9 rounded-md ",default:"w-20 h-20 rounded-lg ",semibig:" w-28 h-28 rounded-lg ",big:"w-32 h-32 rounded-lg "}[n||"default"])}):(0,T.jsx)("div",{"data-element-id":"current-character-avatar",className:(0,X.AK)("flex-shrink-0 bg-gray-100 dark:bg-gray-800 flex items-center justify-center",{small:"w-5 h-5 rounded-sm ",medium:"w-9 h-9 rounded-md ",default:"w-20 h-20 rounded-lg ",semibig:" w-28 h-28 rounded-lg ",big:"w-32 h-32 rounded-lg "}[n||"default"]),children:(0,T.jsx)(k.q1E,{className:(0,X.AK)("text-gray-500",{small:"w-3 h-3",medium:"w-5 h-5",default:"w-8 h-8",big:"w-8 h-8"}[n||"default"])})})}function s6(e){var t=e.character,n=e.characterPlugins,s=void 0===n?[]:n,r=e.checkPluginsAvailable,a=void 0===r||r,i=e.showResetButtons,o=e.onReset,l=e.onChange,c=e.allowChange,d=e.showPlugins,u=void 0===d||d;return(0,T.jsx)("div",{"data-element-id":"current-character",className:"p-4 flex items-center justify-center mb-8 max-w-md mx-auto",children:(0,T.jsxs)("div",{className:"flex items-center justify-center gap-4 flex-col",children:[(0,T.jsx)(s3,{character:t,size:"big"}),(0,T.jsxs)("div",{className:"text-center",children:[(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2 flex-wrap",children:[(0,T.jsx)("div",{className:"text-xl font-semibold",children:t.title})," ",t.isEnforceSpeechSettings?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{"data-tooltip-id":"character-speech-supported",className:(0,X.AK)("text-gray-500"),children:(0,T.jsx)(s5.MVT,{className:"w-4 h-4"})}),(0,T.jsx)(tK.u,{id:"character-speech-supported",place:"top",children:(0,T.jsx)(j.cC,{id:"k5Es8x"})})]}):null,u&&t.isEnforceAssignedPlugins?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{"data-tooltip-id":"character-plugins-supported",className:(0,X.AK)("text-gray-500"),children:(0,T.jsx)(s5.bTI,{className:"w-4 h-4"})}),(0,T.jsx)(tK.u,{id:"character-plugins-supported",place:"top",children:(0,T.jsx)(j.cC,{id:"t77h0I"})})]}):null]}),i?(0,T.jsxs)("div",{className:"text-sm",children:[(0,T.jsx)("button",{"data-element-id":"reset-character-button",onClick:o,className:"text-blue-500 hover:underline font-semibold",children:(0,T.jsx)(j.cC,{id:"OfhWJH"})}),c?(0,T.jsxs)(T.Fragment,{children:[" \xb7 ",(0,T.jsx)("button",{onClick:l,className:"text-blue-500 hover:underline font-semibold","data-element-id":"change-character-button",children:(0,T.jsx)(j.cC,{id:"o+XJ9D"})})]}):null]}):null,u&&t.isEnforceAssignedPlugins?(0,T.jsx)("div",{className:"text-xs font-semibold my-2 flex items-center justify-center gap-2 flex-wrap",children:Object.values(t.assignedPlugins).filter(Boolean).filter(function(e){return e.id}).sort(function(e,t){return e.id.localeCompare(t.id)}).map(function(e){var t=!1===a||s.find(function(t){return t.id===e.id});return(0,T.jsxs)("div",{className:(0,X.AK)("px-2 py-1 rounded bg-gray-200 dark:bg-zinc-700 inline-flex items-center justify-center gap-1",t?"text-gray-700 dark:text-gray-300 ":"text-red-500 dark:text-red-400"),"data-tooltip-id":"character-plugin-not-available-"+e.id,children:[t?(0,T.jsx)("span",{className:"w-4 h-4 flex items-center justify-center",children:(0,T.jsx)(ea,{plugin:e})}):(0,T.jsx)(ec.CSE,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:e.title}),t?null:(0,T.jsx)(tK.u,{id:"character-plugin-not-available-"+e.id,place:"top",children:(0,T.jsx)(j.cC,{id:"4AaI7a"})})]},e.id)})}):null,t.description?(0,T.jsx)("div",{"data-element-id":"current-character-description",className:"text-xs text-gray-500 dark:text-gray-400 whitespace-pre-line mt-2",children:t.description}):null]})]})})}function s8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function s7(e){for(var t=1;t=400)){e.next=17;break}return e.next=13,s.json();case 13:return y(e.sent.userMessage||s9),u(!1),e.abrupt("return");case 17:if(s.ok){e.next=21;break}return y(s9),u(!1),e.abrupt("return");case 21:return e.next=23,s.json();case 23:p(e.sent),e.next=31;break;case 27:e.prev=27,e.t0=e.catch(6),y(s9),console.error(e.t0);case 31:u(!1);case 32:case"end":return e.stop()}},e,null,[[6,27]])})),function(e){return t.apply(this,arguments)});return(0,T.jsx)(B,{wide:!0,showCloseButton:!1,open:s,setOpen:function(e){r(e),e||N()},children:(0,T.jsxs)("div",{className:"p-4",children:[d?(0,T.jsxs)("h2",{className:"text-lg text-center my-10 flex items-center justify-center gap-2",children:[(0,T.jsx)(Z,{}),(0,T.jsx)("span",{children:"Loading AI agent..."})]}):null,b?(0,T.jsx)("h2",{className:"text-lg text-red-500 text-center my-10",children:b}):null,h?(0,T.jsxs)("div",{className:"text-lg text-center",children:[(0,T.jsx)(s6,{character:null==h?void 0:h.data,showResetButtons:!1,allowChange:!1,checkPluginsAvailable:!1}),(0,T.jsx)("div",{className:"my-4 text-sm text-center",children:(0,T.jsx)("a",{className:"text-blue-500 hover:underline",href:(0,X.PO)(null===(n=A.serverHostConfig)||void 0===n?void 0:n.orgURL)+"/characters/".concat(null==h?void 0:h.id),target:"_blank",children:"View Details"})}),(0,T.jsxs)("div",{className:"text-center flex items-center justify-center flex-wrap gap-2",children:[(0,T.jsx)("button",{onClick:function(){a(s7(s7({},h.data),{},{id:"character-"+(0,C.Z)(),lastUsedAt:new Date})),r(!1),N()},className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-gray-400 gap-2",disabled:d,children:"→ Use AI agent"}),(0,T.jsxs)("button",{onClick:function(){return q()},className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2",disabled:d,children:[(0,T.jsx)(k.TvB,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:"Save for later"})]})]})]}):null]})})}function rt(e){var t=e.hostConfig,n=eZ().isDarkMode;return(0,T.jsx)("div",{"data-element-id":"custom-brand-section-container",className:"p-6 flex items-center justify-center",children:t.bannerURL?(0,T.jsx)("img",{src:n&&t.darkBannerURL||t.bannerURL,alt:t.brand,"data-element-id":"brand-banner",className:"max-w-[600px] w-full"}):(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-center space-x-2",children:[(0,T.jsx)("img",{src:n&&t.darkLogoURL||t.logoURL||"/favicon-192x192.png",alt:t.brand,"data-element-id":"brand-icon",className:"rounded-lg w-12 h-12 object-cover"}),(0,T.jsx)("div",{"data-element-id":"brand-name",className:"font-semibold text-4xl sm:text-5xl text-black dark:text-white flex items-center justify-center gap-2",children:(0,T.jsx)("span",{children:t.brand})})]}),(0,T.jsx)("div",{"data-element-id":"brand-tagline",className:"text-center my-4 font-light text-base sm:text-xl my-4 sm:my-6 text-black dark:text-white",children:t.tagline})]})})}var rn=n(12697);function rs(e){var t=e.chatID,n=e.children,s=e.userDataStoreRef,r=e.systemCharacters,a=(0,I.useState)(void 0),i=a[0],o=a[1],l=(0,I.useState)(void 0),c=l[0],d=l[1],u=(0,sA.Q)(null),m=(0,v.Z)(u,1)[0],h=(0,to.C)(null),p=(0,v.Z)(h,1)[0];(0,I.useEffect)(function(){(0,f.Z)(w().mark(function e(){var n,a;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,s.current.getChatData(t);case 3:if(n=e.sent){e.next=7;break}return o(null),e.abrupt("return");case 7:n.character&&(a=(r||[]).find(function(e){return e.id===n.character.id}))&&(n.character=a),o(n),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),o(null),console.error(e.t0);case 15:case"end":return e.stop()}},e,null,[[0,11]])}))()},[t,m]),(0,I.useEffect)(function(){null!==m&&null!==p&&d({userCharacters:m,installedPlugins:p})},[m,p]);var x=(0,I.useMemo)(function(){var e,t;return null!=i&&null!==(e=i.messages)&&void 0!==e&&e.length&&null!==(t=history.state)&&void 0!==t&&t.search?i.messages.findIndex(function(e){var t;return null===(t=(0,X.FB)(e.content))||void 0===t?void 0:t.toLowerCase().includes(history.state.search.toLowerCase())}):-1},[i]);return void 0===i||void 0===c?null:n({preloadChatData:i,preloadUserData:c,highlightedMessageIndex:x})}var rr=new(n(40272)).Z({concurrency:1}),ra={id:"fWsBTs"};function ri(e){var t,n,s=e.onCancelled,r=e.fetchAudio,a=e.allowDownload,i=void 0===a||a,o=(0,I.useState)(!1),l=o[0],c=o[1],d=(0,I.useState)(null),u=d[0],m=d[1],h=(0,j.mV)().i18n,p=(0,I.useState)(!1),x=p[0],g=p[1],b=(0,I.useRef)(null),v=(0,I.useRef)(null);(0,I.useEffect)(function(){y()},[]);var y=(t=(0,f.Z)(w().mark(function e(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:var t;c(!0),v.current=!1,t=function(){if(!v.current)return c(!1),N()},rr.add(t,void 0);case 3:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),A=(n=(0,f.Z)(w().mark(function e(){var t,n,s,a;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,g(!0),e.next=6,r();case 6:return t=e.sent,e.next=9,t.blob();case 9:n=e.sent,s=window.URL.createObjectURL(n),(a=document.createElement("a")).setAttribute("href",s),a.setAttribute("download","audio-".concat(Date.now(),".mp3")),document.body.appendChild(a),a.click(),a.remove(),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(2),console.error(e.t0);case 22:g(!1);case 23:case"end":return e.stop()}},e,null,[[2,19]])})),function(){return n.apply(this,arguments)}),N=function(){var e;return new Promise((e=(0,f.Z)(w().mark(function e(t,n){var s,a,i,o,l,c,d,u;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r();case 3:if((s=e.sent).ok){e.next=21;break}if(!s.errorMessage){e.next=9;break}m(s.errorMessage),e.next=19;break;case 9:return e.prev=9,e.next=12,s.json();case 12:i=e.sent,m(h._({id:"FzlEPS"})+" "+((null==i?void 0:i.userMessage)||(null==i||null===(a=i.detail)||void 0===a?void 0:a.message)||JSON.stringify(i))),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),m(h._(ra));case 19:return t(),e.abrupt("return");case 21:if(o="audio/mpeg",!(window.MediaSource&&MediaSource.isTypeSupported(o))){e.next=33;break}return l=s.body.getReader(),c=new MediaSource,b.current.src=URL.createObjectURL(c),b.current.addEventListener("ended",function(){t()}),b.current.addEventListener("pause",function(){t()}),c.addEventListener("sourceopen",function(){var e=c.addSourceBuffer(o);(function(){var t=(0,f.Z)(w().mark(function t(){var s,r,a;return w().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,l.read();case 3:if(r=(s=t.sent).done,a=s.value,!r){t.next=9;break}return c.endOfStream(),t.abrupt("return");case 9:e.appendBuffer(a),e.addEventListener("updateend",n,{once:!0}),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(0),m(h._(ra)+" "+t.t0.message),console.error("Error reading from stream:",t.t0);case 17:case"end":return t.stop()}},t,null,[[0,13]])}));function n(){return t.apply(this,arguments)}return n})()()}),e.next=31,b.current.play();case 31:case 43:e.next=53;break;case 33:return e.prev=33,e.next=36,s.blob();case 36:return d=e.sent,u=URL.createObjectURL(d),b.current.addEventListener("ended",function(){t()}),b.current.addEventListener("pause",function(){t()}),b.current.src=u,e.next=43,b.current.play();case 45:if(e.prev=45,e.t1=e.catch(33),!(e.t1 instanceof DOMException&&"NotAllowedError"===e.t1.name)){e.next=51;break}return m(h._({id:"UrPLkb"})),t(),e.abrupt("return");case 51:m(h._(ra)+" "+e.t1.message),t();case 53:e.next=59;break;case 55:e.prev=55,e.t2=e.catch(0),console.error(e.t2),t();case 59:case"end":return e.stop()}},e,null,[[0,55],[9,16],[33,45]])})),function(t,n){return e.apply(this,arguments)}))};return l?(0,T.jsxs)("div",{className:"text-xs font-semibold text-gray-500 flex items-center justify-center gap-2 p-2",children:[(0,T.jsx)(Z,{}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"kWu0yk"})}),(0,T.jsx)("button",{onClick:s,className:"text-red-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"dEgA5A"})})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("audio",{ref:b,preload:"none",controls:!0}),i?x?(0,T.jsx)(Z,{}):(0,T.jsx)("button",{onClick:A,children:(0,T.jsx)(k.aBF,{className:"w-4 h-4"})}):null,u?(0,T.jsx)("div",{className:"text-xs font-semibold text-red-500",children:u}):null]})}var ro=(0,R.eK)("useElevenStability"),rl=(0,R.eK)("useElevenClarity"),rc=(0,R.eK)("useElevenVoice"),rd=(0,R.eK)("useElevenAPIKey"),ru=(0,R.eK)("useElevenModelID");function rm(e){var t=e.content,n=e.onCancelled,s=e.speechSettings,r=e.orgElevenLabsAPIKey,a=ro(.75),i=(0,v.Z)(a,2),o=i[0];i[1];var l=rl(.75),c=(0,v.Z)(l,2),d=c[0];c[1];var u=rc("EXAVITQu4vr4xnSDxMaL"),m=(0,v.Z)(u,2),h=m[0];m[1];var p=ru("eleven_monolingual_v1"),x=(0,v.Z)(p,1)[0],g=rd(""),f=(0,v.Z)(g,2),b=f[0];f[1];var y=$(),w=y.serverHostConfig.chatFeatures;return(0,T.jsx)(ri,{onCancelled:n,fetchAudio:function(){var e,n,a,i,l,c=null!==(e=null==s?void 0:s.elevenVoice)&&void 0!==e?e:h;return fetch(null!==(n=y.serverHostConfig)&&void 0!==n&&n.hasElevenLabsAPIKey&&!r?"/api/hosted/voice/elevenlabs?voiceID=".concat(c,"&stream=true"):"https://api.elevenlabs.io/v1/text-to-speech/".concat(c,"/stream"),{headers:{"Content-Type":"application/json","xi-api-key":r||b},method:"POST",body:JSON.stringify({text:t,model_id:null!==(a=null==s?void 0:s.elevenModelID)&&void 0!==a?a:x,voice_settings:{stability:Number(null!==(i=null==s?void 0:s.elevenStability)&&void 0!==i?i:o),similarity_boost:Number(null!==(l=null==s?void 0:s.elevenClarity)&&void 0!==l?l:d)}})})},allowDownload:(0,X.N7)("downloadTextToSpeech",w)})}var rh=(0,R.eK)("useBrowserVoice"),rp=(0,R.eK)("useBrowserVoiceRate"),rx=(0,R.eK)("useBrowserVoicePitch");function rg(e){var t,n=e.content,s=e.onStopped,r=e.speechSettings,a=rh(),i=(0,v.Z)(a,2),o=i[0];i[1];var l=rp(1),c=(0,v.Z)(l,2),d=c[0];c[1];var u=rx(1),m=(0,v.Z)(u,2),h=m[0];m[1];var p=(0,I.useState)({paused:!1,pending:!1,speaking:!1}),x=p[0],g=p[1],b=(0,I.useRef)(null),y=(0,I.useRef)(null);(0,I.useEffect)(function(){A()},[]),(0,I.useEffect)(function(){return N(),b.current=setInterval(function(){window.speechSynthesis.speaking||s(),N()},500),function(){clearInterval(b.current),window.speechSynthesis.cancel()}},[]);var A=(t=(0,f.Z)(w().mark(function e(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",new Promise(function(e,t){y.current=new window.SpeechSynthesisUtterance,y.current.text=n;var s,a,i=null!==(s=null==r?void 0:r.browserVoiceRate)&&void 0!==s?s:d,l=null!==(a=null==r?void 0:r.browserVoicePitch)&&void 0!==a?a:h;y.current.volume=1,y.current.rate=i<.1?.1:i,y.current.pitch=l<.1?.1:l,y.current.voice=window.speechSynthesis.getVoices().filter(function(e){var t;return e.voiceURI===(null!==(t=null==r?void 0:r.browserVoice)&&void 0!==t?t:o)})[0],y.current.addEventListener("end",function(t){e()}),window.speechSynthesis.cancel(),window.speechSynthesis.speak(y.current)}));case 4:e.prev=4,e.t0=e.catch(0),console.error(e.t0);case 7:case"end":return e.stop()}},e,null,[[0,4]])})),function(){return t.apply(this,arguments)}),N=function(){g({paused:window.speechSynthesis.paused,pending:window.speechSynthesis.pending,speaking:window.speechSynthesis.speaking})};return(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2 flex-wrap",children:[x.speaking&&!x.paused&&(0,T.jsxs)("button",{onClick:function(){window.speechSynthesis.pause(),N()},type:"submit",className:"px-4 py-2 rounded-full border border-gray-200 shadow-sm text-sm font-semibold text-gray-500 flex items-center justify-center gap-2 hover:text-black hover:shadow-md transition-all dark:bg-zinc-800 dark:border-zinc-600 dark:hover:text-white bg-white",children:[(0,T.jsx)(k.Wh,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"IgrLD/"})})]}),x.paused&&(0,T.jsxs)("button",{onClick:function(){window.speechSynthesis.resume(),N()},type:"submit",className:"px-4 py-2 rounded-full border border-gray-200 shadow-sm text-sm font-semibold text-gray-500 flex items-center justify-center gap-2 hover:text-black hover:shadow-md transition-all dark:bg-zinc-800 dark:border-zinc-600 dark:hover:text-white bg-white",children:[(0,T.jsx)(k.gmG,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"v39wLo"})})]}),x.speaking&&(0,T.jsxs)("button",{onClick:function(){window.speechSynthesis.cancel(),N()},type:"submit",className:"px-4 py-2 rounded-full border border-gray-200 shadow-sm text-sm font-semibold text-gray-500 flex items-center justify-center gap-2 hover:text-black hover:shadow-md transition-all dark:bg-zinc-800 dark:border-zinc-600 dark:hover:text-white bg-white",children:[(0,T.jsx)(k.JuG,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"ygCKqB"})})]})]})}var rf=(0,R.eK)("useOpenAISpeechVoice"),rb=(0,R.eK)("useOpenAISpeechModel"),rv=(0,R.eK)("useOpenAISpeechSpeed");function ry(e){var t=e.content,n=e.onCancelled,s=e.speechSettings,r=e.orgOpenAIAPIKey,a=rf(X.ZD[0]),i=(0,v.Z)(a,2),o=i[0];i[1];var l=rb("tts-1"),c=(0,v.Z)(l,2),d=c[0];c[1];var u=rv(1),m=(0,v.Z)(u,2),h=m[0];m[1];var p=$(),x=p.serverHostConfig.chatFeatures,g=null==p?void 0:p.decryptedApiKey;return(0,T.jsx)(ri,{onCancelled:n,fetchAudio:function(){var e,n,a,i,l,c,u,m={model:null!==(e=null==s?void 0:s.openAISpeechModel)&&void 0!==e?e:d,input:t,voice:null!==(n=null==s?void 0:s.openAISpeechVoice)&&void 0!==n?n:o,speed:Number(null!==(a=null==s?void 0:s.openAISpeechSpeed)&&void 0!==a?a:h)};return null!==(i=p.serverHostConfig)&&void 0!==i&&i.managed&&null!==(l=p.serverHostConfig)&&void 0!==l&&l.hasOpenAIAPIKey&&(0,X.N7)("useOpenAITextToSpeech",null===(c=p.serverHostConfig)||void 0===c?void 0:c.chatFeatures)&&!(null!==(u=p.serverHostConfig)&&void 0!==u&&u.requireLicenseKey)?fetch("/api/hosted/voice/openai",{method:"POST",body:JSON.stringify(m)}):g||r?fetch("https://api.openai.com/v1/audio/speech",{method:"POST",headers:{Authorization:"Bearer ".concat(r||g),"Content-Type":"application/json"},body:JSON.stringify(m)}):{errorMessage:q.ag._({id:"BLqwK7"})}},allowDownload:(0,X.N7)("downloadTextToSpeech",x)})}var rw=function(e){if("string"!=typeof e)return e;var t=e.replace(/^#+\s(.*)/gm,"$1");return(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\*\*(.*)\*\*/g,"$1")).replace(/__(.*)__/g,"$1")).replace(/\*(.*?)\*/g,"$1")).replace(/_(.*?)_/g,"$1")).replace(/~~(.*?)~~/g,"$1")).replace(/^[ \t]*>+(\s>+)*\s?/gm,"")).replace(/^[ \t]*[*\-+]\s+/gm,"")).replace(/^[ \t]*(\d+)\.\s+/gm,"$1 ")).replace(/`(.+?)`/g,"$1")},rj=(0,R.eK)("useSpeechSource"),rA=(0,R.eK)("useElevenAPIKey"),rN=(0,R.eK)("useOpenAISpeechVoice"),rk=(0,R.eK)("useOpenAISpeechModel"),rC=(0,R.eK)("useOpenAISpeechSpeed"),rq=(0,R.eK)("useElevenStability"),rI=(0,R.eK)("useElevenClarity"),rV=(0,R.eK)("useElevenVoice"),rS=(0,R.eK)("useElevenModelID"),rO=(0,I.forwardRef)(function(e,t){var n,s,r=e.content,a=e.onSettingClick,i=e.playOnMount,o=e.speechSettings,l=e.orgElevenLabsAPIKey,c=e.orgOpenAIAPIKey,d=(0,I.useMemo)(function(){return rw(r)},[r]),u=rj("disabled"),m=(0,v.Z)(u,2),h=m[0];m[1];var p=(0,I.useState)(!1),x=p[0],g=p[1],b=(0,I.useState)(null),y=b[0],A=b[1],N=rA(""),C=(0,v.Z)(N,1)[0],V=rq(),S=(0,v.Z)(V,1)[0],O=rI(),E=(0,v.Z)(O,1)[0],P=rV(),M=(0,v.Z)(P,1)[0],D=rS(),B=(0,v.Z)(D,1)[0],L=rN(),R=(0,v.Z)(L,1)[0],_=rk(),F=(0,v.Z)(_,1)[0],G=rC(),K=(0,v.Z)(G,1)[0],Z=$(),Y=null!==(s=null==o?void 0:o.speechSource)&&void 0!==s?s:h;(0,I.useEffect)(function(){i&&!x&&U(),"browser"===Y&&window.speechSynthesis&&window.speechSynthesis.getVoices()},[]),(0,I.useEffect)(function(){g(!1)},[Y,R,F,K,M,S,E,B,o]);var U=(n=(0,f.Z)(w().mark(function e(){var t;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(A(null),Z.userCanUse("textToSpeech")){e.next=4;break}return A((0,T.jsx)(eF,{name:"Text-to-Speech"})),e.abrupt("return");case 4:if(!(!Y||"disabled"===Y)){e.next=7;break}return a&&a(),e.abrupt("return");case 7:if(!("browser"===Y&&!window.speechSynthesis)){e.next=10;break}return A(q.ag._({id:"Wzyks2"})),e.abrupt("return");case 10:if(!("elevenlabs"===Y&&!C&&!(null!==(t=Z.serverHostConfig)&&void 0!==t&&t.hasElevenLabsAPIKey)&&!l)){e.next=13;break}return o?A(q.ag._({id:"u2ugP9"})):a&&a(),e.abrupt("return");case 13:g(!0);case 14:case"end":return e.stop()}},e)})),function(){return n.apply(this,arguments)});return(0,I.useImperativeHandle)(t,function(){return{play:U}}),(0,T.jsxs)("div",{className:" flex items-center justify-center sm:justify-start gap-2 flex-wrap w-full group",children:[x?null:(0,T.jsxs)("button",{"data-element-id":"in-message-play-button",onClick:U,type:"submit",className:"tts-play-button px-4 py-2 rounded-full border border-gray-200 shadow-sm text-sm font-semibold text-gray-500 flex items-center justify-center gap-2 hover:text-black hover:shadow-md transition-all dark:bg-zinc-800 dark:border-zinc-600 dark:hover:text-white bg-white",children:[(0,T.jsx)(k.gmG,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"T91vKp"})})]}),"browser"===Y?x?(0,T.jsx)(rg,{content:d,onStopped:function(){g(!1)},playOnMount:!0,speechSettings:o}):null:"openai-text-to-speech"===Y?x?(0,T.jsx)(ry,{content:d,onStopped:function(){g(!1)},speechSettings:o,orgOpenAIAPIKey:c}):null:x?(0,T.jsx)(rm,{content:d,onCancelled:function(){g(!1)},speechSettings:o,orgElevenLabsAPIKey:l}):null,y?(0,T.jsx)("div",{className:"text-red-500",children:y}):null,a?(0,T.jsx)("button",{onClick:a,className:"group-hover:inline-block sm:hidden font-semibold text-gray-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"Tz0i8g"})}):null]})}),rE=(0,R.eK)("useBrowserVoice"),rP=(0,R.eK)("useBrowserVoiceRate"),rM=(0,R.eK)("useBrowserVoicePitch");function rT(e){var t,n,s,r,a,i=e.speechSettings,o=e.handleChangeSpeechSetting,l=(0,I.useState)(!1),c=l[0],d=l[1],u=(0,I.useState)([]),m=u[0],h=u[1],p=rE(),x=(0,v.Z)(p,2),g=x[0],f=x[1],b=rP(1),y=(0,v.Z)(b,2),w=y[0],A=y[1],N=rM(1),k=(0,v.Z)(N,2),C=k[0],q=k[1];(0,I.useEffect)(function(){if("speechSynthesis"in window)return d(!0),V(),window.speechSynthesis&&window.speechSynthesis.addEventListener&&window.speechSynthesis.addEventListener("voiceschanged",V),function(){window.speechSynthesis&&window.speechSynthesis.removeEventListener&&window.speechSynthesis.removeEventListener("voiceschanged",V)}},[]);var V=function(){h(speechSynthesis.getVoices().map(function(e){return{voiceURI:e.voiceURI,name:e.name,lang:e.lang}}))};return c?(0,T.jsxs)("div",{className:"space-y-4",children:[(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsxs)("div",{className:" flex items-center justify-center gap-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"cKuv8v"})}),(0,T.jsx)("select",{id:"model",className:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:null!==(t=null==i?void 0:i.browserVoice)&&void 0!==t?t:g,onChange:function(e){return o?o({browserVoice:e.target.value}):f(e.target.value)},children:m.map(function(e){return(0,T.jsxs)("option",{value:e.voiceURI,children:[e.name," (",e.lang,")"]},e.voiceURI)})})]}),(0,T.jsx)("div",{className:"text-xs",children:(0,T.jsx)(j.cC,{id:"CvvaRA"})})]}),(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsxs)("label",{className:"font-semibold shrink-0 flex items-center justify-between gap-2",children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"TAocpQ",values:{0:null!==(n=null==i?void 0:i.browserVoiceRate)&&void 0!==n?n:w}})}),(0,T.jsx)("button",{onClick:function(){return o?o({browserVoiceRate:1}):A(1)},className:"text-blue-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"qRsPIT"})})]}),(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("input",{type:"range",className:"transparent h-1.5 w-full cursor-pointer appearance-none rounded-lg border-transparent bg-neutral-200",min:0,max:2,step:.1,value:null!==(s=null==i?void 0:i.browserVoiceRate)&&void 0!==s?s:w,onChange:function(e){return o?o({browserVoiceRate:e.target.value}):A(e.target.value)}}),(0,T.jsxs)("div",{className:"text-gray-500 text-xs flex items-center justify-between",children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"w625t8"})}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"qmIOJX"})})]})]})]}),(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsxs)("label",{className:"font-semibold shrink-0 flex items-center justify-between gap-2",children:[(0,T.jsx)(j.cC,{id:"PBh8Vb",values:{0:null!==(r=null==i?void 0:i.browserVoicePitch)&&void 0!==r?r:C}}),(0,T.jsx)("button",{onClick:function(){return o?o({browserVoicePitch:1}):q(1)},className:"text-blue-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"qRsPIT"})})]}),(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("input",{type:"range",className:"transparent h-1.5 w-full cursor-pointer appearance-none rounded-lg border-transparent bg-neutral-200",min:0,max:2,step:.1,value:null!==(a=null==i?void 0:i.browserVoicePitch)&&void 0!==a?a:C,onChange:function(e){return o?o({browserVoicePitch:e.target.value}):q(e.target.value)}}),(0,T.jsxs)("div",{className:"text-gray-500 text-xs flex items-center justify-between",children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"pdO539"})}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"bgYTxy"})})]})]})]})]}):(0,T.jsx)("div",{className:"text-gray-500 p-4 text-center text-red-500",children:(0,T.jsx)(j.cC,{id:"Wzyks2"})})}var rD=(0,R.eK)("useOpenAISpeechVoice"),rB=(0,R.eK)("useOpenAISpeechModel"),rL=(0,R.eK)("useOpenAISpeechSpeed");function rR(e){var t,n,s,r,a=e.showAdvanced,i=e.setShowAdvanced,o=e.speechSettings,l=e.handleChangeSpeechSetting,c=rD(),d=(0,v.Z)(c,2),u=d[0],m=d[1],h=rB(),p=(0,v.Z)(h,2),x=p[0],g=p[1],f=rL(1),b=(0,v.Z)(f,2),y=b[0],w=b[1];return(0,T.jsxs)("div",{className:"space-y-4",children:[(0,T.jsxs)("div",{className:" flex items-center justify-center gap-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"cKuv8v"})}),(0,T.jsx)("select",{id:"model",className:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:null!==(t=null==o?void 0:o.openAISpeechVoice)&&void 0!==t?t:u,onChange:function(e){return l?l({openAISpeechVoice:e.target.value}):m(e.target.value)},children:X.ZD.map(function(e){return(0,T.jsx)("option",{value:e,className:"capitalize",children:(0,tk.capitalize)(e)},e)})}),a?(0,T.jsx)("button",{className:"text-blue-500 flex-shrink-0",onClick:function(){return i(!1)},children:(0,T.jsx)(j.cC,{id:"A+GCyx"})}):(0,T.jsx)("button",{className:"text-blue-500 flex-shrink-0",onClick:function(){return i(!0)},children:(0,T.jsx)(j.cC,{id:"NFIOKv"})})]}),a?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"hDkkvu"})}),(0,T.jsxs)("select",{id:"model",className:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:null!==(n=null==o?void 0:o.openAISpeechModel)&&void 0!==n?n:x,onChange:function(e){return l?l({openAISpeechModel:e.target.value}):g(e.target.value)},children:[(0,T.jsx)("option",{value:"tts-1",children:"TTS"}),(0,T.jsx)("option",{value:"tts-1-hd",children:"TTS HD "})]})]}),(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsxs)("label",{className:"font-semibold shrink-0 flex items-center justify-between gap-2",children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"UHgcpG",values:{0:null!==(s=null==o?void 0:o.openAISpeechSpeed)&&void 0!==s?s:y}})}),(0,T.jsx)("button",{onClick:function(){return l?l({openAISpeechSpeed:1}):w(1)},className:"text-blue-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"qRsPIT"})})]}),(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("input",{type:"range",className:"transparent h-1.5 w-full cursor-pointer appearance-none rounded-lg border-transparent bg-neutral-200",min:.25,max:4,step:.05,value:null!==(r=null==o?void 0:o.openAISpeechSpeed)&&void 0!==r?r:y,onChange:function(e){return l?l({openAISpeechSpeed:e.target.value}):w(e.target.value)}}),(0,T.jsxs)("div",{className:"text-gray-500 text-xs flex items-center justify-between",children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"w625t8"})}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"qmIOJX"})})]})]})]})]}):null]})}var r_=JSON.parse('{"b":[{"voice_id":"21m00Tcm4TlvDq8ikWAM","name":"Rachel","samples":null,"category":"premade","fine_tuning":{"model_id":null,"is_allowed_to_fine_tune":false,"fine_tuning_requested":false,"finetuning_state":"not_started","verification_attempts":null,"verification_failures":[],"verification_attempts_count":0,"slice_ids":null},"labels":{},"description":null,"preview_url":"https://storage.googleapis.com/eleven-public-prod/premade/voices/21m00Tcm4TlvDq8ikWAM/6edb9076-c3e4-420c-b6ab-11d43fe341c8.mp3","available_for_tiers":[],"settings":null},{"voice_id":"AZnzlk1XvdvUeBnXmlld","name":"Domi","samples":null,"category":"premade","fine_tuning":{"model_id":null,"is_allowed_to_fine_tune":false,"fine_tuning_requested":false,"finetuning_state":"not_started","verification_attempts":null,"verification_failures":[],"verification_attempts_count":0,"slice_ids":null},"labels":{},"description":null,"preview_url":"https://storage.googleapis.com/eleven-public-prod/premade/voices/AZnzlk1XvdvUeBnXmlld/69c5373f-0dc2-4efd-9232-a0140182c0a9.mp3","available_for_tiers":[],"settings":null},{"voice_id":"EXAVITQu4vr4xnSDxMaL","name":"Sarah","samples":null,"category":"premade","fine_tuning":{"model_id":null,"is_allowed_to_fine_tune":false,"fine_tuning_requested":false,"finetuning_state":"not_started","verification_attempts":null,"verification_failures":[],"verification_attempts_count":0,"slice_ids":null},"labels":{},"description":null,"preview_url":"https://storage.googleapis.com/eleven-public-prod/premade/voices/EXAVITQu4vr4xnSDxMaL/04365bce-98cc-4e99-9f10-56b60680cda9.mp3","available_for_tiers":[],"settings":null},{"voice_id":"ErXwobaYiN019PkySvjV","name":"Antoni","samples":null,"category":"premade","fine_tuning":{"model_id":null,"is_allowed_to_fine_tune":false,"fine_tuning_requested":false,"finetuning_state":"not_started","verification_attempts":null,"verification_failures":[],"verification_attempts_count":0,"slice_ids":null},"labels":{},"description":null,"preview_url":"https://storage.googleapis.com/eleven-public-prod/premade/voices/ErXwobaYiN019PkySvjV/38d8f8f0-1122-4333-b323-0b87478d506a.mp3","available_for_tiers":[],"settings":null},{"voice_id":"MF3mGyEYCl7XYWbV9V6O","name":"Elli","samples":null,"category":"premade","fine_tuning":{"model_id":null,"is_allowed_to_fine_tune":false,"fine_tuning_requested":false,"finetuning_state":"not_started","verification_attempts":null,"verification_failures":[],"verification_attempts_count":0,"slice_ids":null},"labels":{},"description":null,"preview_url":"https://storage.googleapis.com/eleven-public-prod/premade/voices/MF3mGyEYCl7XYWbV9V6O/f9fd64c3-5d62-45cd-b0dc-ad722ee3284e.mp3","available_for_tiers":[],"settings":null},{"voice_id":"TxGEqnHWrfWFTfGW9XjX","name":"Josh","samples":null,"category":"premade","fine_tuning":{"model_id":null,"is_allowed_to_fine_tune":false,"fine_tuning_requested":false,"finetuning_state":"not_started","verification_attempts":null,"verification_failures":[],"verification_attempts_count":0,"slice_ids":null},"labels":{},"description":null,"preview_url":"https://storage.googleapis.com/eleven-public-prod/premade/voices/TxGEqnHWrfWFTfGW9XjX/c6c80dcd-5fe5-4a4c-a74c-b3fec4c62c67.mp3","available_for_tiers":[],"settings":null},{"voice_id":"VR6AewLTigWG4xSOukaG","name":"Arnold","samples":null,"category":"premade","fine_tuning":{"model_id":null,"is_allowed_to_fine_tune":false,"fine_tuning_requested":false,"finetuning_state":"not_started","verification_attempts":null,"verification_failures":[],"verification_attempts_count":0,"slice_ids":null},"labels":{},"description":null,"preview_url":"https://storage.googleapis.com/eleven-public-prod/premade/voices/VR6AewLTigWG4xSOukaG/66e83dc2-6543-4897-9283-e028ac5ae4aa.mp3","available_for_tiers":[],"settings":null},{"voice_id":"pNInz6obpgDQGcFmaJgB","name":"Adam","samples":null,"category":"premade","fine_tuning":{"model_id":null,"is_allowed_to_fine_tune":false,"fine_tuning_requested":false,"finetuning_state":"not_started","verification_attempts":null,"verification_failures":[],"verification_attempts_count":0,"slice_ids":null},"labels":{},"description":null,"preview_url":"https://storage.googleapis.com/eleven-public-prod/premade/voices/pNInz6obpgDQGcFmaJgB/e0b45450-78db-49b9-aaa4-d5358a6871bd.mp3","available_for_tiers":[],"settings":null},{"voice_id":"yoZ06aMxZJJ28mfd3POQ","name":"Sam","samples":null,"category":"premade","fine_tuning":{"model_id":null,"is_allowed_to_fine_tune":false,"fine_tuning_requested":false,"finetuning_state":"not_started","verification_attempts":null,"verification_failures":[],"verification_attempts_count":0,"slice_ids":null},"labels":{},"description":null,"preview_url":"https://storage.googleapis.com/eleven-public-prod/premade/voices/yoZ06aMxZJJ28mfd3POQ/1c4d417c-ba80-4de8-874a-a1c57987ea63.mp3","available_for_tiers":[],"settings":null}]}'),rF={id:"fWsBTs"},rG=(0,R.eK)("useElevenStability"),rK=(0,R.eK)("useElevenClarity"),rZ=(0,R.eK)("useElevenVoice"),rY=(0,R.eK)("useElevenAPIKey"),rU=(0,R.eK)("useElevenModelID"),rH=(0,R.eK)("useElevenCustomVoices");function rz(e){var t,n,s,r,a,i,o,l,c=e.showAdvanced,d=e.setShowAdvanced,u=e.speechSettings,m=e.handleChangeSpeechSetting,h=e.orgElevenLabsAPIKey,p=(0,j.mV)().i18n,x=(0,I.useState)(!1),b=x[0],y=x[1],A=(0,I.useState)(null),N=A[0],q=A[1],V=(0,I.useState)(null),S=V[0],O=V[1],E=rG(.75),P=(0,v.Z)(E,2),M=P[0],D=P[1],B=rK(.75),L=(0,v.Z)(B,2),R=L[0],_=L[1],F=rZ("EXAVITQu4vr4xnSDxMaL"),G=(0,v.Z)(F,2),K=G[0],Z=G[1],U=rU("eleven_monolingual_v1"),H=(0,v.Z)(U,2),z=H[0],W=H[1],Q=rY(""),X=(0,v.Z)(Q,2),J=X[0],ee=X[1],et=rH([]),en=(0,v.Z)(et,2),es=en[0],er=en[1],ea=(0,I.useState)(r_.b),ei=ea[0],eo=ea[1],el=e6(J,1e3),ec=$(),ed=function(e){!u&&([].concat((0,g.Z)(e),(0,g.Z)(es)).map(function(e){return e.voice_id}).includes(K)||er(function(e){return[].concat((0,g.Z)(e),[{id:(0,C.Z)(),name:"",voice_id:K}])}))},eu=(t=(0,f.Z)(w().mark(function e(){var t,n,s,r;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(!J&&!(null!==(t=ec.serverHostConfig)&&void 0!==t&&t.hasElevenLabsAPIKey)&&!h)){e.next=4;break}return eo(r_.b),e.abrupt("return");case 4:return e.next=6,fetch(null!==(n=ec.serverHostConfig)&&void 0!==n&&n.hasElevenLabsAPIKey?"/api/hosted/voice/voices":"https://api.elevenlabs.io/v1/voices",{headers:{"Content-Type":"application/json","xi-api-key":h||J},method:"GET"});case 6:return s=e.sent,e.next=9,s.json();case 9:null!=(r=e.sent)&&r.voices?(eo(r.voices),ed(r.voices)):eo(r_.b),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(0),eo(r_.b),console.error(e.t0);case 17:case"end":return e.stop()}},e,null,[[0,13]])})),function(){return t.apply(this,arguments)});(0,I.useEffect)(function(){eu()},[el]);var em=(n=(0,f.Z)(w().mark(function e(){var t,n;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),O(!1),q(""),e.prev=3,e.next=6,fetch("https://api.elevenlabs.io/v1/voices",{headers:{"Content-Type":"application/json","xi-api-key":J},method:"GET"});case 6:if(!((t=e.sent).status>=400)){e.next=14;break}return e.next=10,t.json();case 10:return q((n=e.sent).detail&&n.detail.message||p._(rF)),y(!1),e.abrupt("return");case 14:if(t.ok){e.next=18;break}return q(p._(rF)),y(!1),e.abrupt("return");case 18:O(!0),e.next=25;break;case 21:e.prev=21,e.t0=e.catch(3),q(p._(rF)),console.error(e.t0);case 25:y(!1);case 26:case"end":return e.stop()}},e,null,[[3,21]])})),function(){return n.apply(this,arguments)});return(0,T.jsxs)("div",{className:"space-y-4",children:[J||null!==(s=ec.serverHostConfig)&&void 0!==s&&s.hasElevenLabsAPIKey||u?null:(0,T.jsx)("div",{className:"text-xs text-red-500",children:(0,T.jsx)(j.cC,{id:"jF//iB"})}),!(null!==(r=ec.serverHostConfig)&&void 0!==r&&r.hasElevenLabsAPIKey)&&!u&&(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsxs)("label",{className:"font-semibold shrink-0",children:[(0,T.jsx)("span",{className:J?"":"text-red-500",children:(0,T.jsx)(j.cC,{id:"gJaAE1"})}),": (",(0,T.jsx)("a",{href:"https://beta.elevenlabs.io/",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"JhXfkQ"})}),")"]}),(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,T.jsx)("input",{type:"password",disabled:b,placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",value:J,onChange:function(e){return ee(e.target.value)}}),(0,T.jsx)("button",{onClick:function(){return em()},type:"submit",disabled:b,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2 flex-shrink-0",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"hlKjs/"})})})]}),N?(0,T.jsx)("div",{className:"text-red-500 text-sm",children:N}):null,S?(0,T.jsx)("div",{className:"text-green-500 text-sm",children:(0,T.jsx)(j.cC,{id:"eDPfNj"})}):null,(0,T.jsx)("div",{className:"text-xs text-gray-500 my-4",children:(0,T.jsx)(j.cC,{id:"UIpYys"})})]}),(0,T.jsxs)("div",{className:" flex items-center justify-center gap-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"cKuv8v"})}),(0,T.jsx)("select",{id:"model",className:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:null!==(a=null==u?void 0:u.elevenVoice)&&void 0!==a?a:K,onChange:function(e){return m?m({elevenVoice:e.target.value}):Z(e.target.value)},children:(0,tk.uniqBy)([].concat((0,g.Z)(es),(0,g.Z)(ei),[{voice_id:K}]),"voice_id").filter(function(e){return e.voice_id}).map(function(e){return(0,T.jsx)("option",{value:e.voice_id,children:e.name||p._({id:"8Tg/JR"})+" (".concat(e.voice_id,")")},e.voice_id)})}),c?(0,T.jsx)("button",{className:"text-blue-500 flex-shrink-0",onClick:function(){return d(!1)},children:(0,T.jsx)(j.cC,{id:"A+GCyx"})}):(0,T.jsx)("button",{className:"text-blue-500 flex-shrink-0",onClick:function(){return d(!0)},children:(0,T.jsx)(j.cC,{id:"NFIOKv"})})]}),c?(0,T.jsxs)(T.Fragment,{children:[!u&&(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"/xJLUo"})}),es.map(function(e,t){return(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,T.jsx)("input",{type:"text",placeholder:p._({id:"6YtxFj"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",disabled:b,value:e.name,onChange:function(e){var n=(0,g.Z)(es);n[t].name=e.target.value,er(n)}}),(0,T.jsx)("input",{type:"text",placeholder:p._({id:"3BQnyB"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",disabled:b,value:e.voice_id,onChange:function(e){var n=(0,g.Z)(es);n[t].voice_id=e.target.value,er(n)}}),(0,T.jsx)(Y,{className:"text-red-500 font-semibold min-w-[55px]",onConfirmed:function(){var e,n=(0,g.Z)(es);n.splice(t,1),er(n),K===es[t].voice_id&&Z(null===(e=ei[0])||void 0===e?void 0:e.voice_id)},children:(0,T.jsx)(j.cC,{id:"t/YqKh"})})]},e.id)}),(0,T.jsx)("div",{className:"flex items-center justify-start gap-2 mt-2",children:(0,T.jsxs)("button",{onClick:function(){er(function(e){return[].concat((0,g.Z)(e),[{id:(0,C.Z)(),name:"",voice_id:""}])})},className:"flex items-center justify-start gap-2 text-blue-500 font-semibold hover:underline",children:[(0,T.jsx)(k.wEH,{className:"w-4 h-4"})," ",(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"JRnw1i"})})]})})]}),(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"hDkkvu"})}),(0,T.jsxs)("select",{id:"model",className:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:null!==(i=null==u?void 0:u.elevenModelID)&&void 0!==i?i:z,onChange:function(e){return m?m({elevenModelID:e.target.value}):W(e.target.value)},children:[(0,T.jsx)("option",{value:"eleven_monolingual_v1",children:"Eleven English v1"}),(0,T.jsx)("option",{value:"eleven_multilingual_v1",children:"Eleven Multilingual v1"}),(0,T.jsx)("option",{value:"eleven_multilingual_v2",children:"Eleven Multilingual v2"})]})]}),(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"CH0AaX"})}),(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("input",{type:"range",className:"transparent h-1.5 w-full cursor-pointer appearance-none rounded-lg border-transparent bg-neutral-200",min:0,max:1,step:.05,value:null!==(o=null==u?void 0:u.elevenStability)&&void 0!==o?o:M,onChange:function(e){return m?m({elevenStability:e.target.value}):D(e.target.value)}}),(0,T.jsxs)("div",{className:"text-gray-500 text-xs flex items-center justify-between",children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"SjsPQu"})}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"3xm05L"})})]})]}),(0,T.jsx)("div",{className:"text-gray-500 text-xs",children:(0,T.jsx)(j.cC,{id:"6sxUIo"})})]}),(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"SqIaK+"})}),(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("input",{type:"range",className:"transparent h-1.5 w-full cursor-pointer appearance-none rounded-lg border-transparent bg-neutral-200",min:0,max:1,step:.05,value:null!==(l=null==u?void 0:u.elevenClarity)&&void 0!==l?l:R,onChange:function(e){return m?m({elevenClarity:e.target.value}):_(e.target.value)}}),(0,T.jsxs)("div",{className:"text-gray-500 text-xs flex items-center justify-between",children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"nTWWCZ"})}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"yx/fMc"})})]})]}),(0,T.jsx)("div",{className:"text-gray-500 text-xs",children:(0,T.jsx)(j.cC,{id:"1RkbIp"})})]})]}):null]})}var rW=(0,R.eK)("useSpeechSource"),rQ=(0,R.eK)("useAutoSpeech"),rX=(0,R.eK)("useShowPlayButton");function rJ(e){var t=e.showOpenAI,n=void 0===t||t,s=rW("disabled"),r=(0,v.Z)(s,2),a=r[0],i=r[1],o=(0,I.useState)(!1),l=o[0],c=o[1],d=(0,I.useState)(q.ag._({id:"u3pv+W"})),u=d[0],m=d[1],h=rX(!0),p=(0,v.Z)(h,2),x=p[0],g=p[1],f=rQ(!1),b=(0,v.Z)(f,2),y=b[0],w=b[1];return(0,I.useEffect)(function(){"openai-text-to-speech"!==a||n||i("disabled")},[]),(0,T.jsxs)("div",{className:"space-y-4",children:[(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"GPIMoy"})}),(0,T.jsxs)("select",{id:"model",className:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:a,onChange:function(e){return i(e.target.value)},children:[(0,T.jsx)("option",{value:"elevenlabs",children:(0,T.jsx)(j.cC,{id:"9r6uEg"})}),n?(0,T.jsx)("option",{value:"openai-text-to-speech",children:(0,T.jsx)(j.cC,{id:"lKxYcA"})}):null,(0,T.jsx)("option",{value:"browser",children:(0,T.jsx)(j.cC,{id:"ZtCLxJ"})}),(0,T.jsx)("option",{value:"disabled",children:(0,T.jsx)(j.cC,{id:"E/QGRL"})})]})]}),(0,T.jsx)("h3",{className:"text-lg font-semibold",children:(0,T.jsx)(j.cC,{id:"M7vN5/"})}),"elevenlabs"===a?(0,T.jsx)(rz,{showAdvanced:l,setShowAdvanced:c}):"openai-text-to-speech"===a?(0,T.jsx)(rR,{showAdvanced:l,setShowAdvanced:c}):"browser"===a?(0,T.jsx)(rT,{}):(0,T.jsx)("div",{className:"space-y-4",children:(0,T.jsx)("div",{className:"text-center text-gray-500 text-orange-500",children:(0,T.jsx)(j.cC,{id:"M+BBlf"})})}),"disabled"===a?null:(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"oRX7OJ"})}),(0,T.jsx)("input",{type:"text",placeholder:q.ag._({id:"y8MW1k"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",value:u,onChange:function(e){return m(e.target.value)}}),(0,T.jsx)(rO,{content:u})]}),(0,T.jsx)(Q,{label:q.ag._({id:"2xLA9y"}),enabled:x,setEnabled:g}),(0,T.jsx)(Q,{label:q.ag._({id:"rXlXlr"}),enabled:y,setEnabled:w})]})}function r$(e){var t,n,s=e.open,r=e.setOpen,a=$();return(0,T.jsxs)(B,{wide:!0,open:s,setOpen:r,showCloseButton:!1,delayMount:!0,children:[(0,T.jsx)("h2",{className:"text-center text-xl font-bold",children:(0,T.jsx)(j.cC,{id:"CZer2q"})}),(0,T.jsx)("hr",{className:"my-4"}),(0,T.jsx)(rJ,{showOpenAI:!(null!==(t=a.serverHostConfig)&&void 0!==t&&t.managed)||(0,X.N7)("useOpenAITextToSpeech",null===(n=a.serverHostConfig)||void 0===n?void 0:n.chatFeatures)}),(0,T.jsx)("div",{className:"text-center mt-4",children:(0,T.jsx)("button",{onClick:function(){return r(!1)},type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"DPfwMq"})})})})]})}function r0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function r1(e){for(var t=1;t=400)){e.next=13;break}return e.next=9,t.json();case 9:return o(e.sent.userMessage||r8),r(!1),e.abrupt("return");case 13:if(t.ok){e.next=17;break}return o(r8),r(!1),e.abrupt("return");case 17:return e.next=19,t.json();case 19:d(e.sent.connections),e.next=27;break;case 23:e.prev=23,e.t0=e.catch(2),o(r8),console.error(e.t0);case 27:r(!1);case 28:case"end":return e.stop()}},e,null,[[2,23]])})),function(){return t.apply(this,arguments)});return(0,T.jsx)("div",{children:(0,T.jsxs)("div",{className:"max-w-3xl mx-auto",children:[s?(0,T.jsx)("div",{className:" flex items-center justify-center p-4",children:(0,T.jsx)(Z,{})}):(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsx)("div",{className:"mt-2 text-center font-semibold",children:(0,T.jsx)(j.cC,{id:"YH4rCS"})}),(null==c?void 0:c.length)>0?(0,T.jsxs)("div",{className:"max-w-md mx-auto my-4",children:[c.map(function(e){return(0,T.jsx)("a",{href:"/api/hosted/sso-login?clientID="+e.clientID+"&redirect_uri="+encodeURIComponent(window.location.pathname)+(m?"&relogin=true":""),onClick:function(e){e.target.innerText=q.ag._({id:"Z3FXyt"})},className:"inline-block w-full my-1 border rounded-md border-gray-200 px-4 py-2 shadow text-center font-medium hover:bg-gray-100 transition-all dark:bg-gray-900 dark:hover:bg-gray-800 dark:border-gray-700",children:e.name},e.clientID)}),(0,T.jsx)("div",{className:"text-center",children:(0,T.jsxs)("label",{className:"inline-flex items-center justify-start gap-2 my-2 text-left",children:[(0,T.jsx)("input",{type:"checkbox",checked:m,onChange:function(e){return h(e.target.checked)}}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"WsEnIq"})})]})})]}):(0,T.jsx)("div",{className:"max-w-md mx-auto px-4 mt-2",children:(0,T.jsx)(j.cC,{id:"ksNPZj"})})]}),i?(0,T.jsx)("div",{className:"text-red-500 text-center",children:i}):null]})})}var r9=(0,R.eK)("useTMCloudEnabled"),ae="Something went wrong. Please try again.";function at(e){var t,n,s=e.hostConfig,r=e.onLoggedIn,a=e.defaultEmail,i=void 0===a?"":a,o=e.requireInviteCode,l=e.loginLabel,c=(0,I.useState)(null),d=c[0],u=c[1],m=(0,I.useState)(i),h=m[0],p=m[1],x=(0,I.useState)(""),g=x[0],b=x[1],y=(0,I.useState)(!1),A=y[0],N=y[1],k=(0,I.useState)(""),C=k[0],V=k[1],S=(0,I.useState)(!1),O=S[0],E=S[1],P=(0,I.useState)(!1),M=P[0],D=P[1],B=r9(!1),L=(0,v.Z)(B,2);L[0],L[1];var R=(0,I.useRef)(null);(0,I.useEffect)(function(){p(i)},[i]);var _=(t=(0,f.Z)(w().mark(function e(){var t;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,E(!0),u(""),e.next=5,fetch("/api/hosted/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:h,inviteCode:g,orgID:s.orgID})});case 5:if(!((t=e.sent).status>=400)){e.next=13;break}return e.next=9,t.json();case 9:return u(e.sent.userMessage||ae),E(!1),e.abrupt("return");case 13:if(t.ok){e.next=17;break}return u(ae),E(!1),e.abrupt("return");case 17:return e.next=19,t.json();case 19:e.sent,N(!0),setTimeout(function(){R.current.focus()},100),e.next=28;break;case 24:e.prev=24,e.t0=e.catch(0),console.error(e.t0),u(ae);case 28:E(!1);case 29:case"end":return e.stop()}},e,null,[[0,24]])})),function(){return t.apply(this,arguments)}),F=(n=(0,f.Z)(w().mark(function e(){var t;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,E(!0),u(""),e.next=5,fetch("/api/hosted/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:h,code:C,orgID:s.orgID}),credentials:"include"});case 5:if(!((t=e.sent).status>=400)){e.next=13;break}return e.next=9,t.json();case 9:return u(e.sent.userMessage||ae),E(!1),e.abrupt("return");case 13:if(t.ok){e.next=17;break}return u(ae),E(!1),e.abrupt("return");case 17:setTimeout(function(){null==r||r()},2e3),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(0),console.error(e.t0),u(ae);case 24:case"end":return e.stop()}},e,null,[[0,20]])})),function(){return n.apply(this,arguments)});return(0,T.jsxs)("div",{children:[M?(0,T.jsx)(r7,{hostConfig:s}):(0,T.jsxs)("div",{children:[A?(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsx)("div",{className:"my-1 font-semibold",children:(0,T.jsx)(j.cC,{id:"hSqeOv",values:{email:h}})}),(0,T.jsx)("input",{ref:R,type:"text",disabled:O,placeholder:"XXXXXX",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700 text-xl text-center",value:C,onChange:function(e){return V(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),F())}})]}),d&&(0,T.jsx)("div",{className:"text-center text-red-500 text-sm font-semibold my-2",children:d}),(0,T.jsxs)("div",{className:"my-4 flex items-center justify-center gap-2",children:[(0,T.jsxs)("button",{onClick:F,disabled:O||!C,className:"flex items-center justify-center px-3 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors gap-2",children:[O?(0,T.jsx)(Z,{}):null,(0,T.jsx)(j.cC,{id:"hQRttt"})]}),(0,T.jsx)("button",{onClick:function(){return N(!1)},disabled:O,className:"flex items-center justify-center px-3 py-2 border border-transparent text-sm font-medium rounded-md text-black bg-white-600 hover:bg-white-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-white-500 disabled:bg-gray-400 disabled:cursor-default transition-colors gap-2 disabled:text-white dark:text-white",children:(0,T.jsx)(j.cC,{id:"dEgA5A"})})]})]}):(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsx)("div",{className:"my-1 font-semibold",children:(0,T.jsx)(j.cC,{id:"vUqMKV"})}),(0,T.jsx)("input",{type:"email",disabled:O,placeholder:"example@gmail.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",value:h,onChange:function(e){return p(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),_())}})]}),(void 0===o?"":o)?(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsx)("div",{className:"my-1 font-semibold",children:(0,T.jsx)(j.cC,{id:"eJbPDS"})}),(0,T.jsx)("div",{className:"text-xs font-semibold my-1 text-gray-500",children:(0,T.jsx)(j.cC,{id:"fSOo0q"})}),(0,T.jsx)("input",{type:"text",disabled:O,placeholder:"XXXXXX",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700 text-xl text-center",value:g,onChange:function(e){return b(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),_())}})]}):null,d&&(0,T.jsx)("div",{className:"text-center text-red-500 text-sm font-semibold my-2",children:d}),(0,T.jsx)("div",{className:"my-4 flex items-center justify-center gap-2",children:(0,T.jsxs)("button",{onClick:_,disabled:O||!h,className:"flex items-center justify-center px-3 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors gap-2",children:[O?(0,T.jsx)(Z,{}):(0,T.jsx)("span",{children:"→"}),(0,T.jsx)("span",{children:s.allowPublicUse&&s.publicModeAllowSignUp?q.ag._({id:"FK/gUg"}):l||q.ag._({id:"z0t9bb"})})]})})]}),(0,T.jsx)("div",{className:"text-xs font-semibold text-gray-500 text-center px-4 mt-4",children:(0,T.jsx)(j.cC,{id:"CXtfyL"})})]}),s.allowSSOLogin?M?(0,T.jsx)("div",{className:"my-4 text-center mx-auto",children:(0,T.jsxs)("button",{onClick:function(){return D(!1)},className:"inline-flex items-center justify-center gap-2 text-blue-500 border border-blue-200 px-4 py-2 rounded-lg shadow font-semibold text-sm hover:shadow-md transition-all dark:border-blue-900 dark:bg-gray-800 dark:hover:bg-gray-900 hover:bg-blue-50",children:[(0,T.jsx)("span",{children:"→"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"u62JiU"})})]})}):(0,T.jsx)("div",{className:"my-4 text-center mx-auto",children:(0,T.jsxs)("button",{onClick:function(){return D(!0)},className:"inline-flex items-center justify-center gap-2 text-blue-500 border border-blue-200 px-4 py-2 rounded-lg shadow font-semibold text-sm hover:shadow-md transition-all dark:border-blue-900 dark:bg-gray-800 dark:hover:bg-gray-900 hover:bg-blue-50",children:[(0,T.jsx)("span",{children:"→"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"kQqZRh"})})]})}):null]})}function an(e){var t,n=e.hostConfig,s=e.open,r=e.setOpen,a=e.orgActive,i=(0,sH.e)(),o=i.user;i.loading,i.loadUser,i.logout,(0,I.useEffect)(function(){s&&l()},[s]);var l=(t=(0,f.Z)(w().mark(function e(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/hosted/org-activate-prompted",{headers:{"Content-Type":"application/json"},method:"POST"});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error(e.t0);case 8:case"end":return e.stop()}},e,null,[[0,5]])})),function(){return t.apply(this,arguments)});return(0,T.jsx)(B,{wide:!0,open:s,setOpen:r,showCloseButton:!1,children:a?o?(0,T.jsxs)("div",{children:[(0,T.jsx)("h2",{className:"text-center text-xl font-bold",children:"⛔ Server License Expired"}),(0,T.jsxs)("p",{className:"my-4 text-sm text-center",children:["Action Required: ",(0,T.jsx)("b",{children:n.name})," server license has expired. Please contact your server administrator to renew the license. If you are the server administrator, please go to the Admin panel to see more details."]}),(0,T.jsx)("div",{className:"mt-4 text-center flex items-center justify-center space-x-2",children:(0,T.jsx)("button",{onClick:function(){return r(!1)},className:"inline-flex items-center px-4 py-2 text-sm font-medium rounded-md text-gray-800 dark:text-zinc-100 dark:disabled:text-zinc-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:text-gray-400",children:(0,T.jsx)("span",{children:"Close"})})})]}):(0,T.jsxs)("div",{children:[(0,T.jsx)("h2",{className:"text-center text-xl font-bold",children:"Please login first"}),(0,T.jsxs)("p",{className:"my-4 text-sm text-center",children:[(0,T.jsx)("b",{children:n.name})," requires an account. Please login to continue."]}),(0,T.jsx)(at,{hostConfig:n,onLoggedIn:function(){window.location.reload()}}),(0,T.jsx)("div",{className:"mt-4 text-center flex items-center justify-center space-x-2",children:(0,T.jsx)("button",{onClick:function(){return r(!1)},className:"inline-flex items-center px-4 py-2 text-sm font-medium rounded-md text-gray-800 dark:text-zinc-100 dark:disabled:text-zinc-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:text-gray-400",children:(0,T.jsx)("span",{children:"I'll login later"})})})]}):(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-start gap-2 text-left",children:[(0,T.jsx)("img",{className:"h-32 w-32",src:"/assets/start-free-trial.png"}),(0,T.jsxs)("div",{children:[(0,T.jsxs)("h2",{className:"text-xl font-bold text-orange-500",children:["Activate ",n.name," to continue"]}),(0,T.jsxs)("p",{className:"my-4 text-sm",children:["Please start your ",(0,T.jsx)("b",{children:"14-day free trial"})," to continue using"," ",(0,T.jsx)("b",{children:n.name}),"."]})]})]}),(0,T.jsx)("p",{className:"mt-4 text-sm text-center",children:(0,T.jsx)("a",{href:"/admin/billing/subscribe",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2",children:"→ Start 14-day Free Trial Now"})})]})})}(0,R.eK)("useLicenseKey");var as=n(6869),ar=n.n(as),aa={id:"lkE00/"},ai=(0,R.eK)("useLatestSeenUpdate");function ao(e){var t,n=e.setOpenChangelog,s=(0,I.useState)(!0),r=s[0],a=s[1],i=(0,I.useState)(null),o=(i[0],i[1]),l=ai(),c=(0,v.Z)(l,2),d=c[0],u=c[1],m=(0,I.useState)(null),h=m[0],p=m[1],x=(0,j.mV)().i18n;$(),(0,I.useEffect)(function(){g()},[]);var g=(t=(0,f.Z)(w().mark(function e(){var t,n;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a(!0),o(""),e.prev=2,e.next=5,fetch((0,X.PO)()+"/api/changelog");case 5:if(!((t=e.sent).status>=400)){e.next=13;break}return e.next=9,t.json();case 9:return o(e.sent.userMessage||x._(aa)),a(!1),e.abrupt("return");case 13:if(t.ok){e.next=17;break}return o(x._(aa)),a(!1),e.abrupt("return");case 17:return e.next=19,t.json();case 19:p(null==(n=e.sent)?void 0:n.latest),d||u(null==n?void 0:n.latest),e.next=28;break;case 24:e.prev=24,e.t0=e.catch(2),o(x._(aa)),console.error(e.t0);case 28:a(!1);case 29:case"end":return e.stop()}},e,null,[[2,24]])})),function(){return t.apply(this,arguments)}),b=!r&&d&&h!==d;return(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)("button",{onClick:function(){h&&u(h),n(!0)},type:"button",className:"cursor-default anchor-changelog-button relative bg-white/20 text-white group flex items-center justify-center rounded-md px-2 py-1 text-xs hover:bg-white/40 transition-all space-x-2 relative",children:[(0,T.jsx)("div",{className:"w-4 h-4 text-base flex items-center justify-center",children:"\uD83D\uDE80"}),b?(0,T.jsx)("div",{className:"absolute bottom-1 right-1 w-2.5 h-2.5 rounded-full bg-green-500",children:(0,T.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-green-500 animate-ping"})}):null]})})}var al=n(95346),ac=n(36710);function ad(e){var t,n=e.currentVersion,s=(0,I.useState)(!1),r=s[0],a=s[1];(0,I.useEffect)(function(){var e=function(){"visible"===document.visibilityState&&i()};return window.document.addEventListener("visibilitychange",e),function(){window.document.removeEventListener("visibilitychange",e)}},[]);var i=(t=(0,f.Z)(w().mark(function e(){var t,s;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(window.localStorage.getItem("TM_LAST_VERSION_DATE")!==(t=new Date().toISOString().slice(0,10))){e.next=6;break}return e.abrupt("return");case 6:return e.prev=6,e.next=9,fetch("/api/version");case 9:if((s=e.sent).ok){e.next=12;break}throw Error("Failed to fetch version");case 12:return e.next=14,s.json();case 14:e.sent.vercelGitSHA!==n&&a(!0),window.localStorage.setItem("TM_LAST_VERSION_DATE",t),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(6),console.error("Error checking new version:",e.t0);case 22:case"end":return e.stop()}},e,null,[[6,19]])})),function(){return t.apply(this,arguments)});return n&&r?(0,T.jsxs)("div",{className:"bg-green-900 text-white p-2 text-xs font-medium flex items-center justify-center gap-2",children:[(0,T.jsx)("div",{className:"text-left",children:(0,T.jsx)(j.cC,{id:"heil9d"})}),(0,T.jsx)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),e.currentTarget.setAttribute("disabled","true"),setTimeout(function(){window.location.reload()},100)},className:"flex-shrink-0 cursor-default inline-flex items-center px-2 py-1 border border-transparent text-xs font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2 transition-colors",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"u6QeR6"})})})]}):null}(0,R.eK)("useUserProfilePicURL");var au=(0,R.eK)("useLastVerifiedToken");function am(){var e,t=(0,I.useState)(!1),n=t[0],s=t[1],r=au(null),a=(0,v.Z)(r,2),i=a[0];a[1];var o=(e=(0,f.Z)(w().mark(function e(){var t,n,r,a,o;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),e.prev=1,e.next=4,fetch((0,X.v9)()+"/api/faqbottoken",{body:JSON.stringify({lastVerifiedToken:i}),headers:{"Content-Type":"application/json"},method:"POST"});case 4:return t=e.sent,e.next=7,t.json();case 7:if(n=e.sent.externalAuthCode,r="https://faqbot.typingmind.com/widget.js",!document.querySelector('script[src="'.concat(r,'"]'))){e.next=14;break}return s(!1),e.abrupt("return");case 14:if(!document.querySelector('iframe[src="'.concat(r,'"]'))){e.next=17;break}return s(!1),e.abrupt("return");case 17:(a=document.createElement("script")).setAttribute("src",r),a.setAttribute("data-external-auth-code",n),a.setAttribute("defer",""),document.body.appendChild(a),o=setInterval(function(){document.querySelector('iframe[src^="https://typingmindfaq.typingcloud.com"]')&&(clearInterval(o),s(!1))},100),e.next=29;break;case 25:e.prev=25,e.t0=e.catch(1),console.error(e.t0),s(!1);case 29:case"end":return e.stop()}},e,null,[[1,25]])})),function(){return e.apply(this,arguments)});return(0,T.jsx)("div",{children:(0,T.jsxs)("button",{onClick:o,type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2",disabled:n,children:[n?(0,T.jsx)(Z,{}):"→",(0,T.jsx)("span",{children:"Load Support Bot"})]})})}function ah(e){var t=e.className;return(0,T.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-label":"Discord",role:"img",viewBox:"0 0 512 512",className:t,children:[(0,T.jsx)("rect",{width:512,height:512,fill:"#fff"}),(0,T.jsx)("path",{id:"a",fill:"#5865f2",d:"M257 129q-26 0-42 3l-10-20q-39 6-77 24-67 102-54 211 41 31 93 47 12-16 20-32-24-10-31-16l7-5q49 21 95 21zm-62 175a34 37 0 111 0"}),(0,T.jsx)("use",{href:"#a",transform:"matrix(-1 0 0 1 512 0)"})]})}function ap(e){var t,n=e.licensePayload;return(0,T.jsxs)("div",{children:[(null==n||null===(t=n.payload)||void 0===t?void 0:t.plan)==="premium"?(0,T.jsxs)("div",{className:"text-left",children:[(0,T.jsx)("div",{className:"mb-4 text-lg font-semibold",children:(0,T.jsx)(j.cC,{id:"vgtoKX"})}),(0,T.jsx)("div",{className:"my-2",children:(0,T.jsx)(j.cC,{id:"3RCFDE",components:{0:(0,T.jsx)("a",{href:"https://www.typingmind.com/faqs",target:"_blank",className:"text-blue-500 hover:underline"}),1:(0,T.jsx)("a",{href:"https://www.typingmind.com/terms",target:"_blank",className:"text-blue-500 hover:underline"}),2:(0,T.jsx)("a",{href:"https://www.typingmind.com/privacy",target:"_blank",className:"text-blue-500 hover:underline"})}})}),(0,T.jsx)("div",{className:"my-2 text-xs",children:(0,T.jsx)(j.cC,{id:"m9UoVv",components:{0:(0,T.jsx)("span",{className:"text-green-500 font-semibold"})}})}),(0,T.jsx)(am,{})]}):(0,T.jsx)("div",{className:"mb-4 text-lg font-semibold",children:(0,T.jsx)(j.cC,{id:"yxWIpJ"})}),(0,T.jsx)("hr",{className:"my-4"}),(0,T.jsxs)("p",{className:"my-2",children:[(0,T.jsxs)("b",{children:["\uD83D\uDCA1 ",(0,T.jsx)(j.cC,{id:"qPyzaP"})]}),": ",(0,T.jsx)("br",{}),(0,T.jsx)("span",{className:"text-sm",children:"Send ideas for new features or improvements here:"}),(0,T.jsx)("br",{}),(0,T.jsx)("a",{href:"https://www.typingmind.com/ideas",className:"text-blue-600 hover:underline font-semibold",target:"_blank",rel:"noreferrer noopener",children:"https://www.typingmind.com/ideas"})," "]}),(0,T.jsx)("hr",{className:"my-4"}),(0,T.jsxs)("p",{className:"my-2",children:[(0,T.jsxs)("b",{children:["\uD83D\uDEDF ",(0,T.jsx)(j.cC,{id:"q0qK3s"})]}),": ",(0,T.jsx)("br",{}),(0,T.jsx)("a",{href:"mailto:support@typingmind.com",className:"text-blue-600 hover:underline",target:"_blank",rel:"noreferrer noopener",children:"support@typingmind.com"})," ",(0,T.jsx)("br",{}),(0,T.jsx)("div",{className:"text-xs",children:(0,T.jsx)(j.cC,{id:"HXWJ3v",components:{0:(0,T.jsx)("span",{className:"text-orange-500 font-semibold"}),1:(0,T.jsx)("i",{})}})})]}),(0,T.jsxs)("p",{className:"my-2",children:[(0,T.jsxs)("b",{children:["\uD83E\uDDB8‍♀️ ",(0,T.jsx)(j.cC,{id:"J22SON"})]}),": ",(0,T.jsx)("br",{}),(0,T.jsxs)("div",{className:"text-xs",children:[(0,T.jsx)(j.cC,{id:"BkStSE"}),(0,T.jsxs)("a",{href:"https://www.typingmind.com/discord",target:"_blank",className:"text-blue-500 hover:underline flex items-center justify-start gap-1",children:[(0,T.jsx)(ah,{className:"w-6 h-6"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"B7fqtM"})})]}),(0,T.jsxs)("ul",{className:"list-disc pl-4",children:[(0,T.jsx)("li",{children:(0,T.jsx)("a",{href:"https://docs.typingmind.com/faqs",target:"_blank",className:"text-blue-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"0dyIBS"})})}),(0,T.jsx)("li",{children:(0,T.jsx)("a",{href:"https://blog.typingmind.com",target:"_blank",className:"text-blue-500 hover:underline",children:"Blog posts & Guides"})}),(0,T.jsx)("li",{children:(0,T.jsx)("a",{href:"https://docs.typingmind.com",target:"_blank",className:"text-blue-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"geLLd1"})})}),(0,T.jsx)("li",{children:(0,T.jsx)("a",{href:"https://www.typingmind.com/terms",target:"_blank",className:"text-blue-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"xowcRf"})})}),(0,T.jsx)("li",{children:(0,T.jsx)("a",{href:"https://www.typingmind.com/privacy",target:"_blank",className:"text-blue-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"LcET2C"})})})]})]})]})]})}function ax(e){var t=e.link,n=e.compact,s=(0,I.useState)(!1),r=s[0],a=s[1];return(0,T.jsxs)("div",{children:[(0,T.jsxs)("button",{onClick:function(){return a(!0)},type:"button",className:"bg-gray-600 text-white group flex items-center justify-center rounded-md px-2 py-1 text-xs hover:bg-gray-500 transition-all space-x-2",children:[(0,T.jsx)(ec.znh,{className:"h-4 w-4","aria-hidden":"true"}),n?null:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"XYLcNv"})})]}),(0,T.jsxs)(B,{open:r,setOpen:a,wide:!0,children:[(0,T.jsx)("h2",{className:"text-2xl mb-10 text-center font-bold",children:"Support"}),(0,T.jsx)("iframe",{src:t,style:{height:600},className:"w-full"})]})]})}function ag(){var e,t=(0,I.useState)(!1),n=t[0],s=t[1],r=($().serverHostConfig||{}).enabledLanguages,a=function(e){sd.Z.set("locale",e,{expires:30})},i=sd.Z.get("locale")||"en",o=r||rn,l=(null===(e=o.find(function(e){return e.locale===i}))||void 0===e?void 0:e.flag)||"?";return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("button",{onClick:function(){s(!0)},type:"button","data-element-id":"language-button",className:"cursor-default bg-white/20 text-white group flex items-center justify-center rounded-md px-2 hover:bg-white/40 transition-all space-x-2 text-base",children:l}),(0,T.jsxs)(B,{open:n,setOpen:s,children:[(0,T.jsx)("div",{className:"text-xl text-center mb-4",children:(0,T.jsx)(j.cC,{id:"MHm/fc"})}),(0,T.jsxs)("div",{className:"text-base mb-2",children:["✅ ",(0,T.jsx)(j.cC,{id:"vdM0PU"})]}),(0,T.jsx)("div",{className:"text-xs text-gray-500 my-2",children:(0,T.jsx)(j.cC,{id:"vzAe+s"})}),o.filter(function(e){return e.approved}).map(function(e){var t=e.locale,n=e.name,s=e.flag;return(0,T.jsxs)("button",{className:"px-2 py-1 rounded-md shadow-sm bg-gray-100 border-gray-200 border hover:bg-gray-200 transition-all inline-flex m-1 items-center justify-center gap-2 dark:bg-gray-800 dark:border-gray-600",onClick:function(){a(t),window.location.reload()},children:[(0,T.jsxs)("span",{children:[s," ",n]})," ",(0,T.jsx)(k.FJM,{className:"text-green-500 w-3 h-3"})]},t)}),o.filter(function(e){return!e.approved&&!e.hidden}).length?(0,T.jsxs)("div",{children:[(0,T.jsx)("hr",{className:"my-4"}),(0,T.jsxs)("div",{className:"text-base mb-2",children:["\uD83D\uDEA7 ",(0,T.jsx)(j.cC,{id:"j+fvUf"})]}),(0,T.jsx)("div",{className:"text-xs text-gray-500 my-2",children:(0,T.jsx)(j.cC,{id:"nrlh+D"})}),(0,T.jsx)("div",{className:"text-base text-center text-gray-500 my-2",children:(0,T.jsxs)("a",{href:"https://www.typingmind.com/translation",className:"text-blue-500 hover:underline text-sm font-semibold",children:["\uD83D\uDC49 ",(0,T.jsx)(j.cC,{id:"qk7MVx"})]})}),o.filter(function(e){return!e.approved&&!e.hidden}).map(function(e){var t=e.locale,n=e.name,s=e.flag;return(0,T.jsxs)("button",{className:"px-2 py-1 rounded-md shadow-sm bg-gray-100 border-gray-200 border hover:bg-gray-200 transition-all inline-block m-1 dark:bg-gray-800 dark:border-gray-600",onClick:function(){a(t),window.location.reload()},children:[s," ",n]},t)})]}):null]})]})}function af(e){var t=e.licensePayload,n=e.compact,s=(0,I.useState)(!1),r=s[0],a=s[1];return(0,T.jsxs)("div",{children:[(0,T.jsxs)("button",{onClick:function(){return a(!0)},type:"button",className:"cursor-default bg-white/20 text-white group flex items-center justify-center rounded-md px-2 py-1 text-xs hover:bg-white/40 transition-all space-x-2",children:[(0,T.jsx)(ec.znh,{className:"h-4 w-4","aria-hidden":"true"}),n?null:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"XYLcNv"})})]}),(0,T.jsx)(B,{open:r,setOpen:a,wide:!0,children:r?(0,T.jsx)(ap,{licensePayload:t}):null})]})}function ab(e){var t=e.hostConfig,n=e.onLoggedIn,s=e.small,r=(0,I.useState)(!1),a=r[0],i=r[1];return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("button",{"data-element-id":"login-button",className:s?"text-blue-500 font-semibold hover:underline text-sm":"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",onClick:function(){return i(!0)},id:"org-login-button",children:t.allowPublicUse&&t.publicModeAllowSignUp?"→ Login / Signup":"→ Member Login"}),(0,T.jsxs)(B,{open:a,setOpen:function(){return i(!1)},showCloseButton:!1,children:[(0,T.jsxs)("h2",{className:"text-lg text-center mb-4 font-semibold",children:["Login to ",t.name]}),(0,T.jsx)(at,{hostConfig:t,onLoggedIn:n,requireInviteCode:t.allowSubscriptions})]})]})}var av=n(77191),ay={id:"fWsBTs"};function aw(e){(0,av.Z)(e);var t,n=(0,I.useState)(!1),s=(n[0],n[1]),r=(0,I.useState)(null),a=(r[0],r[1]),i=(0,I.useState)([]),o=i[0],l=i[1],c=(0,j.mV)().i18n;(0,I.useEffect)(function(){d()},[]);var d=(t=(0,f.Z)(w().mark(function e(){var t;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),a(""),e.prev=2,e.next=5,fetch("/api/hosted/invite-codes",{headers:{"Content-Type":"application/json"}});case 5:if(!((t=e.sent).status>=400)){e.next=13;break}return e.next=9,t.json();case 9:return a(e.sent.userMessage||c._(ay)),s(!1),e.abrupt("return");case 13:if(t.ok){e.next=17;break}return a(c._(ay)),s(!1),e.abrupt("return");case 17:return e.next=19,t.json();case 19:l(e.sent.codes),e.next=27;break;case 23:e.prev=23,e.t0=e.catch(2),a(c._(ay)),console.error(e.t0);case 27:s(!1);case 28:case"end":return e.stop()}},e,null,[[2,23]])})),function(){return t.apply(this,arguments)});return(0,T.jsx)("div",{children:o.length?(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-center my-2",children:(0,T.jsx)(j.cC,{id:"3dz4IW",values:{0:o.length}})}),(0,T.jsx)("div",{className:"flex items-center justify-center gap-2 flex-col",children:o.map(function(e){return(0,T.jsx)("div",{className:"text-center w-fit bg-gray-200 p-2 rounded-md border-gray-200 dark:bg-zinc-700 dark:border-zinc-500 border",children:e},e)})})]}):(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"IBn/EB"})})})}function aj(e){var t,n=e.subscription;return(0,T.jsxs)("div",{className:"text-xs py-2",children:[(0,T.jsx)("div",{children:(0,T.jsx)("a",{href:null===(t=n.payload)||void 0===t?void 0:t.update_url,className:"text-blue-500 hover:text-blue-600",target:"_blank",rel:"noreferrer noopener",children:"Update Payment Method"})}),(0,T.jsx)("div",{children:(0,T.jsx)(Y,{onConfirmed:function(){var e;return window.location.href=null===(e=n.payload)||void 0===e?void 0:e.cancel_url},className:"text-red-500 font-semibold",children:"Cancel"})})]})}var aA=n(70046),aN="Something went wrong. Please try again.";function ak(e){var t,n,s,r,a,i,o=e.user,l=e.hostConfig,c=(0,I.useState)(!0),d=c[0],u=c[1],m=(0,I.useState)(!1),h=m[0],p=m[1],x=(0,I.useState)(null),g=x[0],b=x[1];(0,I.useEffect)(function(){v()},[]);var v=(t=(0,f.Z)(w().mark(function e(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(window.Paddle){e.next=5;break}return e.next=3,new Promise(function(e){return setTimeout(e,100)});case 3:e.next=0;break;case 5:window.Paddle.Setup({vendor:Number(aA.env.NEXT_PUBLIC_PADDLE_VENDOR_ID)}),u(!1);case 8:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),y=function(e){window.Paddle.Checkout.open({product:Number(e),email:o.email,disableLogout:!0,allowQuantity:!1,customData:{orgID:l.orgID},successCallback:function(){window.location.href="/user_subscription_verify"}})},j=(n=(0,f.Z)(w().mark(function e(t){var n;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return p(!0),b(""),e.prev=2,e.next=5,fetch("/api/hosted/update-plan",{body:JSON.stringify({planID:t}),headers:{"Content-Type":"application/json"},method:"POST"});case 5:if(!((n=e.sent).status>=400)){e.next=13;break}return e.next=9,n.json();case 9:return b(e.sent.userMessage||aN),p(!1),e.abrupt("return");case 13:if(n.ok){e.next=17;break}return b(aN),p(!1),e.abrupt("return");case 17:window.location.href="/user_subscription_verify?planID="+t,e.next=24;break;case 20:e.prev=20,e.t0=e.catch(2),b(aN),console.error(e.t0);case 24:p(!1);case 25:case"end":return e.stop()}},e,null,[[2,20]])})),function(e){return n.apply(this,arguments)}),A=function(){var e;return null==o||null===(e=o.subscriptions)||void 0===e?void 0:e.some(function(e){return"active"===e.status&&X.xP.includes(e.planID)})},k=function(){var e;return null==o||null===(e=o.subscriptions)||void 0===e?void 0:e.some(function(e){return"active"===e.status&&X.oC.includes(e.planID)})};return(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"text-xs my-4",children:["All plans include access to all AI chat models."," ",(0,T.jsx)("span",{className:"font-semibold text-orange-500",children:"GPT-4 availability is limited, subject to OpenAI's capacity."})]}),(0,T.jsx)("div",{className:"text-xs my-4",children:"Credit card is required on the free plan to avoid abuse."}),(0,T.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,T.jsxs)("div",{className:"p-2 rounded-md shadow-sm border border-gray-200 dark:border-zinc-700",children:[(0,T.jsx)("div",{className:"text-2xl font-bold text-center",children:"Free"}),(0,T.jsx)("div",{className:"text-center",children:(0,T.jsx)("span",{className:"text-2xl font-extrabold text-gray-500",children:"$0"})}),(0,T.jsxs)("ul",{className:"list-disc pl-4 text-xs my-2",children:[(0,T.jsx)("li",{children:"5 messages/day"}),(0,T.jsx)("li",{children:"GPT-4: Limited"}),(0,T.jsx)("li",{children:"Basic Features"}),(0,T.jsx)("li",{children:"0 invite codes"})]}),(0,T.jsx)("div",{className:"text-center",children:A()?(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-sm font-semibold text-green-500 py-2",children:"✅ Your Plan"}),null==o||null===(s=o.subscriptions)||void 0===s?void 0:s.filter(function(e){return"active"===e.status}).map(function(e){return(0,T.jsx)(aj,{subscription:e},e.subscriptionID)})]}):k()?(0,T.jsxs)("div",{children:[(0,T.jsx)(Y,{onConfirmed:function(){return j(aA.env.NEXT_PUBLIC_PADDLE_SUB_FREE_PLAN_ID)},type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 disabled:bg-gray-400 gap-2",disabled:d||h,confirmText:function(){return(0,T.jsx)("span",{children:"Sure?"})},children:(0,T.jsx)("span",{children:"Downgrade"})}),(0,T.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"You will lose access immediately"})]}):(0,T.jsx)("button",{onClick:function(){return y(aA.env.NEXT_PUBLIC_PADDLE_SUB_FREE_PLAN_ID)},type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-gray-400 gap-2",disabled:d,children:(0,T.jsx)("span",{children:"Get Free"})})})]}),(0,T.jsxs)("div",{className:"p-2 rounded-md shadow-sm border border-gray-200 dark:border-zinc-700",children:[(0,T.jsx)("div",{className:"text-2xl font-bold text-center text-green-500",children:"Pro"}),(0,T.jsxs)("div",{className:"text-center",children:[(0,T.jsx)("span",{className:"text-2xl font-extrabold",children:"$20"}),"/month"]}),(0,T.jsxs)("ul",{className:"list-disc pl-4 text-xs my-2",children:[(0,T.jsx)("li",{children:"Unlimited messages*"}),(0,T.jsx)("li",{children:"GPT-4: Limited"}),(0,T.jsx)("li",{children:(0,T.jsx)("a",{target:"_blank",href:"https://typingmind.com/features",className:"text-blue-500 hover:underline",children:"Premium Features"})}),(0,T.jsx)("li",{children:"3 invite codes"})]}),(0,T.jsx)("div",{className:"text-center",children:k()?(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-sm font-semibold text-green-500 py-2",children:"✅ Your Plan"}),null==o||null===(r=o.subscriptions)||void 0===r?void 0:r.filter(function(e){return"active"===e.status}).map(function(e){return(0,T.jsx)(aj,{subscription:e},e.subscriptionID)})]}):A()?(0,T.jsxs)("div",{children:[(0,T.jsx)(Y,{onConfirmed:function(){return j(aA.env.NEXT_PUBLIC_PADDLE_SUB_PRO_PLAN_ID)},type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-gray-400 gap-2",disabled:d||h,confirmText:function(){return(0,T.jsx)("span",{children:"Sure?"})},children:(0,T.jsx)("span",{children:"Upgrade Pro"})}),(0,T.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"You will be charged immediately"})]}):(0,T.jsx)("button",{onClick:function(){return y(aA.env.NEXT_PUBLIC_PADDLE_SUB_PRO_PLAN_ID)},type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:bg-gray-400 gap-2",disabled:d,children:(0,T.jsx)("span",{children:"Buy Pro"})})})]})]}),g&&(0,T.jsx)("div",{className:"text-red-500 text-sm font-semibold mt-2",children:g}),(0,T.jsx)("div",{className:"text-xs text-gray-500 my-4 space-y-1 text-center",children:(0,T.jsxs)("div",{children:["By subscribing to a plan, you agree to our"," ",(0,T.jsx)("a",{href:(null==l||null===(a=l.links)||void 0===a?void 0:a.terms)||"/terms",target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 underline",children:"Terms of Service"})," and ",(0,T.jsx)("a",{href:(null==l||null===(i=l.links)||void 0===i?void 0:i.privacy)||"/terms",target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 underline",children:"Privacy Policy"}),". Prices are in USD. VAT may apply. Secure payment by"," ",(0,T.jsx)("a",{href:"https://paddle.com",target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 underline",children:"Paddle"}),"."]})}),(0,T.jsxs)("details",{className:"text-xs my-4 space-y-1 text-center",children:[(0,T.jsx)("summary",{className:"cursor-pointer hover:underline",children:"(*) Fair use policy applies"}),(0,T.jsxs)("ul",{className:"list-disc pl-4 text-xs my-2 text-left",children:[(0,T.jsx)("li",{children:"Maximum 10,000 characters per message."}),(0,T.jsx)("li",{children:"Maximum 3,000 messages per day."}),(0,T.jsx)("li",{children:"Maximum 200,000 tokens usage per month."}),(0,T.jsx)("li",{children:"We reserve the right to suspend or terminate your account if you violate the fair use policy."}),(0,T.jsx)("li",{children:"Tokens are counted based on the usage of OpenAI's API resulted from your account's activities."}),(0,T.jsx)("li",{children:"Please see our Terms of Service for more details."})]})]}),(0,T.jsx)(N(),{src:"https://cdn.paddle.com/paddle/paddle.js"})]})}function aC(e){e.user,e.hostConfig;var t=(0,I.useState)(!1),n=t[0],s=t[1];return(0,T.jsxs)("div",{children:[(0,T.jsx)("button",{onClick:function(){return s(!0)},className:"font-semibold text-blue-400 hover:underline",children:"Invite Codes"}),(0,T.jsxs)(B,{open:n,setOpen:s,children:[(0,T.jsx)("h2",{className:"text-center text-xl font-bold mb-4",children:"Invite Codes"}),n?(0,T.jsx)(aw,{}):null]})]})}function aq(e){var t=e.user,n=e.hostConfig,s=(0,I.useState)(!1),r=s[0],a=s[1];(0,I.useEffect)(function(){0===t.subscriptions.filter(function(e){return"active"===e.status}).length&&a(!0)},[]);var i=t.subscriptions.filter(function(e){return X.oC.includes(e.planID)}).filter(function(e){var t;return null==e||null===(t=e.payload)||void 0===t?void 0:t.cancellation_effective_date});return(0,T.jsxs)("div",{children:[t.subscriptions.filter(function(e){return"active"===e.status}).length?(0,T.jsx)("button",{onClick:function(){return a(!0)},className:"font-semibold text-green-500 hover:underline",children:"Manage Subscription"}):(0,T.jsx)("button",{onClick:function(){return a(!0)},className:"font-semibold text-green-500 hover:underline",children:"→ Signup: free 5 messages/day"}),(0,T.jsxs)(B,{open:r,setOpen:a,children:[(0,T.jsx)("h2",{className:"text-center text-xl font-bold mb-4",children:"Manage Subscription"}),i.length?i.map(function(e,t){return(0,T.jsxs)("div",{className:"bg-yellow-100 border-l-4 border-yellow-500 p-4 mb-4 text-xs",children:[(0,T.jsx)("p",{className:"font-semibold",children:"You have a subscription that is being cancelled."}),(0,T.jsxs)("p",{children:["Cancellation effective date:"," ",(0,T.jsx)("b",{children:e.payload.cancellation_effective_date})]}),(0,T.jsx)("p",{children:"You can still use the app until the end of your billing period."})]},t)}):null,r?(0,T.jsx)(ak,{user:t,hostConfig:n}):null]})]})}function aI(e){var t,n,s,r,a,i,o=e.setOpenOrgUserProfilePopup,l=(0,sH.e)(),c=l.user,d=l.logout;return(0,T.jsxs)("div",{className:"flex items-start",children:[(0,T.jsx)("div",{className:"self-center mr-2",children:(0,T.jsx)("div",{className:"w-8 h-8 bg-white/20 flex items-center justify-center flex-shrink-0 rounded-full",children:(0,T.jsx)(k.Xws,{className:"h-4 w-4 text-white"})})}),(0,T.jsxs)("div",{children:[(0,T.jsx)("b",{className:"block font-semibold mb-0.5",children:null!==(t=c.profile)&&void 0!==t&&t.firstName&&null!==(n=c.profile)&&void 0!==n&&n.lastName?"".concat([null===(s=c.profile)||void 0===s?void 0:s.firstName,null===(r=c.profile)||void 0===r?void 0:r.lastName].join(" ")):(0,T.jsx)(j.cC,{id:"qhwV2C"})}),(0,T.jsx)("span",{className:"break-all text-sm",children:c.email||c.externalUserID})]}),(0,T.jsxs)(tl.v,{as:"div",className:"relative flex text-left ml-auto",children:[(0,T.jsxs)(tl.v.Button,{className:"relative -mr-1 text-gray-100 hover:text-white transiton-all inline-block group-hover:inline-block p-0.5 rounded-full hover:bg-white/20 cursor-pointer",children:[(0,T.jsx)(V.$T6,{className:"w-6 h-6"}),null!==(a=c.profile)&&void 0!==a&&a.firstName&&null!==(i=c.profile)&&void 0!==i&&i.lastName?null:(0,T.jsx)("div",{className:"absolute top-0 right-1 w-1.5 h-1.5 rounded-full bg-orange-500"})]}),(0,T.jsx)(S.u,{as:I.Fragment,enter:"transition ease-out duration-100",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,T.jsx)(tl.v.Items,{className:"absolute z-40 right-0 mt-2 origin-top-right -top-1/2 divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:(0,T.jsxs)("div",{className:"px-1 py-1 ",children:[(0,T.jsx)(tl.v.Item,{children:function(e){var t,n,s=e.active;return(0,T.jsxs)("button",{className:"".concat(s?"bg-blue-600 text-white":"text-gray-900"," relative cursor-default group flex shrink-0 whitespace-nowrap space-x-2 w-full items-center rounded-md pl-2 pr-3 py-2 text-sm font-medium"),onClick:function(){return o(!0)},children:[(0,T.jsx)(k.dfI,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"Dx6IaP"})}),null!==(t=c.profile)&&void 0!==t&&t.firstName&&null!==(n=c.profile)&&void 0!==n&&n.lastName?null:(0,T.jsx)("div",{className:"absolute top-2 left-3 w-1.5 h-1.5 rounded-full bg-orange-500"})]})}}),(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:function(){window.confirm("Are you sure you want to logout?")&&d()},className:"".concat(t?"bg-blue-600 text-white":"text-gray-900"," cursor-default group flex shrink-0 whitespace-nowrap space-x-2 w-full items-center rounded-md pl-2 pr-3 py-2 text-sm font-medium"),children:[(0,T.jsx)(k.d7k,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"nOhz3x"})})]})}})]})})})]})]})}function aV(e){var t=e.hostConfig,n=e.small,s=e.setOpenOrgUserProfilePopup,r=(0,sH.e)(),a=r.user,i=r.loading,o=r.loadUser;return(0,I.useEffect)(function(){o()},[]),i&&!a?null:(0,T.jsx)("div",{children:a?"anonymous"===a.externalUserID?null!=t&&t.publicModeAllowLogin?(0,T.jsx)(ab,{hostConfig:t,small:n,onLoggedIn:function(){window.location.reload()}}):null:n?null:(0,T.jsxs)("div",{className:"text-sm text-left pt-1 pb-1",children:[(0,T.jsx)(aI,{setOpenOrgUserProfilePopup:s}),t.allowSubscriptions?(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2 flex-wrap border-t border-white/20 mt-3 pt-2",children:[(0,T.jsx)(aq,{user:a,hostConfig:t}),(0,T.jsx)(aC,{user:a,hostConfig:t})]}):null]}):(0,T.jsx)(ab,{hostConfig:t,small:n,onLoggedIn:function(){window.location.reload()}})})}var aS=n(10245),aO=(0,R.eK)("useTMCloudEnabled");function aE(){var e=aO(!1),t=(0,v.Z)(e,2),n=t[0];t[1];var s=(0,aS.n)().syncStatus;return n?"scheduled"===s?(0,T.jsx)("div",{className:"absolute bottom-1 right-1 w-2 h-2 rounded-full bg-orange-500"}):"started"===s?(0,T.jsx)("div",{className:"absolute bottom-1 right-1 w-2 h-2 rounded-full bg-green-500"}):"error"===s?(0,T.jsxs)("div",{className:"absolute bottom-1 right-1 w-2 h-2 rounded-full bg-red-500",children:[" ",(0,T.jsx)("div",{className:"absolute bottom-0 right-0 w-2 h-2 rounded-full bg-red-500 animate-ping"})]}):null:(0,T.jsx)(k.Wh,{className:"absolute bottom-1 right-1 w-2 h-2 shadow text-yellow-500"})}function aP(e){var t=e.setOpenBackupSync;return(0,T.jsxs)("button",{onClick:function(){return t(!0)},type:"button","data-element-id":"cloud-button",className:"cursor-default bg-white/20 text-white group flex items-center justify-center rounded-md px-2 py-1 text-xs hover:bg-white/40 transition-all space-x-2 relative",children:[(0,T.jsx)(k.Qvc,{className:"w-4 h-4"}),(0,T.jsx)(aE,{})]})}function aM(e){var t=e.setChats,n=e.wait,s=void 0===n?5e3:n,r=e.showCoruptedMessage,a=e.emptyMessage,i=(0,I.useState)([]),o=i[0],l=i[1],c=(0,I.useState)(null),d=c[0],u=c[1],m=$();(0,I.useEffect)(function(){var e=setTimeout((0,f.Z)(w().mark(function e(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("ChatsCoruptCheck"),e.t0=X.FW,e.next=4,(0,R.CQ)().entries();case 4:e.t1=e.sent.filter(function(e){var t=(0,v.Z)(e,2),n=t[0];return t[1],n.startsWith("CHAT_")}).map(function(e){var t=(0,v.Z)(e,2);return t[0],t[1]}).filter(Boolean),l((0,e.t0)(e.t1));case 7:case"end":return e.stop()}},e)})),s);return function(){clearTimeout(e)}},[]);var h=function(){if(!m.licensePayload){u(q.ag._({id:"meXG5q"}));return}t(o)};return o.length?(0,T.jsxs)("div",{className:"m-2 p-2 bg-yellow-500 text-black rounded-lg text-xs space-y-2 max-w-xs mx-auto text-center",children:[(0,T.jsxs)("div",{children:[void 0===r||r?q.ag._({id:"TzBiUJ"}):""," ",(0,T.jsx)(j.cC,{id:"Wtg0tB",values:{0:o.length},components:{0:(0,T.jsx)("b",{})}})]}),d?(0,T.jsx)("div",{className:"text-red-500 font-semibold bg-white",children:d}):null,(0,T.jsx)("div",{className:"text-center",children:(0,T.jsx)("button",{onClick:function(){return h()},type:"button",className:"rounded-full border border-blue-500 px-3 py-1 text-sm my-0 hover:bg-blue-600 transition-all space-x-1 bg-blue-500 text-white",children:(0,T.jsx)(j.cC,{id:"mBkVGB"})})})]}):(void 0===a?function(){return null}:a)()}var aT=(0,R.eK)("useLicenseKey");function aD(){var e,t=(0,I.useState)(!1),n=t[0],s=t[1],r=(0,I.useState)(!1),a=r[0],i=r[1],o=(0,I.useState)(!1),l=o[0],c=o[1],d=aT(""),u=(0,v.Z)(d,2),m=u[0],h=u[1],p=(e=(0,f.Z)(w().mark(function e(){var t,n;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,i(!0),c(""),t="https://www.typingmind.com",e.next=6,(0,R.CQ)().get("INSTANCE_ID");case 6:return n=e.sent,e.next=9,fetch(t+"/api/unlink-license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:m,instanceID:n})});case 9:return e.sent.ok,e.next=13,(0,R.CQ)().del("INSTANCE_ID");case 13:h(""),window.location.reload(),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(0),console.error(e.t0),c("Something went wrong. Please try again.");case 21:i(!1);case 22:case"end":return e.stop()}},e,null,[[0,17]])})),function(){return e.apply(this,arguments)});return m?(0,T.jsxs)("div",{className:"text-center",children:[(0,T.jsx)("div",{children:(0,T.jsx)("button",{onClick:function(){return s(!0)},className:"text-red-500 hover:underline text-sm font-semibold",children:(0,T.jsx)(j.cC,{id:"W2RH+r"})})}),n?(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-sm text-orange-500 my-2",children:(0,T.jsx)(j.cC,{id:"qZyW8X"})}),l&&(0,T.jsx)("div",{className:"text-red-500 my-2 font-semibold",children:l}),(0,T.jsx)("div",{children:(0,T.jsx)("button",{onClick:p,type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 disabled:bg-gray-400 gap-2",disabled:a,children:(0,T.jsx)(j.cC,{id:"Kb4R2a"})})}),(0,T.jsx)("div",{children:(0,T.jsx)("button",{onClick:function(){return s(!1)},className:"text-gray-500 hover:underline text-sm font-semibold p-4",children:(0,T.jsx)(j.cC,{id:"dEgA5A"})})})]}):null]}):null}function aB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}var aL=(0,R.eK)("useLicenseKey"),aR={id:"fWsBTs"};function a_(e){var t,n,s,r,a=e.open,i=e.licenseError,o=e.setOpen,l=e.setOpenBuy,c=e.setLicenseVerified,d=e.verifyLicenseKey,u=e.licensePayload,m=e.onLicenseKeyActivated,h=aL(""),p=(0,v.Z)(h,2),x=p[0],g=p[1],y=(0,I.useState)(""),A=y[0],N=y[1],C=(0,I.useState)(!1),q=C[0],V=C[1],S=(0,I.useState)(""),O=S[0],E=S[1],P=(0,I.useState)(!0),M=P[0],D=P[1],L=(0,j.mV)().i18n,_=$(),F=(0,I.useRef)();(0,I.useEffect)(function(){x||(0,R.CQ)().del("INSTANCE_ID")},[]),(0,I.useEffect)(function(){x?D(!0):D(!1)},[]),(0,I.useEffect)(function(){a&&(E(""),x?D(!0):D(!1),N(""),setTimeout(function(){var e;null===(e=F.current)||void 0===e||e.focus()},700))},[a]),(0,I.useEffect)(function(){N(x)},[x]);var G=(t=(0,f.Z)(w().mark(function e(){var t,n,s,r,a;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==A){e.next=5;break}return g(""),o(!1),c(!1),e.abrupt("return");case 5:return e.prev=5,V(!0),E(""),t="https://www.typingmind.com",e.next=11,(0,R.CQ)().get("INSTANCE_ID");case 11:return n=e.sent,e.next=14,fetch(t+"/api/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(function(e){for(var t=1;t=500)){e.next=22;break}return e.next=18,s.text();case 18:return e.sent,E(L._({id:"0O2epA"})),V(!1),e.abrupt("return");case 22:if(!(s.status>=400)){e.next=37;break}return e.next=25,s.json();case 25:if(!(r=e.sent).deviceUnlinked){e.next=30;break}return E(L._({id:"XvQUAU"})),V(!1),e.abrupt("return");case 30:if(!r.limitReached){e.next=34;break}return E((0,T.jsxs)("div",{className:"text-left flex flex-col gap-2",children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"cTdBYz"})}),(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"XNLbke",values:{0:r.activationLimit}})}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"gj6qzs",values:{0:r.activationUsage}})})]}),(0,T.jsx)("div",{className:"text-center",children:(0,T.jsx)("a",{href:"https://www.typingmind.com/license",target:"_blank",className:"font-semibold hover:underline p-2 rounded border-red-500 inline-block border",children:(0,T.jsx)(j.cC,{id:"lcFzRd"})})}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.cC,{id:"xDic64"})," "]}),(0,T.jsx)("div",{children:(0,T.jsx)("a",{className:"hover:underline",href:"https://www.typingmind.com/faqs",children:(0,T.jsx)(j.cC,{id:"vXqHoZ"})})})]})),V(!1),e.abrupt("return");case 34:return E(r.userMessage||L._(aR)),V(!1),e.abrupt("return");case 37:if(s.ok){e.next=41;break}return E(L._(aR)),V(!1),e.abrupt("return");case 41:return e.next=43,s.json();case 43:if(!(a=e.sent).instanceID){e.next=47;break}return e.next=47,(0,R.CQ)().set("INSTANCE_ID",a.instanceID);case 47:return e.next=49,d(A);case 49:g(A),o(!1),c(!0),null==m||m(),e.next=59;break;case 55:e.prev=55,e.t0=e.catch(5),console.error(e.t0),E(L._(aR));case 59:V(!1);case 60:case"end":return e.stop()}},e,null,[[5,55]])})),function(){return t.apply(this,arguments)});return(0,T.jsxs)(B,{open:a,setOpen:o,showCloseButton:!1,children:[(0,T.jsxs)("h2",{className:"text-center text-xl font-bold",children:["\uD83D\uDD11 ",(0,T.jsx)(j.cC,{id:"4o/F78"})]}),(0,T.jsx)("p",{className:"my-2 text-sm",children:(0,T.jsx)(j.cC,{id:"5trAhQ",components:{0:(0,T.jsx)("b",{})}})}),i?(0,T.jsx)("div",{className:"text-sm font-semibold text-red-500",children:i.limitReached?(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"0EmptK",components:{0:(0,T.jsx)("br",{}),1:(0,T.jsx)("b",{})}})}):i.deviceUnlinked?(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"6QICdW"})}):i.userMessage?(0,T.jsx)("div",{children:i.userMessage}):null}):null,(0,T.jsx)("div",{className:"my-4 z-100 relative",children:M?(0,T.jsxs)("div",{className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700 text-right flex items-center justify-end gap-4",children:[(0,T.jsxs)("span",{children:["**************************",x.slice(-4)]}),(0,T.jsx)("button",{onClick:function(){D(!1),N(""),setTimeout(function(){var e;null===(e=F.current)||void 0===e||e.focus()},100)},className:"text-blue-500 hover:underline",children:(0,T.jsx)(j.cC,{id:"rZf6Qw"})})]}):(0,T.jsx)("input",{type:"text",ref:F,disabled:q,placeholder:L._({id:"j/jUA8"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",value:A,onChange:function(e){return N(e.target.value)},onKeyDown:function(e){"Enter"!==e.key||A&&A.startsWith("sk-")||(e.preventDefault(),G())}})}),O&&(0,T.jsx)("div",{className:"my-2 text-sm text-red-500 text-center",children:O}),A&&A.startsWith("sk-")?(0,T.jsx)("p",{className:"my-2 text-sm text-red-500",children:(0,T.jsx)(j.cC,{id:"vVD6Dy"})}):null,M?null:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("p",{className:"my-2 text-sm",children:(0,T.jsx)(j.cC,{id:"gvy3rp",components:{0:(0,T.jsx)("button",{onClick:function(){o(!1),setTimeout(function(){l(!0)},500)},className:"text-blue-500 hover:underline"})}})}),(0,T.jsxs)("p",{className:"my-2 text-sm",children:[(0,T.jsx)(j.cC,{id:"4TQrIR"})," →"," ",(0,T.jsx)("a",{className:"text-blue-500 hover:underline",href:(null===(n=_.serverHostConfig)||void 0===n||null===(n=n.licenseServerConfig)||void 0===n?void 0:n.recoverLink)||"https://app.lemonsqueezy.com/my-orders/",target:"_blank",rel:"noopener noreferrer",children:(0,T.jsx)(j.cC,{id:"9kEKKZ"})})]}),(0,T.jsx)("div",{className:"my-4 text-center flex items-center justify-center space-x-2",children:(0,T.jsxs)("button",{disabled:q||!A||A&&A.startsWith("sk-"),onClick:G,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:bg-gray-500",children:[q?(0,T.jsx)(Z,{}):(0,T.jsx)(ec.bzc,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"VzNizi"})})]})}),(0,T.jsx)("p",{className:"my-2 text-xs",children:(0,T.jsx)(j.cC,{id:"153KVj"})})]}),u?(0,T.jsx)("div",{className:"text-center",children:(0,T.jsx)(j.cC,{id:"2LLYJB",values:{0:(0,X.fm)((null==u||null===(s=u.payload)||void 0===s?void 0:s.plan)||"?")},components:{0:(0,T.jsx)("b",{className:"text-green-500"})}})}):null,(0,T.jsxs)("div",{className:"text-center mt-4",children:[(0,T.jsx)("div",{className:"my-2 text-center",children:(0,T.jsxs)("button",{onClick:function(){o(!1),setTimeout(function(){l(!0)},500)},className:"text-blue-500 hover:underline inline-flex items-center justify-center gap-2 font-semibold",children:[(0,T.jsx)(k.PcH,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"ldcOo7"})})]})}),(0,T.jsx)("div",{className:"my-2",children:(0,T.jsxs)("a",{target:"_blank",rel:"noopener noreferrer",href:(null===(r=_.serverHostConfig)||void 0===r||null===(r=r.licenseServerConfig)||void 0===r?void 0:r.manageLink)||"https://www.typingmind.com/license",className:"text-blue-500 hover:underline inline-flex items-center justify-center gap-2 font-semibold",children:[(0,T.jsx)(k.q2z,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"HjdyXC"})})]})}),(0,T.jsx)("div",{className:"mt-2",children:(0,T.jsx)(aD,{})})]})]})}var aF=n(98191);function aG(){var e=eZ(),t=e.themeMode,n=e.setThemeMode;return(0,T.jsx)("button",{onClick:function(){return n("light"===t?"dark":"dark"===t?"system":"light")},type:"button","data-element-id":"dark-mode-button",className:"cursor-default bg-white/20 text-white group flex items-center justify-center rounded-md px-2 py-1 text-xs hover:bg-white/40 transition-all space-x-2",children:"dark"===t?(0,T.jsx)(tR.Lac,{className:"h-4 w-4"}):"light"===t?(0,T.jsx)(tR.q4P,{className:"w-4 h-4"}):"system"===t?(0,T.jsx)(aF.g9d,{className:"w-4 h-4"}):null})}function aK(){return(0,T.jsxs)("details",{children:[(0,T.jsx)("summary",{className:"text-left font-semibold my-2 text-base cursor-pointer hover:underline",children:(0,T.jsx)(j.cC,{id:"aPd0KC"})}),(0,T.jsxs)("ul",{className:"space-y-2 list-disc pl-4",children:[(0,T.jsx)("li",{className:"",children:(0,T.jsx)(j.cC,{id:"jefIoa",components:{0:(0,T.jsx)("b",{})}})}),(0,T.jsx)("li",{className:"",children:(0,T.jsx)(j.cC,{id:"+iNEMI"})}),(0,T.jsx)("li",{className:"",children:(0,T.jsx)(j.cC,{id:"IwdUX/",components:{0:(0,T.jsx)("b",{}),1:(0,T.jsx)("a",{target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline",href:"https://platform.openai.com/account/usage"})}})}),(0,T.jsx)("li",{className:"",children:(0,T.jsx)(j.cC,{id:"gbk4fY",components:{0:(0,T.jsx)("a",{target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline",href:"https://openai.com/pricing"})}})}),(0,T.jsx)("li",{className:"",children:(0,T.jsx)(j.cC,{id:"7ziKq7",components:{0:(0,T.jsx)("b",{})}})}),(0,T.jsx)("li",{children:(0,T.jsx)("a",{className:"text-blue-500 hover:underline",target:"_blank",rel:"noopener noreferrer",href:"https://platform.openai.com/docs/guides/chat",children:(0,T.jsx)(j.cC,{id:"4nqCi7"})})})]})]})}var aZ=(0,R.eK)("useAPIKey"),aY=(0,R.eK)("useAnthropicAPIKey"),aU=(0,R.eK)("useGeminiAPIKey");function aH(e){var t,n=e.decryptedApiKey,s=e.decryptedAnthropicApiKey,r=e.onCompleted,a=e.setOpenDecrypt,i=e.isAPIKeyOptional,o=$().serverHostConfig,l=o.enableClaude,c=o.enableGPT,d=aZ(""),u=(0,v.Z)(d,2),m=u[0],h=u[1],p=aY(""),x=(0,v.Z)(p,2),g=x[0],b=x[1],y=aU(""),A=(0,v.Z)(y,2),N=A[0],C=A[1],q=(0,I.useState)(!1),V=q[0],S=q[1],O=(0,j.mV)().i18n,E=[n,s].filter(Boolean).filter(function(e){return e.startsWith("encrypted-")}).length,P=(t=(0,f.Z)(w().mark(function e(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(E>0)){e.next=3;break}return a(!0),e.abrupt("return");case 3:S(!0);case 4:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)});return(0,T.jsxs)("div",{className:"",children:[m||g?(0,T.jsx)("button",{onClick:P,className:"bg-white/20 text-white group flex items-center justify-center rounded-md px-2 py-1 text-xs font-medium w-full hover:bg-white/40 transition-all cursor-default",children:E>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(k.kUi,{className:"text-red-400 mr-2 h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,T.jsx)("span",{className:"font-mono text-red-400",children:(0,T.jsx)(j.cC,{id:"Hjx5Vx"})})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ec.bzc,{className:"text-green-500 mr-2 h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,T.jsx)("span",{children:m||g?O._({id:"hp8OtS"}):""})]})}):(0,T.jsxs)("button",{className:"cursor-default bg-white/20 text-white group flex items-center justify-center rounded-md px-2 py-1 text-xs font-medium w-full hover:bg-gray-500 transition-all space-x-1",onClick:P,children:[i?null:(0,T.jsx)(ec.CSE,{className:"text-yellow-500 h-4 w-4 flex-shrink-0 ","aria-hidden":"true"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"YnCPVD"})})]}),(0,T.jsxs)(B,{open:V,setOpen:S,showCloseButton:!1,children:[(0,T.jsxs)("h2",{className:"text-center text-xl font-bold",children:["\uD83D\uDD11 ",(0,T.jsx)(j.cC,{id:"YnCPVD"}),":"]}),i?(0,T.jsx)("div",{className:"text-xs my-4 bg-green-500 text-white p-2 rounded-md shadow",children:(0,T.jsx)(j.cC,{id:"Gnota0",components:{0:(0,T.jsx)("b",{})}})}):null,(0,T.jsx)("div",{className:"text-xs my-4",children:(0,T.jsx)(j.cC,{id:"yX4ZJX"})}),V?(0,T.jsxs)("div",{className:"space-y-4",children:[c?(0,T.jsx)(sS,{onCompleted:r,apiKey:m,setApiKey:h}):null,l?(0,T.jsx)(sE,{onCompleted:r,anthropicAPIKey:g,setAnthropicAPIKey:b}):null,X.PI?(0,T.jsx)(sP,{onCompleted:r,geminiAPIKey:N,setGeminiAPIKey:C}):null]}):null,(0,T.jsx)("div",{className:"my-4",children:(0,T.jsx)(sG,{})}),m||g?null:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"my-2 text-center space-x-2 flex items-center justify-center"}),(0,T.jsx)("div",{className:"my-4 text-center font-semibold",children:(0,T.jsxs)("details",{children:[(0,T.jsx)("summary",{className:"my-4 cursor-pointer hover:underline",children:(0,T.jsx)(j.cC,{id:"1xrXA1"})}),(0,T.jsxs)("ul",{className:"list-disc pl-4 text-left space-y-4",children:[(0,T.jsx)("li",{children:(0,T.jsx)(j.cC,{id:"OpIDIK",components:{0:(0,T.jsx)("a",{className:"text-blue-500 hover:underline",target:"_blank",rel:"noopener noreferrer",href:"https://platform.openai.com/account/billing/overview"})}})}),(0,T.jsx)("li",{children:(0,T.jsx)(j.cC,{id:"tOO5PC"})})]})]})}),(0,T.jsx)("div",{className:" text-center",children:(0,T.jsxs)("a",{className:"text-blue-500 hover:underline font-semibold",target:"_blank",rel:"noreferrer",href:"https://docs.typingmind.com/other-resources/how-tos/how-to-use-open-router-models-on-typing-mind",children:["→ ",(0,T.jsx)(j.cC,{id:"OoaSi5"})]})})]})]})]})}function az(e){var t=e.licenseVerified,n=e.setOpenLicenseKey;return(0,T.jsx)("div",{children:(0,T.jsx)("button",{onClick:function(){return n(!0)},className:"cursor-default bg-white/20 text-white group flex items-center justify-center rounded-md px-2 py-1 text-xs font-medium w-full hover:bg-white/40 transition-all",children:!0===t?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ec.bzc,{className:"text-green-500 mr-2 h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,T.jsx)(j.cC,{id:"JEv05s"})]}):!1===t?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ec.CSE,{className:"text-yellow-500 mr-2 h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,T.jsx)(j.cC,{id:"khlq+8"})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ec.CSE,{className:"text-yellow-500 mr-2 h-4 w-4 flex-shrink-0 opacity-0","aria-hidden":"true"}),(0,T.jsx)("span",{className:"opacity-0",children:"Loading"})]})})})}function aW(e){var t=e.link,n=void 0===t?"mailto:feedback@typingmind.com":t,s=e.compact,r=(0,I.useState)(!1),a=r[0],i=r[1];return(0,T.jsxs)("div",{children:[(0,T.jsxs)("button",{"data-element-id":"send-feedback-button",onClick:function(){return i(!0)},type:"button",className:"cursor-default bg-gray-600 text-white group flex items-center justify-center rounded-md px-2 py-1 text-xs hover:bg-gray-500 transition-all space-x-2",children:[(0,T.jsx)(V.fsM,{className:"h-4 w-4","aria-hidden":"true"}),s?null:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"YirHq7"})})]}),(0,T.jsx)(B,{open:a,setOpen:i,children:(0,T.jsxs)("div",{className:"text-center",children:[(0,T.jsx)("h2",{className:"text-xl font-semibold text-center",children:"Feedback/Support"}),(0,T.jsx)("p",{className:"my-4",children:(0,T.jsx)(j.cC,{id:"OZbbiL"})}),(0,T.jsx)("p",{className:"my-4",children:(0,T.jsx)("a",{href:n,className:"text-blue-600 hover:underline",target:"_blank",rel:"noreferrer noopener",children:n.startsWith("mailto:")?n.slice(7):n})})]})})]})}(0,R.eK)("useLicenseKey");var aQ=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function aX(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=e.getDate(),r=aQ[e.getMonth()],a=e.getFullYear(),i=e.getHours(),o=e.getMinutes();return(o<10&&(o="0".concat(o)),t)?"".concat(t," at ").concat(i,":").concat(o):n?"".concat(s," ").concat(r," at ").concat(i,":").concat(o):"".concat(s," ").concat(r," ").concat(a,". at ").concat(i,":").concat(o)}function aJ(e){if(!e)return null;var t="object"==typeof e?e:new Date(e),n=new Date,s=new Date(n-864e5),r=Math.round((n-t)/1e3),a=Math.round(r/60),i=n.toDateString()===t.toDateString(),o=s.toDateString()===t.toDateString(),l=n.getFullYear()===t.getFullYear();if(r<5)return"now";if(r<60)return"".concat(r," seconds ago");if(r<90)return"about a minute ago";if(a<60)return"".concat(a," minutes ago");if(i)return aX(t,"Today");if(o)return aX(t,"Yesterday");if(l)return aX(t,!1,!0);return aX(t)}var a$=n(28276),a0=n(23501),a1=n.n(a0),a2=function(e){var t=e.suggestions,n=void 0===t?[]:t,s=e.tags,r=e.setTags,a=e.placeholder,i=e.allowNew,o=e.className,l=e.inputClassName,c=e.autoFocus,d=e.newTagText,u=e.allowBackspace,m=(0,I.useRef)(),h=(0,I.useState)(!1),p=h[0],x=h[1];(0,I.useEffect)(function(){if(c){var e;null===(e=m.current)||void 0===e||null===(e=e.input)||void 0===e||null===(e=e.current)||void 0===e||null===(e=e.input)||void 0===e||null===(e=e.current)||void 0===e||e.focus()}},[]);var f=(0,I.useMemo)(function(){return n.filter(function(e){return!s.find(function(t){return t.name===e.name})})},[s,n]);return(0,T.jsx)("div",{"data-element-id":"add-new-prompt-tags-input",className:o,children:(0,T.jsx)(a1(),{tags:s,suggestions:f,onDelete:function(e){r(s.filter(function(t,n){return n!==e}))},onAddition:function(e){s.find(function(t){return t.id===e.id||t.name===e.name})||(0===e.id&&(e.id="tag-"+(0,C.Z)()),r([].concat((0,g.Z)(s),[e])),x(!1))},allowNew:i&&p,minQueryLength:0,onInput:i?function(e){if(p&&0===e.length){x(!1);return}if(!p&&e.length>0){x(!0);return}}:void 0,newTagText:d||q.ag._({id:"uFQF6u"}),placeholderText:a||q.ag._({id:"ENWqZw"}),ref:m,classNames:{root:"w-full",selected:"flex flex-wrap gap-2 w-full mb-2 empty:hidden",selectedTag:'border border-gray-400 dark:border-gray-100 rounded-md px-2 py-0.5 after:content-["✕"] after:ml-2 hover:border-red-500 after:hover:text-red-500',search:"w-full max-w-full relative",searchInput:function(){for(var e=arguments.length,t=Array(e),n=0;n0?(0,T.jsx)("button",{onClick:function(){C(!0)},className:"cursor-default text-white/50 hover:text-white transiton-all p-1",children:(0,T.jsx)(ec.YK6,{className:"w-6 h-6 sm:w-4 sm:h-4"})}):(0,T.jsx)(Y,{onConfirmed:r,className:"cursor-default text-white/50 hover:text-white transiton-all p-1",children:(0,T.jsx)(ec.YK6,{className:"w-6 h-6 sm:w-4 sm:h-4"})})]})})]})),(0,T.jsxs)("div",{className:io("pl-6 relative hidden",m&&"!block mb-4"),children:[n,l>0?(0,T.jsx)("div",{className:"absolute top-0 -translate-y-5 left-5 h-[calc(100%+20px)] w-[1px] bg-white/20 -translate-x-1/2"}):(0,T.jsx)("div",{className:"mt-2 mr-2 rounded-md text-white/50 border border-white/50 border-dashed p-2 text-sm font-semibold text-center",children:"Empty folder"})]}),(0,T.jsx)(tK.u,{id:"add-chat-button",place:"top",children:(0,T.jsx)(j.cC,{id:"5jeS/s"})})]})};function ic(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function id(e){for(var t=1;t0&&(0,T.jsx)("span",{className:"absolute bottom-0 right-0 w-2 h-2 rounded-full bg-orange-500"})]}),(0,T.jsx)(iw.J.Panel,{className:"absolute right-0 z-20 mt-3 w-[272px] text-sm",children:(0,T.jsxs)("div",{"data-element-id":"tag-search-panel",className:"p-2 rounded-md shadow-xl ring-red-400 border border-gray-500 bg-gray-600",children:[(0,T.jsxs)("label",{className:"block space-y-1 relative z-10 text-white",children:[(0,T.jsx)("span",{className:"block font-semibold ",children:"Filter by tags"}),(0,T.jsx)("input",{placeholder:q.ag._({id:"lnWve4"}),type:"search",className:"bg-gray-700 text-white px-2 py-1 rounded-md w-full",value:d,onChange:function(e){return u(e.target.value)}})]}),(0,T.jsxs)("div",{className:"max-h-[200px] overflow-auto text-white space-y-2 mt-2",children:[h.map(function(e){var t=!!o.find(function(t){return t.name===e.name});return(0,T.jsxs)("label",{className:"flex items-center space-x-2 px-1",children:[(0,T.jsx)("input",{type:"checkbox",checked:t,className:"h-4 w-4 rounded border-gray-300",onChange:function(){return l(function(n){return t?n.filter(function(t){return t.id!==e.id}):[].concat((0,g.Z)(n),[e])})}}),(0,T.jsx)("p",{children:e.name})]},e.id)}),0===h.length&&(0,T.jsx)("p",{children:(0,T.jsx)(j.cC,{id:"cCELIA"})})]}),(0,T.jsxs)("div",{className:"mt-2 flex justify-end items-center space-x-1",children:[(0,T.jsx)("button",{onClick:function(){l([])},className:" text-orange-400 hover:text-orange-500 mr-auto transition font-bold py-2 px-1 rounded inline-flex space-x-1 justify-center items-center",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"OfhWJH"})})}),(0,T.jsx)("button",{onClick:function(){l(n),u(""),r()},className:" text-white transition font-bold py-2 px-4 rounded inline-flex space-x-1 justify-center items-center",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"dEgA5A"})})}),(0,T.jsx)("button",{onClick:function(){s(o),u(""),r()},className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors whitespace-nowrap gap-1",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"zga9sT"})})})]})]})})]})}})};function iN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n=2)){e.next=5;break}return e.next=3,E(tu);case 3:ta(e.sent);case 5:case"end":return e.stop()}},e)}))()},[tn,tu]);var t2=function(){e_(function(e){return[{id:"fo-"+(0,C.Z)(),title:q.ag._({id:"tX5yOZ"}),new:!0,open:!0,createdAt:new Date,updatedAt:new Date,syncedAt:null}].concat((0,g.Z)(e)).map(function(e,t){return iC(iC({},e),{},{order:t})})})},t4=function(e){e_(function(t){var n=(0,X.Jq)(t).findIndex(function(t){return t.id===e.id}),s=(0,g.Z)(t);return s[n]=iC(iC({},e),{},{updatedAt:new Date,syncedAt:null}),s})},t5=function(e,t){eK(function(t){return[].concat((0,g.Z)(t),[e])}),e_((0,X.Jq)(eR).filter(function(t){return t.id!==e}));var n=t1[e]||[];t&&F(n)},t6=function(){tb(!1),tw([])},t8=function(e,t){var n=e0?tU.findIndex(function(e){return e===e0}):-1,s=tU.findIndex(function(t){return t===e});t.shiftKey&&-1!==n&&n!==s?tw(function(e){var t=n=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw a}}}}((0,X.Jq)(eR));try{for(s.s();!(n=s.n()).done;){var r,a=n.value;if(null!==(r=t1[a.id])&&void 0!==r&&r.includes(t.id)){e[a.id]=[].concat((0,g.Z)(e[a.id]||[]),[t]);return}}}catch(e){s.e(e)}finally{s.f()}e.ROOT=[].concat((0,g.Z)(e.ROOT||[]),[t])}),e},[ne,eR,t1]);if((0,I.useEffect)(function(){tH(function(){return[].concat((0,g.Z)((0,X.Jq)(eR).map(function(e){return nn[e.id]||[]})),[nn.ROOT||[]]).flat().map(function(e){return e.id})})},[nn,eR]),!eA)return null;var ns={"--list-background-color":(0,X.dl)(t0,tZ?7:10),"--sidebar-color":(0,X.dl)(t0,tZ?10:20),"--popup-color":(0,X.dl)(t0,tZ?20:25)};return(0,T.jsxs)("div",{onTouchMove:function(e){eV&&e.touches[0].clientX-eV<-100&&U(!1)},onTouchStart:function(e){eS(e.touches[0].clientX)},onTouchEnd:function(){eS(null)},style:ns,className:"jsx-2562846439 flex min-h-0 flex-1 flex-col bg-gray-800",children:[(0,T.jsx)("div",{id:"navbar",className:"jsx-2562846439 flex flex-1 flex-col",children:(0,T.jsxs)("nav",{"data-element-id":"side-bar-background",className:"jsx-2562846439 bg-[color:var(--list-background-color)] flex flex-col h-screen",children:[(0,T.jsx)("div",{className:"jsx-2562846439 flex-shrink-0",children:(0,T.jsxs)("div",{"data-element-id":"sidebar-beginning-part",className:"jsx-2562846439 px-2 space-y-2 bg-[color:var(--sidebar-color)] py-2",children:[(0,T.jsxs)("div",{className:"jsx-2562846439 flex items-center justify-center space-x-2",children:[(0,T.jsxs)("button",{onClick:function(){K(),U(!1),setTimeout(function(){var e=document.getElementById("chat-input-textbox");e&&e.focus()},100)},"data-element-id":"new-chat-button-in-side-bar",className:"jsx-2562846439 "+(iL("cursor-default bg-white/20 hover:bg-white/40 text-white group flex items-center justify-center rounded-md px-2 py-2 text-sm font-medium w-full transition-all")||""),children:[(0,T.jsx)(tR.wIw,{className:iL("text-gray-300 mr-2 h-6 w-6 flex-shrink-0"),"aria-hidden":"true"}),(0,T.jsx)(j.cC,{id:"q2+WzE"})]}),(0,T.jsxs)(tl.v,{as:"div",className:"relative inline-block text-left",children:[(0,T.jsx)("div",{className:"jsx-2562846439",children:(0,T.jsx)(tl.v.Button,{"data-element-id":"settings-button",className:iL("cursor-default bg-white/20 hover:bg-white/40 text-white group flex items-center justify-center rounded-md px-2 py-2 text-sm font-medium transition-all w-10 shrink-0"),children:(0,T.jsx)(al.Bbf,{className:iL("text-gray-300 h-6 w-6 flex-shrink-0"),"aria-hidden":"true"})})}),(0,T.jsx)(S.u,{as:I.Fragment,enter:"transition ease-out duration-100",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,T.jsxs)(tl.v.Items,{className:"absolute right-0 w-60 top-10 z-10 mt-2 origin-top-left rounded-md bg-[color:var(--popup-color)] shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none p-2",children:[(0,X.N7)("yourProfile",J.chatFeatures)?(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:eh,className:"jsx-2562846439 "+(iL(t?"bg-white/20 text-white":"text-white/90","group flex items-center px-4 py-2 text-sm w-full cursor-default rounded")||""),children:[null!=e9&&e9.picURL?(0,T.jsx)("img",{src:e9.picURL,"data-element-id":"user-profile-image",className:"jsx-2562846439 mr-3 h-5 w-5 rounded-sm transition-all error-fallback-gray"}):(0,T.jsx)("div",{className:"jsx-2562846439 mr-3 h-5 w-5 flex items-center justify-center",children:(0,T.jsx)(sI.EDj,{"data-element-id":"user-profile-symbol",className:"h-5 w-5 text-white"})}),null!=e9&&e9.name?(0,T.jsx)("span",{className:"jsx-2562846439",children:null==e9?void 0:e9.name}):(0,T.jsx)("span",{className:"jsx-2562846439",children:(0,T.jsx)(j.cC,{id:"hKtWk2"})})]})}}):null,(0,X.N7)("modelSettings",J.chatFeatures)?(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:function(){return ep(!0)},className:"jsx-2562846439 "+(iL(t?"bg-white/20 text-white":"text-white/90","group flex items-center px-4 py-2 text-sm w-full cursor-default rounded")||""),children:[(0,T.jsx)(tR.NNQ,{className:"mr-3 h-5 w-5 text-white/90 group-hover:text-white","aria-hidden":"true"}),(0,T.jsx)(j.cC,{id:"//nm2/"})]})}}):null,(0,X.N7)("chatMemory",J.chatFeatures)?(0,T.jsx)(tl.v.Item,{className:"hidden",children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:function(){return eg(!0)},className:"jsx-2562846439 "+(iL(t?"bg-white/20 text-white":"text-white/90","group flex items-center px-4 py-2 text-sm w-full cursor-default rounded")||""),children:[(0,T.jsx)(sI.WAq,{className:"mr-3 h-5 w-5 text-white/90 group-hover:text-white","aria-hidden":"true"}),(0,T.jsx)(j.cC,{id:"v8o+Rn"})]})}}):null,(0,X.N7)("usePlugins",J.chatFeatures)?(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:function(){return ex()},className:"jsx-2562846439 "+(iL(t?"bg-white/20 text-white":"text-white/90","group flex items-center px-4 py-2 text-sm w-full cursor-default rounded")||""),children:[(0,T.jsx)(s5.bTI,{className:"mr-3 h-5 w-5 text-white/90 group-hover:text-white","aria-hidden":"true"}),(0,T.jsx)(j.cC,{id:"ohUJJM"})]})}}):null,(0,X.N7)("syncToCloud",J.chatFeatures)?(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:function(){return en(!0)},className:"jsx-2562846439 "+(iL(t?"bg-white/20 text-white":"text-white/90","group flex items-center px-4 py-2 text-sm w-full cursor-default rounded")||""),children:[(0,T.jsx)(k.Qvc,{className:"mr-3 h-5 w-5 text-white/90 group-hover:text-white","aria-hidden":"true"}),(0,T.jsx)(j.cC,{id:"r5HG3n"})]})}}):null,(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:Q,className:"jsx-2562846439 "+(iL(t?"bg-white/20 text-white":"text-white/90","group flex items-center px-4 py-2 text-sm w-full cursor-default rounded")||""),children:[(0,T.jsx)(tR.XlX,{className:"mr-3 h-5 w-5 text-white/90 group-hover:text-white","aria-hidden":"true"}),(0,T.jsx)(j.cC,{id:"Q6hhn8"})]})}})]})})]})]}),(0,T.jsxs)("div",{className:"jsx-2562846439 relative flex items-center space-x-2",children:[(0,T.jsxs)("div",{className:"jsx-2562846439 relative w-full",children:[(0,T.jsx)("input",{"data-element-id":"search-chats-bar",type:"text",placeholder:q.ag._({id:"wRL7Wp"}),value:eC,onChange:function(e){return eq(e.target.value)},onKeyDown:function(e){27===e.keyCode&&eq("")},className:"jsx-2562846439 bg-black/20 text-white px-2 py-1 rounded-md w-full border border-white/20 ring-white/20"}),eC?(0,T.jsx)("button",{onClick:function(){return eq("")},className:"jsx-2562846439 absolute right-0 top-0 bottom-0 flex items-center justify-center px-2 text-white",children:(0,T.jsx)(ec.oHP,{className:"w-4 h-4"})}):null]}),(0,T.jsxs)("div",{className:"jsx-2562846439 flex items-center space-x-2 w-[88px] shrink-0",children:[(0,T.jsx)("button",{onClick:function(){t2()},"data-element-id":"create-new-folder",className:"jsx-2562846439 cursor-default text-white/50 hover:text-white transiton-all flex items-center justify-center shrink-0",children:(0,T.jsx)(k.RHD,{className:"w-6 h-6"})}),(0,T.jsx)(iA,{tags:th,setTags:tp}),tf?(0,T.jsx)("button",{onClick:t6,"data-element-id":"select-chats-symbol",className:"jsx-2562846439 cursor-default text-white/50 hover:text-white transiton-all flex items-center justify-center shrink-0",children:(0,T.jsx)(k.aHS,{className:"w-6 h-6"})}):(0,T.jsx)("button",{onClick:function(){tb(!0)},"data-element-id":"select-chats-symbol",className:"jsx-2562846439 cursor-default text-white/50 hover:text-white transiton-all flex items-center justify-center shrink-0",children:(0,T.jsx)(a3.ajS,{className:"w-6 h-6"})})]})]}),th.length>0&&(0,T.jsx)("div",{className:"jsx-2562846439 gap-2 flex flex-wrap items-center",children:th.map(function(e,t){return(0,T.jsxs)("button",{onClick:function(t){tp(function(t){return t.filter(function(t){return t.name!==e.name})})},style:{backgroundColor:(0,X.vm)(e.name)},className:"jsx-2562846439 cursor-default text-white text-xs space-x-1 flex items-center px-1 py-[2px] rounded-sm whitespace-nowrap hover:opacity-70",children:[(0,T.jsx)("span",{className:"jsx-2562846439",children:e.name}),(0,T.jsx)(ec.oHP,{})]},e.id)})}),tf&&(0,T.jsxs)("div",{className:"jsx-2562846439",children:[(0,T.jsxs)("div",{className:"jsx-2562846439 flex items-center gap-x-2",children:[(0,T.jsx)("input",{type:"checkbox",checked:ty.length>0&&ty.length===ne.length,onChange:function(){ty.length!==ne.length?tw(ne.map(function(e){return e.id})):tw([])},className:"jsx-2562846439 mx-2"}),(0,T.jsx)(a8,{selectedChatIDs:ty,onMoved:t6,moveChatsToFolder:P,asChild:!0,children:function(e){var t=e.openFolderPopup;return(0,T.jsxs)(tl.v,{as:"div",className:"grow relative flex text-left",children:[(0,T.jsx)(tl.v.Button,{disabled:!ty.length,className:"grow bg-gray-600 text-white group flex items-center justify-center rounded-md px-2 py-2 text-sm font-medium hover:bg-gray-500 transition-all disabled:bg-gray-400 cursor-default ",children:(0,T.jsx)(j.cC,{id:"7zrNaY",values:{0:ty.length}})}),(0,T.jsx)(S.u,{as:I.Fragment,enter:"transition ease-out duration-100",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,T.jsx)(tl.v.Items,{className:"absolute z-40 right-0 left-0 top-full mt-2 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:(0,T.jsxs)("div",{className:"jsx-2562846439 px-1 py-1 ",children:[(0,T.jsx)(tl.v.Item,{children:function(e){var n=e.active;return(0,T.jsxs)("button",{onClick:function(){t()},className:"jsx-2562846439 "+(iL("cursor-default group flex shrink-0 whitespace-nowrap space-x-2 w-full items-center rounded-md px-2 py-2 text-sm",n?"bg-blue-600 text-white":"text-gray-900")||""),children:[(0,T.jsx)(a3.Oqo,{className:"w-4 h-4"}),(0,T.jsx)("span",{className:"jsx-2562846439",children:(0,T.jsx)(j.cC,{id:"/DMBqC"})})]})}}),eX?(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:function(){_(ty),t6()},className:"jsx-2562846439 "+(iL("cursor-default group flex shrink-0 whitespace-nowrap space-x-2 w-full items-center rounded-md px-2 py-2 text-sm",t?"bg-blue-600 text-white":"text-gray-900")||""),children:[(0,T.jsx)(a3.z2M,{className:"w-4 h-4"}),(0,T.jsx)("span",{className:"jsx-2562846439",children:(0,T.jsx)(j.cC,{id:"5JOLV9"})})]})}}):(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClick:function(){L(ty),t6()},className:"jsx-2562846439 "+(iL("cursor-default group flex shrink-0 whitespace-nowrap space-x-2 w-full items-center rounded-md px-2 py-2 text-sm",t?"bg-blue-600 text-white":"text-gray-900")||""),children:[(0,T.jsx)(k.ALl,{className:"w-4 h-4"}),(0,T.jsx)("span",{className:"jsx-2562846439",children:(0,T.jsx)(j.cC,{id:"B495Gs"})})]})}}),(0,T.jsx)(tl.v.Item,{children:function(e){var t=e.active;return(0,T.jsxs)("button",{onClickCapture:function(e){tQ?(F(ty),t6()):(e.stopPropagation(),tX(!0))},className:"jsx-2562846439 "+(iL("group flex shrink-0 whitespace-nowrap space-x-2 w-full items-center rounded-md px-2 py-2 text-sm",t?"bg-blue-600 text-white":"text-red-500",tQ&&"!bg-red-500 text-white")||""),children:[(0,T.jsx)(ec.YK6,{className:"w-4 h-4"}),(0,T.jsx)("span",{className:"jsx-2562846439",children:tQ?(0,T.jsx)(j.cC,{id:"Aqw8Kb"}):(0,T.jsx)(j.cC,{id:"cnGeoo"})})]})}})]})})})]})}}),(0,T.jsx)("div",{className:"jsx-2562846439 w-[88px] shrink-0 flex"})]}),(0,T.jsx)("hr",{className:"jsx-2562846439 border border-white/20 mt-2"})]}),tL&&tD&&!tM.licensePayload?(0,T.jsxs)("div",{className:"jsx-2562846439 bg-red-500 dark:bg-red-900/50 rounded-md p-2 text-white font-semibold text-xs",children:[(0,T.jsx)(j.cC,{id:"3Fa5Z/"})," ",(0,T.jsx)("button",{onClick:function(){return document.getElementById("nav-buy-button").click()},className:"jsx-2562846439 underline",children:(0,T.jsx)(j.cC,{id:"oqsSYB"})})]}):null]})}),(0,T.jsx)("div",{"data-element-id":"sidebar-middle-part",className:"jsx-2562846439 "+(iL(M?"opacity-100":"opacity-0","overflow-y-auto overflow-x-hidden grow transition-opacity")||""),children:(0,T.jsxs)(ac.fC,{className:"w-[320px] h-full overflow-hidden relative",children:[(0,T.jsx)(ac.l_,{className:"w-full h-full relative",children:(0,T.jsxs)("div",{className:"jsx-2562846439 max-w-[320px]",children:[tt.length&&!eC||eX?(0,T.jsx)("button",{onClick:function(){return eJ(!eX)},className:"jsx-2562846439 cursor-default px-2 py-1 bg-black/20 text-white/50 text-xs text-center mb-2 font-semibold w-full hover:bg-black/30 transition-colors hover:text-white flex items-center justify-center gap-1",children:eX?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(k.bUI,{className:"inline-block w-3 h-3"}),(0,T.jsx)("span",{className:"jsx-2562846439",children:(0,T.jsx)(j.cC,{id:"qn5Xo4"})})]}):(0,T.jsx)("span",{className:"jsx-2562846439",children:(0,T.jsx)(j.cC,{id:"6KMTVy",values:{0:tt.length}})})}):null,0===ne.length&&0===(0,X.Jq)(eR).length?eC?(0,T.jsxs)("div",{className:"jsx-2562846439 text-gray-500 text-center my-2",children:[(0,T.jsx)("p",{className:"jsx-2562846439 text-sm",children:(0,T.jsx)(j.cC,{id:"Ev2r9A"})}),(0,T.jsx)("p",{className:"jsx-2562846439 text-xs",children:(0,T.jsx)(j.cC,{id:"tSEkZI",values:{searchKeyword:eC}})})]}):(0,T.jsx)("div",{className:"jsx-2562846439 flex flex-col items-center justify-center p-4 border border-dashed border-2 border-gray-500 rounded-lg mx-2 my-2",children:(0,T.jsxs)("div",{className:"jsx-2562846439 text-gray-500 text-center",children:[(0,T.jsx)("p",{className:"jsx-2562846439 text-sm",children:(0,T.jsx)(j.cC,{id:"CP6gDt"})}),(0,T.jsx)("p",{className:"jsx-2562846439 text-xs",children:(0,T.jsx)(j.cC,{id:"zOYG6Z"})})]})}):null,(0,T.jsxs)(im,{chats:te,moveChatsToFolder:P,children:[(0,T.jsx)(nD.Fo,{items:(0,X.Jq)(eR),strategy:nD.qw,children:(0,X.Jq)(eR).map(function(e){var t=nn[e.id]||[],n=t.map(function(e){return e.id});return(eC||th.length)&&!t.length?null:(0,T.jsx)(n_,{id:e.id,data:{type:"SORTABLE_FOLDER",numberOfChats:t.length},customHandlePosition:!0,children:function(s){var r=s.listeners,a=s.attributes;return(0,T.jsx)(ih,{id:e.id,children:(0,T.jsx)(il,{folder:e,onEdit:t4,onDelete:function(t){return t5(e.id,t)},shouldOpen:!!eC||(null==n?void 0:n.includes(D)),numberOfChats:t.length,dragHandle:{listeners:r,attributes:a},onAddNewChat:function(){return t7(e.id)},children:t.map(function(t){return(0,T.jsx)(ig,{id:t.id,data:{container:e.id},customHandlePosition:!0,children:function(e){var n,s,r=e.listeners,a=e.attributes;return(0,T.jsx)(iv,{minHeight:e5?36:56,children:(0,T.jsx)(it,{chat:t,moveChatsToFolder:P,thin:e5,onToggleFavorite:ee,highlightedTitle:null===(n=nt[t.id])||void 0===n?void 0:n.title,highlightedPreview:null===(s=nt[t.id])||void 0===s?void 0:s.preview,onSelect:function(e){return Z(e,{search:eC})},selected:t.id===D,onDelete:function(e){return F([e])},onArchive:B,onUnarchive:R,onEditName:G,onUpdateTags:em,dragHandle:{listeners:r,attributes:a},loading:ed[t.id],checked:null==ty?void 0:ty.includes(t.id),onCheck:tf?function(e){t8(t.id,e)}:void 0,overrideBotAvatarURL:J&&J.useLogoAsChatAvatar?J.botAvatarURL:void 0,fallbackAvatarURL:J.botAvatarURL,onSelectTag:function(e){return tp([e])}})})}},t.id)})})})}},e.id)})}),(0,T.jsx)(ih,{id:"ROOT",className:"flex-1 pb-8",children:null===(n=nn.ROOT)||void 0===n?void 0:n.map(function(e){return(0,T.jsx)(ig,{id:e.id,data:{container:"ROOT"},customHandlePosition:!0,children:function(t){var n,s,r=t.listeners,a=t.attributes;return(0,T.jsx)(iv,{minHeight:e5?36:56,children:(0,T.jsx)(it,{chat:e,moveChatsToFolder:P,thin:e5,onToggleFavorite:ee,highlightedTitle:null===(n=nt[e.id])||void 0===n?void 0:n.title,highlightedPreview:null===(s=nt[e.id])||void 0===s?void 0:s.preview,onSelect:function(e){return Z(e,{search:eC})},selected:e.id===D,onDelete:function(e){return F([e])},onArchive:B,onUnarchive:R,onEditName:G,onUpdateTags:em,dragHandle:{listeners:r,attributes:a},loading:ed[e.id],checked:null==ty?void 0:ty.includes(e.id),onCheck:tf?function(t){t8(e.id,t)}:void 0,overrideBotAvatarURL:J&&J.useLogoAsChatAvatar?J.botAvatarURL:void 0,fallbackAvatarURL:J.botAvatarURL,onSelectTag:function(e){return tp([e])}})})}},e.id)})})]})]})}),(0,T.jsx)(ac.LW,{className:"flex select-none touch-none p-0.5 bg-white/20 transition-colors duration-[160ms] ease-out hover:bg-white/30 data-[orientation=vertical]:w-2.5 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:h-2.5",orientation:"vertical",children:(0,T.jsx)(ac.bU,{className:"flex-1 bg-white/50 rounded-[10px] relative before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:w-full before:h-full before:min-w-[20px] before:min-h-[44px] z-10"})})]})}),(0,T.jsxs)("div",{className:"jsx-2562846439 flex-shrink-0",children:[tz>=10&&tN&&!tK&&(0,T.jsx)("div",{className:"jsx-2562846439",children:tI?(0,T.jsx)("div",{className:"jsx-2562846439 flex justify-end px-2 pb-2",children:(0,T.jsx)("button",{onClick:function(){tV(!1)},className:"jsx-2562846439 ",children:(0,T.jsx)("div",{className:"jsx-2562846439 w-4 h-4 bg-[#ffc252] rounded-full",children:(0,T.jsx)("div",{className:"jsx-2562846439 w-4 h-4 bg-[#ffc252] rounded-full animate-ping"})})})}):(0,T.jsxs)("div",{className:"jsx-2562846439 flex items-center space-x-2 bg-[#ffc252] text-black px-2 py-1 text-xs",children:[(0,T.jsxs)("div",{className:"jsx-2562846439",children:[(0,T.jsxs)("p",{className:"jsx-2562846439",children:[(0,T.jsx)(j.cC,{id:"UAJekh",components:{0:(0,T.jsx)("b",{className:"jsx-2562846439"})}})," "]}),(0,T.jsxs)("div",{className:"jsx-2562846439 mt-1 flex items-center space-x-2",children:[(0,T.jsx)("button",{onClick:function(){return(0,X.N7)("syncToCloud",J.chatFeatures)?en(!0):Q()},className:"jsx-2562846439 text-blue-700 hover:underline",children:(0,T.jsx)(j.cC,{id:"a2tx9b"})}),(0,T.jsx)(Y,{className:"text-blue-700 hover:underline",onConfirmed:function(){tk(!1)},children:(0,T.jsx)(j.cC,{id:"QbJr9B"})})]})]}),(0,T.jsx)("button",{onClick:function(){tV(!0)},className:"jsx-2562846439 text-white transiton-all",children:(0,T.jsx)(k.aHS,{className:"w-6 h-6 sm:w-4 sm:h-4"})})]})}),(0,T.jsx)(ad,{currentVersion:null==J?void 0:J.vercelGitSHA}),(0,T.jsxs)("div",{"data-element-id":"side-bar-footer",className:"jsx-2562846439 "+(iL("bg-[color:var(--sidebar-color)] flex flex-col flex-shrink-0 p-3 justify-center gap-1 relative ")||""),children:[(0,T.jsx)("button",{onClick:function(){return eW(!1)},className:"jsx-2562846439 "+(iL("cursor-default absolute top-2 left-2 rounded-full bg-white/20 w-8 h-8 items-center justify-center text-white hover:bg-white/30 transition-all group",ez?"flex":"hidden")||""),children:(0,T.jsx)(ec.N9e,{className:"w-5 h-5 group-hover:-translate-y-1 transition-all"})}),(0,T.jsx)("button",{onClick:function(){return eW(!0)},className:"jsx-2562846439 "+(iL("cursor-default absolute left-2 rounded-full w-8 h-8 flex items-center justify-center text-white transition-all group",ez?"hidden":"flex",J.managed&&!J.allowUserAPIKey&&(null===(s=J.externalAuthConfig)||void 0===s?void 0:s.type)!=="setapp"?"-top-5 bg-[color:var(--sidebar-color)]":"top-2 bg-white/20")||""),children:(0,T.jsx)(ec.w4J,{className:"w-5 h-5 group-hover:translate-y-1 transition-all"})}),(0,T.jsxs)("div",{className:"jsx-2562846439 "+(iL("items-center justify-center flex-col",ez?"hidden":"flex")||""),children:[J.managed?J.allowUserAPIKey?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"jsx-2562846439 mb-4 grid grid-cols-2 gap-2",children:[J.requireLicenseKey?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"jsx-2562846439 text-xs text-white font-semibold flex items-center justify-end",children:(0,T.jsx)(j.cC,{id:"4o/F78"})}),(0,T.jsx)(az,{licenseVerified:H,setOpenLicenseKey:eP})]}):null,(0,T.jsx)("div",{className:"jsx-2562846439 text-xs text-white font-semibold flex items-center justify-end",children:(0,T.jsx)(j.cC,{id:"yRnk5W"})}),(0,T.jsx)(aH,{isAPIKeyOptional:J.isAPIKeyOptional,setOpenDecrypt:eo,decryptedApiKey:er})]}),J.allowGuests?null:(0,T.jsx)("div",{className:"jsx-2562846439 text-white w-full text-center border-t border-white/20 mb-2 pt-2",children:(0,T.jsx)(aV,{hostConfig:J,setOpenOrgUserProfilePopup:ef})})]}):(null===(r=J.externalAuthConfig)||void 0===r?void 0:r.type)==="setapp"?null:(0,T.jsx)("div",{className:"jsx-2562846439 text-white mb-2 w-full text-center",children:(0,T.jsx)(aV,{hostConfig:J,setOpenOrgUserProfilePopup:ef})}):(0,T.jsxs)("div",{className:"jsx-2562846439 mb-2 grid grid-cols-2 gap-2",children:[(0,T.jsx)("div",{className:"jsx-2562846439 text-xs text-white font-semibold flex items-center justify-end",children:(0,T.jsx)(j.cC,{id:"4o/F78"})}),(0,T.jsxs)("div",{className:"jsx-2562846439 flex items-center justify-center gap-1",children:[(0,T.jsx)(az,{licenseVerified:H,setOpenLicenseKey:eP}),(0,T.jsx)("button",{onClick:function(){return W(!0)},className:"jsx-2562846439 hover:scale-125 transition-all",children:(0,T.jsx)(ec.WYw,{className:"h-4 w-4 text-red-500","aria-hidden":"true"})})]}),(0,T.jsx)("div",{className:"jsx-2562846439 text-xs text-white font-semibold flex items-center justify-end",children:(0,T.jsx)(j.cC,{id:"FfSJ1Y"})}),(0,T.jsx)("div",{className:"jsx-2562846439 flex items-center relative",children:(0,T.jsx)(aH,{setOpenDecrypt:eo,decryptedApiKey:er,decryptedAnthropicApiKey:ea,decryptedGeminiApiKey:ei})})]}),(0,T.jsx)(a_,{open:eE,setOpen:eP,setOpenBuy:W,setLicenseVerified:z,verifyLicenseKey:es,licensePayload:et,onLicenseKeyActivated:eb}),(0,T.jsx)(ir,{open:eT,setOpen:eD}),(0,T.jsx)("div",{className:"jsx-2562846439 border-t border-white/20 py-1 w-full"}),(0,T.jsxs)("div",{className:"jsx-2562846439 text-xs text-white/50 font-semibold text-center",children:[J.hosted?J.brand:(0,T.jsx)("a",{href:"https://typingmind.com",className:"jsx-2562846439",children:"TypingMind.com"})," ","\xa9"," ",(0,T.jsx)("span",{onClick:function(){return tP(tE+1)},className:"jsx-2562846439",children:new Date().getFullYear()}),J.hosted?null:(0,T.jsxs)(T.Fragment,{children:[" | ",(0,T.jsx)("a",{href:"/contact",target:"_blank",className:"jsx-2562846439 hover:underline font-normal",children:(0,T.jsx)(j.cC,{id:"jfC/xh"})})]})]}),J.hosted?(0,T.jsxs)("div",{className:"jsx-2562846439 text-xs text-white/50 text-center",children:[(0,T.jsx)("a",{href:(null==J||null===(a=J.links)||void 0===a?void 0:a.privacy)||"#",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"rjGI/Q"})})," | ",(0,T.jsx)("a",{href:(null==J||null===(i=J.links)||void 0===i?void 0:i.terms)||"#",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"4Y5H+g"})}),null!=J&&null!==(o=J.links)&&void 0!==o&&o.faqs?(0,T.jsxs)(T.Fragment,{children:[" | ",(0,T.jsx)("a",{href:(null==J||null===(l=J.links)||void 0===l?void 0:l.faqs)||"#",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"aJ4pMe"})})]}):null,null!=J&&null!==(c=J.links)&&void 0!==c&&c.docs?(0,T.jsxs)(T.Fragment,{children:[" | ",(0,T.jsx)("a",{href:(null==J||null===(d=J.links)||void 0===d?void 0:d.docs)||"#",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"TbjyhA"})})]}):null,null!=J&&null!==(u=J.links)&&void 0!==u&&u.contact?(0,T.jsxs)(T.Fragment,{children:[" | ",(0,T.jsx)("a",{href:(null==J||null===(m=J.links)||void 0===m?void 0:m.contact)||"#",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"jfC/xh"})})]}):null,null!=J&&null!==(h=J.links)&&void 0!==h&&h.about?(0,T.jsxs)(T.Fragment,{children:[" | ",(0,T.jsx)("a",{href:(null==J||null===(p=J.links)||void 0===p?void 0:p.about)||"#",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"uyJsf6"})})]}):null,J.managed&&!J.allowSubscriptions?(null==J||null===(x=J.links)||void 0===x?void 0:x.admin)===!1?null:(0,T.jsxs)(T.Fragment,{children:[" | ",(0,T.jsx)("a",{href:"/admin",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"U3pytU"})})]}):null]}):(0,T.jsxs)("div",{className:"jsx-2562846439 text-xs text-white/50 text-center",children:[(0,T.jsx)("a",{href:"/privacy",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"rjGI/Q"})})," | ",(0,T.jsx)("a",{href:"/terms",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"4Y5H+g"})})," | ",(0,T.jsx)("a",{href:"/faqs",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"aJ4pMe"})})," | ",(0,T.jsx)("a",{rel:"noopener noreferrer",href:"/discord",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"OdPOhy"})})," | ",(0,T.jsx)("a",{href:"https://docs.typingmind.com",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"TbjyhA"})})," | ",(0,T.jsx)("a",{href:"https://blog.typingmind.com",target:"_blank",className:"jsx-2562846439 hover:underline",children:(0,T.jsx)(j.cC,{id:"astDB+"})})]}),J.managed?null:J.hosted?null:(tc&&H)|null===H?(0,T.jsxs)("div",{className:"jsx-2562846439 relative",children:[(0,T.jsxs)("a",{href:"https://custom.typingmind.com?ref=typingmind",target:"_blank",className:"jsx-2562846439 text-xs text-white text-center px-4 py-2 my-2 rounded-lg w-full flex items-center justify-center hover:bg-gray-800/40 transition-all ring-1 ring-white/20",children:[(0,T.jsx)("span",{className:"jsx-2562846439 text-xs font-bold whitespace-nowrap",children:"TypingMind Custom"}),(0,T.jsx)(is.riV,{className:"h-3 w-3 shrink-0"}),(0,T.jsxs)("span",{className:"jsx-2562846439 text-xs inline-flex items-center whitespace-nowrap",children:["Bring AI to your team",(0,T.jsx)(is.UE1,{className:"h-4 w-4"})]})]}),(0,T.jsxs)("button",{onClick:function(){return td(!1)},type:"button",className:"jsx-2562846439 top-0 -right-1 mt-1 absolute focus-visible:outline-offset-2 p-0.5 bg-gray-100 rounded-full",children:[(0,T.jsx)("span",{className:"jsx-2562846439 sr-only",children:"Expanse banner"}),(0,T.jsx)(is.E0f,{className:"h-2 w-2 text-gray-900","aria-hidden":"true"})]})]}):(0,T.jsxs)("div",{className:"jsx-2562846439 relative",children:[(0,T.jsxs)("a",{href:"https://custom.typingmind.com?ref=typingmind",target:"_blank",className:"jsx-2562846439 text-xs text-white text-center px-4 py-2 my-2 rounded-md w-full flex items-center justify-center flex-col hover:opacity-90 transition-all bg-gradient-to-r custom-bg-gradient-animation",children:[(0,T.jsxs)("span",{className:"jsx-2562846439 inline-flex items-center text-sm font-bold",children:["Bring AI to your team",(0,T.jsx)(is.UE1,{className:"h-4 w-4"})]}),(0,T.jsxs)("span",{className:"jsx-2562846439 text-gray-100",children:["Build private & secure AI chat for your team, powered by"," ",(0,T.jsx)("b",{className:"jsx-2562846439",children:"TypingMind"})," chat UI"]})]}),H&&(0,T.jsxs)("button",{onClick:function(){return td(!0)},type:"button",className:"jsx-2562846439 top-0 -right-1 mt-1 absolute focus-visible:outline-offset-2 p-0.5 bg-gray-100 rounded-full",children:[(0,T.jsx)("span",{className:"jsx-2562846439 sr-only",children:"Collapse banner"}),(0,T.jsx)(ec.ywL,{className:"h-2.5 w-2.5 text-gray-900","aria-hidden":"true"})]})]})]}),(0,T.jsxs)("div",{onClick:function(){return ew(ey+1)},className:"jsx-2562846439 "+(iL("text-center flex items-center pb-safe gap-2",ez?"justify-end ":"justify-center")||""),children:[J.hosted?null!=J&&null!==(y=J.links)&&void 0!==y&&y.supportIframeURL?(0,T.jsx)(ax,{link:null==J||null===(A=J.links)||void 0===A?void 0:A.supportIframeURL,compact:ez}):null!=J&&null!==(N=J.links)&&void 0!==N&&N.feedback?(0,T.jsx)(aW,{link:null==J||null===(V=J.links)||void 0===V?void 0:V.feedback,compact:ez}):null:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(af,{compact:ez,licensePayload:et}),(0,T.jsx)(ao,{setOpenChangelog:eu})]}),J.hosted&&!J.managed?(0,T.jsxs)("a",{href:"https://www.typingmind.com/self-host-updates",target:"_blank",className:"jsx-2562846439 bg-gray-600 text-white group flex items-center justify-center rounded-md px-2 py-1 text-xs hover:bg-gray-500 transition-all space-x-2",children:[(0,T.jsx)(ec.kA6,{className:"h-4 w-4","aria-hidden":"true"}),(0,T.jsx)("span",{className:"jsx-2562846439",children:(0,T.jsx)(j.cC,{id:"qIrtcK"})})]}):null,(0,X.N7)("changeUILanguage",J.chatFeatures)?(0,T.jsx)(ag,{}):null,(0,T.jsx)(aG,{}),(0,X.N7)("syncToCloud",J.chatFeatures)&&(0,T.jsx)(aP,{setOpenBackupSync:en})]})]})]})]})}),(0,T.jsx)(ar(),{id:"2562846439",children:["#navbar.jsx-2562846439{color-scheme:dark;}"]})]})}function i_(){var e,t=(0,I.useState)(null),n=t[0],s=t[1],r=(0,I.useState)(null),a=r[0],i=r[1];return(0,I.useEffect)(function(){(0,f.Z)(w().mark(function e(){var t,n,s;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(t=navigator)||void 0===t||null===(t=t.storage)||void 0===t||null===(n=t.estimate)||void 0===n?void 0:n.call(t);case 2:(s=e.sent)&&i(s);case 4:case"end":return e.stop()}},e)}))()},[]),(0,I.useEffect)(function(){var e=0;for(var t in localStorage)localStorage.hasOwnProperty(t)&&(e+=localStorage.getItem(t).length,t.substring(0,5));var n=5242880-e;s({usagePercentage:(e/5242880*100).toFixed(2),usedSpace:e,totalSpace:5242880,availableSpace:n})},[]),(0,T.jsxs)("div",{children:[(0,T.jsx)("h3",{className:"text-xl font-bold",children:(0,T.jsx)(j.cC,{id:"RlyAC4"})}),(0,T.jsx)("div",{className:"text-xs my-2",children:(0,T.jsx)(j.cC,{id:"9jrTB+"})}),n?(0,T.jsxs)("div",{className:"my-4 text-xs",children:[(0,T.jsx)("div",{className:"font-semibold text-sm",children:(0,T.jsx)(j.cC,{id:"0ivkbP"})}),(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"my-2 h-4 w-full bg-green-500 rounded-lg overflow-hidden relative",children:(0,T.jsx)("div",{style:{width:"".concat(n.usedSpace/n.totalSpace*100,"%")},className:"h-4 w-full bg-red-500 absolute top-0 left-0 bottom-0"})}),(0,T.jsxs)("div",{className:"flex items-center justify-between ",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.cC,{id:"2iTmdZ"})," ",(0,T.jsx)("b",{children:(n.usedSpace/1024/1024).toFixed(2)+" MB"})," (",n.usagePercentage,"%)"]}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.cC,{id:"ml4bvW"})," ",(0,T.jsx)("b",{children:(n.totalSpace/1024/1024).toFixed(2)+" MB"})," "]})]})]})]}):null,a?(0,T.jsxs)("div",{className:"my-4 text-xs",children:[(0,T.jsx)("div",{className:"font-semibold text-sm",children:(0,T.jsx)(j.cC,{id:"2tuzFd"})}),(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"my-2 h-4 w-full bg-green-500 rounded-lg overflow-hidden relative",children:(0,T.jsx)("div",{style:{width:"".concat(a.usage/a.quota*100,"%")},className:"h-4 w-full bg-red-500 absolute top-0 left-0 bottom-0"})}),(0,T.jsxs)("div",{className:"flex items-center justify-between ",children:[(0,T.jsxs)("div",{children:["IndexedDB:"," ",(0,T.jsx)("b",{children:(0,X.td)((null==a||null===(e=a.usageDetails)||void 0===e?void 0:e.indexedDB)||(null==a?void 0:a.usage)||0)})," "]}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.cC,{id:"ml4bvW"})," ",(0,T.jsx)("b",{children:(0,X.td)(a.quota||0)})," "]})]})]})]}):null,(0,T.jsx)("div",{className:"text-xs my-2 text-orange-500",children:(0,T.jsx)(j.cC,{id:"kMEn8S"})})]})}var iF={id:"fWsBTs"};function iG(e){var t,n,s,r,a,i,o,l,c,d,u,m,h=e.subscription,p=(0,I.useState)(h),x=p[0],g=p[1],b=(0,I.useState)(!1),v=b[0],y=b[1],A=(0,I.useState)(null),N=A[0],k=A[1],C=(0,j.mV)().i18n,q=(t=(0,f.Z)(w().mark(function e(t){var n,s,r,a;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("cancel"!==t||window.confirm(C._({id:"/ns5IT"}))){e.next=3;break}return e.abrupt("return");case 3:return y(!0),k(""),e.prev=5,e.next=8,fetch("/api/cloud/subscriptions/"+h.id,{headers:{"Content-Type":"application/json"},method:"PUT",body:JSON.stringify({action:t})});case 8:if(!((s=e.sent).status>=400)){e.next=16;break}return e.next=12,s.json();case 12:return k(e.sent.userMessage||C._(iF)),y(!1),e.abrupt("return");case 16:if(s.ok){e.next=20;break}return k(C._(iF)),y(!1),e.abrupt("return");case 20:return e.next=22,s.json();case 22:g((r=e.sent).subscription),"update"===t&&null!=r&&null!==(n=r.subscription)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&null!==(n=n.attributes)&&void 0!==n&&null!==(n=n.urls)&&void 0!==n&&n.update_payment_method&&window.open(null==r||null===(a=r.subscription)||void 0===a||null===(a=a.data)||void 0===a||null===(a=a.attributes)||void 0===a||null===(a=a.urls)||void 0===a?void 0:a.update_payment_method,"_blank"),e.next=31;break;case 27:e.prev=27,e.t0=e.catch(5),k(C._(iF)),console.error(e.t0);case 31:y(!1);case 32:case"end":return e.stop()}},e,null,[[5,27]])})),function(e){return t.apply(this,arguments)});return(0,T.jsx)("div",{className:"flex items-center justify-between py-2",children:(0,T.jsx)("div",{className:"flex items-center",children:(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"text-lg font-medium flex items-center justify-start gap-2",children:[(null==x||null===(n=x.data)||void 0===n||null===(n=n.attributes)||void 0===n?void 0:n.status)==="active"?(0,T.jsx)("div",{className:"text-xs text-white px-2 py-1 bg-green-500 rounded-md inline-block",children:(0,T.jsx)(j.cC,{id:"F6pfE9"})}):(null==x||null===(s=x.data)||void 0===s||null===(s=s.attributes)||void 0===s?void 0:s.status)==="cancelled"?(0,T.jsx)("div",{className:"text-xs text-white px-2 py-1 bg-red-500 rounded-md inline-block",children:(0,T.jsx)(j.cC,{id:"vv7kpg"})}):(0,T.jsx)("div",{className:"text-xs text-white px-2 py-1 bg-gray-500 rounded-md inline-block",children:null==x||null===(r=x.data)||void 0===r||null===(r=r.attributes)||void 0===r?void 0:r.status_formatted}),(null==x||null===(a=x.data)||void 0===a||null===(a=a.attributes)||void 0===a?void 0:a.variant_name)!=="Default"?(0,T.jsx)("div",{children:null==x||null===(i=x.data)||void 0===i||null===(i=i.attributes)||void 0===i?void 0:i.variant_name}):(0,T.jsx)("span",{children:null==x||null===(o=x.data)||void 0===o||null===(o=o.attributes)||void 0===o?void 0:o.product_name})]}),(null==x||null===(l=x.data)||void 0===l||null===(l=l.attributes)||void 0===l?void 0:l.status)==="cancelled"?(0,T.jsxs)("div",{className:"text-xs text-gray-500 my-1",children:[(0,T.jsx)(j.cC,{id:"FP9FYD"}),":"," ",new Date(null==x||null===(c=x.data)||void 0===c||null===(c=c.attributes)||void 0===c?void 0:c.ends_at).toLocaleString()]}):null,(0,T.jsx)("div",{className:"flex items-center justify-start gap-2 my-2",children:(null==x||null===(d=x.data)||void 0===d||null===(d=d.attributes)||void 0===d?void 0:d.status)==="active"?(0,T.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[(0,T.jsx)("button",{onClick:function(){return q("update")},disabled:v,className:"px-4 py-2 bg-blue-500 rounded-md text-sm font-medium text-white hover:bg-blue-600 disabled:bg-gray-400 flex items-center justify-center gap-2",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"XymtD/"})})}),(0,T.jsx)("button",{onClick:function(){return q("cancel")},disabled:v,className:"px-4 py-2 bg-red-500 rounded-md text-sm font-medium text-white hover:bg-red-600 disabled:bg-gray-400 flex items-center justify-center gap-2",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"dEgA5A"})})})]}):(null==x||null===(u=x.data)||void 0===u||null===(u=u.attributes)||void 0===u?void 0:u.status)==="cancelled"&&new Date(null==x||null===(m=x.data)||void 0===m||null===(m=m.attributes)||void 0===m?void 0:m.ends_at)>new Date?(0,T.jsx)("div",{className:"flex items-center justify-start gap-2",children:(0,T.jsx)("button",{onClick:function(){return q("resume")},disabled:v,className:"px-4 py-2 bg-blue-500 rounded-md text-sm font-medium text-white hover:bg-blue-600 disabled:bg-gray-400 flex items-center justify-center gap-2",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"v39wLo"})})})}):null}),v?(0,T.jsxs)("div",{className:"text-xs text-gray-500 my-1 flex items-center justify-start my-2 gap-2",children:[(0,T.jsx)(Z,{}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"rYG2u6"})})]}):null,N&&(0,T.jsx)("div",{className:"text-center text-red-500 text-sm font-semibold my-2",children:N})]})})})}function iK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function iZ(e){for(var t=1;t=400)){e.next=13;break}return e.next=9,t.json();case 9:return c(e.sent.userMessage||iQ),N(!1),e.abrupt("return");case 13:if(t.ok){e.next=17;break}return c(iQ),N(!1),e.abrupt("return");case 17:return e.next=19,t.json();case 19:e.sent,x(!0),setTimeout(function(){C.current.focus()},100),e.next=28;break;case 24:e.prev=24,e.t0=e.catch(0),console.error(e.t0),c(iQ);case 28:N(!1);case 29:case"end":return e.stop()}},e,null,[[0,24]])})),function(){return t.apply(this,arguments)}),V=(n=(0,f.Z)(w().mark(function e(){var t,n;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,N(!0),c(""),e.next=5,fetch((0,X.wV)()+"/api/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:u,code:b})});case 5:if(!((t=e.sent).status>=400)){e.next=13;break}return e.next=9,t.json();case 9:return c(e.sent.userMessage||iQ),N(!1),e.abrupt("return");case 13:if(t.ok){e.next=17;break}return c(iQ),N(!1),e.abrupt("return");case 17:return e.next=19,t.json();case 19:n=e.sent,sd.Z.set("typingmindcloud_token",n.token,{expires:180,sameSite:"none",secure:!0}),null==s||s(),e.next=28;break;case 24:e.prev=24,e.t0=e.catch(0),console.error(e.t0),c(iQ);case 28:N(!1);case 29:case"end":return e.stop()}},e,null,[[0,24]])})),function(){return n.apply(this,arguments)});return(0,T.jsx)("div",{children:p?(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsx)("div",{className:"my-1 font-semibold",children:(0,T.jsx)(j.cC,{id:"hSqeOv",values:{email:u}})}),(0,T.jsx)("input",{ref:C,type:"text",disabled:A,placeholder:"XXXXXX",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-zinc-700 text-xl text-center",value:b,onChange:function(e){return v(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),V())}})]}),l&&(0,T.jsx)("div",{className:"text-center text-red-500 text-sm font-semibold my-2",children:l}),(0,T.jsxs)("div",{className:"my-4 flex items-center justify-center gap-2",children:[(0,T.jsxs)("button",{onClick:V,disabled:A||!b,className:"flex items-center justify-center px-3 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors gap-2",children:[A?(0,T.jsx)(Z,{}):null,(0,T.jsx)(j.cC,{id:"hQRttt"})]}),(0,T.jsx)("button",{onClick:function(){return x(!1)},disabled:A,className:"flex items-center justify-center px-3 py-2 border border-transparent text-sm font-medium rounded-md text-black bg-white-600 hover:bg-white-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-white-500 disabled:bg-gray-400 disabled:cursor-default transition-colors gap-2 disabled:text-white dark:text-white",children:(0,T.jsx)(j.cC,{id:"dEgA5A"})})]})]}):(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"my-4",children:[i?(0,T.jsx)("div",{className:"my-1 font-semibold",children:(0,T.jsx)(j.cC,{id:"vUqMKV"})}):(0,T.jsx)("div",{className:"my-1 font-semibold",children:(0,T.jsx)(j.cC,{id:"xEX8ic"})}),(0,T.jsx)("input",{ref:k,type:"email",disabled:A||!i,placeholder:"example@gmail.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700 disabled:text-gray-500",value:u,onChange:function(e){return m(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),q())}})]}),l&&(0,T.jsx)("div",{className:"text-center text-red-500 text-sm font-semibold my-2",children:l}),(0,T.jsx)("div",{className:"my-4 flex items-center justify-center gap-2",children:(0,T.jsxs)("button",{onClick:q,disabled:A||!u,className:"flex items-center justify-center px-3 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors gap-2",children:[A?(0,T.jsx)(Z,{}):null,(0,T.jsx)(j.cC,{id:"7xHXyX"})]})})]})})}var iJ=n(49704),i$=n.n(iJ);function i0(e){var t,n,s,r,a,i,o,l=e.licensePayload,c=e.allowCloudSubscription,d=e.lockSyncStatus,u=e.onOpenCloudFilesPopup,m=(0,I.useState)(null),h=m[0],p=m[1],x=(0,I.useState)(!1),g=x[0],f=x[1],b=(0,aS.n)().scheduleSync,v=$(),y=(0,sH.e)(),w=y.user;y.loading,y.loadUser;var A=(v||{}).serverHostConfig;(0,I.useEffect)(function(){N()},[l]);var N=function(){var e=sd.Z.get("typingmindcloud_token");p(i$().decode(e))},k=!A.managed||!!A.requireLicenseKey||(null===(t=A.externalAuthConfig)||void 0===t?void 0:t.type)==="setapp"||!!A.allowAnyCloudSyncEmail;return(0,T.jsx)("div",{className:"space-y-4",children:(0,T.jsx)("div",{children:h?(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:" flex items-center justify-between text-gray-500",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.cC,{id:"AeXO77"}),":"," ",(0,T.jsx)("span",{className:"font-semibold",children:(null==h||null===(n=h.user)||void 0===n?void 0:n.email)||(null==h||null===(s=h.user)||void 0===s?void 0:s.externalUserID)})]}),d?null:(0,T.jsx)(Y,{onConfirmed:function(){sd.Z.remove("typingmindcloud_token"),p(null)},className:"text-red-500",confirmText:function(){return(0,T.jsx)("span",{className:"text-red-500 underline",children:"Sure?"})},children:(0,T.jsx)(j.cC,{id:"nOhz3x"})})]}),(0,T.jsx)("hr",{className:"my-2"}),(0,T.jsx)(iW,{cloudTokenPayload:h,allowCloudSubscription:c,lockSyncStatus:d,onOpenCloudFilesPopup:u,showSyncSettings:!A.managed})]}):(0,T.jsxs)("div",{children:[(0,T.jsx)("div",{className:"text-base font-semibold my-4",children:(0,T.jsx)(j.cC,{id:"TQjmbE"})}),(0,T.jsxs)("div",{className:"text-xs space-y-2",children:[(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"nTJf+7"})}),(0,T.jsxs)("ul",{className:"list-disc pl-4",children:[(0,T.jsx)("li",{children:(0,T.jsx)(j.cC,{id:"wg2WXT",values:{0:(0,X.v9)(null==A?void 0:A.hostname).replace("http://","").replace("https://","")||window.location.host},components:{0:(0,T.jsx)("b",{})}})}),(0,T.jsx)("li",{children:(0,T.jsx)(j.cC,{id:"o3VQwn"})}),(0,T.jsx)("li",{children:(0,T.jsx)(j.cC,{id:"CUHiET",components:{0:(0,T.jsx)("a",{href:(null==A||null===(r=A.links)||void 0===r?void 0:r.privacy)||"/privacy",target:"_blank",rel:"noreferrer",className:"text-blue-500"}),1:(0,T.jsx)("a",{href:(null==A||null===(a=A.links)||void 0===a?void 0:a.terms)||"/terms",target:"_blank",rel:"noreferrer",className:"text-blue-500"})}})})]})]}),(0,T.jsxs)("label",{className:"flex items-center justify-center gap-2 my-4",children:[(0,T.jsx)("input",{type:"checkbox",checked:g,onChange:function(e){return f(e.target.checked)}}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"rzZxW6"})})]}),g?(0,T.jsxs)("div",{children:[!A.managed||A.requireLicenseKey||(null===(i=A.externalAuthConfig)||void 0===i?void 0:i.type)==="setapp"||w?(0,T.jsx)("div",{className:"max-w-xs mx-auto",children:(0,T.jsx)(iX,{allowChangeEmail:k,defaultEmail:null==l||null===(o=l.payload)||void 0===o?void 0:o.email,onLoggedIn:function(){N(),b()}})}):(0,T.jsx)("div",{className:"text-center text-red-500",children:"Please login first before enabling Cloud Sync"}),(0,T.jsx)(iz,{})]}):null]})})})}var i1=(0,R.eK)("useTMCloudEnabled");function i2(e){var t=e.allowCloudSubscription,n=e.lockSyncStatus,s=e.licensePayload,r=e.onOpenCloudFilesPopup,a=i1(!1),i=(0,v.Z)(a,2),o=i[0],l=i[1];return(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:" flex items-center justify-between",children:[(0,T.jsxs)("h3",{className:"text-lg font-semibold flex items-center justify-start gap-2",children:[(0,T.jsx)(k.H_w,{className:"h-5 w-5 text-blue-500"}),(0,T.jsx)(j.cC,{id:"UbVRmW"})]}),n?null:(0,T.jsx)(Q,{enabled:o,setEnabled:function(e){l(e)}})]}),o?(0,T.jsx)("div",{className:"my-4 bg-gray-100 px-3 py-3 rounded-lg border border-gray-200 dark:bg-zinc-800 dark:border-gray-600",children:(0,T.jsx)(i0,{licensePayload:s,allowCloudSubscription:t,lockSyncStatus:n,onOpenCloudFilesPopup:r})}):(0,T.jsx)("div",{className:"text-xs my-2",children:(0,T.jsx)(j.cC,{id:"TssG/Z",components:{0:(0,T.jsx)("b",{})}})})]})}var i4=n(67266),i5=n.n(i4),i3=n(78798),i6=n(68919);function i8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function i7(e){for(var t=1;t0&&tc.push("".concat(n._({id:"YVY9Iw",values:{0:a.length}}),"")),(null==y?void 0:y.length)>0&&tc.push("".concat(n._({id:"yxF19Y",values:{0:y.length}}),"")),eC.length>0&&tc.push("".concat(n._({id:"ao4ihU",values:{0:eC.length}}),"")),(null==u?void 0:u.length)>0&&tc.push("".concat(n._({id:"IPXOXm",values:{0:u.length}}),"")),p.length>0&&tc.push("".concat(n._({id:"Ftz/t9",values:{0:p.length}}),"")),tc.push(n._({id:"G7dFid",values:{0:td.length,messagesCount:tl}})),(0,T.jsxs)("div",{children:[th?(0,T.jsx)("h3",{className:"text-xl font-bold mb-4",children:th}):null,(0,T.jsx)("div",{className:"mb-4",dangerouslySetInnerHTML:{__html:n._({id:"tdX+tp"})+" "+tc.join(", ")}}),(0,T.jsxs)("div",{className:"my-4 flex items-center flex-wrap gap-2",children:[(0,T.jsxs)("button",{onClick:function(){return tn(function(e){return!e})},type:"button",className:"inline-flex items-center px-2 py-1 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors",children:[(0,T.jsx)(ec.r2j,{className:"w-4 h-4 mr-2"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"GS+Mus"})})]}),(0,T.jsxs)("button",{type:"button",onClick:function(){var e=document.createElement("input");e.type="file",e.accept="application/json",e.onchange=function(e){var t=e.target.files[0],s=new FileReader;s.onload=function(e){var t=e.target.result;try{var s=JSON.parse(t);tp({success:s})}catch(e){console.error(e),alert(n._(i9))}},s.readAsText(t)},e.click()},className:"inline-flex items-center px-2 py-1 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors",children:[(0,T.jsx)(ec.cX4,{className:"w-4 h-4 mr-2"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"l3s5ri"})})]}),(0,T.jsxs)("button",{type:"button",onClick:function(){return e3(!0)},className:"inline-flex items-center px-2 py-1 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-orange-600 hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500 disabled:bg-gray-400 disabled:cursor-default transition-colors",children:[(0,T.jsx)(ec.wg8,{className:"w-4 h-4 mr-2"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"N/QNdH"})})]}),tx?(0,T.jsxs)("div",{className:"w-full flex items-center gap-2 flex-wrap",children:[(0,T.jsxs)("button",{type:"button",onClick:function(){var e=document.createElement("input");e.type="file",e.accept="application/json",e.onchange=function(e){var t=e.target.files[0],n=new FileReader;n.onload=function(e){var t=e.target.result;try{var n=JSON.parse(t),s=oV(n),r=s.failedChats,a=s.validChats;tp({success:{data:{chats:a}},fail:r})}catch(e){console.error(e),alert(i9)}},n.readAsText(t)},e.click()},className:"inline-flex whitespace-nowrap items-center px-2 py-1 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors",children:[(0,T.jsx)(ec.cX4,{className:"w-4 h-4 mr-2"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"+wwQdk"})})]}),(0,T.jsx)("button",{onClick:function(){return ta(function(e){return!e})},className:"text-blue-500 hover:text-blue-700 text-center",children:(0,T.jsx)(j.cC,{id:"IHD/ra"})})]}):null]}),tr&&(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsx)("h3",{className:"font-bold",children:(0,T.jsx)(j.cC,{id:"7ONgDR"})}),(0,T.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-x-6 gap-y-2",children:[(0,T.jsx)("img",{src:"/assets/openai-guide/1.png",width:3136,height:1764}),(0,T.jsx)("img",{src:"/assets/openai-guide/2.png",width:3136,height:1764}),(0,T.jsx)("img",{src:"/assets/openai-guide/3.png",width:3136,height:1764})]})]}),tt&&(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsx)("h3",{className:"font-bold",children:(0,T.jsx)(j.cC,{id:"iTDzyV"})}),(0,T.jsx)("div",{className:"mt-2 w-full grid grid-cols-1 xs:grid-cols-2 gap-x-6 gap-y-2",children:oS.map(function(e){var t;return(0,T.jsxs)("label",{className:"flex items-center space-x-2",children:[(0,T.jsx)("input",{type:"checkbox",className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-600",checked:null===(t=e7[e.id])||void 0===t||t,onChange:function(){return ti(e.id)}}),(0,T.jsx)("span",{children:e.label})]},e.id)})}),(0,T.jsxs)("button",{onClick:function(){var e,s,r,a,i={};if(oO.forEach(function(e){var t;(null===(t=e7[e.section])||void 0===t||t)&&e.data.forEach(function(e){i[e]=o[e]})}),!Object.keys(i).some(function(e){return Array.isArray(i[e])?i[e].length>0:!!i[e]})){window.alert(n._({id:"Amd0C9"}));return}var l=i5()(i),c=(0,X.M)(l),d=new Date,u=(null===(e=t.serverHostConfig)||void 0===e?void 0:e.displayBrand)==="TypingMind"||(null===(s=t.serverHostConfig)||void 0===s?void 0:s.displayBrand)==="Typing Mind"?"_typingmind":null!==(r=t.serverHostConfig)&&void 0!==r&&r.subdomain?"_"+(null===(a=t.serverHostConfig)||void 0===a?void 0:a.subdomain):"",m="".concat((0,i6.Z)(d,"yyyyMMdd_HHmmss")).concat(u,"_export.json"),h="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify({checksum:c,data:i})),p=document.createElement("a");p.setAttribute("href",h),p.setAttribute("download",m),document.body.appendChild(p),p.click(),p.remove()},type:"button",className:"mt-3 inline-flex items-center px-2 py-1 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors",children:[(0,T.jsx)(ec.RFS,{className:"w-4 h-4 mr-2"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"IFNYKF"})})]})]}),e5?(0,T.jsxs)("div",{className:"my-4",children:[(0,T.jsx)("div",{className:"text-xs text-gray-500 my-4",children:(0,T.jsx)(j.cC,{id:"HFASYW"})}),(0,T.jsx)(aM,{wait:0,setChats:function(e){tu(e),window.location.reload()},showCoruptedMessage:!1,emptyMessage:function(){return(0,T.jsx)("div",{className:"text-base font-semibold p-4",children:(0,T.jsx)(j.cC,{id:"gIikXc"})})}})]}):null]})};function oP(e){var t=e.allowCloudSubscription,n=e.lockSyncStatus,s=e.open,r=e.setOpen,a=e.licensePayload,i=e.chats,o=e.setChats,l=e.onImportData,c=e.onOpenCloudFilesPopup;return(0,T.jsxs)(B,{wide:!0,open:s,setOpen:r,showCloseButton:!1,delayMount:!0,children:[(0,T.jsx)("h2",{className:"text-center text-xl font-bold",children:(0,T.jsx)(j.cC,{id:"r5HG3n"})}),(0,T.jsx)("hr",{className:"my-4"}),(0,T.jsxs)("div",{className:"space-y-4",children:[(0,T.jsx)(i2,{licensePayload:a,allowCloudSubscription:t,lockSyncStatus:n,onOpenCloudFilesPopup:c}),(0,T.jsx)("div",{children:(0,T.jsxs)("div",{children:[(0,T.jsxs)("h3",{className:"text-lg font-semibold flex items-center justify-start gap-2 mb-2",children:[(0,T.jsx)("div",{className:"h-6 w-6 flex items-center justify-center flex-shrink-0",children:(0,T.jsx)(k.lbL,{className:"h-4 w-4 text-blue-500"})}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"NcEE8j"})})]}),(0,T.jsx)(oE,{chats:i,setChats:o,title:null,onImportData:l})]})})]})]})}var oM=(0,R.eK)("useExampleFilled");function oT(e){var t=e.onLoaded,n=oM(!1),s=(0,v.Z)(n,2),r=s[0],a=s[1],i=$(),o=(i.serverHostConfig||{}).exampleChats,l=i.serverHostConfig.chatFeatures;return(0,I.useEffect)(function(){(0,X.N7)("addExampleChats",l)&&setTimeout((0,f.Z)(w().mark(function e(){var n,s;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!r){e.next=3;break}return e.abrupt("return");case 3:if(!(JSON.parse((0,R.cF)().getItem("TM_useChatList")||"[]").length>0)){e.next=6;break}return e.abrupt("return");case 6:return n=null!=o&&o.length?o:iy.f,e.next=9,(0,R.CQ)().setMany(n.map(function(e){return["CHAT_"+e.chatID,e]}));case 9:s=(0,X.FW)(n),(0,R.cF)().setItem("TM_useChatList",JSON.stringify(s)),a(!0),t&&t(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),console.error(e.t0);case 18:case"end":return e.stop()}},e,null,[[0,15]])})),0)},[]),null}var oD=(0,R.eK)("useDismissMacWarning");function oB(){var e=oD(!1),t=(0,v.Z)(e,2),n=t[0],s=t[1],r=(0,I.useState)(!1),a=r[0],i=r[1];return(0,I.useEffect)(function(){!n&&window.navigator.userAgent.includes("TypingMindMac")&&i(!0)},[]),(0,T.jsxs)(B,{open:a,setOpen:i,showCloseButton:!1,children:[(0,T.jsx)("h2",{className:"text-center text-xl font-bold flex items-center justify-center space-x-2",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"VHZsGc"})})}),(0,T.jsx)("div",{className:"my-2 text-center text-xs",children:(0,T.jsx)(j.cC,{id:"0x5QFE"})}),(0,T.jsx)("ul",{className:"my-4 pl-4 list-disc",children:(0,T.jsx)("li",{children:(0,T.jsx)(j.cC,{id:"/dqlKh"})})}),(0,T.jsxs)("div",{className:"my-2 text-center gap-2 flex items-center justify-center",children:[(0,T.jsx)("button",{onClick:function(){return i(!1)},className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:bg-gray-500",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"FPsvA8"})})}),(0,T.jsx)("button",{onClick:function(){s(!0),i(!1)},className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-gray-600 hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 space-x-1 disabled:bg-gray-500",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"VbN7mk"})})})]})]})}function oL(e){var t,n=e.open,s=e.setOpen,r=e.setOpenLicenseKey,a=e.setOpenBuy,i=(0,I.useState)(5),o=i[0],l=i[1];(0,I.useEffect)(function(){n&&c()},[n]);var c=(t=(0,f.Z)(w().mark(function e(){var t;return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=10;case 1:if(!(t>=0)){e.next=8;break}return l(t),e.next=5,new Promise(function(e){return setTimeout(e,1e3)});case 5:t--,e.next=1;break;case 8:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)});return(0,T.jsxs)(B,{wide:!0,open:n,setOpen:function(e){0===o&&s(e)},showCloseButton:!1,children:[(0,T.jsx)("h2",{className:"text-center text-xl font-bold",children:"Thank you for using TypingMind"}),(0,T.jsx)("p",{className:"text-center my-2",children:(0,T.jsx)(j.cC,{id:"Ny0rdk",components:{0:(0,T.jsx)("span",{className:"text-red-500"}),1:(0,T.jsx)("b",{})}})}),(0,T.jsx)("p",{className:"my-4 text-sm text-center",children:(0,T.jsx)("b",{children:(0,T.jsx)(j.cC,{id:"pKmr0j",components:{0:(0,T.jsx)("span",{className:"text-red-500"})}})})}),(0,T.jsx)("div",{className:"my-4 text-center flex items-center justify-center flex-wrap gap-2",children:(0,T.jsx)("button",{onClick:function(){0===o&&s(!1),setTimeout(function(){a(!0)},1)},className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 space-x-1 disabled:bg-gray-500",children:(0,T.jsxs)("span",{children:["→ ",(0,T.jsx)(j.cC,{id:"ggrnf1"})]})})}),(0,T.jsx)("p",{className:"mt-4 text-xs text-center",children:(0,T.jsx)(j.cC,{id:"Wkdy65"})}),(0,T.jsx)("div",{className:"my-2 text-center flex items-center justify-center flex-wrap gap-2",children:(0,T.jsxs)("button",{onClick:function(){0===o&&s(!1),setTimeout(function(){r(!0)},1)},className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:bg-gray-500",children:[(0,T.jsx)(sz.itj,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"IRwH+C"})})]})}),(0,T.jsx)("div",{className:"mt-4 text-center flex items-center justify-center space-x-2",children:(0,T.jsx)("button",{onClick:function(){s(!1),setTimeout(function(){a(!0)},1)},disabled:o>0,className:"inline-flex items-center px-4 py-2 text-sm font-medium rounded-md text-gray-800 dark:text-zinc-100 dark:disabled:text-zinc-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 space-x-1 disabled:text-gray-400",children:(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"aMPH6M",values:{0:o>0?" (".concat(o,")"):""}})})})})]})}(0,R.eK)("useLicenseKey");var oR=(0,R.eK)("useVoiceLanguage"),o_=function(){var e=oR("en-US"),t=(0,v.Z)(e,2),n=t[0],s=t[1];return(0,T.jsx)("select",{className:"w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:n,onChange:function(e){return s(e.target.value)},children:oF.map(function(e){return(0,T.jsx)("option",{value:e.value,className:"text-ellipsis",children:e.label},e.value)})})},oF=[{label:"Afrikaans (South Africa)",value:"af-ZA"},{label:"Albanian (Albania)",value:"sq-AL"},{label:"Amharic (Ethiopia)",value:"am-ET"},{label:"Arabic (Algeria)",value:"ar-DZ"},{label:"Arabic (Bahrain)",value:"ar-BH"},{label:"Arabic (Egypt)",value:"ar-EG"},{label:"Arabic (Iraq)",value:"ar-IQ"},{label:"Arabic (Israel)",value:"ar-IL"},{label:"Arabic (Jordan)",value:"ar-JO"},{label:"Arabic (Kuwait)",value:"ar-KW"},{label:"Arabic (Lebanon)",value:"ar-LB"},{label:"Arabic (Mauritania)",value:"ar-MR"},{label:"Arabic (Morocco)",value:"ar-MA"},{label:"Arabic (Oman)",value:"ar-OM"},{label:"Arabic (Qatar)",value:"ar-QA"},{label:"Arabic (Saudi Arabia)",value:"ar-SA"},{label:"Arabic (State of Palestine)",value:"ar-PS"},{label:"Arabic (Tunisia)",value:"ar-TN"},{label:"Arabic (United Arab Emirates)",value:"ar-AE"},{label:"Arabic (Yemen)",value:"ar-YE"},{label:"Armenian (Armenia)",value:"hy-AM"},{label:"Azerbaijani (Azerbaijan)",value:"az-AZ"},{label:"Basque (Spain)",value:"eu-ES"},{label:"Bengali (Bangladesh)",value:"bn-BD"},{label:"Bengali (India)",value:"bn-IN"},{label:"Bosnian (Bosnia and Herzegovina)",value:"bs-BA"},{label:"Bulgarian (Bulgaria)",value:"bg-BG"},{label:"Burmese (Myanmar)",value:"my-MM"},{label:"Catalan (Spain)",value:"ca-ES"},{label:"Chinese, Cantonese (Traditional Hong Kong)",value:"yue-Hant-HK"},{label:"Chinese, Mandarin (Simplified, China)",value:"zh (cmn-Hans-CN)"},{label:"Chinese, Mandarin (Traditional, Taiwan)",value:"zh-TW (cmn-Hant-TW)"},{label:"Croatian (Croatia)",value:"hr-HR"},{label:"Czech (Czech Republic)",value:"cs-CZ"},{label:"Danish (Denmark)",value:"da-DK"},{label:"Dutch (Belgium)",value:"nl-BE"},{label:"Dutch (Netherlands)",value:"nl-NL"},{label:"English (Australia)",value:"en-AU"},{label:"English (Canada)",value:"en-CA"},{label:"English (Ghana)",value:"en-GH"},{label:"English (Hong Kong)",value:"en-HK"},{label:"English (India)",value:"en-IN"},{label:"English (Ireland)",value:"en-IE"},{label:"English (Kenya)",value:"en-KE"},{label:"English (New Zealand)",value:"en-NZ"},{label:"English (Nigeria)",value:"en-NG"},{label:"English (Pakistan)",value:"en-PK"},{label:"English (Philippines)",value:"en-PH"},{label:"English (Singapore)",value:"en-SG"},{label:"English (South Africa)",value:"en-ZA"},{label:"English (Tanzania)",value:"en-TZ"},{label:"English (United Kingdom)",value:"en-GB"},{label:"English (United States)",value:"en-US"},{label:"Estonian (Estonia)",value:"et-EE"},{label:"Filipino (Philippines)",value:"fil-PH"},{label:"Finnish (Finland)",value:"fi-FI"},{label:"French (Belgium)",value:"fr-BE"},{label:"French (Canada)",value:"fr-CA"},{label:"French (France)",value:"fr-FR"},{label:"French (Switzerland)",value:"fr-CH"},{label:"Galician (Spain)",value:"gl-ES"},{label:"Georgian (Georgia)",value:"ka-GE"},{label:"German (Austria)",value:"de-AT"},{label:"German (Germany)",value:"de-DE"},{label:"German (Switzerland)",value:"de-CH"},{label:"Greek (Greece)",value:"el-GR"},{label:"Gujarati (India)",value:"gu-IN"},{label:"Hebrew (Israel)",value:"iw-IL"},{label:"Hindi (India)",value:"hi-IN"},{label:"Hungarian (Hungary)",value:"hu-HU"},{label:"Icelandic (Iceland)",value:"is-IS"},{label:"Indonesian (Indonesia)",value:"id-ID"},{label:"Italian (Italy)",value:"it-IT"},{label:"Italian (Switzerland)",value:"it-CH"},{label:"Japanese (Japan)",value:"ja-JP"},{label:"Javanese (Indonesia)",value:"jv-ID"},{label:"Kannada (India)",value:"kn-IN"},{label:"Kazakh (Kazakhstan)",value:"kk-KZ"},{label:"Khmer (Cambodia)",value:"km-KH"},{label:"Korean (South Korea)",value:"ko-KR"},{label:"Lao (Laos)",value:"lo-LA"},{label:"Latvian (Latvia)",value:"lv-LV"},{label:"Lithuanian (Lithuania)",value:"lt-LT"},{label:"Macedonian (North Macedonia)",value:"mk-MK"},{label:"Malay (Malaysia)",value:"ms-MY"},{label:"Malayalam (India)",value:"ml-IN"},{label:"Marathi (India)",value:"mr-IN"},{label:"Mongolian (Mongolia)",value:"mn-MN"},{label:"Nepali (Nepal)",value:"ne-NP"},{label:"Norwegian Bokm\xe5l (Norway)",value:"no-NO"},{label:"Persian (Iran)",value:"fa-IR"},{label:"Polish (Poland)",value:"pl-PL"},{label:"Portuguese (Brazil)",value:"pt-BR"},{label:"Portuguese (Portugal)",value:"pt-PT"},{label:"Punjabi (Gurmukhi India)",value:"pa-Guru-IN"},{label:"Romanian (Romania)",value:"ro-RO"},{label:"Russian (Russia)",value:"ru-RU"},{label:"Kinyarwanda (Rwanda)",value:"rw-RW"},{label:"Serbian (Serbia)",value:"sr-RS"},{label:"Sinhala (Sri Lanka)",value:"si-LK"},{label:"Slovak (Slovakia)",value:"sk-SK"},{label:"Slovenian (Slovenia)",value:"sl-SI"},{label:"Swati (South Africa)",value:"ss-latn-za"},{label:"Southern Sotho (South Africa)",value:"st-ZA"},{label:"Spanish (Argentina)",value:"es-AR"},{label:"Spanish (Bolivia)",value:"es-BO"},{label:"Spanish (Chile)",value:"es-CL"},{label:"Spanish (Colombia)",value:"es-CO"},{label:"Spanish (Costa Rica)",value:"es-CR"},{label:"Spanish (Dominican Republic)",value:"es-DO"},{label:"Spanish (Ecuador)",value:"es-EC"},{label:"Spanish (El Salvador)",value:"es-SV"},{label:"Spanish (Guatemala)",value:"es-GT"},{label:"Spanish (Honduras)",value:"es-HN"},{label:"Spanish (Mexico)",value:"es-MX"},{label:"Spanish (Nicaragua)",value:"es-NI"},{label:"Spanish (Panama)",value:"es-PA"},{label:"Spanish (Paraguay)",value:"es-PY"},{label:"Spanish (Peru)",value:"es-PE"},{label:"Spanish (Puerto Rico)",value:"es-PR"},{label:"Spanish (Spain)",value:"es-ES"},{label:"Spanish (United States)",value:"es-US"},{label:"Spanish (Uruguay)",value:"es-UY"},{label:"Spanish (Venezuela)",value:"es-VE"},{label:"Sundanese (Indonesia)",value:"su-ID"},{label:"Swahili (Kenya)",value:"sw-KE"},{label:"Swahili (Tanzania)",value:"sw-TZ"},{label:"Swedish (Sweden)",value:"sv-SE"},{label:"Tamil (India)",value:"ta-IN"},{label:"Tamil (Malaysia)",value:"ta-MY"},{label:"Tamil (Singapore)",value:"ta-SG"},{label:"Tamil (Sri Lanka)",value:"ta-LK"},{label:"Telugu (India)",value:"te-IN"},{label:"Thai (Thailand)",value:"th-TH"},{label:"Setswana (South Africa)",value:"tn-latn-za"},{label:"Turkish (Turkey)",value:"tr-TR"},{label:"Tsonga (South Africa)",value:"ts-ZA"},{label:"Ukrainian (Ukraine)",value:"uk-UA"},{label:"Urdu (India)",value:"ur-IN"},{label:"Urdu (Pakistan)",value:"ur-PK"},{label:"Uzbek (Uzbekistan)",value:"uz-UZ"},{label:"Venda (South Africa)",value:"ve-ZA"},{label:"Vietnamese (Vietnam)",value:"vi-VN"},{label:"isiXhosa (South Africa)",value:"xh-ZA"},{label:"Zulu (South Africa)",value:"zu-ZA"}],oG=(0,R.eK)("useVoiceLanguage");function oK(e){var t,n=e.startRecordOnMount,s=(e.onCancel,e.onTextAvailable),r=(0,I.useState)(!1),a=r[0],i=r[1],o=(0,I.useState)(""),l=o[0],c=o[1],d=(0,I.useState)(""),u=d[0],m=d[1],h=(0,I.useState)(!1),p=h[0],x=h[1],g=oG("en-US"),b=(0,v.Z)(g,1)[0],y=(0,I.useRef)(null),A=(0,I.useRef)(!1),N=(0,I.useRef)("");(0,I.useEffect)(function(){if(y.current&&(y.current.abort(),y.current=null),!("webkitSpeechRecognition"in window)){x(!0);return}y.current=new window.webkitSpeechRecognition,y.current.lang=b,y.current.continuous=!1,y.current.interimResults=!0,y.current.onstart=function(){},y.current.onresult=function(e){for(var t=N.current+(N.current?"\n":""),n=N.current+(N.current?"\n":""),s=e.resultIndex;s=400)){e.next=30;break}return e.next=24,c.json();case 24:return C((p=e.sent).userMessage||(null===(h=p.error)||void 0===h?void 0:h.message)||oY),m(!1),x(URL.createObjectURL(t)),e.abrupt("return");case 30:if(c.ok){e.next=36;break}return C(oY),m(!1),x(URL.createObjectURL(t)),e.abrupt("return");case 36:return e.next=38,c.json();case 38:g=e.sent,s?s(g.text,r):(y(g.text),m(!1)),e.next=49;break;case 42:e.prev=42,e.t0=e.catch(5),console.error(e.t0),C(oY),m(!1),x(URL.createObjectURL(t));case 49:case"end":return e.stop()}},e,null,[[5,42]])}))).apply(this,arguments)}return(0,T.jsxs)("div",{className:"p-2 w-full flex items-center justify-center flex-col gap-4",children:[u||b?null:l?(0,T.jsxs)("div",{className:"text-gray-500 text-lg font-light p-4",children:[(0,T.jsxs)("div",{className:"text-center my-2 relative isolate p-1",children:[(0,T.jsx)("svg",{viewBox:"0 0 100 100",className:"w-full h-full absolute top-0 left-0 z-[-1] text-red-500",children:(0,T.jsx)("circle",{cx:50,cy:50,r:45,fill:"none",stroke:"currentColor",strokeWidth:5,strokeDashoffset:"282.6",transform:"rotate(-90 50 50)",children:(0,T.jsx)("animate",{attributeName:"stroke-dasharray",values:"0,282.6;282.6,0",dur:"120s",repeatCount:1})})}),(0,T.jsx)("div",{className:"rounded-full bg-gray-300 dark:bg-zinc-600 dark:hover:bg-zinc-500 p-6 inline-flex items-center justify-center transition-all hover:bg-gray-200 space-x-2",children:(0,T.jsx)(k.uYL,{className:"w-8 h-8 animate-listening"})})]}),(0,T.jsx)("div",{className:" animate-listening",children:(0,T.jsx)(j.cC,{id:"95r17U"})}),(0,T.jsx)(oH,{})]}):(0,T.jsx)("div",{className:"text-gray-500 text-sm p-4 text-center",children:(0,T.jsx)(j.cC,{id:"mWkeNy"})}),u?(0,T.jsxs)("div",{className:"text-gray-500 text-lg font-light p-4 flex items-center justify-center gap-2",children:[(0,T.jsx)(Z,{}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"fp5rKh"})})]}):null,b?(0,T.jsx)("div",{className:"text-left py-2 px-4 bg-gray-100 rounded-md max-w-lg",children:b}):null,N?(0,T.jsx)("div",{className:"text-red-500 text-sm",children:N}):null,p&&(0,T.jsxs)("a",{href:p,download:!0,className:"text-blue-500 cursor-pointer hover:underline disabled:no-underline disabled:cursor-default flex items-center space-x-1",children:[(0,T.jsx)(V.uKn,{size:16}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"uOcnoU"})})]}),(0,T.jsx)("div",{className:"flex items-center justify-center gap-2 flex-wrap",children:l?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("button",{className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 disabled:bg-gray-400 gap-2",onClick:function(){_()},children:[(0,T.jsx)(k.u9M,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"JmZ/+d"})})]}),(0,T.jsxs)("button",{className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-gray-600 hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 disabled:bg-gray-400 gap-2",onClick:r,children:[(0,T.jsx)(k.Xm5,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"dEgA5A"})})]})]}):u?null:(0,T.jsxs)("button",{className:"inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2",onClick:function(){y(""),x(null),R()},children:[(0,T.jsx)(k.gbA,{className:"w-4 h-4"}),(0,T.jsx)("span",{children:b||p?q.ag._({id:"GyaNUA"}):q.ag._({id:"w80YWM"})})]})}),!u&&!l&&(0,T.jsxs)("div",{children:[(0,T.jsx)(j.cC,{id:"mp5yqd",components:{0:(0,T.jsx)("button",{className:"text-blue-500 cursor-pointer hover:underline disabled:no-underline disabled:cursor-default",onClick:function(){var e;return null===(e=P.current)||void 0===e?void 0:e.click()},disabled:l||u})}}),(0,T.jsx)("input",{ref:P,type:"file",accept:".flac,.mp3,.mp4,.mpeg,.mpga,.m4a,.ogg,.wav,.webm",className:"hidden",onChange:function(e){C("");try{var t=e.target.files[0];F(t,null,{preventAutoSend:!0})}catch(e){console.error(e),C(oY)}}})]})]})}var oW=(0,R.eK)("useTranscribeService"),oQ=(0,R.eK)("useVoiceAutoSend"),oX=(0,R.eK)("useAutoStartRecord"),oJ=(0,R.eK)("useWhisperPrompt");function o$(e){var t,n,s=e.openAIAPIKey,r=e.onTextAvailable,a=e.onCancel,i=e.showRecord,o=e.showTitle,l=oW("browser"),c=(0,v.Z)(l,2),d=c[0],u=c[1],m=oQ(!1),h=(0,v.Z)(m,2),p=h[0],x=h[1],g=oX(!1),f=(0,v.Z)(g,2),b=f[0],y=f[1],w=$(),A=(0,I.useState)(!1),N=A[0],k=A[1],C=oJ(""),V=(0,v.Z)(C,2),S=V[0],O=V[1];return(0,I.useEffect)(function(){var e,t;"whisper"===d&&null!==(e=w.serverHostConfig)&&void 0!==e&&e.managed&&!(0,X.N7)("useOpenAIWhisper",null===(t=w.serverHostConfig)||void 0===t?void 0:t.chatFeatures)&&u("browser")},[]),(0,T.jsxs)("div",{className:"space-y-4",children:[(0,T.jsxs)("div",{children:[void 0===o||o?(0,T.jsx)("div",{className:"text-xl font-bold text-center mb-2",children:(0,T.jsx)(j.cC,{id:"JGrfzE"})}):null,(0,T.jsx)("div",{className:"text-sm font-semibold my-2",children:(0,T.jsx)(j.cC,{id:"MbTAbA"})}),(0,T.jsxs)("select",{id:"model",className:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:d,onChange:function(e){return u(e.target.value)},children:[(0,T.jsx)("option",{value:"browser",children:(0,T.jsx)(j.cC,{id:"9kNmZU"})}),!(null!==(t=w.serverHostConfig)&&void 0!==t&&t.managed)||(0,X.N7)("useOpenAIWhisper",null===(n=w.serverHostConfig)||void 0===n?void 0:n.chatFeatures)?(0,T.jsx)("option",{value:"whisper",children:(0,T.jsx)(j.cC,{id:"I3d9HX"})}):null]})]}),"whisper"===d&&(0,T.jsx)("button",{className:"text-blue-500 ml-auto block",onClick:function(){return k(!N)},children:N?(0,T.jsx)(j.cC,{id:"9aHqty"}):(0,T.jsx)(j.cC,{id:"PUO6ed"})}),"whisper"===d&&N&&(0,T.jsxs)("div",{className:"space-y-2 pb-2",children:[(0,T.jsx)("label",{className:"font-semibold shrink-0",children:(0,T.jsx)(j.cC,{id:"gxYlbr"})}),(0,T.jsx)("input",{type:"text",placeholder:q.ag._({id:"ZMHXQC"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700",autoComplete:"off",value:S,onChange:function(e){return O(e.target.value)}}),(0,T.jsx)("p",{className:"text-xs text-gray-500",children:(0,T.jsx)(j.cC,{id:"+VVCL3",components:{0:(0,T.jsx)("a",{href:"https://platform.openai.com/docs/guides/speech-to-text/prompting",className:"text-blue-500 hover:underline",target:"_blank"})}})})]}),(0,T.jsxs)("div",{className:"my-4 flex items-start justify-center flex-col gap-2",children:[(0,T.jsx)(Q,{enabled:b,setEnabled:y,label:q.ag._({id:"4ryaAZ"})}),(0,T.jsx)(Q,{enabled:p,setEnabled:x,label:q.ag._({id:"bE4siw"})})]}),void 0===i||i?(0,T.jsx)(T.Fragment,{children:"whisper"===d?(0,T.jsx)(oz,{openAIAPIKey:s,onTextAvailable:r,startRecordOnMount:b,onCancel:a}):"browser"===d?(0,T.jsx)(oK,{onTextAvailable:r,startRecordOnMount:b,onCancel:a}):null}):null]})}var o0=n(32832),o1=(0,R.eK)("useSidebarColorHue"),o2=(0,R.eK)("useCompactSidebarLine"),o4=(0,R.eK)("useFontSize");function o5(e){var t=e.showSidebarColor,n=e.onClickChangeSidebarColor,s=eZ(),r=s.themeMode,a=s.setThemeMode,i=o1(X.V$),o=(0,v.Z)(i,2),l=o[0];o[1];var c=o2(!1),d=(0,v.Z)(c,2),u=d[0],m=d[1],h=o4("small"),p=(0,v.Z)(h,2),x=p[0],g=p[1];return(0,T.jsx)("div",{children:(0,T.jsxs)("div",{className:"grid grid-cols-2 items-center justify-center gap-2",children:[(0,T.jsx)("div",{className:"text-sm font-semibold text-right",children:(0,T.jsx)(j.cC,{id:"FEr96N"})}),(0,T.jsxs)("select",{className:"block w-fit rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:r,onChange:function(e){a(e.target.value)},children:[(0,T.jsx)("option",{value:"light",children:(0,T.jsx)(j.cC,{id:"1njn7W"})}),(0,T.jsx)("option",{value:"dark",children:(0,T.jsx)(j.cC,{id:"pvnfJD"})}),(0,T.jsx)("option",{value:"system",children:(0,T.jsx)(j.cC,{id:"D+NlUC"})})]}),void 0===t||t?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"text-sm font-semibold text-right",children:(0,T.jsx)(j.cC,{id:"ebEv56"})}),(0,T.jsx)("div",{children:(0,T.jsx)("button",{onClick:function(){n()},style:{backgroundColor:(0,X.dl)(l)},className:"w-20 h-8 block w-fit rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6"})})]}):null,(0,T.jsx)("div",{className:"text-sm font-semibold text-right",children:(0,T.jsx)(j.cC,{id:"tbgdI4"})}),(0,T.jsxs)("select",{className:"block w-fit rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:u?"1":"",onChange:function(e){m("1"===e.target.value)},children:[(0,T.jsx)("option",{value:"",children:(0,T.jsx)(j.cC,{id:"ovBPCi"})}),(0,T.jsx)("option",{value:"1",children:(0,T.jsx)(j.cC,{id:"9S4Fiy"})})]}),(0,T.jsx)("div",{className:"text-sm font-semibold text-right",children:(0,T.jsx)(j.cC,{id:"cGeFup"})}),(0,T.jsxs)("select",{className:"block w-fit rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:x,onChange:function(e){g(e.target.value.toLowerCase())},children:[(0,T.jsx)("option",{value:"small",children:(0,T.jsx)(j.cC,{id:"4Revpc"})}),(0,T.jsx)("option",{value:"medium",children:(0,T.jsx)(j.cC,{id:"agPptk"})}),(0,T.jsx)("option",{value:"large",children:(0,T.jsx)(j.cC,{id:"k7rCa/"})}),(0,T.jsx)("option",{value:"extra",children:(0,T.jsx)(j.cC,{id:"vp6Yr4"})}),(0,T.jsx)("option",{value:"2extra",children:(0,T.jsx)(j.cC,{id:"tIa0nY"})})]})]})})}var o3=(0,R.eK)("useStreaming"),o6=(0,R.eK)("useAutomaticTitle"),o8=(0,R.eK)("useSuggestKeywords"),o7=(0,R.eK)("useSearchEngine"),o9=(0,R.eK)("useSoundMode"),le=(0,R.eK)("useReopenPreviousChat"),lt=(0,R.eK)("useAutoArchiveOldChats"),ln=(0,R.eK)("useAutoDeleteArchivedChats");function ls(e){var t=e.showSuggestKeywords,n=o3(!0),s=(0,v.Z)(n,2),r=s[0],a=s[1],i=o6(!0),o=(0,v.Z)(i,2),l=o[0],c=o[1],d=o8(!0),u=(0,v.Z)(d,2),m=u[0],h=u[1],p=o7("google"),x=(0,v.Z)(p,2),g=x[0],f=x[1],b=o9(!0),y=(0,v.Z)(b,2),w=y[0],A=y[1],N=le(!1),k=(0,v.Z)(N,2),C=k[0],V=k[1],S=lt(""),O=(0,v.Z)(S,2),E=O[0],P=O[1],M=ln(""),D=(0,v.Z)(M,2),B=D[0],L=D[1],R=(0,I.useMemo)(function(){return!["google","ddg","bing","brave"].includes(g)},[g]);return(0,T.jsx)("div",{children:(0,T.jsxs)("div",{className:"space-y-4",children:[(0,T.jsx)(Q,{label:q.ag._({id:"3mDv0d"}),description:q.ag._({id:"bW1s55"}),enabled:r,setEnabled:function(e){a(e)}}),(0,T.jsx)(Q,{label:q.ag._({id:"2Pa8mz"}),description:q.ag._({id:"BrM1bb"}),enabled:l,setEnabled:function(e){c(e)}}),(void 0===t||t)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Q,{label:q.ag._({id:"ZK5+g/"}),description:q.ag._({id:"LqNfc3"}),enabled:m,setEnabled:function(e){h(e)}}),m?(0,T.jsx)("div",{className:"flex justify-center",children:(0,T.jsxs)("div",{className:"flex flex-col",children:[(0,T.jsxs)("div",{className:"grid grid-cols-2 items-center justify-center gap-2",children:[(0,T.jsx)("div",{className:"text-sm text-right",children:(0,T.jsx)(j.cC,{id:"xEEOHj"})}),(0,T.jsxs)("select",{className:"block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:R?"":g,onChange:function(e){f(e.target.value.toLowerCase())},children:[(0,T.jsx)("option",{value:"google",children:"Google"}),(0,T.jsx)("option",{value:"ddg",children:"DuckDuckGo"}),(0,T.jsx)("option",{value:"bing",children:"Bing"}),(0,T.jsx)("option",{value:"brave",children:"Brave"}),(0,T.jsx)("option",{value:"",children:"Kagi"})]})]}),R&&(0,T.jsxs)("div",{className:"mt-2 w-full",children:[(0,T.jsx)("div",{className:"text-sm",children:(0,T.jsx)(j.cC,{id:"aABkGI"})}),(0,T.jsx)("a",{href:"https://kagi.com/settings?p=user_details",target:"_blank",rel:"noopenner noreferer",className:"mt-1 text-blue-500 hover:underline text-xs",children:(0,T.jsx)(j.cC,{id:"zCNvh1"})}),(0,T.jsx)("input",{type:"text",className:"mt-2 block w-full rounded-md border-0 py-1.5 px-3 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:g,onChange:function(e){f(e.target.value.toLowerCase())}})]})]})}):null]}),(0,T.jsx)(Q,{label:q.ag._({id:"Sb94+G"}),description:q.ag._({id:"47jGM/"}),enabled:w,setEnabled:function(e){A(e)}}),(0,T.jsx)(Q,{label:q.ag._({id:"yjKqG9"}),description:q.ag._({id:"NL1iX0"}),enabled:C,setEnabled:function(e){V(e)}}),(0,T.jsx)(Q,{label:q.ag._({id:"Tppod2"}),description:q.ag._({id:"4iqlgG"}),enabled:!!E,setEnabled:function(e){P(e?24:"")}}),E?(0,T.jsxs)("div",{className:"grid grid-cols-2 items-center justify-center gap-2",children:[(0,T.jsx)("div",{className:"text-sm text-right",children:(0,T.jsx)(j.cC,{id:"WAOQ5J"})}),(0,T.jsxs)("select",{className:"block w-fit rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:E,onChange:function(e){P(Number(e.target.value))},children:[(0,T.jsx)("option",{value:24,children:(0,T.jsx)(j.cC,{id:"VaA9mu"})}),(0,T.jsx)("option",{value:48,children:(0,T.jsx)(j.cC,{id:"UtXEjp"})}),(0,T.jsx)("option",{value:72,children:(0,T.jsx)(j.cC,{id:"7ZrpGs"})}),(0,T.jsx)("option",{value:168,children:(0,T.jsx)(j.cC,{id:"3vtzIH"})}),(0,T.jsx)("option",{value:336,children:(0,T.jsx)(j.cC,{id:"O2B4EJ"})}),(0,T.jsx)("option",{value:504,children:(0,T.jsx)(j.cC,{id:"B/1Qzd"})}),(0,T.jsx)("option",{value:720,children:(0,T.jsx)(j.cC,{id:"voMgY+"})}),(0,T.jsx)("option",{value:1440,children:(0,T.jsx)(j.cC,{id:"HCLj1r"})}),(0,T.jsx)("option",{value:2160,children:(0,T.jsx)(j.cC,{id:"x1VeBD"})})]})]}):null,(0,T.jsx)(Q,{label:q.ag._({id:"+ZWSxY"}),description:q.ag._({id:"OSt5XJ"}),enabled:!!B,setEnabled:function(e){L(e?24:"")}}),B?(0,T.jsxs)("div",{className:"grid grid-cols-2 items-center justify-center gap-2",children:[(0,T.jsx)("div",{className:"text-sm text-right",children:(0,T.jsx)(j.cC,{id:"be4IUs"})}),(0,T.jsxs)("select",{className:"block w-fit rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 dark:text-white dark:bg-zinc-700 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-blue-600 sm:text-sm sm:leading-6",value:B,onChange:function(e){L(Number(e.target.value))},children:[(0,T.jsx)("option",{value:24,children:(0,T.jsx)(j.cC,{id:"VaA9mu"})}),(0,T.jsx)("option",{value:48,children:(0,T.jsx)(j.cC,{id:"UtXEjp"})}),(0,T.jsx)("option",{value:72,children:(0,T.jsx)(j.cC,{id:"7ZrpGs"})}),(0,T.jsx)("option",{value:168,children:(0,T.jsx)(j.cC,{id:"3vtzIH"})}),(0,T.jsx)("option",{value:336,children:(0,T.jsx)(j.cC,{id:"O2B4EJ"})}),(0,T.jsx)("option",{value:504,children:(0,T.jsx)(j.cC,{id:"B/1Qzd"})}),(0,T.jsx)("option",{value:720,children:(0,T.jsx)(j.cC,{id:"voMgY+"})}),(0,T.jsx)("option",{value:1440,children:(0,T.jsx)(j.cC,{id:"HCLj1r"})}),(0,T.jsx)("option",{value:2160,children:(0,T.jsx)(j.cC,{id:"x1VeBD"})})]})]}):null]})})}var lr=n(57161);function la(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function li(e){for(var t=1;t0?"mt-4":""),children:e.label},e.label):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("button",{className:(0,X.AK)("w-full p-2 rounded-md transition-colors hover:bg-gray-100 text-left cursor-default flex items-center justify-start gap-2 my-1 dark:text-gray-200 dark:hover:bg-gray-800",e.label===a.label?"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200":"text-gray-800 ",l?"bg-gray-100 dark:bg-gray-800 dark:text-gray-200":""),onClick:function(){l?m(function(t){return li(li({},t),{},(0,b.Z)({},e.label,!t[e.label]))}):i(e)},children:[e.icon?(0,T.jsx)(e.icon,{className:"w-4 h-4"}):null,(0,T.jsx)("span",{children:e.label}),l?u[e.label]?(0,T.jsx)(al.jX5,{className:"w-5 h-5 -ml-2"}):(0,T.jsx)(al.h2L,{className:"w-5 h-5 -ml-2"}):null]},e.label),l&&u[e.label]?(0,T.jsx)("div",{className:"w-full p-2 mb-4",children:null===(n=e.renderSection)||void 0===n?void 0:n.call(e)}):null]})})}),l?null:(0,T.jsxs)("div",{className:"w-full",children:[(0,T.jsx)("h3",{className:"text-xl font-bold mb-2",children:null==a?void 0:a.label}),(0,T.jsx)("div",{children:null==a||null===(t=a.renderSection)||void 0===t?void 0:t.call(a)})]})]})}var ll=n(59557),lc=(0,R.eK)("useExtensionURLs");function ld(){var e=lc([]),t=(0,v.Z)(e,2),n=t[0],s=t[1],r=(0,I.useState)(""),a=r[0],i=r[1],o=(0,I.useState)(""),l=o[0],c=o[1],d=(0,I.useState)(!1),u=d[0],m=d[1],h=(0,I.useState)(!1),p=h[0],x=h[1];return(0,T.jsxs)("div",{className:"",children:[(0,T.jsxs)("div",{className:"text-xs",children:[(0,T.jsx)(j.cC,{id:"K8lalb"}),(0,T.jsx)("a",{href:"https://docs.typingmind.com/typing-mind-extensions",className:"text-blue-500 font-semibold text-blue-500 text-xs hover:underline ml-1",target:"_blank",rel:"noreferrer noopener",children:(0,T.jsx)(j.cC,{id:"8RknI/"})})]}),(0,T.jsx)("div",{className:"text-xs text-orange-500",children:(0,T.jsx)(j.cC,{id:"2T68PV"})}),(0,T.jsxs)("div",{className:"flex items-stretch justify-center gap-2 my-2",children:[(0,T.jsx)("input",{type:"text",value:a,onChange:function(e){return i(e.target.value)},placeholder:q.ag._({id:"rcyeIO"}),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700 disabled:text-gray-500 w-full"}),(0,T.jsxs)("button",{onClick:function(){var e;if(""===a.trim()){c(q.ag._({id:"9Rz3G/"}));return}if(n.includes(a)){c(q.ag._({id:"Mwh/zr"}));return}m(!0),(e=document.createElement("script")).setAttribute("type","text/javascript"),e.src=a,e.onload=function(){s([].concat((0,g.Z)(n),[a])),x(!0),i(""),m(!1),c(""),document.head.removeChild(e),e.onload=function(){}},e.onerror=function(t){console.error("Failed to load extension: ".concat(a)),c(q.ag._({id:"0aIV5B",values:{url:a}})),m(!1),document.head.removeChild(e),e.onerror=function(){}},document.head.appendChild(e)},className:"inline-flex items-center px-3 py-1.5 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 gap-2",disabled:u,children:[u?(0,T.jsx)(Z,{}):null,(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"TKQ7K+"})})]})]}),p?(0,T.jsxs)("div",{className:"text-xs text-orange-500",children:[(0,T.jsx)(j.cC,{id:"ZbQrfp"})," ",(0,T.jsx)("button",{className:"text-blue-500 hover:underline font-semibold text-xs",onClick:function(){window.location.reload()},children:(0,T.jsx)(j.cC,{id:"u6QeR6"})})]}):null,l&&(0,T.jsx)("p",{className:"text-red-500 text-xs mt-2",children:l}),(0,T.jsx)("div",{className:"my-2",children:n.map(function(e,t){return(0,T.jsxs)("div",{className:"mt-1 w-full p-2 bg-gray-100 dark:bg-zinc-800 rounded-md flex items-center justify-center gap-2",children:[(0,T.jsx)("div",{className:"w-full break-all",children:e}),(0,T.jsx)(Y,{onConfirmed:function(){s(n.filter(function(t){return t!==e})),x(!0)},className:"text-red-500 font-semibold hover:underline",children:(0,T.jsx)(j.cC,{id:"fo0VXg"})})]},t)})})]})}function lu(){return(0,T.jsxs)("div",{children:[(0,T.jsx)("a",{href:"/test/simple-web-audio-recorder-demo-master/index.html",children:"Audio Recorder"}),(0,T.jsx)("button",{onClick:function(){throw Error("new crash test")},className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors whitespace-nowrap space-x-1",children:"click to crash"}),(0,T.jsx)("div",{children:(0,T.jsx)(j.cC,{id:"V17zQG"})})]})}var lm={id:"M8UX1B"},lh=(0,R.eK)("useCurrentCompletionEndpoint"),lp=(0,R.eK)("useCurrentAnthropicEndpoint"),lx=(0,R.eK)("useOpenAIOrgID");function lg(e){(0,av.Z)(e);var t,n,s,r=lh("https://api.openai.com/v1/chat/completions"),a=(0,v.Z)(r,2),i=a[0],o=a[1],l=lp("https://cloud2.typingmind.com/api/claude/v1/messages"),c=(0,v.Z)(l,2),d=c[0],u=c[1],m=(0,I.useState)(i),h=m[0],p=m[1],x=(0,I.useState)(d),g=x[0],b=x[1],y=lx(""),A=(0,v.Z)(y,2),N=A[0],k=A[1],C=(0,I.useState)(N),q=C[0],V=C[1],S=(0,I.useState)(!1),O=S[0],E=S[1],P=(0,I.useState)(null),M=P[0],D=P[1],B=(0,j.mV)().i18n;(0,I.useEffect)(function(){p(i)},[i]),(0,I.useEffect)(function(){b(d)},[d]);var L=(t=(0,f.Z)(w().mark(function e(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return E(!0),D(""),e.prev=2,o(h),window.alert(B._({id:"kGCe95"})),window.location.reload(),e.abrupt("return");case 9:e.prev=9,e.t0=e.catch(2),D(B._(lm)),console.error(e.t0);case 13:E(!1);case 14:case"end":return e.stop()}},e,null,[[2,9]])})),function(){return t.apply(this,arguments)}),R=(n=(0,f.Z)(w().mark(function e(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return E(!0),D(""),e.prev=2,u(g),window.alert(B._({id:"kGCe95"})),window.location.reload(),e.abrupt("return");case 9:e.prev=9,e.t0=e.catch(2),D(B._(lm)),console.error(e.t0);case 13:E(!1);case 14:case"end":return e.stop()}},e,null,[[2,9]])})),function(){return n.apply(this,arguments)}),_=(s=(0,f.Z)(w().mark(function e(){return w().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return D(""),e.prev=1,k(q),window.alert(B._({id:"kGCe95"})),window.location.reload(),e.abrupt("return");case 8:e.prev=8,e.t0=e.catch(1),D(B._(lm)),console.error(e.t0);case 12:E(!1);case 13:case"end":return e.stop()}},e,null,[[1,8]])})),function(){return s.apply(this,arguments)});return(0,T.jsxs)("div",{className:"my-2 space-y-4",children:[(0,T.jsxs)("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[(0,T.jsxs)("label",{className:"text-sm font-semibold flex items-center justify-center gap-2",children:[(0,T.jsxs)("span",{children:[(0,T.jsx)(j.cC,{id:"Rde+o4"}),":"]}),(0,T.jsxs)("button",{onClick:function(){p("https://api.openai.com/v1/chat/completions")},className:"hover:underline text-blue-500 font-semibold flex-shrink-0",children:["(",(0,T.jsx)(j.cC,{id:"SFteAp"}),")"]})]}),(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2 w-full",children:[(0,T.jsx)("input",{type:"text",placeholder:"https://...",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700 disabled:text-gray-500",autoComplete:"off",value:h,onChange:function(e){return p(e.target.value)},disabled:O,onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),L())}}),(0,T.jsx)("button",{onClick:function(){L()},disabled:O,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors whitespace-nowrap space-x-1",children:O?(0,T.jsx)(Z,{}):(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"tfDRzk"})})})]})]}),(0,T.jsxs)("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[(0,T.jsxs)("label",{className:"text-sm font-semibold flex items-center justify-center gap-2",children:[(0,T.jsxs)("span",{children:[(0,T.jsx)(j.cC,{id:"8xI/bl"}),":"]}),(0,T.jsxs)("button",{onClick:function(){b("https://cloud2.typingmind.com/api/claude/v1/messages")},className:"hover:underline text-blue-500 font-semibold flex-shrink-0",children:["(",(0,T.jsx)(j.cC,{id:"SFteAp"}),")"]})]}),(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2 w-full",children:[(0,T.jsx)("input",{type:"text",placeholder:"https://...",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700 disabled:text-gray-500",autoComplete:"off",value:g,onChange:function(e){return b(e.target.value)},disabled:O,onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),R())}}),(0,T.jsx)("button",{onClick:function(){R()},disabled:O,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors whitespace-nowrap space-x-1",children:O?(0,T.jsx)(Z,{}):(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"tfDRzk"})})})]})]}),(0,T.jsxs)("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[(0,T.jsxs)("label",{className:"text-sm font-semibold flex items-center justify-center gap-2",children:[(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"rNGD7J"})}),(0,T.jsxs)("button",{onClick:function(){V("")},className:"hover:underline text-blue-500 font-semibold flex-shrink-0",children:["(",(0,T.jsx)(j.cC,{id:"SFteAp"}),")"]})]}),(0,T.jsxs)("div",{className:"flex items-center justify-center gap-2 w-full",children:[(0,T.jsx)("input",{type:"text",placeholder:"org-xxxxxx",className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm dark:bg-zinc-700 disabled:text-gray-500",autoComplete:"off",value:q,onChange:function(e){return V(e.target.value)},disabled:O,onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),_())}}),(0,T.jsx)("button",{onClick:function(){_()},disabled:O,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-400 disabled:cursor-default transition-colors whitespace-nowrap space-x-1",children:O?(0,T.jsx)(Z,{}):(0,T.jsx)("span",{children:(0,T.jsx)(j.cC,{id:"tfDRzk"})})})]})]}),(0,T.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:(0,T.jsx)(j.cC,{id:"NnuIWZ"})}),M&&(0,T.jsx)("div",{className:"mt-2 text-sm text-red-500",children:M})]})}function lf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function lb(e){for(var t=1;t