PageSourceSearch

https://botech.com.cn/_next/static/chunks/711-ccd6ec538f6a971f.js

js botech.com.cn collected 2026-10-07 03:19:10 UTC 51,476 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[711],{1400:(e,t,a)=>{"use strict";a.d(t,{J:()=>r,u:()=>s});var s=function(e){return e.YAML_CONTENT="yaml-content",e.YAML_URL="yaml-url",e}({}),r=function(e){return e.COMPLETED="completed",e.COMPLETED_WITH_WARNINGS="completed-with-warnings",e.PENDING="pending",e.FAILED="failed",e}({})},5865:(e,t,a)=>{"use strict";a.d(t,{A:()=>m});var s=a(58501),r=a(33505),l=a(52088),n=a(82778),i=a.n(n),o=a(24219);let c=e=>{let[t,a]=(0,r.useState)(!1),s=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),a(!0)},[]),l=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]);return{handleDragEnter:s,handleDragOver:l,handleDragLeave:(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),a(!1)},[]),handleDrop:(0,r.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),a(!1);let s=t.dataTransfer.files[0];s&&e(s)},[e]),isDragActive:t}};var p=a(35999),d=a(46039);let m=e=>{let{className:t,cropShape:a,onImageInput:n}=e,[m,x]=(0,r.useState)(),[u,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>()=>{m&&URL.revokeObjectURL(m.url)},[m]);let[g,f]=(0,r.useState)({x:0,y:0}),[v,j]=(0,r.useState)(1),b=async(e,t)=>{m&&(null==n||n(!0,m.url,t,m.file.name))},{isDragActive:y,handleDragEnter:w,handleDragOver:N,handleDragLeave:A,handleDrop:k}=c(e=>x({file:e,url:URL.createObjectURL(e)})),C=(0,r.createRef)();return(0,s.jsx)("div",{className:i()(t,"w-full px-3 py-1.5"),children:(0,s.jsx)("div",{className:i()(y&&"border-primary-600","relative aspect-square bg-gray-50 border-[1.5px] border-gray-200 border-dashed rounded-lg flex flex-col justify-center items-center text-gray-500"),onDragEnter:w,onDragOver:N,onDragLeave:A,onDrop:k,children:m?u?(0,s.jsx)("img",{src:null==m?void 0:m.url,alt:""}):(0,s.jsx)(l.Ay,{image:null==m?void 0:m.url,crop:g,zoom:v,aspect:1,cropShape:a,onCropChange:f,onCropComplete:b,onZoomChange:j}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.e,{className:"pointer-events-none mb-3 h-[30px] w-[30px]"}),(0,s.jsxs)("div",{className:"mb-[2px] text-sm font-medium",children:[(0,s.jsx)("span",{className:"pointer-events-none",children:"Drop your image here, or\xa0"}),(0,s.jsx)("button",{className:"text-components-button-primary-bg",onClick:()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.click()},children:"browse"}),(0,s.jsx)("input",{ref:C,type:"file",className:"hidden",onClick:e=>e.target.value="",accept:d.g$.map(e=>".".concat(e)).join(","),onChange:e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];a&&(x({file:a,url:URL.createObjectURL(a)}),(0,p.zC)(a).then(e=>{h(!!e),e&&(null==n||n(!1,a))}))}})]}),(0,s.jsx)("div",{className:"pointer-events-none text-xs",children:"Supports PNG, JPG, JPEG, WEBP and GIF"})]})})})}},17351:(e,t,a)=>{"use strict";a.d(t,{A:()=>v});var s=a(58501),r=a(33505),l=a(93703),n=a(21267),i=a(61487),o=a(90985),c=a(24219),p=a(22134),d=a(42615),m=a(5865),x=a(85911),u=a.n(x),h=a(35999),g=a(79776),f=a(29839);let v=e=>{let{onSelect:t,onClose:a,className:x}=e,{t:v}=(0,l.Bd)(),j=[{key:"emoji",label:v("app.iconPicker.emoji"),icon:(0,s.jsx)("span",{className:"text-lg",children:"\uD83E\uDD16"})},{key:"image",label:v("app.iconPicker.image"),icon:(0,s.jsx)(c.e,{})}],[b,y]=(0,r.useState)("emoji"),[w,N]=(0,r.useState)(),A=(0,r.useCallback)((e,t)=>{N({emoji:e,background:t})},[N]),[k,C]=(0,r.useState)(),{handleLocalFileUpload:S}=(0,p.LC)({limit:3,disabled:!1,onUpload:e=>{e.fileId&&(C(!1),null==t||t({type:"image",fileId:e.fileId,url:e.url}))}}),[E,D]=(0,r.useState)(),_=async(e,t,a,s)=>{D(e?{tempUrl:t,croppedAreaPixels:a,fileName:s}:{file:t})},L=async()=>{if("emoji"===b)w&&(null==t||t({type:"emoji",icon:w.emoji,background:w.background}));else{if(!E)return;if(C(!0),"file"in E){S(E.file);return}let e=await (0,h.Ay)(E.tempUrl,E.croppedAreaPixels,E.fileName);S(new File([e],E.fileName,{type:e.type}))}};return(0,s.jsxs)(n.A,{onClose:()=>{},isShow:!0,closable:!1,wrapperClassName:x,className:(0,g.A)(u().container,"!w-[362px] !p-0"),children:[!f.w9&&(0,s.jsx)("div",{className:"w-full p-2 pb-0",children:(0,s.jsx)("div",{className:"flex items-center justify-center gap-2 rounded-xl bg-background-body p-1",children:j.map(e=>(0,s.jsxs)("button",{className:"\n                        flex h-8 flex-1 shrink-0 items-center justify-center rounded-xl p-2 text-sm font-medium\n                        ".concat(b===e.key&&"bg-components-main-nav-nav-button-bg-active shadow-md","\n                      "),onClick:()=>y(e.key),children:[e.icon," \xa0 ",e.label]},e.key))})}),(0,s.jsx)(d.A,{className:(0,g.A)("emoji"===b?"block":"hidden","pt-2"),onSelect:A}),(0,s.jsx)(m.A,{className:"image"===b?"block":"hidden",onImageInput:_}),(0,s.jsx)(i.A,{className:"m-0"}),(0,s.jsxs)("div",{className:"flex w-full items-center justify-center gap-2 p-3",children:[(0,s.jsx)(o.Ay,{className:"w-full",onClick:()=>null==a?void 0:a(),children:v("app.iconPicker.cancel")}),(0,s.jsx)(o.Ay,{variant:"primary",className:"w-full",disabled:k,loading:k,onClick:L,children:v("app.iconPicker.ok")})]})]})}},18590:e=>{e.exports={textGradient:"style_textGradient__Kahei"}},19102:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>m,Ov:()=>g,R2:()=>h});var s=a(58501),r=a(93703),l=a(33505),n=a(14624),i=a(30765),o=a(79776),c=a(70658),p=a(30607);let d=["chat","agent-chat","completion","advanced-chat","workflow"],m=e=>{let{value:t,onChange:a}=e,[r,i]=(0,l.useState)(!1);return(0,s.jsx)(c.a,{open:r,onOpenChange:i,placement:"bottom-start",offset:4,children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(c.Q$,{onClick:()=>i(e=>!e),className:"block",children:(0,s.jsxs)("div",{className:(0,o.A)("flex cursor-pointer items-center justify-between space-x-1 rounded-md px-2 hover:bg-state-base-hover"),children:[(0,s.jsx)(x,{values:t}),t&&t.length>0&&(0,s.jsx)("div",{className:"h-4 w-4",onClick:e=>{e.stopPropagation(),a([])},children:(0,s.jsx)(n.z5f,{className:"h-3.5 w-3.5 cursor-pointer text-text-quaternary hover:text-text-tertiary"})})]})}),(0,s.jsx)(c.vV,{className:"z-[1002]",children:(0,s.jsx)("ul",{className:"relative w-[240px] rounded-xl border border-components-panel-border bg-components-panel-bg-blur p-1 shadow-lg backdrop-blur-[5px]",children:d.map(e=>(0,s.jsx)(u,{type:e,checked:!!(t.length>0&&(null==t?void 0:t.indexOf(e))!==-1),onClick:()=>{var s;(null==t?void 0:t.indexOf(e))!==-1?a(null!==(s=null==t?void 0:t.filter(t=>t!==e))&&void 0!==s?s:[]):a([...t||[],e])}},e))})})]})})};function x(e){let{values:t}=e,{t:a}=(0,r.Bd)();return t&&0!==t.length?1===t.length?(0,s.jsxs)("div",{className:(0,o.A)("flex h-8 flex-nowrap items-center justify-between gap-1"),children:[(0,s.jsx)(h,{type:t[0]}),(0,s.jsx)("div",{className:"line-clamp-1 flex flex-1 items-center text-center",children:(0,s.jsx)(g,{type:t[0],className:"system-sm-medium text-components-menu-item-text"})})]}):(0,s.jsx)("div",{className:(0,o.A)("relative flex h-8 items-center justify-between -space-x-2"),children:t.map((e,t)=>(0,s.jsx)(h,{type:e,wrapperClassName:"border border-components-panel-on-panel-item-bg",style:{zIndex:5-t}},e))}):(0,s.jsxs)("div",{className:(0,o.A)("flex h-8 items-center justify-between gap-1"),children:[(0,s.jsx)(n.znc,{className:"h-4 w-4 text-text-tertiary"}),(0,s.jsx)("div",{className:"system-sm-medium min-w-[65px] grow text-center text-text-tertiary",children:a("app.typeSelector.all")}),(0,s.jsx)(n.eQr,{className:"h-4 w-4 text-text-tertiary"})]})}function u(e){let{checked:t,type:a,onClick:r}=e;return(0,s.jsxs)("li",{className:"flex cursor-pointer items-center space-x-2 rounded-lg py-1 pl-2 pr-1 hover:bg-state-base-hover",onClick:r,children:[(0,s.jsx)(i.A,{checked:t}),(0,s.jsx)(h,{type:a}),(0,s.jsx)("div",{className:"grow p-1 pl-0",children:(0,s.jsx)(g,{type:a,className:"system-sm-medium text-components-menu-item-text"})})]})}function h(e){let{type:t,className:a,wrapperClassName:r,style:l}=e,i=(0,o.A)("inline-flex h-5 w-5 items-center justify-center rounded-md border border-divider-regular",r),c=(0,o.A)("h-3.5 w-3.5 text-components-avatar-shape-fill-stop-100",a);return"chat"===t?(0,s.jsx)("div",{style:l,className:(0,o.A)(i,"bg-components-icon-bg-blue-solid"),children:(0,s.jsx)(p.sH,{className:c})}):"agent-chat"===t?(0,s.jsx)("div",{style:l,className:(0,o.A)(i,"bg-components-icon-bg-violet-solid"),children:(0,s.jsx)(p.V2,{className:c})}):"advanced-chat"===t?(0,s.jsx)("div",{style:l,className:(0,o.A)(i,"bg-components-icon-bg-blue-light-solid"),children:(0,s.jsx)(p.yQ,{className:c})}):"workflow"===t?(0,s.jsx)("div",{style:l,className:(0,o.A)(i,"bg-components-icon-bg-indigo-solid"),children:(0,s.jsx)(n.EfJ,{className:c})}):"completion"===t?(0,s.jsx)("div",{style:l,className:(0,o.A)(i,"bg-components-icon-bg-teal-solid"),children:(0,s.jsx)(p.Dn,{className:c})}):null}function g(e){let{type:t,className:a}=e,{t:l}=(0,r.Bd)(),n="";return"chat"===t&&(n=l("app.typeSelector.chatbot")),"agent-chat"===t&&(n=l("app.typeSelector.agent")),"completion"===t&&(n=l("app.typeSelector.completion")),"advanced-chat"===t&&(n=l("app.typeSelector.advanced")),"workflow"===t&&(n=l("app.typeSelector.workflow")),(0,s.jsx)("span",{className:a,children:n})}},19599:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>w,WI:()=>b});var s=a(33505),r=a(30910),l=a(10303),n=a(30694),i=a(6317),o=a(53175);let c=()=>{},p=c(),d=Object,m=e=>e===p,x=e=>"function"==typeof e,u=new WeakMap,h=(e,t)=>d.prototype.toString.call(e)===`[object ${t}]`,g=0,f=e=>{let t,a;let s=typeof e,r=h(e,"Date"),l=h(e,"RegExp"),n=h(e,"Object");
1if(d(e)!==e||r||l)t=r?e.toJSON():"symbol"==s?e.toString():"string"==s?JSON.stringify(e):""+e;else{if(t=u.get(e))return t;if(t=++g+"~",u.set(e,t),Array.isArray(e)){for(a=0,t="@";a<e.length;a++)t+=f(e[a])+",";u.set(e,t)}if(n){t="#";let s=d.keys(e).sort();for(;!m(a=s.pop());)m(e[a])||(t+=a+":"+f(e[a])+",");u.set(e,t)}}return t},v=e=>{if(x(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?f(e):"",t]},j=e=>v(e?e(0,null):null)[0],b=e=>n.q+j(e),y=Promise.resolve(),w=(0,i.Ht)(r.Ay,e=>(t,a,r)=>{let i;let c=(0,s.useRef)(!1),{cache:p,initialSize:d=1,revalidateAll:m=!1,persistSize:x=!1,revalidateFirstPage:u=!0,revalidateOnMount:h=!1,parallel:g=!1}=r,[,,,f]=l.b.get(l.c);try{(i=j(t))&&(i=n.q+i)}catch(e){}let[v,b,w]=(0,l.z)(p,i),N=(0,s.useCallback)(()=>(0,l.e)(v()._l)?d:v()._l,[p,i,d]);(0,o.useSyncExternalStore)((0,s.useCallback)(e=>i?w(i,()=>{e()}):()=>{},[p,i]),N,N);let A=(0,s.useCallback)(()=>{let e=v()._l;return(0,l.e)(e)?d:e},[i,d]),k=(0,s.useRef)(A());(0,l.u)(()=>{if(!c.current){c.current=!0;return}i&&b({_l:x?k.current:A()})},[i,p]);let C=h&&!c.current,S=e(i,async e=>{let s=v()._i,n=v()._r;b({_r:l.U});let i=[],o=A(),[c]=(0,l.z)(p,e),d=c().data,x=[],h=null;for(let e=0;e<o;++e){let[o,c]=(0,l.s)(t(e,g?null:h));if(!o)break;let[v,j]=(0,l.z)(p,o),b=v().data,y=m||s||(0,l.e)(b)||u&&!e&&!(0,l.e)(d)||C||d&&!(0,l.e)(d[e])&&!r.compare(d[e],b);if(a&&("function"==typeof n?n(b,c):y)){let t=async()=>{if(o in f){let e=f[o];delete f[o],b=await e}else b=await a(c);j({data:b,_k:c}),i[e]=b};g?x.push(t):await t()}else i[e]=b;g||(h=b)}return g&&await Promise.all(x.map(e=>e())),b({_i:l.U}),i},r),E=(0,s.useCallback)(function(e,t){let a="boolean"==typeof t?{revalidate:t}:t||{},s=!1!==a.revalidate;return i?(s&&((0,l.e)(e)?b({_i:!0,_r:a.revalidate}):b({_i:!1,_r:a.revalidate})),arguments.length?S.mutate(e,{...a,revalidate:s}):S.mutate()):y},[i,p]),D=(0,s.useCallback)(e=>{let a;if(!i)return y;let[,s]=(0,l.z)(p,i);if((0,l.a)(e)?a=e(A()):"number"==typeof e&&(a=e),"number"!=typeof a)return y;s({_l:a}),k.current=a;let r=[],[n]=(0,l.z)(p,i),o=null;for(let e=0;e<a;++e){let[a]=(0,l.s)(t(e,o)),[s]=(0,l.z)(p,a),i=a?s().data:l.U;if((0,l.e)(i))return E(n().data);r.push(i),o=i}return E(r)},[i,p,E,A]);return{size:A(),setSize:D,mutate:E,get data(){return S.data},get error(){return S.error},get isValidating(){return S.isValidating},get isLoading(){return S.isLoading}}})},35999:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>l,zC:()=>n});let s=e=>new Promise((t,a)=>{let s=new Image;s.addEventListener("load",()=>t(s)),s.addEventListener("error",e=>a(e)),s.setAttribute("crossOrigin","anonymous"),s.src=e});function r(e){return e*Math.PI/180}async function l(e,t,a){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{horizontal:!1,vertical:!1},i=await s(e),o=document.createElement("canvas"),c=o.getContext("2d"),p=function(e){var t;switch(null===(t=e.split(".").pop())||void 0===t?void 0:t.toLowerCase()){case"png":return"image/png";case"jpg":case"jpeg":default:return"image/jpeg";case"gif":return"image/gif";case"webp":return"image/webp"}}(a);if(!c)throw Error("Could not create a canvas context");let d=r(l),{width:m,height:x}=function(e,t,a){let s=r(a);return{width:Math.abs(Math.cos(s)*e)+Math.abs(Math.sin(s)*t),height:Math.abs(Math.sin(s)*e)+Math.abs(Math.cos(s)*t)}}(i.width,i.height,l);o.width=m,o.height=x,c.translate(m/2,x/2),c.rotate(d),c.scale(n.horizontal?-1:1,n.vertical?-1:1),c.translate(-i.width/2,-i.height/2),c.drawImage(i,0,0);let u=document.createElement("canvas"),h=u.getContext("2d");if(!h)throw Error("Could not create a canvas context");return u.width=t.width,u.height=t.height,h.drawImage(o,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((e,t)=>{u.toBlob(a=>{a?e(a):t(Error("Could not create a blob"))},p)})}function n(e){return new Promise((t,a)=>{let s=new FileReader;s.onload=function(a){var s,r;let l=new Uint8Array(null===(s=a.target)||void 0===s?void 0:s.result);e.name.toLowerCase().endsWith(".gif")?t(!0):82===(r=l)[0]&&73===r[1]&&70===r[2]&&70===r[3]&&87===r[8]&&69===r[9]&&66===r[10]&&80===r[11]?t(function(e){for(let t=12;t<e.length-4;t++)if(65===e[t]&&78===e[t+1]&&73===e[t+2]&&77===e[t+3])return!0;return!1}(l)):t(!1)},s.onerror=function(e){a(e)},s.readAsArrayBuffer(e)})}},39993:(e,t,a)=>{"use strict";a.d(t,{A:()=>
1o});var s=a(58501),r=a(22601),l=a(58140),n=a(14624),i=a(79776);function o(e){let{className:t,wrapperClassName:a,open:o,onClose:c=()=>{},children:p,closable:d=!1,overflowVisible:m=!1}=e;return(0,s.jsx)(r.e,{show:o,appear:!0,children:(0,s.jsxs)(l.lG,{as:"div",className:(0,i.A)("modal-dialog",a),onClose:c,children:[(0,s.jsx)(r._,{children:(0,s.jsx)("div",{className:(0,i.A)("fixed inset-0 bg-background-overlay-backdrop backdrop-blur-[6px]","duration-300 ease-in data-[closed]:opacity-0","data-[enter]:opacity-100","data-[leave]:opacity-0")})}),(0,s.jsx)("div",{className:"fixed inset-0 h-screen w-screen p-4",onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,s.jsx)("div",{className:"relative h-full w-full rounded-2xl border border-effects-highlight bg-background-default-subtle",children:(0,s.jsx)(r._,{children:(0,s.jsxs)(l.Lj,{className:(0,i.A)("h-full",m?"overflow-visible":"overflow-hidden","duration-100 ease-in data-[closed]:opacity-0 data-[closed]:scale-95","data-[enter]:opacity-100 data-[enter]:scale-100","data-[leave]:opacity-0 data-[enter]:scale-95",t),children:[d&&(0,s.jsx)("div",{className:"absolute right-3 top-3 z-50 flex h-9 w-9 cursor-pointer items-center justify-center rounded-[10px] bg-components-button-tertiary-bg hover:bg-components-button-tertiary-bg-hover",onClick:e=>{e.stopPropagation(),c()},children:(0,s.jsx)(n.Z6D,{className:"h-3.5 w-3.5 text-components-button-tertiary-text"})}),p]})})})})]})})}},46720:(e,t,a)=>{"use strict";a.d(t,{A:()=>f});var s=a(58501),r=a(33505),l=a(93703),n=a(14624),i=a(17351),o=a(21267),c=a(90985),p=a(43988),d=a(49968),m=a(23010),x=a(69),u=a(95739),h=a(12920),g=a(60863);let f=e=>{let{show:t=!1,isEditModal:a=!1,appIconType:f,appIcon:v,appIconBackground:j,appIconUrl:b,appName:y,appDescription:w,appMode:N,appUseIconAsAnswerIcon:A,onConfirm:k,onHide:C}=e,{t:S}=(0,l.Bd)(),[E,D]=r.useState(y),[_,L]=(0,r.useState)(()=>
1"image"===f?{type:"image",fileId:v,url:b}:{type:"emoji",icon:v,background:j}),[P,I]=(0,r.useState)(!1),[F,T]=(0,r.useState)(w||""),[R,M]=(0,r.useState)(A||!1),{plan:O,enableBilling:U}=(0,h.oh)(),z=U&&O.usage.buildApps>=O.total.buildApps;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.A,{isShow:t,onClose:()=>{},className:"relative !max-w-[480px] px-8",children:[(0,s.jsx)("div",{className:"absolute right-4 top-4 cursor-pointer p-2",onClick:C,children:(0,s.jsx)(n.Qks,{className:"h-4 w-4 text-text-tertiary"})}),a&&(0,s.jsx)("div",{className:"mb-9 text-xl font-semibold leading-[30px] text-text-primary",children:S("app.editAppTitle")}),!a&&(0,s.jsx)("div",{className:"mb-9 text-xl font-semibold leading-[30px] text-text-primary",children:S("explore.appCustomize.title",{name:y})}),(0,s.jsxs)("div",{className:"mb-9",children:[(0,s.jsxs)("div",{className:"pt-2",children:[(0,s.jsx)("div",{className:"py-2 text-sm font-medium leading-[20px] text-text-primary",children:S("app.newApp.captionName")}),(0,s.jsxs)("div",{className:"flex items-center justify-between space-x-2",children:[(0,s.jsx)(u.A,{size:"large",onClick:()=>{I(!0)},className:"cursor-pointer",iconType:_.type,icon:"image"===_.type?_.fileId:_.icon,background:"image"===_.type?void 0:_.background,imageUrl:"image"===_.type?_.url:void 0}),(0,s.jsx)(p.A,{value:E,onChange:e=>D(e.target.value),placeholder:S("app.newApp.appNamePlaceholder")||"",className:"h-10 grow"})]})]}),(0,s.jsxs)("div",{className:"pt-2",children:[(0,s.jsx)("div",{className:"py-2 text-sm font-medium leading-[20px] text-text-primary",children:S("app.newApp.captionDescription")}),(0,s.jsx)(d.Ay,{className:"resize-none",placeholder:S("app.newApp.appDescriptionPlaceholder")||"",value:F,onChange:e=>T(e.target.value)})]}),a&&("chat"===N||"advanced-chat"===N||"agent-chat"===N)&&(0,s.jsxs)("div",{className:"pt-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"py-2 text-sm font-medium leading-[20px] text-text-primary",children:S("app.answerIcon.title")}),(0,s.jsx)(m.A,{defaultValue:R,onChange:e=>M(e)})]}),(0,s.jsx)("p",{className:"body-xs-regular text-text-tertiary",children:S("app.answerIcon.descriptionInExplore")})]}),!a&&z&&(0,s.jsx)(g.A,{loc:"app-explore-create"})]}),(0,s.jsxs)("div",{className:"flex flex-row-reverse",children:[(0,s.jsx)(c.Ay,{disabled:!a&&z,className:"ml-2 w-24",variant:"primary",onClick:()=>{if(!E.trim()){x.Ay.notify({type:"error",message:S("explore.appCustomize.nameRequired")});return}k({name:E,icon_type:_.type,icon:"emoji"===_.type?_.icon:_.fileId,icon_background:"emoji"===_.type?_.background:void 0,description:F,use_icon_as_answer_icon:R}),C()},children:a?S("common.operation.save"):S("common.operation.create")}),(0,s.jsx)(c.Ay,{className:"w-24",onClick:C,children:S("common.operation.cancel")})]})]}),P&&(0,s.jsx)(i.A,{onSelect:e=>{L(e),I(!1)},onClose:()=>
1{L("image"===f?{type:"image",url:b,fileId:v}:{type:"emoji",icon:v,background:j}),I(!1)}})]})}},60718:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var s=a(33505);let r=s.forwardRef(function(e,t){let{title:a,titleId:r,...l}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},l),a?s.createElement("title",{id:r},a):null,s.createElement("path",{d:"M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z"}))})},60863:(e,t,a)=>{"use strict";a.d(t,{A:()=>m});var s=a(58501),r=a(33505),l=a(93703),n=a(16911),i=a(11217),o=a(18590),c=a.n(o),p=a(79776),d=a(90137);let m=r.memo(e=>{let{loc:t,className:a}=e,{t:r}=(0,l.Bd)();return(0,s.jsx)(d.A,{wrapperClassName:"rounded-lg",canvasClassName:"rounded-lg",gradientClassName:"rounded-lg",children:(0,s.jsxs)("div",{className:(0,p.A)("mt-6 flex cursor-pointer flex-col rounded-lg border-2 border-solid border-transparent px-3.5 py-4 shadow-md transition-all duration-200 ease-in-out",a),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:(0,p.A)(c().textGradient,"text-base font-semibold leading-[24px]"),children:[(0,s.jsx)("div",{children:r("billing.apps.fullTipLine1")}),(0,s.jsx)("div",{children:r("billing.apps.fullTipLine2")})]}),(0,s.jsx)("div",{className:"flex",children:(0,s.jsx)(n.A,{loc:t})})]}),(0,s.jsx)(i.A,{className:"mt-4"})]})})})},66448:(e,t,a)=>{"use strict";a.d(t,{n:()=>s});let s=(e,t,a)=>{a(e?"workflow"===t.mode||"advanced-chat"===t.mode?"/app/".concat(t.id,"/workflow"):"/app/".concat(t.id,"/configuration"):"/app/".concat(t.id,"/overview"))}},75064:(e,t,a)=>{"use strict";a.d(t,{A:()=>P});var s=a(58501),r=a(33505),l=a(93703),n=a(7485),i=a(76756),o=a(14624),c=a(26472),p=a.n(c),d=a(23707),m=a(22064),x=a(96544),u=a(17351),h=a(90985),g=a(61487),f=a(79776),v=a(99664),j=a(12920),b=a(69),y=a(5894),w=a(43988),N=a(49968),A=a(95739),k=a(60863),C=a(30607),S=a(29839),E=a(66448),D=a(39993),_=a(28014);function L(e){let{onClose:t,onSuccess:a,onCreateFromTemplate:c}=e,{t:p}=(0,l.Bd)(),{push:x}=(0,n.useRouter)(),{notify:f}=(0,i.NT)(b.$o),D=(0,i.i7)(v.Ay,e=>e.mutateApps),[_,L]=(0,r.useState)("chat"),[P,R]=(0,r.useState)({type:"emoji",icon:"\uD83E\uDD16",background:"#FFEAD5"}),[M,O]=(0,r.useState)(!1),[U,z]=(0,r.useState)(""),[B,W]=(0,r.useState)(""),{plan:J,enableBilling:G}=(0,j.oh)(),H=G&&J.usage.buildApps>=J.total.buildApps,{isCurrentWorkspaceEditor:V}=(0,v.Us)(),q=(0,r.useRef)(!1),Q=(0,r.useCallback)(async()=>{if(!_){f({type:"error",message:p("app.newApp.appTypeRequired")});return}if(!U.trim()){f({type:"error",message:p("app.newApp.nameNotEmpty")});return}if(!q.current){q.current=!0;try{let e=await (0,y.Ef)({name:U,description:B,icon_type:P.type,icon:"emoji"===P.type?P.icon:P.fileId,icon_background:"emoji"===P.type?P.background:void 0,mode:_});f({type:"success",message:p("app.newApp.appCreated")}),a(),t(),D(),localStorage.setItem(S.Im,"1"),(0,E.n)(V,e,x)}catch(e){f({type:"error",message:p("app.newApp.appCreateFailed")})}q.current=!1}},[U,f,p,_,P,B,a,t,D,x,V]),{run:Y}=(0,d.A)(Q,{wait:300});return(0,m.A)(["meta.enter","ctrl.enter"],()=>{H||Y()}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex h-full justify-center overflow-y-auto overflow-x-hidden",children:[(0,s.jsx)("div",{className:"flex flex-1 shrink-0 justify-end",children:(0,s.jsxs)("div",{className:"px-10",children:[(0,s.jsx)("div",{className:"h-6 w-full 2xl:h-[139px]"}),(0,s.jsx)("div",{className:"pb-6 pt-1",children:(0,s.jsx)("span",{className:"title-2xl-semi-bold text-text-primary",children:p("app.newApp.startFromBlank")})}),(0,s.jsx)("div",{className:"mb-2 leading-6",children:(0,s.jsx)("span",{className:"system-sm-semibold text-text-secondary",children:p("app.newApp.chooseAppType")})}),(0,s.jsxs)("div",{className:"flex w-[660px] flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("span",{className:"system-2xs-medium-uppercase text-text-tertiary",children:p("app.newApp.forBeginners")})}),(0,s.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,s.jsx)(I,{active:"chat"===_,title:p("app.types.chatbot"),description:p("app.newApp.chatbotShortDescription"),icon:(0,s.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-components-icon-bg-blue-solid",children:(0,s.jsx)(C.sH,{className:"h-4 w-4 text-components-avatar-shape-fill-stop-100"})}),onClick:()=>{L("chat")}}),(0,s.jsx)(I,{active:"agent-chat"===_,title:p("app.types.agent"),description:p("app.newApp.agentShortDescription"),icon:(0,s.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-components-icon-bg-violet-solid",children:(0,s.jsx)(C.V2,{className:"h-4 w-4 text-components-avatar-shape-fill-stop-100"})}),onClick:()=>{L("agent-chat")}}),(0,s.jsx)(I,{active:"completion"===_,title:p("app.newApp.completeApp"),description:p("app.newApp.completionShortDescription"),icon:(0,s.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-components-icon-bg-teal-solid",children:(0,s.jsx)(C.Dn,{className:"h-4 w-4 text-components-avatar-shape-fill-stop-100"})}),onClick:()=>{L("completion")}})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("span",{className:"system-2xs-medium-uppercase text-text-tertiary",children:p("app.newApp.forAdvanced")})}),(0,s.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,s.jsx)(I,{beta:!0,active:"advanced-chat"===_,title:p("app.types.advanced"),description:p("app.newApp.advancedShortDescription"),icon:(0,s.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-components-icon-bg-blue-light-solid",children:(0,s.jsx)(C.yQ,{className:"h-4 w-4 text-components-avatar-shape-fill-stop-100"})}),onClick:()=>{L("advanced-chat")}}),(0,s.jsx)(I,{beta:!0,active:"workflow"===_,title:p("app.types.workflow"),description:p("app.newApp.workflowShortDescription"),icon:(0,s.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-components-icon-bg-indigo-solid",children:(0,s.jsx)(o.EfJ,{className:"h-4 w-4 text-components-avatar-shape-fill-stop-100"})}),onClick:()=>{L("workflow")}})]})]}),(0,s.jsx)(g.A,{style:{margin:0}}),(0,s.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"mb-1 flex h-6 items-center",children:(0,s.jsx)("label",{className:"system-sm-semibold text-text-secondary",children:p("app.newApp.captionName")})}),(0,s.jsx)(w.A,{value:U,onChange:e=>z(e.target.value),placeholder:p("app.newApp.appNamePlaceholder")||""})]}),(0,s.jsx)(A.A,{iconType:P.type,icon:"emoji"===P.type?P.icon:P.fileId,background:"emoji"===P.type?P.background:void 0,imageUrl:"image"===P.type?P.url:void 0,size:"xxl",className:"cursor-pointer rounded-2xl",onClick:()=>{O(!0)}}),M&&(0,s.jsx)(u.A,{onSelect:e=>{R(e),O(!1)},onClose:()=>{O(!1)}})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-1 flex h-6 items-center",children:[(0,s.jsx)("label",{className:"system-sm-semibold text-text-secondary",children:p("app.newApp.captionDescription")}),(0,s.jsxs)("span",{className:"system-xs-regular ml-1 text-text-tertiary",children:["(",p("app.newApp.optional"),")"]})]}),(0,s.jsx)(N.Ay,{className:"resize-none",placeholder:p("app.newApp.appDescriptionPlaceholder")||"",value:B,onChange:e=>W(e.target.value)})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pb-10 pt-5",children:[(0,s.jsxs)("div",{className:"system-xs-regular flex cursor-pointer items-center gap-1 text-text-tertiary",onClick:c,children:[(0,s.jsx)("span",{children:p("app.newApp.noIdeaTip")}),(0,s.jsx)("div",{className:"p-[1px]",children:(0,s.jsx)(o.D8V,{className:"h-3.5 w-3.5"})})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(h.Ay,{onClick:t,children:p("app.newApp.Cancel")}),(0,s.jsxs)(h.Ay,{disabled:H||!U,className:"gap-1",variant:"primary",onClick:Y,children:[(0,s.jsx)("span",{children:p("app.newApp.Create")}),(0,s.jsxs)("div",{className:"flex gap-0.5",children:[(0,s.jsx)(o.xbe,{size:14,className:"system-kbd rounded-sm bg-components-kbd-bg-white p-0.5"}),(0,s.jsx)(o.SzL,{size:14,className:"system-kbd rounded-sm bg-components-kbd-bg-white p-0.5"})]})]})]})]})]})}),(0,s.jsxs)("div",{className:"relative flex h-full flex-1 shrink justify-start overflow-hidden",children:[(0,s.jsx)("div",{className:"absolute left-0 right-0 top-0 h-6 border-b border-b-divider-subtle 2xl:h-[139px]"}),(0,s.jsxs)("div",{className:"max-w-[760px] border-x border-x-divider-subtle",children:[(0,s.jsx)("div",{className:"h-6 2xl:h-[139px]"}),(0,s.jsx)(F,{mode:_}),(0,s.jsx)("div",{className:"absolute left-0 right-0 border-b border-b-divider-subtle"}),(0,s.jsxs)("div",{className:"flex h-[448px] w-[664px] items-center justify-center",style:{background:"repeating-linear-gradient(135deg, transparent, transparent 2px, rgba(16,24,40,0.04) 4px,transparent 3px, transparent 6px)"},children:[(0,s.jsx)(T,{show:"chat"===_,mode:"chat"}),(0,s.jsx)(T,{show:"advanced-chat"===_,mode:"advanced-chat"}),(0,s.jsx)(T,{show:"agent-chat"===_,mode:"agent-chat"}),(0,s.jsx)(T,{show:"completion"===_,mode:"completion"}),(0,s.jsx)(T,{show:"workflow"===_,mode:"workflow"})]}),(0,s.jsx)("div",{className:"absolute left-0 right-0 border-b border-b-divider-subtle"})]})]})]}),H&&(0,s.jsx)("div",{className:"px-8 py-2",children:(0,s.jsx)(k.A,{loc:"app-create"})})]})}let P=e=>{let{show:t,onClose:a,onSuccess:r,onCreateFromTemplate:l}=e;return(0,s.jsx)(D.A,{overflowVisible:!0,closable:!0,open:t,onClose:a,children:(0,s.jsx)(L,{onClose:a,onSuccess:r,onCreateFromTemplate:l})})};function I(e){let{icon:t,title:a,beta:r=!1,description:n,active:i,onClick:o}=e,{t:c}=(0,l.Bd)();return(0,s.jsxs)("div",{className:(0,f.A)("relative box-content h-[84px] w-[191px] cursor-pointer rounded-xl\n      border-[0.5px] border-components-option-card-option-border\n      bg-components-panel-on-panel-item-bg p-3 shadow-xs hover:shadow-md",i?"shadow-md outline outline-[1.5px] outline-components-option-card-option-selected-border":""),onClick:o,children:[r&&(0,s.jsx)("div",{className:"system-2xs-medium-uppercase absolute right-3 top-3 min-w-[18px] rounded-[5px] border border-divider-deep px-[5px] py-[3px] text-text-tertiary",children:c("common.menus.status")}),t,(0,s.jsx)("div",{className:"system-sm-semibold mb-0.5 mt-2 text-text-secondary",children:a}),(0,s.jsx)("div",{className:"system-xs-regular text-text-tertiary",children:n})]})}function F(e){let{mode:t}=e,{t:a}=(0,l.Bd)(),r={chat:{title:a("app.types.chatbot"),description:a("app.newApp.chatbotUserDescription"),link:"https://docs.dify.ai/guides/application-orchestrate#application_type"},"advanced-chat":{title:a("app.types.advanced"),description:a("app.newApp.advancedUserDescription"),link:"https://docs.dify.ai/guides/workflow"},"agent-chat":{title:a("app.types.agent"),description:a("app.newApp.agentUserDescription"),link:"https://docs.dify.ai/guides/application-orchestrate/agent"},completion:{title:a("app.newApp.completeApp"),description:a("app.newApp.completionUserDescription"),link:null},workflow:{title:a("app.types.workflow"),description:a("app.newApp.workflowUserDescription"),link:"https://docs.dify.ai/guides/workflow"}}[t];return(0,s.jsxs)("div",{className:"px-8 py-4",children:[(0,s.jsx)("h4",{className:"system-sm-semibold-uppercase text-text-secondary",children:r.title}),(0,s.jsxs)("div",{className:"system-xs-regular mt-1 min-h-8 max-w-96 text-text-tertiary",children:[(0,s.jsx)("span",{children:r.description}),r.link&&(0,s.jsx)(p(),{target:"_blank",href:r.link,className:"ml-1 text-text-accent",children:a("app.newApp.learnMore")})]})]})}function T(e){let{mode:t,show:a}=e,{theme:r}=(0,_.A)(),l={chat:"Chatbot","advanced-chat":"Chatflow","agent-chat":"Agent",completion:"TextGenerator",workflow:"Workflow"};return(0,s.jsxs)("picture",{children:[(0,s.jsx)("source",{media:"(resolution: 1x)",srcSet:"/screenshots/".concat(r,"/").concat(l[t],".png")}),(0,s.jsx)("source",{media:"(resolution: 2x)",srcSet:"/screenshots/".concat(r,"/").concat(l[t],"@2x.png")}),(0,s.jsx)("source",{media:"(resolution: 3x)",srcSet:"/screenshots/".concat(r,"/").concat(l[t],"@3x.png")}),(0,s.jsx)(x.default,{className:a?"":"hidden",src:"/screenshots/".concat(r,"/").concat(l[t],".png"),alt:"App Screen Shot",width:664,height:448})]})}},75612:(e,t,a)=>{"use strict";a.d(t,{A:()=>U});var s=a(58501),r=a(33505),l=a(7485),n=a(93703),i=a(76756),o=a(30910),c=a(23707),p=a(14624),d=a(60718),m=a(19102),x=a(90985),u=a(79776),h=a(95739);let g=e=>{let{app:t,onCreate:a}=e,{t:r}=(0,n.Bd)(),{app:l}=t;return(0,s.jsxs)("div",{className:(0,u.A)("group relative flex h-[132px] curs
1or-pointer flex-col overflow-hidden rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-on-panel-item-bg p-4  shadow-xs hover:shadow-lg"),children:[(0,s.jsxs)("div",{className:"flex shrink-0 grow-0 items-center gap-3 pb-2",children:[(0,s.jsxs)("div",{className:"relative shrink-0",children:[(0,s.jsx)(h.A,{size:"large",iconType:l.icon_type,icon:l.icon,background:l.icon_background,imageUrl:l.icon_url}),(0,s.jsx)(m.R2,{wrapperClassName:"absolute -bottom-0.5 -right-0.5 w-4 h-4 rounded-[4px] border border-divider-regular outline outline-components-panel-on-panel-item-bg",className:"h-3 w-3",type:l.mode})]}),(0,s.jsxs)("div",{className:"flex grow flex-col gap-1",children:[(0,s.jsx)("div",{className:"line-clamp-1",children:(0,s.jsx)("span",{className:"system-md-semibold text-text-secondary",title:l.name,children:l.name})}),(0,s.jsx)(m.Ov,{className:"system-2xs-medium-uppercase text-text-tertiary",type:t.app.mode})]})]}),(0,s.jsx)("div",{className:"system-xs-regular py-1 text-text-tertiary",children:(0,s.jsx)("div",{className:"line-clamp-3",children:t.description})}),(0,s.jsx)("div",{className:(0,u.A)("absolute bottom-0 left-0 right-0 hidden bg-gradient-to-t from-components-panel-gradient-2 from-[60.27%] to-transparent p-4 pt-8 group-hover:flex"),children:(0,s.jsx)("div",{className:(0,u.A)("flex h-8 w-full items-center space-x-2"),children:(0,s.jsxs)(x.Ay,{variant:"primary",className:"grow",onClick:()=>a(),children:[(0,s.jsx)(d.A,{className:"mr-1 h-4 w-4"}),(0,s.jsx)("span",{className:"text-xs",children:r("app.newApp.useTemplate")})]})})})]})};var f=a(61487),v=function(e){return e.RECOMMENDED="Recommended",e.ASSISTANT="Assistant",e.AGENT="Agent",e.HR="HR",e.PROGRAMMING="Programming",e.WORKFLOW="Workflow",e.WRITING="Writing",e}({});function j(e){let{current:t,onClick:a,onCreateFromBlank:r}=e,{t:l}=(0,n.Bd)();return(0,s.jsxs)("div",{className:"flex h-full w-full flex-col",children:[(0,s.jsx)("ul",{children:(0,s.jsx)(b,{category:"Recommended",active:"Recommended"===t,onClick:a})}),(0,s.jsx)("div",{className:"system-xs-medium-uppercase px-3 pb-1 pt-2 text-text-tertiary",children:l("app.newAppFromTemplate.byCategories")}),(0,s.jsxs)("ul",{className:"flex grow flex-col gap-0.5",children:[(0,s.jsx)(b,{category:"Assistant",active:"Assistant"===t,onClick:a}),(0,s.jsx)(b,{category:"Agent",active:"Agent"===t,onClick:a}),(0,s.jsx)(b,{category:"HR",active:"HR"===t,onClick:a}),(0,s.jsx)(b,{category:"Programming",active:"Programming"===t,onClick:a}),(0,s.jsx)(b,{category:"Workflow",active:"Workflow"===t,onClick:a}),(0,s.jsx)(b,{category:"Writing",active:"Writing"===t,onClick:a})]}),(0,s.jsx)(f.A,{bgStyle:"gradient"}),(0,s.jsxs)("div",{className:"flex cursor-pointer items-center gap-1 px-3 py-1 text-text-tertiary",onClick:r,children:[(0,s.jsx)(p.URK,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"system-xs-regular",children:l("app.newApp.startFromBlank")})]})]})}function b(e){let{category:t,active:a,onClick:r}=e;return(0,s.jsxs)("li",{className:(0,u.A)("p-1 pl-3 rounded-lg flex items-center gap-2 group cursor-pointer hover:bg-state-base-hover [&.active]:bg-state-base-active",a&&"active"),onClick:()=>{null==r||r(t)},children:[(0,s.jsx)("div",{className:"inline-flex h-5 w-5 items-center justify-center rounded-md border border-divider-regular bg-components-icon-bg-midnight-solid group-[.active]:bg-components-icon-bg-blue-solid",children:(0,s.jsx)(w,{category:t})}),(0,s.jsx)(y,{category:t,className:(0,u.A)("system-sm-medium text-components-menu-item-text group-[.active]:text-components-menu-item-text-active group-hover:text-components-menu-item-text-hover",a&&"system-sm-semibold")})]})}function y(e){let{category:t,className:a}=e,{t:r}=(0,n.Bd)();return(0,s.jsx)("span",{className:a,children:r("app.newAppFromTemplate.sidebar.".concat(t))})}function w(e){let{category:t}=e;return"Agent"===t?(0,s.jsx)(p.TXv,{className:"h-3.5 w-3.5 text-components-avatar-shape-fill-stop-100"}):"Assistant"===t?(0,s.jsx)(p.Zks,{className:"h-3.5 w-3.5 text-components-avatar-shape-fill-stop-100"}):"HR"===t?(0,s.jsx)(p.pCt,{className:"h-3.5 w-3.5 text-components-avatar-shape-fill-stop-100"}):"Programming"===t?(0,s.jsx)(p.wpg,{className:"h-3.5 w-3.5 text-components-avatar-shape-fill-stop-100"}):"Recommended"===t?(0,s.jsx)(p.mq5,{className:"h-3.5 w-3.5 text-components-avatar-shape-fill-stop-100"}):"Writing"===t?(0,s.jsx)(p.Jzj,{className:"h-3.5 w-3.5 text-components-avatar-shape-fill-stop-100"}):"Workflow"===t?(0,s.jsx)(p.EfJ,{className:"h-3.5 w-3.5 text-components-avatar-shape-fill-stop-100"}):(0,s.jsx)(p.NS$,{className:"h-3.5 w-3.5 text-components-avatar-shape-fill-stop-100"})}var N=a(69),A=a(94327),k=a(83285),C=a(5894),S=a(83677),E=a(46720),D=a(54832),_=a(29839),L=a(99664),P=a(66448),I=a(43988),F=a(1400),T=a(86413);let R=r.memo(e=>{let{onSuccess:t,onCreateFromBlank:a}=e,{t:p}=(0,n.Bd)(),{isCurrentWorkspaceEditor:d}=(0,L.Us)(),{push:x}=(0,l.useRouter)(),{hasEditPermission:h}=(0,i.NT)(A.A),b=v.RECOMMENDED,[w,R]=(0,r.useState)(""),[O,U]=(0,r.useState)(""),{run:z}=(0,c.A)(()=>{U(w)},{wait:500}),B=e=>{R(e),z()},[W,J]=(0,r.useState)([]),[G,H]=(0,S.Z)({defaultTab:b,disableSearchParams:!0}),{data:{categories:V,allList:q}}=(0,o.Ay)(["/explore/apps"],()=>(0,k.QI)().then(e=>
1{let{categories:t,recommended_apps:a}=e;return{categories:t,allList:a.sort((e,t)=>e.position-t.position)}}),{fallbackData:{categories:[],allList:[]}}),Q=(0,r.useMemo)(()=>{let e=q.filter(e=>G===b||e.category===G);return 0===W.length?e:e.filter(e=>!!(W.includes("chat")&&"chat"===e.app.mode||W.includes("advanced-chat")&&"advanced-chat"===e.app.mode||W.includes("agent-chat")&&"agent-chat"===e.app.mode||W.includes("completion")&&"completion"===e.app.mode||W.includes("workflow")&&"workflow"===e.app.mode))},[W,G,b,q]),Y=(0,r.useMemo)(()=>{if(!O||!Q||0===Q.length)return Q;let e=O.toLowerCase();return Q.filter(t=>t.app&&t.app.name&&t.app.name.toLowerCase().includes(e))},[O,Q]),[$,Z]=r.useState(null),[K,X]=r.useState(!1),{handleCheckPluginDependencies:ee}=(0,T.o)(),et=async e=>{let{name:a,icon_type:s,icon:r,icon_background:l,description:n}=e,{export_data:i,mode:o}=await (0,k.L)(null==$?void 0:$.app.id);try{let e=await (0,C.nW)({mode:F.u.YAML_CONTENT,yaml_content:i,name:a,icon_type:s,icon:r,icon_background:l,description:n});X(!1),N.Ay.notify({type:"success",message:p("app.newApp.appCreated")}),t&&t(),e.app_id&&await ee(e.app_id),localStorage.setItem(_.Im,"1"),(0,P.n)(d,{id:e.app_id,mode:o},x)}catch(e){N.Ay.notify({type:"error",message:p("app.newApp.appCreateFailed")})}};return V&&0!==V.length?(0,s.jsxs)("div",{className:"flex h-full flex-col",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-divider-burn py-3",children:[(0,s.jsx)("div",{className:"min-w-[180px] pl-5",children:(0,s.jsx)("span",{className:"title-xl-semi-bold text-text-primary",children:p("app.newApp.startFromTemplate")})}),(0,s.jsxs)("div",{className:"flex max-w-[548px] flex-1 items-center rounded-xl border border-components-panel-border bg-components-panel-bg-blur p-1.5 shadow-md",children:[(0,s.jsx)(m.Ay,{value:W,onChange:J}),(0,s.jsx)("div",{className:"h-[14px]",children:(0,s.jsx)(f.A,{type:"vertical"})}),(0,s.jsx)(I.A,{showClearIcon:!0,wrapperClassName:"w-full flex-1",className:"bg-transparent hover:border-transparent hover:bg-transparent focus:border-transparent focus:bg-transparent focus:shadow-none",placeholder:p("app.newAppFromTemplate.searchAllTemplate"),value:w,onChange:e=>B(e.target.value),onClear:()=>B("")})]}),(0,s.jsx)("div",{className:"h-8 w-[180px]"})]}),(0,s.jsxs)("div",{className:"relative flex flex-1 overflow-y-auto",children:[!O&&(0,s.jsx)("div",{className:"h-full w-[200px] p-4",children:(0,s.jsx)(j,{current:G,onClick:e=>{H(e)},onCreateFromBlank:a})}),(0,s.jsxs)("div",{className:"h-full flex-1 shrink-0 grow overflow-auto border-l border-divider-burn p-6 pt-2",children:[Y&&Y.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"pb-1 pt-4",children:O?(0,s.jsx)("p",{className:"title-md-semi-bold text-text-tertiary",children:Y.length>1?p("app.newApp.foundResults",{count:Y.length}):p("app.newApp.foundResult",{count:Y.length})}):(0,s.jsx)(y,{category:G,className:"title-md-semi-bold text-text-primary"})}),(0,s.jsx)("div",{className:(0,u.A)("grid shrink-0 grid-cols-1 content-start gap-3 sm:grid-cols-1 md:grid-cols-2 xl:grid-cols-4 2xl:grid-cols-5 2k:grid-cols-6"),children:Y.map(e=>(0,s.jsx)(g,{app:e,canCreate:h,onCreate:()=>{Z(e),X(!0)}},e.app_id))})]}),(!Y||0===Y.length)&&(0,s.jsx)(M,{})]})]}),K&&(0,s.jsx)(E.A,{appIconType:(null==$?void 0:$.app.icon_type)||"emoji",appIcon:(null==$?void 0:$.app.icon)||"",appIconBackground:(null==$?void 0:$.app.icon_background)||"",appIconUrl:null==$?void 0:$.app.icon_url,appName:(null==$?void 0:$.app.name)||"",appDescription:(null==$?void 0:$.app.description)||"",show:K,onConfirm:et,onHide:()=>X(!1)})]}):(0,s.jsx)("div",{className:"flex h-full items-center",children:(0,s.jsx)(D.A,{type:"area"})})});function M(){let{t:e}=(0,n.Bd)();return(0,s.jsxs)("div",{className:"w-full rounded-lg bg-workflow-process-bg p-4",children:[(0,s.jsx)("div",{className:"mb-2 inline-flex h-8 w-8 items-center justify-center rounded-lg bg-components-card-bg shadow-lg",children:(0,s.jsx)(p.mYn,{className:"h-5 w-5 text-text-tertiary"})}),(0,s.jsx)("p",{className:"title-md-semi-bold text-text-primary",children:e("app.newApp.noTemplateFound")}),(0,s.jsx)("p",{className:"system-sm-regular text-text-tertiary",children:e("app.newApp.noTemplateFoundTip")})]})}var O=a(39993);let U=e=>{let{show:t,onSuccess:a,onClose:r,onCreateFromBlank:l}=e;return(0,s.jsx)(O.A,{open:t,closable:!0,onClose:r,children:(0,s.jsx)(R,{onCreateFromBlank:l,onSuccess:()=>{a(),r()}})})}},82903:(e,t,a)=>{"use strict";a.d(t,{A:()=>A,u:()=>N});var s=a(58501),r=a(33505),l=a(7485),n=a(76756),i=a(93703),o=a(14624),c=a(87407),p=a(90985),d=a(43988),m=a(21267),x=a(69),u=a(5894),h=a(1400),g=a(99664),f=a(12920),v=a(60863),j=a(29839),b=a(66448),y=a(79776),w=a(86413),N=function(e){return e.FROM_FILE="from-file",e.FROM_URL="from-url",e}({});let A=e=>{let{show:t,onSuccess:a,onClose:N,activeTab:A="from-file",dslUrl:k=""}=e,{push:C}=(0,l.useRouter)(),{t:S}=(0,i.Bd)(),{notify:E}=(0,n.NT)(x.$o),[D,_]=(0,r.useState)(),[L,P]=(0,r.useState)(),[I,F]=(0,r.useState)(A),[T,R]=(0,r.useState)(k),[M,O]=(0,r.useState)(!1),[U,z]=(0,r.useState)(),[B,W]=(0,r.useState)(),{handleCheckPluginDependencies:J}=(0,w.o)(),G=e=>{let t=new FileReader;t.onload=function(e){var t;P(null===(t=e.target)||void 0===t?void 0:t.result)},t.readAsText(e)},{isCurrentWorkspaceEditor:H}=(0,g.Us)(),{plan:V,enableBilling:q}=(0,f.oh)(),Q=q&&V.usage.buildApps>=V.total.buildApps,Y=(0,r.useRef)(!1),$=async()=>
1{if(("from-file"!==I||D)&&("from-url"!==I||T)&&!Y.current){Y.current=!0;try{let e;if("from-file"===I&&(e=await (0,u.nW)({mode:h.u.YAML_CONTENT,yaml_content:L||""})),"from-url"===I&&(e=await (0,u.nW)({mode:h.u.YAML_URL,yaml_url:T||""})),!e)return;let{id:t,status:s,app_id:r,app_mode:l,imported_dsl_version:n,current_dsl_version:i}=e;s===h.J.COMPLETED||s===h.J.COMPLETED_WITH_WARNINGS?(a&&a(),N&&N(),E({type:s===h.J.COMPLETED?"success":"warning",message:S(s===h.J.COMPLETED?"app.newApp.appCreated":"app.newApp.caution"),children:s===h.J.COMPLETED_WITH_WARNINGS&&S("app.newApp.appCreateDSLWarning")}),localStorage.setItem(j.Im,"1"),r&&await J(r),(0,b.n)(H,{id:r,mode:l},C)):s===h.J.PENDING?(z({importedVersion:null!=n?n:"",systemVersion:null!=i?i:""}),N&&N(),setTimeout(()=>{O(!0)},300),W(t)):E({type:"error",message:S("app.newApp.appCreateFailed")})}catch(e){E({type:"error",message:S("app.newApp.appCreateFailed")})}Y.current=!1}},Z=async()=>{try{if(!B)return;let{status:e,app_id:t,app_mode:s}=await (0,u.vX)({import_id:B});e===h.J.COMPLETED?(a&&a(),N&&N(),E({type:"success",message:S("app.newApp.appCreated")}),t&&await J(t),localStorage.setItem(j.Im,"1"),(0,b.n)(H,{id:t,mode:s},C)):e===h.J.FAILED&&E({type:"error",message:S("app.newApp.appCreateFailed")})}catch(e){E({type:"error",message:S("app.newApp.appCreateFailed")})}},K=[{key:"from-file",label:S("app.importFromDSLFile")},{key:"from-url",label:S("app.importFromDSLUrl")}],X=(0,r.useMemo)(()=>!!Q||("from-file"===I?!D:"from-url"===I&&!T),[Q,I,D,T]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(m.A,{className:"w-[520px] rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg p-0 shadow-xl",isShow:t,onClose:()=>{},children:[(0,s.jsxs)("div",{className:"title-2xl-semi-bold flex items-center justify-between pb-3 pl-6 pr-5 pt-6 text-text-primary",children:[S("app.importFromDSL"),(0,s.jsx)("div",{className:"flex h-8 w-8 cursor-pointer items-center",onClick:()=>N(),children:(0,s.jsx)(o.Qks,{className:"h-5 w-5 text-text-tertiary"})})]}),(0,s.jsx)("div",{className:"system-md-semibold flex h-9 items-center space-x-6 border-b border-divider-subtle px-6 text-text-tertiary",children:K.map(e=>(0,s.jsxs)("div",{className:(0,y.A)("relative flex h-full cursor-pointer items-center",I===e.key&&"text-text-primary"),onClick:()=>F(e.key),children:[e.label,I===e.key&&(0,s.jsx)("div",{className:"absolute bottom-0 h-[2px] w-full bg-util-colors-blue-brand-blue-brand-600"})]},e.key))}),(0,s.jsxs)("div",{className:"px-6 py-4",children:["from-file"===I&&(0,s.jsx)(c.A,{className:"mt-0",file:D,updateFile:e=>{_(e),e&&G(e),e||P("")}}),"from-url"===I&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"system-md-semibold leading6 mb-1",children:"DSL URL"}),(0,s.jsx)(d.A,{placeholder:S("app.importFromDSLUrlPlaceholder")||"",value:T,onChange:e=>R(e.target.value)})]})]}),Q&&(0,s.jsx)("div",{className:"px-6",children:(0,s.jsx)(v.A,{className:"mt-0",loc:"app-create-dsl"})}),(0,s.jsxs)("div",{className:"flex justify-end px-6 py-5",children:[(0,s.jsx)(p.Ay,{className:"mr-2",onClick:N,children:S("app.newApp.Cancel")}),(0,s.jsx)(p.Ay,{disabled:X,variant:"primary",onClick:$,children:S("app.newApp.Create")})]})]}),(0,s.jsxs)(m.A,{isShow:M,onClose:()=>O(!1),className:"w-[480px]",children:[(0,s.jsxs)("div",{className:"flex flex-col items-start gap-2 self-stretch pb-4",children:[(0,s.jsx)("div",{className:"title-2xl-semi-bold text-text-primary",children:S("app.newApp.appCreateDSLErrorTitle")}),(0,s.jsxs)("div",{className:"system-md-regular flex grow flex-col text-text-secondary",children:[(0,s.jsx)("div",{children:S("app.newApp.appCreateDSLErrorPart1")}),(0,s.jsx)("div",{children:S("app.newApp.appCreateDSLErrorPart2")}),(0,s.jsx)("br",{}),(0,s.jsxs)("div",{children:[S("app.newApp.appCreateDSLErrorPart3"),(0,s.jsx)("span",{className:"system-md-medium",children:null==U?void 0:U.importedVersion})]}),(0,s.jsxs)("div",{children:[S("app.newApp.appCreateDSLErrorPart4"),(0,s.jsx)("span",{className:"system-md-medium",children:null==U?void 0:U.systemVersion})]})]})]}),(0,s.jsxs)("div",{className:"flex items-start justify-end gap-2 self
1-stretch pt-6",children:[(0,s.jsx)(p.Ay,{variant:"secondary",onClick:()=>O(!1),children:S("app.newApp.Cancel")}),(0,s.jsx)(p.Ay,{variant:"primary",destructive:!0,onClick:Z,children:S("app.newApp.Confirm")})]})]})]})}},83285:(e,t,a)=>{"use strict";a.d(t,{GX:()=>n,L:()=>l,QI:()=>r,mQ:()=>i,tY:()=>o});var s=a(20141);let r=()=>(0,s.Jt)("/explore/apps"),l=e=>(0,s.Jt)("/explore/apps/".concat(e)),n=e=>(0,s.Jt)("/installed-apps".concat(e?"?app_id=".concat(e):"")),i=e=>(0,s.yH)("/installed-apps/".concat(e)),o=(e,t)=>(0,s.F6)("/installed-apps/".concat(e),{body:{is_pinned:t}})},83677:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var s=a(7485),r=a(33505);let l=e=>{let{defaultTab:t,routingBehavior:a="push",searchParamName:l="category",disableSearchParams:n=!1}=e,i=(0,s.usePathname)(),o=(0,s.useSearchParams)(),[c,p]=(0,r.useState)(n?t:o.get(l)||t);return[c,e=>{p(e),n||history["".concat(a,"State")](null,"","".concat(i,"?").concat(l,"=").concat(e))}]}},85911:e=>{e.exports={container:"style_container__wxmh1"}},86413:(e,t,a)=>{"use strict";a.d(t,{o:()=>n});var s=a(33505),r=a(96556),l=a(13776);let n=()=>{let{mutateAsync:e}=(0,l.Iz)();return{handleCheckPluginDependencies:(0,s.useCallback)(async t=>{let{leaked_dependencies:a}=await e(t),{setDependencies:s}=r.P.getState();s(a)},[e])}}},87407:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var s=a(58501),r=a(33505),l=a(14624),n=a(93703),i=a(76756),o=a(91619),c=a(79776),p=a(49238),d=a(69),m=a(27114),x=a(90985);let u=r.memo(e=>{let{file:t,updateFile:a,className:u}=e,{t:h}=(0,n.Bd)(),{notify:g}=(0,i.NT)(d.$o),[f,v]=(0,r.useState)(!1),j=(0,r.useRef)(null),b=(0,r.useRef)(null),y=(0,r.useRef)(null),w=e=>{e.preventDefault(),e.stopPropagation(),e.target!==b.current&&v(!0)},N=e=>{e.preventDefault(),e.stopPropagation()},A=e=>{e.preventDefault(),e.stopPropagation(),e.target===b.current&&v(!1)},k=e=>{if(e.preventDefault(),e.stopPropagation(),v(!1),!e.dataTransfer)return;let t=[...e.dataTransfer.files];if(t.length>1){g({type:"error",message:h("datasetCreation.stepOne.uploader.validation.count")});return}a(t[0])},C=()=>{y.current&&(y.current.value="",y.current.click(),y.current.oncancel=()=>a(t))};return(0,r.useEffect)(()=>{var e,t,a,s;return null===(e=j.current)||void 0===e||e.addEventListener("dragenter",w),null===(t=j.current)||void 0===t||t.addEventListener("dragover",N),null===(a=j.current)||void 0===a||a.addEventListener("dragleave",A),null===(s=j.current)||void 0===s||s.addEventListener("drop",k),()=>{var e,t,a,s;null===(e=j.current)||void 0===e||e.removeEventListener("dragenter",w),null===(t=j.current)||void 0===t||t.removeEventListener("dragover",N),null===(a=j.current)||void 0===a||a.removeEventListener("dragleave",A),null===(s=j.current)||void 0===s||s.removeEventListener("drop",k)}},[]),(0,s.jsxs)("div",{className:(0,c.A)("mt-6",u),children:[(0,s.jsx)("input",{ref:y,style:{display:"none"},type:"file",id:"fileUploader",accept:".yaml,.yml",onChange:e=>{var t;a(null===(t=e.target.files)||void 0===t?void 0:t[0])}}),(0,s.jsxs)("div",{ref:j,children:[!t&&(0,s.jsxs)("div",{className:(0,c.A)("flex h-12 items-center rounded-xl border border-dashed border-gray-200 bg-gray-50 text-sm font-normal",f&&"border border-[#B2CCFF] bg-[#F5F8FF]"),children:[(0,s.jsxs)("div",{className:"flex w-full items-center justify-center space-x-2",children:[(0,s.jsx)(m.C7,{className:"mr-2 h-6 w-6"}),(0,s.jsxs)("div",{className:"text-gray-500",children:[h("datasetCreation.stepOne.uploader.button"),(0,s.jsx)("span",{className:"cursor-pointer pl-1 text-[#155eef]",onClick:C,children:h("datasetDocuments.list.batchModal.browse")})]})]}),f&&(0,s.jsx)("div",{ref:b,className:"absolute left-0 top-0 h-full w-full"})]}),t&&(0,s.jsxs)("div",{className:(0,c.A)("group flex items-center rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-on-panel-item-bg shadow-xs","hover:border-[#B2CCFF] hover:bg-[#F5F8FF]"),children:[(0,s.jsx)("div",{className:"flex items-center justify-center p-3",children:(0,s.jsx)(p.Ye,{className:"h-6 w-6 shrink-0"})}),(0,s.jsxs)("div",{className:"flex grow flex-col items-start gap-0.5 py-1 pr-2",children:[(0,s.jsx)("span",{className:"font-inter max-w-[calc(100%_-_30px)] overflow-hidden text-ellipsis whitespace-nowrap text-[12px] font-medium leading-4 text-text-secondary",children:t.name}),(0,s.jsxs)("div",{className:"font-inter flex h-3 items-center gap-1 self-stretch text-[10px] font-medium uppercase leading-3 text-text-tertiary",children:[(0,s.jsx)("span",{children:"YAML"}),(0,s.jsx)("span",{className:"text-text-quaternary",children:"\xb7"}),(0,s.jsx)("span",{children:(0,o.v7)(t.size)})]})]}),(0,s.jsxs)("div",{className:"hidden items-center group-hover:flex",children:[(0,s.jsx)(x.Ay,{onClick:C,children:h("datasetCreation.stepOne.uploader.change")}),(0,s.jsx)("div",{className:"mx-2 h-4 w-px bg-gray-200"}),(0,s.jsx)("div",{className:"cursor-pointer p-2",onClick:()=>{y.current&&(y.current.value=""),a()},children:(0,s.jsx)(l.WFf,{className:"h-4 w-4 text-text-tertiary"})})]})]})]})]})})},94327:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(76756).q6)({controlUpdateInstalledApps:0,setControlUpdateInstalledApps:()=>{},hasEditPermission:!1,installedApps:[],setInstalledApps:()=>{}})},96556:(e,t,a)=>{"use strict";a.d(t,{P:()=>s});let s=(0,a(56915).vt)(e=>({dependencies:[],setDependencies:t=>e({dependencies:t})}))}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.