@pickaxeproject/react 6.21.0 → 6.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/common/documents.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Document/List.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/IceBreaker/Breaker.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/IceBreaker/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Provider.js +1 -1
- package/dist/cjs/hooks/pickaxe/useSpeechToText.js +1 -1
- package/dist/cjs/src/components/Pickaxe/Addons/IceBreaker/Breaker.d.ts +3 -1
- package/dist/cjs/src/components/Pickaxe/Addons/IceBreaker/index.d.ts +3 -1
- package/dist/esm/common/documents.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Document/List.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/IceBreaker/Breaker.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/IceBreaker/index.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/esm/components/Pickaxe/Provider.js +1 -1
- package/dist/esm/hooks/pickaxe/useSpeechToText.js +1 -1
- package/dist/esm/src/components/Pickaxe/Addons/IceBreaker/Breaker.d.ts +3 -1
- package/dist/esm/src/components/Pickaxe/Addons/IceBreaker/index.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.additionalAllowedFileExtensions=[".doc",".md",".html",".htm",".wav"],exports.allowedFileMimeTypes=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/csv","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/json","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/markdown","text/html","application/xml","text/xml","audio/mpeg","audio/wav","audio/x-wav","audio/wave","video/mp4","video/quicktime","video/x-quicktime","video/avi","video/x-msvideo","video/x-matroska"],exports.allowedImageMimeTypes=["image/png","image/jpeg","image/webp","image/gif"];
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.additionalAllowedFileExtensions=[".doc",".md",".html",".htm",".wav"],exports.allowedFileMimeTypes=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/csv","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/json","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/markdown","text/x-markdown","text/html","application/xml","text/xml","audio/mpeg","audio/wav","audio/x-wav","audio/wave","video/mp4","video/quicktime","video/x-quicktime","video/avi","video/x-msvideo","video/x-matroska"],exports.allowedImageMimeTypes=["image/png","image/jpeg","image/webp","image/gif"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("react"),i=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),r=require("./hooks/useDocument.js"),l=require("../../../../common/utils.js"),o=require("../../../Icons/spinner-lines.svg.js"),n=require("../../../Icons/file.svg.js"),c=require("../../../Icons/x.svg.js"),d=require("../../../Icons/circle-info.svg.js"),u=require("../../../../common/cn.js");exports.default=({className:f,isDisabled:m})=>{const{styles:h,colors:x,translations:j,isRtl:b}=i.usePickaxeContext(),{documents:g,isUploading:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("react"),i=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),r=require("./hooks/useDocument.js"),l=require("../../../../common/utils.js"),o=require("../../../Icons/spinner-lines.svg.js"),n=require("../../../Icons/file.svg.js"),c=require("../../../Icons/x.svg.js"),d=require("../../../Icons/circle-info.svg.js"),u=require("../../../../common/cn.js");exports.default=({className:f,isDisabled:m})=>{const{styles:h,colors:x,translations:j,isRtl:b}=i.usePickaxeContext(),{documents:g,isUploading:v,removeDocument:p}=r.useDocument(),{sessionId:y,contextId:k}=i.usePickaxeContext(),w=a.useStyleFontSize();return s.jsx("div",Object.assign({className:u.default("flex flex-row gap-3 flex-wrap",f)},{children:g.map(((i,a)=>{var r,f,g,N,C,O,_,R;return s.jsx(t.Fragment,{children:"document"===i.type?s.jsxs("div",Object.assign({className:u.default("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",b&&"flex-row-reverse"),style:{borderRadius:h.cornerRadius,borderColor:x.secondaryText+"50"}},{children:[s.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:h.cornerRadius,backgroundColor:x.accent,color:x.accentText},"failed"===i.status&&{backgroundColor:x.error,color:"white"})},{children:"uploading"===i.status?s.jsx(o.default,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===i.status?s.jsx(d.default,{className:"w-5 h-5 shrink-0"}):s.jsx(n.default,{className:"w-5 h-5 shrink-0"})})),s.jsxs("div",Object.assign({className:u.default("flex flex-col justify-center truncate",b?"text-right items-end":"text-left items-start")},{children:[s.jsx("p",Object.assign({className:u.default(w.b3,"font-medium truncate")},{children:i.name})),s.jsx("p",Object.assign({className:u.default(w.b4,"opacity-80 truncate")},{children:"failed"===i.status?(null===(r=i.error)||void 0===r?void 0:r.includes("You have reached the file limit"))?null!==(f=null==j?void 0:j["file-limit-reached"])&&void 0!==f?f:"You have reached the file limit.":null!==(g=null==j?void 0:j["something-wrong-occured"])&&void 0!==g?g:"Something wrong occured":l.formatBytes(i.size)}))]})),!v&&s.jsx("button",Object.assign({type:"button",className:u.default("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",b?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:x.accent,color:x.accentText},disabled:v||m,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(p(i.id),"failed"!==i.status){const e=`${process.env.NEXT_PUBLIC_DOCUMENT_API2_URL}/decrement_document_count?sessionid=${k}&responseid=${y}&documentid=${i.documentId}`;yield fetch(e)}}))},{children:s.jsx(c.default,{className:"w-4 h-4 shrink-0"})}))]})):"image"===i.type?s.jsxs("div",Object.assign({className:"relative h-[56px] flex flex-col items-center justify-center w-[56px]",style:Object.assign({borderRadius:h.cornerRadius,backgroundColor:x.accent,color:x.accentText},"failed"===i.status&&{backgroundColor:x.error,color:"white"})},{children:["finished"===i.status?s.jsx("img",{className:"object-cover w-full h-full",style:{borderRadius:h.cornerRadius},src:`https://cdn.mail.studio/documentinterrogation/${null!==(N=i.folder)&&void 0!==N?N:"jpg"}/${i.documentId}.${null!==(C=i.folder)&&void 0!==C?C:"jpg"}`,alt:""}):"failed"===i.status?s.jsx(d.default,{className:"w-5 h-5 shrink-0"}):s.jsx(o.default,{className:"w-5 h-5 animate-spin shrink-0"}),!v&&s.jsx("button",Object.assign({type:"button",className:u.default("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",b?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:x.accent,color:x.accentText},disabled:v||m,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(p(i.id),"failed"!==i.status){const e=`${process.env.NEXT_PUBLIC_DOCUMENT_API2_URL}/decrement_document_count?sessionid=${k}&responseid=${y}&documentid=${i.documentId}`;yield fetch(e)}}))},{children:s.jsx(c.default,{className:"w-4 h-4 shrink-0"})}))]})):"website"===i.type?s.jsxs("div",Object.assign({className:u.default("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",b&&"flex-row-reverse"),style:{borderRadius:h.cornerRadius,borderColor:x.secondaryText+"50"}},{children:[s.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:h.cornerRadius,backgroundColor:x.accent,color:x.accentText},"failed"===i.status&&{backgroundColor:x.error,color:"white"})},{children:"uploading"===i.status?s.jsx(o.default,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===i.status?s.jsx(d.default,{className:"w-5 h-5 shrink-0"}):s.jsx(n.default,{className:"w-5 h-5 shrink-0"})})),s.jsxs("div",Object.assign({className:u.default("flex flex-col justify-center truncate",b?"text-right items-end":"text-left items-start")},{children:[s.jsx("p",Object.assign({className:u.default(w.b3,"font-medium truncate")},{children:i.name})),s.jsx("p",Object.assign({className:u.default(w.b4,"opacity-80 truncate")},{children:"failed"===i.status?(null===(O=i.error)||void 0===O?void 0:O.includes("You have reached the file limit"))?null!==(_=null==j?void 0:j["file-limit-reached"])&&void 0!==_?_:"You have reached the file limit.":null!==(R=null==j?void 0:j["something-wrong-occured"])&&void 0!==R?R:"Something wrong occured":"Website "}))]})),!v&&s.jsx("button",Object.assign({type:"button",className:u.default("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",b?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:x.accent,color:x.accentText},disabled:v||m,onClick:()=>p(i.id)},{children:s.jsx(c.default,{className:"w-4 h-4 shrink-0"})}))]})):null},a)}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),o=require("../../../../hooks/core/useHover.js"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../../../common/cn.js");exports.default=({type:i,text:a,onSend:n})=>{const{colors:l,styles:c,forceMobile:u,responsiveBy:x}=t.usePickaxeContext(),d=o.useHover(),{isHover:p}=d,m=e.__rest(d,["isHover"]);return r.jsxs("div",Object.assign({className:s.default("relative text-sm group flex flex-grow cursor-pointer overflow-hidden font-semilight w-full select-none px-[1em] py-[9px] duration-200 transition-colors border w-full ease-in-out","right"===i&&("viewport"===x?"min-[767px]:justify-end min-[767px]:max-w-max":"@[767px]/pickaxe-root:justify-end @[767px]/pickaxe-root:max-w-max"),u&&"max-w-full"),onClick:()=>null==n?void 0:n(a),style:{background:p?l.secondary:"transparent",borderColor:l.secondaryText+"30",borderRadius:c.cornerRadius}},m,{children:[r.jsx("div",{className:"absolute inset-0 backdrop-blur-md z-0",style:{background:p?l.secondary:l.primary+"10",borderRadius:c.cornerRadius}}),r.jsx("p",Object.assign({className:s.default("line-clamp-2 duration-200 transition-colors ease-in-out relative","center"===i&&"line-clamp-3","right"===i&&("viewport"===x?"min-[767px]:text-right":"@[767px]/pickaxe-root:text-right"),u&&"text-left"),style:{color:p?l.secondaryText:l.secondaryText+"60"}},{children:a}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("./Breaker.js");exports.default=({type:t,data:a,onSend:s})=>e.jsx(e.Fragment,{children:a.map(((a,d)=>e.jsx(r.default,{type:t,text:a,onSend:s},d)))});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),i=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../Addons/Auth/hooks/useAuthContext.js"),t=require("../../Addons/Auth/hooks/useAuth.js"),l=require("../../../../hooks/pickaxe/useResponseContext.js"),n=require("../../../../hooks/pickaxe/useDimensionContext.js"),o=require("../../Addons/Scroll/hooks/useScrollContext.js"),r=require("../../../../hooks/studio/useStyleFontSize.js"),c=require("../../../../hooks/pickaxe/useConversation.js"),d=require("../../Addons/Artifact/hooks/useArtifactContext.js"),u=require("framer-motion"),x=require("../../../Icons/lock.svg.js"),m=require("../../../Core/ErrorAlert.js"),f=require("../../common/PickaxeHead.js"),h=require("../../common/PickaxeEmbedHead.js"),j=require("../../common/PickaxeUpgradeCard.js"),g=require("../../common/PickaxeSkeleton.js"),p=require("../../common/PickaxeHistoryButton.js"),v=require("../../Addons/Scroll/ScrollLockView.js"),b=require("../../Addons/Artifact/Renderer/index.js"),y=require("./Message.js"),k=require("./CustomMessage.js"),w=require("../../Addons/IceBreaker/index.js"),N=require("../../common/PickaxeBranding.js"),C=require("../../../../common/cn.js"),O=require("../../../../common/chatMessages.js"),q=require("../../Addons/Auth/VerificationCodeForm.js");exports.default=({additionalScrollHeight:A,smitheryAuthData:S,isForceHideInfo:P,isInputFocused:I,onSubmit:L,resubmitPrompt:M})=>{var H,R,D,F,B;const{sessionId:E,deploymentType:T,pickaxe:z,translations:W,misc:$,isNewChat:_,isRtl:V,isEmbed:U,isShowIceBreaker:G,setSessionId:J,setLastSessionId:K}=i.usePickaxeContext(),{emailInput:Q,isLoggedOut:X,isSending:Y,isResendDisabled:Z,isSent:ee,isPricingAuth:se}=a.useAuthContext(),{onSend:ie}=t.useAuth(),{scrollContainerRef:ae,isLocked:te}=o.useScrollContext(),{messages:le,limitData:ne,error:oe}=l.useResponseContext(),{height:re,width:ce}=n.useDimensionContext(),{currentArtifact:de,chatPopupType:ue,currentPopupType:xe}=d.useArtifactContext(),me=c.useConversation(),fe=r.useStyleFontSize(),he=s.useMemo((()=>(null==z?void 0:z.icebreakers)?z.icebreakers.slice(0,3):[]),[null==z?void 0:z.icebreakers]),je=s.useMemo((()=>{const e=!!me.data&&me.data.messages.length>1;return!P&&me.isSuccess&&_&&!e}),[P,me.isSuccess,_,me.data]),ge=s.useMemo((()=>!(null==z?void 0:z.chatflag)&&(null==z?void 0:z.enablechatresponses)&&le.length>0),[z,le]),pe=s.useMemo((()=>!!me.data&&me.data.messages.some((e=>"intromessage"===e.area))),[me.data]),ve="chat-input"===T&&se&&X&&ee,be=G&&!I&&!pe&&je&&ce>767,ye=G&&!I&&(pe||ce<=767),ke=s.useMemo((()=>{var e,s;const i=null!==(s=null===(e=me.data)||void 0===e?void 0:e.messages)&&void 0!==s?s:[];return O.mergeConversationMessages(le,i)}),[null===(H=me.data)||void 0===H?void 0:H.messages,le]),we=()=>{K(E),J("")};return s.useLayoutEffect((()=>{if(!te)return;const e=ae.current;e&&(e.scrollTop=e.scrollHeight)}),[A,null===(R=me.data)||void 0===R?void 0:R.messages.length,te,ae,ke.length]),e.jsxs("div",Object.assign({ref:ae,className:"flex flex-1 w-full flex-col items-center overflow-y-auto pb-4 scrollbar scrollbar-thin min-h-0 mb-4 [overflow-anchor:none]"},{children:[e.jsx(u.AnimatePresence,{children:!!de&&"inline"===xe&&e.jsx(u.motion.div,Object.assign({className:C.default("absolute top-0 z-20 w-full px-4 py-2",ue),style:{height:`calc(${re-A}px - 80px)`},initial:{opacity:0,y:-20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.2,ease:"easeOut"}},{children:e.jsx(b.default,{type:"inline",className:"pxe-artifact-inline h-full shadow",artifact:{id:de.id,version:de.version}})}))}),e.jsxs("div",Object.assign({className:"relative flex flex-col items-center flex-grow w-full max-w-[800px]"},{children:[je&&U&&e.jsx("div",Object.assign({className:C.default("absolute right-4 top-3 flex items-center gap-2","popup"===T&&"right-12")},{children:e.jsx(p.default,{tip:(null==W?void 0:W["chat-history"])||"Chat History",onClick:we})})),e.jsx(f.default,Object.assign({className:C.default("opacity-0 mt-[0%] transition-all duration-500 ease-in-out max-h-0 overflow-hidden max-w-[500px]",je&&"opacity-100 mt-[10%] max-h-[100%]"),iconClassName:"duration-300 hover:opacity-90",maxDescriptionChars:500},!ve&&{onIconClick:we})),U&&!me.isLoading&&e.jsx(h.default,Object.assign({className:C.default("opacity-0 transition-all duration-500 ease-in-out h-0 w-full sticky top-0 z-10",!je&&"opacity-100 h-[56px]"),iconClassName:"duration-300 hover:opacity-90",historyBtnTip:(null==W?void 0:W["chat-history"])||"Chat History"},!ve&&{onIconClick:we,onHistoryClick:we})),e.jsxs("div",Object.assign({className:C.default("flex flex-col flex-grow mt-6 transition-all duration-300 ease-in-out w-full px-4",U&&!me.isLoading&&!je&&"mt-0")},{children:[be&&e.jsx("div",Object.assign({className:C.default("grid grid-cols-3 gap-4",2===he.length&&"grid-cols-2",1===he.length&&"grid-cols-1")},{children:e.jsx(w.default,{type:"center",data:he,onSend:L})})),ve?e.jsx("div",Object.assign({className:"flex flex-col w-full"},{children:e.jsxs("div",Object.assign({className:"grid grid-cols-1 gap-y-6 w-full"},{children:[e.jsx(k.default,Object.assign({chatRole:"user"},{children:e.jsxs("div",Object.assign({className:"flex items-center gap-x-3"},{children:[e.jsx(x.default,{className:"h-6 w-6 shrink-0"}),e.jsx("p",Object.assign({className:"font-semilight"},{children:Q}))]}))})),e.jsxs(k.default,Object.assign({chatRole:"assistant"},{children:[e.jsxs("p",Object.assign({className:"py-3 font-semilight"},{children:[`${null!==(D=null==W?void 0:W["we-sent-your-an-activation-link"])&&void 0!==D?D:"We sent you an activation link. Please be sure to check your spam folder too."} `,e.jsx("span",Object.assign({className:"underline underline-offset-2 cursor-pointer",onClick:()=>{Z||Y||ie(!0)}},{children:Y?null!==(F=null==W?void 0:W.resending)&&void 0!==F?F:"Resending...":null!==(B=null==W?void 0:W.resend)&&void 0!==B?B:"Resend"}))]})),e.jsx(q.default,{compact:!0})]}))]}))})):e.jsx(e.Fragment,{children:me.isLoading&&!(null==z?void 0:z.enablechatresponses)?e.jsxs("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[_&&e.jsxs("div",Object.assign({className:"flex flex-col items-center w-full"},{children:[e.jsx(g.default,{className:"w-[72px] h-[72px]"}),e.jsx(g.default,{className:"h-[20px] mt-6 w-full"}),e.jsx(g.default,{className:"h-[20px] mt-2 w-full"}),e.jsx(g.default,{className:"h-[20px] mt-2 w-full max-w-[400px]"})]})),e.jsx(g.default,{className:"h-10 w-[70%] animate-pulse justify-self-end rounded"}),e.jsx(g.default,{className:"h-[150px] w-[70%] animate-pulse rounded"}),e.jsx(g.default,{className:"h-10 w-[50%] animate-pulse justify-self-end rounded"})]})):me.isError?e.jsx("div",Object.assign({className:"flex w-full justify-center"},{children:e.jsxs("p",Object.assign({className:C.default(fe.b2,"text-center font-semibold")},{children:[(null==W?void 0:W["something-went-wrong-please-try-again"])||"Something went wrong. Please try again, or"," ",e.jsx("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help",target:"_blank",rel:"noreferrer"},{children:(null==W?void 0:W["contact-us"])||"contact us"}))," ",(null==W?void 0:W["for-help"])||"for help."]}))})):me.data||ge?e.jsxs("div",Object.assign({className:"flex flex-col w-full flex-grow justify-between"},{children:[e.jsxs("div",Object.assign({className:"grid grid-cols-1 gap-y-6 w-full"},{children:[ke.map(((s,i)=>e.jsx(y.default,{smitheryData:S,resubmitPrompt:M,index:i,message:s,isLastMessage:i===ke.length-1},`message-${i}`))),ne?e.jsx("div",Object.assign({className:"flex max-w-[100%] items-center gap-x-3"},{children:e.jsx(j.default,{})})):oe?e.jsx("div",Object.assign({className:C.default("flex items-center gap-x-3",V?"justify-end":"justify-start")},{children:e.jsx(m.default,{error:oe})})):null]})),e.jsxs("div",Object.assign({className:C.default("flex flex-col",!$.isWhiteLabel||ye&&"mt-4")},{children:[!$.isWhiteLabel&&e.jsx(N.default,{containerClassName:C.default("justify-end",ye&&"mb-2")}),ye&&e.jsx("div",Object.assign({className:"flex flex-col items-end gap-2"},{children:e.jsx(w.default,{type:"right",data:he,onSend:L})})),e.jsx(v.default,{})]}))]})):null})]}))]}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),o=require("./Addons/Artifact/Provider.js"),n=require("./DimensionProvider.js"),a=require("./ResponseProvider.js"),s=require("./Addons/Document/Provider.js"),r=require("./Addons/Auth/Provider.js");function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}const d=i.createContext({});exports.PickaxeContext=d,exports.PickaxeProvider=({children:c,origin:u,sender:p,senderType:f,deploymentId:g,portalId:h,deploymentType:m,deploymentDimensions:y,deploymentMisc:v,styles:b,colors:w,limits:S={},misc:k={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:P,artifact:C={popupType:"auto"},responsiveBy:x="viewport",locale:I="en",opacity:F=1,forceMobile:A=!1,disableHtml:q=!1,disableJs:T=!1,disableCss:j=!1,loadFont:D=!0,isRtl:O=!1,isEmbed:U=!1,mcpEnabled:E=!1,studioSessionToken:R,isDropShadow:M=!1,allowGuestUsage:L=!0,persistActiveConversation:G=!1,preventInitialSessionId:H=!1,onUpgrade:W,onGenerateComplete:_,onSessionIdChange:B})=>{const[N,V]=i.useState(""),[Y,X]=i.useState(""),[z,J]=i.useState(""),[Q,K]=i.useState(""),[Z,$]=i.useState(p),[ee,te]=i.useState(null),[ie,oe]=i.useState(f),[ne,ae]=i.useState("loading"),[se,re]=i.useState([]),[le,de]=i.useState(null),[ce,ue]=i.useState(null),[pe,fe]=i.useState(null),[ge,he]=i.useState(null),[me,ye]=i.useState("");i.useEffect((()=>ye("")),[Y]);const[ve,be]=i.useState(!1),[we,Se]=i.useState(!0),[ke,Pe]=i.useState(!0),[Ce,xe]=i.useState(!1);return i.useEffect((()=>{be(!1)}),[null==b?void 0:b.font]),i.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&D&&!ve&&(null==b?void 0:b.font)&&"Real Head Pro"!==b.font)try{(yield Promise.resolve().then((function(){return l(require("webfontloader"))}))).default.load({google:{families:[b.font]},active:()=>{be(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),be(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),be(!0)}}))}),[D,ve,null==b?void 0:b.font]),i.useEffect((()=>{$(p)}),[p]),t.jsx(d.Provider,Object.assign({value:Object.assign(Object.assign({origin:u,contextId:N,pickaxeId:Y,sessionId:z,lastSessionId:Q,sender:Z,senderType:ie,portalId:h,deploymentId:g,deploymentType:m,validationStatus:ne,validationUpgradeGroups:se,validationUpgradeUrl:le,deploymentDimensions:y,deploymentMisc:v,accessGroup:ee,pickaxe:ge,selectedModel:me,setSelectedModel:ye,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},b),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},w),misc:k,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, or GIF files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},P),artifact:C,responsiveBy:x,locale:I,opacity:F,forceMobile:A,loadFont:D,disableHtml:q,disableJs:T,disableCss:j,isFontLoaded:ve,isNewChat:we,isShowIceBreaker:ke,isShowFeedbackMessage:Ce,isRtl:O,isEmbed:U,mcpEnabled:E,isDropShadow:M,allowGuestUsage:L,persistActiveConversation:G,clientSecret:pe,stripeAccountId:ce,preventInitialSessionId:H,setClientSecret:fe,setStripeAccountId:ue,setContextId:V,setValidationStatus:ae,setValidationUpgradeGroups:re,setValidationUpgradeUrl:de,setPickaxeId:X,setSessionId:e=>{J((t=>{const i="function"==typeof e?e(t):e;return null==B||B(i),i}))},setLastSessionId:K,setSender:$,setSenderType:oe,setAccessGroup:te,setPickaxe:he,setIsFontLoaded:be,setIsNewChat:Se,setIsShowIceBreaker:Pe,setIsShowFeedbackMessage:xe},W&&{onUpgrade:W}),_&&{onGenerateComplete:_})},{children:t.jsx(r.default,Object.assign({initialToken:R},{children:t.jsx(n.default,{children:t.jsx(a.default,Object.assign({limits:S},{children:t.jsx(s.default,{children:t.jsx(o.ArtifactProvider,Object.assign({},C,{children:c}))})}))})}))}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),o=require("./Addons/Artifact/Provider.js"),n=require("./DimensionProvider.js"),a=require("./ResponseProvider.js"),s=require("./Addons/Document/Provider.js"),r=require("./Addons/Auth/Provider.js");function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}const d=i.createContext({});exports.PickaxeContext=d,exports.PickaxeProvider=({children:c,origin:u,sender:p,senderType:f,deploymentId:g,portalId:h,deploymentType:m,deploymentDimensions:y,deploymentMisc:v,styles:b,colors:w,limits:S={},misc:k={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:P,artifact:C={popupType:"auto"},responsiveBy:x="viewport",locale:I="en",opacity:F=1,forceMobile:A=!1,disableHtml:q=!1,disableJs:T=!1,disableCss:j=!1,loadFont:D=!0,isRtl:O=!1,isEmbed:U=!1,mcpEnabled:E=!1,studioSessionToken:R,isDropShadow:M=!1,allowGuestUsage:L=!0,persistActiveConversation:G=!1,preventInitialSessionId:H=!1,onUpgrade:W,onGenerateComplete:_,onSessionIdChange:B})=>{const[N,V]=i.useState(""),[Y,X]=i.useState(""),[z,J]=i.useState(""),[Q,K]=i.useState(""),[Z,$]=i.useState(p),[ee,te]=i.useState(null),[ie,oe]=i.useState(f),[ne,ae]=i.useState("loading"),[se,re]=i.useState([]),[le,de]=i.useState(null),[ce,ue]=i.useState(null),[pe,fe]=i.useState(null),[ge,he]=i.useState(null),[me,ye]=i.useState("");i.useEffect((()=>ye("")),[Y]);const[ve,be]=i.useState(!1),[we,Se]=i.useState(!0),[ke,Pe]=i.useState(!0),[Ce,xe]=i.useState(!1);return i.useEffect((()=>{be(!1)}),[null==b?void 0:b.font]),i.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&D&&!ve&&(null==b?void 0:b.font)&&"Real Head Pro"!==b.font)try{(yield Promise.resolve().then((function(){return l(require("webfontloader"))}))).default.load({google:{families:[b.font]},active:()=>{be(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),be(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),be(!0)}}))}),[D,ve,null==b?void 0:b.font]),i.useEffect((()=>{$(p)}),[p]),t.jsx(d.Provider,Object.assign({value:Object.assign(Object.assign({origin:u,contextId:N,pickaxeId:Y,sessionId:z,lastSessionId:Q,sender:Z,senderType:ie,portalId:h,deploymentId:g,deploymentType:m,validationStatus:ne,validationUpgradeGroups:se,validationUpgradeUrl:le,deploymentDimensions:y,deploymentMisc:v,accessGroup:ee,pickaxe:ge,selectedModel:me,setSelectedModel:ye,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},b),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},w),misc:k,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.","something-wrong-occured":"Something wrong occurred",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, or GIF files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},P),artifact:C,responsiveBy:x,locale:I,opacity:F,forceMobile:A,loadFont:D,disableHtml:q,disableJs:T,disableCss:j,isFontLoaded:ve,isNewChat:we,isShowIceBreaker:ke,isShowFeedbackMessage:Ce,isRtl:O,isEmbed:U,mcpEnabled:E,isDropShadow:M,allowGuestUsage:L,persistActiveConversation:G,clientSecret:pe,stripeAccountId:ce,preventInitialSessionId:H,setClientSecret:fe,setStripeAccountId:ue,setContextId:V,setValidationStatus:ae,setValidationUpgradeGroups:re,setValidationUpgradeUrl:de,setPickaxeId:X,setSessionId:e=>{J((t=>{const i="function"==typeof e?e(t):e;return null==B||B(i),i}))},setLastSessionId:K,setSender:$,setSenderType:oe,setAccessGroup:te,setPickaxe:he,setIsFontLoaded:be,setIsNewChat:Se,setIsShowIceBreaker:Pe,setIsShowFeedbackMessage:xe},W&&{onUpgrade:W}),_&&{onGenerateComplete:_})},{children:t.jsx(r.default,Object.assign({initialToken:R},{children:t.jsx(n.default,{children:t.jsx(a.default,Object.assign({limits:S},{children:t.jsx(s.default,{children:t.jsx(o.ArtifactProvider,Object.assign({},C,{children:c}))})}))})}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react"),r=require("../../common/api/pickaxe.js");const o=()=>{if("undefined"!=typeof window)return window.AudioContext||window.webkitAudioContext},n=e=>{var t,r;e.processor&&(e.processor.onaudioprocess=null,e.processor.disconnect()),null===(t=e.source)||void 0===t||t.disconnect(),null===(r=e.silentGain)||void 0===r||r.disconnect(),e.processor=void 0,e.source=void 0,e.silentGain=void 0;for(const t of e.stream.getTracks())t.stop();"closed"!==e.audioContext.state&&e.audioContext.close()}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react"),r=require("../../common/api/pickaxe.js");const o=()=>{if("undefined"!=typeof window)return window.AudioContext||window.webkitAudioContext},n=e=>{var t,r;e.processor&&(e.processor.onaudioprocess=null,e.processor.disconnect()),null===(t=e.source)||void 0===t||t.disconnect(),null===(r=e.silentGain)||void 0===r||r.disconnect(),e.processor=void 0,e.source=void 0,e.silentGain=void 0;for(const t of e.stream.getTracks())t.stop();"closed"!==e.audioContext.state&&e.audioContext.close()};exports.useSpeechToText=()=>{var s;const[c,i]=t.useState(""),[a,u]=t.useState(!1),[l,d]=t.useState(!1),m=t.useRef(!0),p=t.useRef(0),f=t.useRef(null),w=t.useRef(new Map),y=e=>{n(e),e.socket.readyState!==WebSocket.OPEN&&e.socket.readyState!==WebSocket.CONNECTING||e.socket.close(),f.current===e&&(f.current=null)};t.useEffect((()=>(m.current=!0,()=>{m.current=!1,p.current+=1;const e=f.current;e&&(e.socket.readyState===WebSocket.OPEN&&e.socket.send(JSON.stringify({type:"Terminate"})),y(e))})),[]);return{speechTranscript:c,isSpeechSupported:"undefined"!=typeof window&&Boolean(o())&&Boolean(null===(s=navigator.mediaDevices)||void 0===s?void 0:s.getUserMedia)&&"WebSocket"in window,isSpeechProcessing:l,isSpeechListening:a,onStartListening:t=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;const t=++p.current,s=o();if(!s||!(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia))return;const c=f.current;let a,l;c&&y(c);try{d(!0),u(!1),i(""),w.current.clear(),a=yield navigator.mediaDevices.getUserMedia({audio:{autoGainControl:!0,channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),l=new s;const{data:e}=yield r.pickaxeApi2.post("/speech/assemblyai");if(!e.success||!e.token)throw new Error(e.error||"AssemblyAI streaming token was not returned");if(!m.current||t!==p.current)return;const o=new URL("wss://streaming.assemblyai.com/v3/ws");o.searchParams.set("sample_rate",String(16e3)),o.searchParams.set("speech_model","whisper-rt"),o.searchParams.set("language_detection","true"),o.searchParams.set("format_turns","true"),o.searchParams.set("token",e.token);const c={socket:new WebSocket(o),stream:a,audioContext:l,started:!1};a=void 0,l=void 0,f.current=c,yield new Promise(((e,r)=>{const o=window.setTimeout((()=>{r(new Error("AssemblyAI streaming session timed out"))}),1e4),s=e=>{c.started||(window.clearTimeout(o),r(e))};c.socket.binaryType="arraybuffer",c.socket.onmessage=r=>{try{const n=JSON.parse(String(r.data));if("Begin"!==n.type||c.started){if("Turn"===n.type)(e=>{var t;const r=(e=>{var t,r;const o=null===(t=e.transcript)||void 0===t?void 0:t.trim();if(o)return o;const n=null===(r=e.utterance)||void 0===r?void 0:r.trim();return n&&!/^(?:\[[^\]]+\]\s*)+$/.test(n)?n:""})(e),o=null!==(t=e.turn_order)&&void 0!==t?t:0;r?w.current.set(o,r):w.current.delete(o);const n=Array.from(w.current.entries()).sort((([e],[t])=>e-t)).map((([,e])=>e)).join(" ").trim();m.current&&i(n)})(n);else if("Termination"===n.type)c.socket.close();else if("Error"===n.type)throw new Error(n.error||"AssemblyAI streaming failed")}else{c.started=!0,window.clearTimeout(o);const r=c.audioContext.createMediaStreamSource(c.stream),n=c.audioContext.createScriptProcessor(4096,1,1),s=c.audioContext.createGain();s.gain.value=0,n.onaudioprocess=({inputBuffer:e})=>{if(c.socket.readyState!==WebSocket.OPEN)return;const t=((e,t)=>{const r=t/16e3,o=Math.max(1,Math.round(e.length/r)),n=new Int16Array(o);let s=0;for(let t=0;t<o;t+=1){const o=Math.min(e.length,Math.round((t+1)*r));let c=0,i=0;for(;s<o;s+=1)c+=e[s],i+=1;const a=Math.max(-1,Math.min(1,i?c/i:0));n[t]=a<0?32768*a:32767*a}return n})(e.getChannelData(0),e.sampleRate);c.socket.send(t.buffer)},r.connect(n),n.connect(s),s.connect(c.audioContext.destination),c.source=r,c.processor=n,c.silentGain=s,c.audioContext.resume(),m.current&&t===p.current&&u(!0),e()}}catch(e){console.error("Could not process AssemblyAI message",e),s(e instanceof Error?e:new Error(String(e))),c.socket.close()}},c.socket.onerror=()=>{const e=new Error("Could not connect to AssemblyAI streaming");s(e),c.started&&console.error(e),c.socket.close()},c.socket.onclose=()=>{s(new Error("AssemblyAI streaming closed before it started")),(e=>{n(e),f.current===e&&(f.current=null,m.current&&u(!1))})(c)}})),m.current&&t===p.current||y(c)}catch(e){const t=f.current;t&&y(t),console.error("Could not start AssemblyAI speech recognition",e)}finally{if(a)for(const e of a.getTracks())e.stop();"closed"!==(null==l?void 0:l.state)&&(null==l||l.close()),m.current&&t===p.current&&d(!1)}})),onStopListening:()=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=++p.current,t=f.current;if(t)try{d(!0),n(t),yield new Promise((e=>{const r=window.setTimeout(e,2e3),o=t.socket.onclose;t.socket.onclose=n=>{window.clearTimeout(r),null==o||o.call(t.socket,n),e()},t.socket.readyState===WebSocket.OPEN?t.socket.send(JSON.stringify({type:"Terminate"})):e()}))}catch(e){console.error("Could not stop AssemblyAI speech recognition",e)}finally{y(t),m.current&&e===p.current&&(u(!1),d(!1))}else u(!1)}))}};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
export type BreakerType = "center" | "right";
|
|
1
2
|
interface BreakerProps {
|
|
3
|
+
type: BreakerType;
|
|
2
4
|
text: string;
|
|
3
5
|
onSend: (value: string) => void;
|
|
4
6
|
}
|
|
5
|
-
declare const Breaker: ({ text, onSend }: BreakerProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const Breaker: ({ type, text, onSend }: BreakerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export default Breaker;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { BreakerType } from "./Breaker";
|
|
1
2
|
interface IceBreakersProps {
|
|
3
|
+
type: BreakerType;
|
|
2
4
|
data: string[];
|
|
3
5
|
onSend: (value: string) => void;
|
|
4
6
|
}
|
|
5
|
-
declare const IceBreakers: ({ data, onSend }: IceBreakersProps) => import("react/jsx-runtime").JSX.Element
|
|
7
|
+
declare const IceBreakers: ({ type, data, onSend }: IceBreakersProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export default IceBreakers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/csv","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/json","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/markdown","text/html","application/xml","text/xml","audio/mpeg","audio/wav","audio/x-wav","audio/wave","video/mp4","video/quicktime","video/x-quicktime","video/avi","video/x-msvideo","video/x-matroska"],
|
|
1
|
+
const e=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/csv","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/json","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/markdown","text/x-markdown","text/html","application/xml","text/xml","audio/mpeg","audio/wav","audio/x-wav","audio/wave","video/mp4","video/quicktime","video/x-quicktime","video/avi","video/x-msvideo","video/x-matroska"],o=["image/png","image/jpeg","image/webp","image/gif"],i=[".doc",".md",".html",".htm",".wav"];export{i as additionalAllowedFileExtensions,e as allowedFileMimeTypes,o as allowedImageMimeTypes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../../_virtual/_tslib.js";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{Fragment as i}from"react";import{usePickaxeContext as
|
|
1
|
+
import{__awaiter as e}from"../../../../_virtual/_tslib.js";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{Fragment as i}from"react";import{usePickaxeContext as o}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as r}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as n}from"./hooks/useDocument.js";import{formatBytes as l}from"../../../../common/utils.js";import c from"../../../Icons/spinner-lines.svg.js";import a from"../../../Icons/file.svg.js";import d from"../../../Icons/x.svg.js";import u from"../../../Icons/circle-info.svg.js";import m from"../../../../common/cn.js";const h=({className:h,isDisabled:f})=>{const{styles:b,colors:g,translations:p,isRtl:v}=o(),{documents:x,isUploading:j,removeDocument:N}=n(),{sessionId:y,contextId:k}=o(),w=r();return t("div",Object.assign({className:m("flex flex-row gap-3 flex-wrap",h)},{children:x.map(((o,r)=>{var n,h,x,O,C,R,_,I;return t(i,{children:"document"===o.type?s("div",Object.assign({className:m("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",v&&"flex-row-reverse"),style:{borderRadius:b.cornerRadius,borderColor:g.secondaryText+"50"}},{children:[t("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:b.cornerRadius,backgroundColor:g.accent,color:g.accentText},"failed"===o.status&&{backgroundColor:g.error,color:"white"})},{children:"uploading"===o.status?t(c,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===o.status?t(u,{className:"w-5 h-5 shrink-0"}):t(a,{className:"w-5 h-5 shrink-0"})})),s("div",Object.assign({className:m("flex flex-col justify-center truncate",v?"text-right items-end":"text-left items-start")},{children:[t("p",Object.assign({className:m(w.b3,"font-medium truncate")},{children:o.name})),t("p",Object.assign({className:m(w.b4,"opacity-80 truncate")},{children:"failed"===o.status?(null===(n=o.error)||void 0===n?void 0:n.includes("You have reached the file limit"))?null!==(h=null==p?void 0:p["file-limit-reached"])&&void 0!==h?h:"You have reached the file limit.":null!==(x=null==p?void 0:p["something-wrong-occured"])&&void 0!==x?x:"Something wrong occured":l(o.size)}))]})),!j&&t("button",Object.assign({type:"button",className:m("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",v?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:g.accent,color:g.accentText},disabled:j||f,onClick:()=>e(void 0,void 0,void 0,(function*(){if(N(o.id),"failed"!==o.status){const e=`${process.env.NEXT_PUBLIC_DOCUMENT_API2_URL}/decrement_document_count?sessionid=${k}&responseid=${y}&documentid=${o.documentId}`;yield fetch(e)}}))},{children:t(d,{className:"w-4 h-4 shrink-0"})}))]})):"image"===o.type?s("div",Object.assign({className:"relative h-[56px] flex flex-col items-center justify-center w-[56px]",style:Object.assign({borderRadius:b.cornerRadius,backgroundColor:g.accent,color:g.accentText},"failed"===o.status&&{backgroundColor:g.error,color:"white"})},{children:["finished"===o.status?t("img",{className:"object-cover w-full h-full",style:{borderRadius:b.cornerRadius},src:`https://cdn.mail.studio/documentinterrogation/${null!==(O=o.folder)&&void 0!==O?O:"jpg"}/${o.documentId}.${null!==(C=o.folder)&&void 0!==C?C:"jpg"}`,alt:""}):"failed"===o.status?t(u,{className:"w-5 h-5 shrink-0"}):t(c,{className:"w-5 h-5 animate-spin shrink-0"}),!j&&t("button",Object.assign({type:"button",className:m("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",v?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:g.accent,color:g.accentText},disabled:j||f,onClick:()=>e(void 0,void 0,void 0,(function*(){if(N(o.id),"failed"!==o.status){const e=`${process.env.NEXT_PUBLIC_DOCUMENT_API2_URL}/decrement_document_count?sessionid=${k}&responseid=${y}&documentid=${o.documentId}`;yield fetch(e)}}))},{children:t(d,{className:"w-4 h-4 shrink-0"})}))]})):"website"===o.type?s("div",Object.assign({className:m("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",v&&"flex-row-reverse"),style:{borderRadius:b.cornerRadius,borderColor:g.secondaryText+"50"}},{children:[t("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:b.cornerRadius,backgroundColor:g.accent,color:g.accentText},"failed"===o.status&&{backgroundColor:g.error,color:"white"})},{children:"uploading"===o.status?t(c,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===o.status?t(u,{className:"w-5 h-5 shrink-0"}):t(a,{className:"w-5 h-5 shrink-0"})})),s("div",Object.assign({className:m("flex flex-col justify-center truncate",v?"text-right items-end":"text-left items-start")},{children:[t("p",Object.assign({className:m(w.b3,"font-medium truncate")},{children:o.name})),t("p",Object.assign({className:m(w.b4,"opacity-80 truncate")},{children:"failed"===o.status?(null===(R=o.error)||void 0===R?void 0:R.includes("You have reached the file limit"))?null!==(_=null==p?void 0:p["file-limit-reached"])&&void 0!==_?_:"You have reached the file limit.":null!==(I=null==p?void 0:p["something-wrong-occured"])&&void 0!==I?I:"Something wrong occured":"Website "}))]})),!j&&t("button",Object.assign({type:"button",className:m("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",v?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:g.accent,color:g.accentText},disabled:j||f,onClick:()=>N(o.id)},{children:t(d,{className:"w-4 h-4 shrink-0"})}))]})):null},r)}))}))};export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as
|
|
1
|
+
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsxs as o,jsx as r}from"react/jsx-runtime";import{useHover as t}from"../../../../hooks/core/useHover.js";import{usePickaxeContext as i}from"../../../../hooks/pickaxe/usePickaxeContext.js";import s from"../../../../common/cn.js";const n=({type:n,text:a,onSend:l})=>{const{colors:c,styles:m,forceMobile:p,responsiveBy:x}=i(),d=t(),{isHover:u}=d,f=e(d,["isHover"]);return o("div",Object.assign({className:s("relative text-sm group flex flex-grow cursor-pointer overflow-hidden font-semilight w-full select-none px-[1em] py-[9px] duration-200 transition-colors border w-full ease-in-out","right"===n&&("viewport"===x?"min-[767px]:justify-end min-[767px]:max-w-max":"@[767px]/pickaxe-root:justify-end @[767px]/pickaxe-root:max-w-max"),p&&"max-w-full"),onClick:()=>null==l?void 0:l(a),style:{background:u?c.secondary:"transparent",borderColor:c.secondaryText+"30",borderRadius:m.cornerRadius}},f,{children:[r("div",{className:"absolute inset-0 backdrop-blur-md z-0",style:{background:u?c.secondary:c.primary+"10",borderRadius:m.cornerRadius}}),r("p",Object.assign({className:s("line-clamp-2 duration-200 transition-colors ease-in-out relative","center"===n&&"line-clamp-3","right"===n&&("viewport"===x?"min-[767px]:text-right":"@[767px]/pickaxe-root:text-right"),p&&"text-left"),style:{color:u?c.secondaryText:c.secondaryText+"60"}},{children:a}))]}))};export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,Fragment as t}from"react/jsx-runtime";import r from"./Breaker.js";const o=({type:o,data:a,onSend:n})=>e(t,{children:a.map(((t,a)=>e(r,{type:o,text:t,onSend:n},a)))});export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as s,Fragment as i}from"react/jsx-runtime";import{useMemo as t,useLayoutEffect as o}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as n}from"../../Addons/Auth/hooks/useAuthContext.js";import{useAuth as l}from"../../Addons/Auth/hooks/useAuth.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{useDimensionContext as c}from"../../../../hooks/pickaxe/useDimensionContext.js";import{useScrollContext as m}from"../../Addons/Scroll/hooks/useScrollContext.js";import{useStyleFontSize as d}from"../../../../hooks/studio/useStyleFontSize.js";import{useConversation as p}from"../../../../hooks/pickaxe/useConversation.js";import{useArtifactContext as u}from"../../Addons/Artifact/hooks/useArtifactContext.js";import{AnimatePresence as h,motion as f}from"framer-motion";import g from"../../../Icons/lock.svg.js";import x from"../../../Core/ErrorAlert.js";import j from"../../common/PickaxeHead.js";import v from"../../common/PickaxeEmbedHead.js";import b from"../../common/PickaxeUpgradeCard.js";import y from"../../common/PickaxeSkeleton.js";import
|
|
1
|
+
import{jsxs as e,jsx as s,Fragment as i}from"react/jsx-runtime";import{useMemo as t,useLayoutEffect as o}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as n}from"../../Addons/Auth/hooks/useAuthContext.js";import{useAuth as l}from"../../Addons/Auth/hooks/useAuth.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{useDimensionContext as c}from"../../../../hooks/pickaxe/useDimensionContext.js";import{useScrollContext as m}from"../../Addons/Scroll/hooks/useScrollContext.js";import{useStyleFontSize as d}from"../../../../hooks/studio/useStyleFontSize.js";import{useConversation as p}from"../../../../hooks/pickaxe/useConversation.js";import{useArtifactContext as u}from"../../Addons/Artifact/hooks/useArtifactContext.js";import{AnimatePresence as h,motion as f}from"framer-motion";import g from"../../../Icons/lock.svg.js";import x from"../../../Core/ErrorAlert.js";import j from"../../common/PickaxeHead.js";import v from"../../common/PickaxeEmbedHead.js";import b from"../../common/PickaxeUpgradeCard.js";import y from"../../common/PickaxeSkeleton.js";import k from"../../common/PickaxeHistoryButton.js";import w from"../../Addons/Scroll/ScrollLockView.js";import N from"../../Addons/Artifact/Renderer/index.js";import O from"./Message.js";import C from"./CustomMessage.js";import A from"../../Addons/IceBreaker/index.js";import S from"../../common/PickaxeBranding.js";import P from"../../../../common/cn.js";import{mergeConversationMessages as I}from"../../../../common/chatMessages.js";import H from"../../Addons/Auth/VerificationCodeForm.js";const L=({additionalScrollHeight:L,smitheryAuthData:R,isForceHideInfo:D,isInputFocused:B,onSubmit:T,resubmitPrompt:E})=>{var F,M,z,W,$;const{sessionId:V,deploymentType:U,pickaxe:_,translations:q,misc:G,isNewChat:J,isRtl:K,isEmbed:Q,isShowIceBreaker:X,setSessionId:Y,setLastSessionId:Z}=a(),{emailInput:ee,isLoggedOut:se,isSending:ie,isResendDisabled:te,isSent:oe,isPricingAuth:ae}=n(),{onSend:ne}=l(),{scrollContainerRef:le,isLocked:re}=m(),{messages:ce,limitData:me,error:de}=r(),{height:pe,width:ue}=c(),{currentArtifact:he,chatPopupType:fe,currentPopupType:ge}=u(),xe=p(),je=d(),ve=t((()=>(null==_?void 0:_.icebreakers)?_.icebreakers.slice(0,3):[]),[null==_?void 0:_.icebreakers]),be=t((()=>{const e=!!xe.data&&xe.data.messages.length>1;return!D&&xe.isSuccess&&J&&!e}),[D,xe.isSuccess,J,xe.data]),ye=t((()=>!(null==_?void 0:_.chatflag)&&(null==_?void 0:_.enablechatresponses)&&ce.length>0),[_,ce]),ke=t((()=>!!xe.data&&xe.data.messages.some((e=>"intromessage"===e.area))),[xe.data]),we="chat-input"===U&&ae&&se&&oe,Ne=X&&!B&&!ke&&be&&ue>767,Oe=X&&!B&&(ke||ue<=767),Ce=t((()=>{var e,s;const i=null!==(s=null===(e=xe.data)||void 0===e?void 0:e.messages)&&void 0!==s?s:[];return I(ce,i)}),[null===(F=xe.data)||void 0===F?void 0:F.messages,ce]),Ae=()=>{Z(V),Y("")};return o((()=>{if(!re)return;const e=le.current;e&&(e.scrollTop=e.scrollHeight)}),[L,null===(M=xe.data)||void 0===M?void 0:M.messages.length,re,le,Ce.length]),e("div",Object.assign({ref:le,className:"flex flex-1 w-full flex-col items-center overflow-y-auto pb-4 scrollbar scrollbar-thin min-h-0 mb-4 [overflow-anchor:none]"},{children:[s(h,{children:!!he&&"inline"===ge&&s(f.div,Object.assign({className:P("absolute top-0 z-20 w-full px-4 py-2",fe),style:{height:`calc(${pe-L}px - 80px)`},initial:{opacity:0,y:-20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.2,ease:"easeOut"}},{children:s(N,{type:"inline",className:"pxe-artifact-inline h-full shadow",artifact:{id:he.id,version:he.version}})}))}),e("div",Object.assign({className:"relative flex flex-col items-center flex-grow w-full max-w-[800px]"},{children:[be&&Q&&s("div",Object.assign({className:P("absolute right-4 top-3 flex items-center gap-2","popup"===U&&"right-12")},{children:s(k,{tip:(null==q?void 0:q["chat-history"])||"Chat History",onClick:Ae})})),s(j,Object.assign({className:P("opacity-0 mt-[0%] transition-all duration-500 ease-in-out max-h-0 overflow-hidden max-w-[500px]",be&&"opacity-100 mt-[10%] max-h-[100%]"),iconClassName:"duration-300 hover:opacity-90",maxDescriptionChars:500},!we&&{onIconClick:Ae})),Q&&!xe.isLoading&&s(v,Object.assign({className:P("opacity-0 transition-all duration-500 ease-in-out h-0 w-full sticky top-0 z-10",!be&&"opacity-100 h-[56px]"),iconClassName:"duration-300 hover:opacity-90",historyBtnTip:(null==q?void 0:q["chat-history"])||"Chat History"},!we&&{onIconClick:Ae,onHistoryClick:Ae})),e("div",Object.assign({className:P("flex flex-col flex-grow mt-6 transition-all duration-300 ease-in-out w-full px-4",Q&&!xe.isLoading&&!be&&"mt-0")},{children:[Ne&&s("div",Object.assign({className:P("grid grid-cols-3 gap-4",2===ve.length&&"grid-cols-2",1===ve.length&&"grid-cols-1")},{children:s(A,{type:"center",data:ve,onSend:T})})),we?s("div",Object.assign({className:"flex flex-col w-full"},{children:e("div",Object.assign({className:"grid grid-cols-1 gap-y-6 w-full"},{children:[s(C,Object.assign({chatRole:"user"},{children:e("div",Object.assign({className:"flex items-center gap-x-3"},{children:[s(g,{className:"h-6 w-6 shrink-0"}),s("p",Object.assign({className:"font-semilight"},{children:ee}))]}))})),e(C,Object.assign({chatRole:"assistant"},{children:[e("p",Object.assign({className:"py-3 font-semilight"},{children:[`${null!==(z=null==q?void 0:q["we-sent-your-an-activation-link"])&&void 0!==z?z:"We sent you an activation link. Please be sure to check your spam folder too."} `,s("span",Object.assign({className:"underline underline-offset-2 cursor-pointer",onClick:()=>{te||ie||ne(!0)}},{children:ie?null!==(W=null==q?void 0:q.resending)&&void 0!==W?W:"Resending...":null!==($=null==q?void 0:q.resend)&&void 0!==$?$:"Resend"}))]})),s(H,{compact:!0})]}))]}))})):s(i,{children:xe.isLoading&&!(null==_?void 0:_.enablechatresponses)?e("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[J&&e("div",Object.assign({className:"flex flex-col items-center w-full"},{children:[s(y,{className:"w-[72px] h-[72px]"}),s(y,{className:"h-[20px] mt-6 w-full"}),s(y,{className:"h-[20px] mt-2 w-full"}),s(y,{className:"h-[20px] mt-2 w-full max-w-[400px]"})]})),s(y,{className:"h-10 w-[70%] animate-pulse justify-self-end rounded"}),s(y,{className:"h-[150px] w-[70%] animate-pulse rounded"}),s(y,{className:"h-10 w-[50%] animate-pulse justify-self-end rounded"})]})):xe.isError?s("div",Object.assign({className:"flex w-full justify-center"},{children:e("p",Object.assign({className:P(je.b2,"text-center font-semibold")},{children:[(null==q?void 0:q["something-went-wrong-please-try-again"])||"Something went wrong. Please try again, or"," ",s("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help",target:"_blank",rel:"noreferrer"},{children:(null==q?void 0:q["contact-us"])||"contact us"}))," ",(null==q?void 0:q["for-help"])||"for help."]}))})):xe.data||ye?e("div",Object.assign({className:"flex flex-col w-full flex-grow justify-between"},{children:[e("div",Object.assign({className:"grid grid-cols-1 gap-y-6 w-full"},{children:[Ce.map(((e,i)=>s(O,{smitheryData:R,resubmitPrompt:E,index:i,message:e,isLastMessage:i===Ce.length-1},`message-${i}`))),me?s("div",Object.assign({className:"flex max-w-[100%] items-center gap-x-3"},{children:s(b,{})})):de?s("div",Object.assign({className:P("flex items-center gap-x-3",K?"justify-end":"justify-start")},{children:s(x,{error:de})})):null]})),e("div",Object.assign({className:P("flex flex-col",!G.isWhiteLabel||Oe&&"mt-4")},{children:[!G.isWhiteLabel&&s(S,{containerClassName:P("justify-end",Oe&&"mb-2")}),Oe&&s("div",Object.assign({className:"flex flex-col items-end gap-2"},{children:s(A,{type:"right",data:ve,onSend:T})})),s(w,{})]}))]})):null})]}))]}))]}))};export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{createContext as i,useState as o,useEffect as n}from"react";import{ArtifactProvider as a}from"./Addons/Artifact/Provider.js";import s from"./DimensionProvider.js";import r from"./ResponseProvider.js";import l from"./Addons/Document/Provider.js";import d from"./Addons/Auth/Provider.js";const c=i({}),p=({children:i,origin:p,sender:u,senderType:m,deploymentId:f,portalId:g,deploymentType:h,deploymentDimensions:y,deploymentMisc:v,styles:b,colors:w,limits:k={},misc:S={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:C,artifact:I={popupType:"auto"},responsiveBy:P="viewport",locale:F="en",opacity:x=1,forceMobile:A=!1,disableHtml:T=!1,disableJs:D=!1,disableCss:U=!1,loadFont:q=!0,isRtl:R=!1,isEmbed:O=!1,mcpEnabled:j=!1,studioSessionToken:E,isDropShadow:M=!1,allowGuestUsage:L=!0,persistActiveConversation:G=!1,preventInitialSessionId:H=!1,onUpgrade:W,onGenerateComplete:B,onSessionIdChange:N})=>{const[V,Y]=o(""),[X,J]=o(""),[_,z]=o(""),[Q,K]=o(""),[Z,$]=o(u),[ee,te]=o(null),[ie,oe]=o(m),[ne,ae]=o("loading"),[se,re]=o([]),[le,de]=o(null),[ce,pe]=o(null),[ue,me]=o(null),[fe,ge]=o(null),[he,ye]=o("");n((()=>ye("")),[X]);const[ve,be]=o(!1),[we,ke]=o(!0),[Se,Ce]=o(!0),[Ie,Pe]=o(!1);return n((()=>{be(!1)}),[null==b?void 0:b.font]),n((()=>{e(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&q&&!ve&&(null==b?void 0:b.font)&&"Real Head Pro"!==b.font)try{(yield import("webfontloader")).default.load({google:{families:[b.font]},active:()=>{be(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),be(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),be(!0)}}))}),[q,ve,null==b?void 0:b.font]),n((()=>{$(u)}),[u]),t(c.Provider,Object.assign({value:Object.assign(Object.assign({origin:p,contextId:V,pickaxeId:X,sessionId:_,lastSessionId:Q,sender:Z,senderType:ie,portalId:g,deploymentId:f,deploymentType:h,validationStatus:ne,validationUpgradeGroups:se,validationUpgradeUrl:le,deploymentDimensions:y,deploymentMisc:v,accessGroup:ee,pickaxe:fe,selectedModel:he,setSelectedModel:ye,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},b),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},w),misc:S,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, or GIF files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},C),artifact:I,responsiveBy:P,locale:F,opacity:x,forceMobile:A,loadFont:q,disableHtml:T,disableJs:D,disableCss:U,isFontLoaded:ve,isNewChat:we,isShowIceBreaker:Se,isShowFeedbackMessage:Ie,isRtl:R,isEmbed:O,mcpEnabled:j,isDropShadow:M,allowGuestUsage:L,persistActiveConversation:G,clientSecret:ue,stripeAccountId:ce,preventInitialSessionId:H,setClientSecret:me,setStripeAccountId:pe,setContextId:Y,setValidationStatus:ae,setValidationUpgradeGroups:re,setValidationUpgradeUrl:de,setPickaxeId:J,setSessionId:e=>{z((t=>{const i="function"==typeof e?e(t):e;return null==N||N(i),i}))},setLastSessionId:K,setSender:$,setSenderType:oe,setAccessGroup:te,setPickaxe:ge,setIsFontLoaded:be,setIsNewChat:ke,setIsShowIceBreaker:Ce,setIsShowFeedbackMessage:Pe},W&&{onUpgrade:W}),B&&{onGenerateComplete:B})},{children:t(d,Object.assign({initialToken:E},{children:t(s,{children:t(r,Object.assign({limits:k},{children:t(l,{children:t(a,Object.assign({},I,{children:i}))})}))})}))}))};export{c as PickaxeContext,p as PickaxeProvider};
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{createContext as i,useState as o,useEffect as n}from"react";import{ArtifactProvider as a}from"./Addons/Artifact/Provider.js";import s from"./DimensionProvider.js";import r from"./ResponseProvider.js";import l from"./Addons/Document/Provider.js";import d from"./Addons/Auth/Provider.js";const c=i({}),p=({children:i,origin:p,sender:u,senderType:m,deploymentId:g,portalId:f,deploymentType:h,deploymentDimensions:y,deploymentMisc:v,styles:b,colors:w,limits:k={},misc:S={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:C,artifact:I={popupType:"auto"},responsiveBy:P="viewport",locale:F="en",opacity:x=1,forceMobile:A=!1,disableHtml:T=!1,disableJs:D=!1,disableCss:U=!1,loadFont:q=!0,isRtl:R=!1,isEmbed:O=!1,mcpEnabled:j=!1,studioSessionToken:E,isDropShadow:M=!1,allowGuestUsage:L=!0,persistActiveConversation:G=!1,preventInitialSessionId:H=!1,onUpgrade:W,onGenerateComplete:B,onSessionIdChange:N})=>{const[V,Y]=o(""),[X,J]=o(""),[_,z]=o(""),[Q,K]=o(""),[Z,$]=o(u),[ee,te]=o(null),[ie,oe]=o(m),[ne,ae]=o("loading"),[se,re]=o([]),[le,de]=o(null),[ce,pe]=o(null),[ue,me]=o(null),[ge,fe]=o(null),[he,ye]=o("");n((()=>ye("")),[X]);const[ve,be]=o(!1),[we,ke]=o(!0),[Se,Ce]=o(!0),[Ie,Pe]=o(!1);return n((()=>{be(!1)}),[null==b?void 0:b.font]),n((()=>{e(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&q&&!ve&&(null==b?void 0:b.font)&&"Real Head Pro"!==b.font)try{(yield import("webfontloader")).default.load({google:{families:[b.font]},active:()=>{be(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),be(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),be(!0)}}))}),[q,ve,null==b?void 0:b.font]),n((()=>{$(u)}),[u]),t(c.Provider,Object.assign({value:Object.assign(Object.assign({origin:p,contextId:V,pickaxeId:X,sessionId:_,lastSessionId:Q,sender:Z,senderType:ie,portalId:f,deploymentId:g,deploymentType:h,validationStatus:ne,validationUpgradeGroups:se,validationUpgradeUrl:le,deploymentDimensions:y,deploymentMisc:v,accessGroup:ee,pickaxe:ge,selectedModel:he,setSelectedModel:ye,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},b),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},w),misc:S,translations:Object.assign({"form-next":"Next","form-progress":"Form progress","form-page-progress":"Question {current} of {total}","action-confirmation-needed":"Confirmation needed","action-confirmation-unavailable":"Confirmation unavailable","action-approved":"Approved","action-declined":"Declined","action-expired":"Expired","action-not-run":"Not run","action-label":"Action: {name}","action-confirmation-description":"Review this action before it runs. Your decision applies only to this call.","action-inputs":"Action inputs","decline-action":"Decline","approve-action":"Approve action","action-confirmation-resolved":"This confirmation has expired or already been resolved.","action-decision-failed":"Could not save your decision. Please try again.","ai-model":"AI model","default-ai-model":"Default ({model})","attach-files":"Attach files","new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.","something-wrong-occured":"Something wrong occurred",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","enter-verification-code":"Or enter the 6-digit code from the email","verification-code-session-missing":"Your login request could not be found. Please resend the email.","verification-code-invalid":"Invalid verification code.",verifying:"Verifying...",verify:"Verify","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","mcp-use-with-ai-app":"Use with an AI app","mcp-use-agent-in-ai-app":"Use this agent in your AI app","mcp-connect-description":"Connect through MCP. Requests will be sent as your signed-in Studio user.","mcp-ai-app":"AI app","mcp-copy-configuration":"Copy MCP configuration","mcp-private-configuration-note":"Keep this configuration private. It contains your Studio session token and stops working when that session expires.","log-out":"Log Out","clear-form":"Clear form","form.clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free","pricing.free":"Free",unlimited:"Unlimited","pricing.unlimited":"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.","queue-message":"Queue message","stop-response":"Stop response",steer:"Steer","steer-with":"Steer with",steering:"Steering...",starting:"Starting...","remove-queued-message":"Remove queued message","edit-message":"Edit message","more-options":"More options","failed-to-interrupt-current-response":"Failed to interrupt the current response.","current-response-still-stopping":"The current response is still stopping. Please send your message again in a moment.","queued-message-waiting":"A queued message is waiting for the previous response to finish.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","pricing.upgrade":"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, HTML, XML, PNG, JPEG, WEBP, or GIF files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},C),artifact:I,responsiveBy:P,locale:F,opacity:x,forceMobile:A,loadFont:q,disableHtml:T,disableJs:D,disableCss:U,isFontLoaded:ve,isNewChat:we,isShowIceBreaker:Se,isShowFeedbackMessage:Ie,isRtl:R,isEmbed:O,mcpEnabled:j,isDropShadow:M,allowGuestUsage:L,persistActiveConversation:G,clientSecret:ue,stripeAccountId:ce,preventInitialSessionId:H,setClientSecret:me,setStripeAccountId:pe,setContextId:Y,setValidationStatus:ae,setValidationUpgradeGroups:re,setValidationUpgradeUrl:de,setPickaxeId:J,setSessionId:e=>{z((t=>{const i="function"==typeof e?e(t):e;return null==N||N(i),i}))},setLastSessionId:K,setSender:$,setSenderType:oe,setAccessGroup:te,setPickaxe:fe,setIsFontLoaded:be,setIsNewChat:ke,setIsShowIceBreaker:Ce,setIsShowFeedbackMessage:Pe},W&&{onUpgrade:W}),B&&{onGenerateComplete:B})},{children:t(d,Object.assign({initialToken:E},{children:t(s,{children:t(r,Object.assign({limits:k},{children:t(l,{children:t(a,Object.assign({},I,{children:i}))})}))})}))}))};export{c as PickaxeContext,p as PickaxeProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{useState as t,useRef as r,useEffect as o}from"react";import{pickaxeApi2 as n}from"../../common/api/pickaxe.js";const s=()=>{if("undefined"!=typeof window)return window.AudioContext||window.webkitAudioContext},c=e=>{var t,r;e.processor&&(e.processor.onaudioprocess=null,e.processor.disconnect()),null===(t=e.source)||void 0===t||t.disconnect(),null===(r=e.silentGain)||void 0===r||r.disconnect(),e.processor=void 0,e.source=void 0,e.silentGain=void 0;for(const t of e.stream.getTracks())t.stop();"closed"!==e.audioContext.state&&e.audioContext.close()},i=
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{useState as t,useRef as r,useEffect as o}from"react";import{pickaxeApi2 as n}from"../../common/api/pickaxe.js";const s=()=>{if("undefined"!=typeof window)return window.AudioContext||window.webkitAudioContext},c=e=>{var t,r;e.processor&&(e.processor.onaudioprocess=null,e.processor.disconnect()),null===(t=e.source)||void 0===t||t.disconnect(),null===(r=e.silentGain)||void 0===r||r.disconnect(),e.processor=void 0,e.source=void 0,e.silentGain=void 0;for(const t of e.stream.getTracks())t.stop();"closed"!==e.audioContext.state&&e.audioContext.close()},i=()=>{var i;const[a,u]=t(""),[l,d]=t(!1),[m,p]=t(!1),f=r(!0),w=r(0),y=r(null),v=r(new Map),k=e=>{c(e),e.socket.readyState!==WebSocket.OPEN&&e.socket.readyState!==WebSocket.CONNECTING||e.socket.close(),y.current===e&&(y.current=null)};o((()=>(f.current=!0,()=>{f.current=!1,w.current+=1;const e=y.current;e&&(e.socket.readyState===WebSocket.OPEN&&e.socket.send(JSON.stringify({type:"Terminate"})),k(e))})),[]);return{speechTranscript:a,isSpeechSupported:"undefined"!=typeof window&&Boolean(s())&&Boolean(null===(i=navigator.mediaDevices)||void 0===i?void 0:i.getUserMedia)&&"WebSocket"in window,isSpeechProcessing:m,isSpeechListening:l,onStartListening:t=>e(void 0,void 0,void 0,(function*(){var e;const t=++w.current,r=s();if(!r||!(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia))return;const o=y.current;let i,a;o&&k(o);try{p(!0),d(!1),u(""),v.current.clear(),i=yield navigator.mediaDevices.getUserMedia({audio:{autoGainControl:!0,channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),a=new r;const{data:e}=yield n.post("/speech/assemblyai");if(!e.success||!e.token)throw new Error(e.error||"AssemblyAI streaming token was not returned");if(!f.current||t!==w.current)return;const o=new URL("wss://streaming.assemblyai.com/v3/ws");o.searchParams.set("sample_rate",String(16e3)),o.searchParams.set("speech_model","whisper-rt"),o.searchParams.set("language_detection","true"),o.searchParams.set("format_turns","true"),o.searchParams.set("token",e.token);const s={socket:new WebSocket(o),stream:i,audioContext:a,started:!1};i=void 0,a=void 0,y.current=s,yield new Promise(((e,r)=>{const o=window.setTimeout((()=>{r(new Error("AssemblyAI streaming session timed out"))}),1e4),n=e=>{s.started||(window.clearTimeout(o),r(e))};s.socket.binaryType="arraybuffer",s.socket.onmessage=r=>{try{const n=JSON.parse(String(r.data));if("Begin"!==n.type||s.started){if("Turn"===n.type)(e=>{var t;const r=(e=>{var t,r;const o=null===(t=e.transcript)||void 0===t?void 0:t.trim();if(o)return o;const n=null===(r=e.utterance)||void 0===r?void 0:r.trim();return n&&!/^(?:\[[^\]]+\]\s*)+$/.test(n)?n:""})(e),o=null!==(t=e.turn_order)&&void 0!==t?t:0;r?v.current.set(o,r):v.current.delete(o);const n=Array.from(v.current.entries()).sort((([e],[t])=>e-t)).map((([,e])=>e)).join(" ").trim();f.current&&u(n)})(n);else if("Termination"===n.type)s.socket.close();else if("Error"===n.type)throw new Error(n.error||"AssemblyAI streaming failed")}else{s.started=!0,window.clearTimeout(o);const r=s.audioContext.createMediaStreamSource(s.stream),n=s.audioContext.createScriptProcessor(4096,1,1),c=s.audioContext.createGain();c.gain.value=0,n.onaudioprocess=({inputBuffer:e})=>{if(s.socket.readyState!==WebSocket.OPEN)return;const t=((e,t)=>{const r=t/16e3,o=Math.max(1,Math.round(e.length/r)),n=new Int16Array(o);let s=0;for(let t=0;t<o;t+=1){const o=Math.min(e.length,Math.round((t+1)*r));let c=0,i=0;for(;s<o;s+=1)c+=e[s],i+=1;const a=Math.max(-1,Math.min(1,i?c/i:0));n[t]=a<0?32768*a:32767*a}return n})(e.getChannelData(0),e.sampleRate);s.socket.send(t.buffer)},r.connect(n),n.connect(c),c.connect(s.audioContext.destination),s.source=r,s.processor=n,s.silentGain=c,s.audioContext.resume(),f.current&&t===w.current&&d(!0),e()}}catch(e){console.error("Could not process AssemblyAI message",e),n(e instanceof Error?e:new Error(String(e))),s.socket.close()}},s.socket.onerror=()=>{const e=new Error("Could not connect to AssemblyAI streaming");n(e),s.started&&console.error(e),s.socket.close()},s.socket.onclose=()=>{n(new Error("AssemblyAI streaming closed before it started")),(e=>{c(e),y.current===e&&(y.current=null,f.current&&d(!1))})(s)}})),f.current&&t===w.current||k(s)}catch(e){const t=y.current;t&&k(t),console.error("Could not start AssemblyAI speech recognition",e)}finally{if(i)for(const e of i.getTracks())e.stop();"closed"!==(null==a?void 0:a.state)&&(null==a||a.close()),f.current&&t===w.current&&p(!1)}})),onStopListening:()=>e(void 0,void 0,void 0,(function*(){const e=++w.current,t=y.current;if(t)try{p(!0),c(t),yield new Promise((e=>{const r=window.setTimeout(e,2e3),o=t.socket.onclose;t.socket.onclose=n=>{window.clearTimeout(r),null==o||o.call(t.socket,n),e()},t.socket.readyState===WebSocket.OPEN?t.socket.send(JSON.stringify({type:"Terminate"})):e()}))}catch(e){console.error("Could not stop AssemblyAI speech recognition",e)}finally{k(t),f.current&&e===w.current&&(d(!1),p(!1))}else d(!1)}))}};export{i as useSpeechToText};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
export type BreakerType = "center" | "right";
|
|
1
2
|
interface BreakerProps {
|
|
3
|
+
type: BreakerType;
|
|
2
4
|
text: string;
|
|
3
5
|
onSend: (value: string) => void;
|
|
4
6
|
}
|
|
5
|
-
declare const Breaker: ({ text, onSend }: BreakerProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const Breaker: ({ type, text, onSend }: BreakerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export default Breaker;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { BreakerType } from "./Breaker";
|
|
1
2
|
interface IceBreakersProps {
|
|
3
|
+
type: BreakerType;
|
|
2
4
|
data: string[];
|
|
3
5
|
onSend: (value: string) => void;
|
|
4
6
|
}
|
|
5
|
-
declare const IceBreakers: ({ data, onSend }: IceBreakersProps) => import("react/jsx-runtime").JSX.Element
|
|
7
|
+
declare const IceBreakers: ({ type, data, onSend }: IceBreakersProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export default IceBreakers;
|