1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[36031],{5518:(e,r,t)=>{t.d(r,{n:()=>o});var a=t(46512),s=t(62489),l=t(81219),i=t(56732);let n=async e=>{var r,t;let a=await s.getFolders(e);if(!a.success)throw Error(a.error||"Failed to fetch folders");let l=a.folders||(null==(r=a.data)?void 0:r.folders)||[];return{folders:l,total:(null==(t=a.data)?void 0:t.total)||l.length}};function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{autoFetch:r=!0,limit:t=50,skip:s=0,teamId:o}=e,{createFolder:d}=(0,l.K)(),c=r?"folders-only-".concat(JSON.stringify({limit:t,skip:s,teamId:o||null})):null,{data:m,error:u,isLoading:p,mutate:x}=(0,a.Ay)(c,()=>n({limit:t,skip:s,teamId:o}),{revalidateOnFocus:!1,revalidateOnReconnect:!0,dedupingInterval:i.B0.NORMAL_POLL,errorRetryCount:3,onError:e=>{let r=e.message||"Klas\xf6rler y\xfcklenirken hata oluÅtu";e.message&&(e.message.includes("ERR_CONNECTION_RESET")||e.message.includes("ERR_CONNECTION_REFUSED")||e.message.includes("ERR_NETWORK")||e.message.includes("Failed to fetch")||e.message.includes("NetworkError")||e.message.includes("ERR_INTERNET_DISCONNECTED")||e.message.includes("ERR_NAME_NOT_RESOLVED")?r="Sunucu ile baÄlantı kurulamadı. Bir ka\xe7 dakika sonra tekrar deneyin, devam ederse [email protected] adresine mail atın.":(e.message.includes("timeout")||e.message.includes("TIMEOUT"))&&(r="İstek zaman aÅımına uÄradı. L\xfctfen tekrar deneyin.")),console.error("SWR error fetching folders:",r,e)}}),h=(null==m?void 0:m.folders)||[];return{folders:h,foldersLoading:p,foldersError:u,foldersTotal:(null==m?void 0:m.total)||0,refreshFolders:async()=>await x(),mutateFoldersCache:async()=>await x(),createFolder:async e=>{try{let r={id:"temp-".concat(Date.now()),name:e.name,color:e.color||"#6b7280",description:e.description,teamId:e.teamId,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};await x(e=>e?{...e,folders:[...e.folders||[],r],total:(e.total||0)+1}:e,!1);let t=await d(e);if(t.success)return await x(),t;throw await x(),Error(t.error||"Failed to create folder")}catch(e){throw await x(),e}},isLoading:p,error:u,mutate:x}}},20699:(e,r,t)=>{t.d(r,{S:()=>g});var a=t(95155),s=t(12115),l=t(69881),i=t(90235),n=t(97003),o=t(7220),d=t(24033),c=t(27937),m=t(59847),u=t(35299),p=t(22198),x=t(29939);let h={red:"text-red-500",orange:"text-orange-500",yellow:"text-yellow-500",green:"text-green-500",blue:"text-blue-500",indigo:"text-indigo-500",purple:"text-purple-500",pink:"text-pink-500",gray:"text-gray-500",teal:"text-teal-500",cyan:"text-cyan-500"};function g(e){var r;let{folders:t,foldersLoading:g,selectedFolder:f,onFolderChange:v,disabled:b=!1,needsTeamFirst:y=!1,onAddFolder:j,label:N="Folder",placeholder:w,allowClear:k=!1,clearLabel:S}=e,{t:C}=(0,l.s9)(),[A,T]=(0,s.useState)(new Set),I=(0,s.useRef)(!1),F=e=>t?t.filter(r=>(void 0===r.parentId?null:r.parentId)===e&&"uncategorized"!==r.id):[],E=function(e){var r,t;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=[],i=F(e.id),n=i.length>0,u=A.has(e.id);return l.push((0,a.jsxs)(o._2,{onSelect:r=>{if(I.current){I.current=!1,r.preventDefault();return}v(e.id)},className:"cursor-pointer",style:{paddingLeft:"".concat(8+16*s,"px")},children:[n?(0,a.jsx)("button",{type:"button","aria-label":u?"Collapse":"Expand",onPointerDown:()=>{I.current=!0},onClick:r=>{var t;r.stopPropagation(),r.preventDefault(),t=e.id,T(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},className:"mr-1 -ml-1 flex size-4 flex-shrink-0 items-center justify-center rounded hover:bg-gray-200 dark:hover:bg-gray-700",children:u?(0,a.jsx)(d.A,{className:"size-3.5 text-gray-500"}):(0,a.jsx)(c.A,{className:"size-3.5 text-gray-500"})}):(0,a.jsx)("span",{className:"mr-1 size-4 flex-shrink-0 inline-block"}),(0,a.jsx)(m.A,{className:(0,x.cn)("size-4 mr-2 flex-shrink-0",(null==(t=e.color)?void 0:t.startsWith("#"))?"":h[t||"gray"]||"text-gray-500"),style:(null==(r=e.color)?void 0:r.startsWith("#"))?{color:e.color}:void 0}),e.name]},e.id)),n&&u&&i.forEach(e=>{l.push(...E(e,s+1))}),l};(0,s.useEffect)(()=>{if(!f||!t)return;let e=new Map(t.map(e=>[e.id,e])),r=new Set,a=e.get(f);for(;(null==a?void 0:a.parentId)&&e.has(a.parentId);)r.add(a.parentId),a=e.get(a.parentId);r.size>0&&T(e=>{let t=new Set(e);
1return r.forEach(e=>t.add(e)),t})},[f,t]);let D=f?null==t||null==(r=t.find(e=>e.id===f))?void 0:r.name:void 0;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(i.J,{children:N}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)(o.rI,{children:[(0,a.jsx)(o.ty,{asChild:!0,children:(0,a.jsx)(n.$,{variant:"outline",className:"flex-1 justify-between h-10 text-sm bg-gray-50 dark:bg-gray-800/50 border-gray-200 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800",disabled:g||b,children:(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[g?(0,a.jsx)(u.A,{className:"size-4 animate-spin text-gray-400"}):(0,a.jsx)(m.A,{className:"size-4 text-gray-400"}),(0,a.jsx)("span",{className:"text-gray-600 dark:text-gray-300 truncate",children:y?C("playwright-authoring:importFolderSelect.selectTeamFirst"):D||w||C("playwright-authoring:importFolderSelect.selectFolder")})]})})}),(0,a.jsx)(o.SQ,{align:"start",className:"w-[400px] z-[10006] p-1",children:(0,a.jsxs)("div",{className:"max-h-[300px] overflow-y-auto overflow-x-hidden",children:[k&&(0,a.jsxs)(o._2,{onSelect:()=>v(""),className:"cursor-pointer text-gray-600 dark:text-gray-300",children:[(0,a.jsx)("span",{className:"mr-1 size-4 flex-shrink-0 inline-block"}),(0,a.jsx)(m.A,{className:"size-4 mr-2 flex-shrink-0 text-gray-400"}),S||w||C("playwright-authoring:importFolderSelect.selectFolder")]}),F(null).map(e=>E(e,0)),(!t||0===t.length)&&(0,a.jsx)("div",{className:"p-4 text-center text-sm text-gray-500",children:C("playwright-authoring:importFolderSelect.notFound")})]})})]}),j&&(0,a.jsx)(n.$,{variant:"outline",size:"icon",onClick:j,disabled:b,className:"size-10 flex-shrink-0 bg-gray-50 dark:bg-gray-800/50 border-gray-200 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 hover:border-[#0EA5E9]/40 hover:text-[#0EA5E9] transition-colors",children:(0,a.jsx)(p.A,{className:"size-4"})})]})]})}},32559:(e,r,t)=>{t.d(r,{Fc:()=>n,TN:()=>d,XL:()=>o});var a=t(95155);t(12115);var s=t(83101),l=t(29939);let i=(0,s.F)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=e=>{let{className:r,variant:t,ref:s,...n}=e;return(0,a.jsx)("div",{ref:s,role:"alert",className:(0,l.cn)(i({variant:t}),r),...n})};n.displayName="Alert";let o=e=>{let{className:r,ref:t,...s}=e;return(0,a.jsx)("h5",{ref:t,className:(0,l.cn)("mb-1 font-medium leading-none tracking-tight",r),...s})};o.displayName="AlertTitle";let d=e=>{let{className:r,ref:t,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("text-sm [&_p]:leading-relaxed",r),...s})};d.displayName="AlertDescription"},33745:(e,r,t)=>{t.d(r,{w:()=>h});var a=t(95155),s=t(12115),l=t(54679),i=t(97003),n=t(33789),o=t(90235);function d(e){let{currentColor:r="#3b82f6",onColorChange:t}=e,l=(0,s.useRef)(null),i=(0,s.useRef)(null),[n,o]=(0,s.useState)((null==r?void 0:r.startsWith("#"))?r:"#3b82f6");return(0,s.useEffect)(()=>{(null==r?void 0:r.startsWith("#"))?o(r):o("#3b82f6")},[r]),(0,s.useEffect)(()=>{let e=l.current,r=i.current;if(!e||!r)return;let a=e=>{let t=e.target.value;o(t),r&&(r.style.backgroundColor=t)},s=e=>{t(e.target.value)},n=()=>{};return e.addEventListener("input",a),e.addEventListener("change",s),e.addEventListener("click",n),()=>{e.removeEventListener("input",a),e.removeEventListener("change",s),e.removeEventListener("click",n)}},[t]),(0,s.useEffect)(()=>{let e=i.current;e&&l.current&&((null==r?void 0:r.startsWith("#"))?(e.style.backgroundColor=r,e.style.borderColor="white",e.style.boxShadow="0 0 0 2px black",l.current.value=r):(e.style.backgroundColor="#3b82f6",e.style.borderColor="#e2e8f0",e.style.boxShadow="none",l.current.value="#3b82f6"))},[r]),(0,a.jsx)("div",{ref:i,className:"size-10 rounded-full border-2 border-gray-200 flex-shrink-0 relative overflow-hidden cursor-pointer",style:{backgroundColor:n,borderColor:"#3b82f6"!==n?"white":"#e2e8f0",boxShadow:"#3b82f6"!==n?"0 0 0 2px black":"none"},children:(0,a.jsx)("input",{ref:l,type:"color",value:n,onChange:e=>{o(e.target.value)},className:"absolute inset-0 opacity-0 size-full cursor-pointer",title:"Select custom color"})})}var c=t(5917),m=t(35299),u=t(69881),p=t(66900);let x=[{value:"blue",hex:"#3b82f6"},{value:"green",hex:"#10b981"},{value:"red",hex:"#f43f5e"},{value:"purple",hex:"#8b5cf6"},{value:"yellow",hex:"#f59e0b"},{value:"orange",hex:"#f97316"},{value:"pink",hex:"#ec4899"},{value:"indigo",hex:"#6366f1"},{value:"teal",hex:"#14b8a6"},{value:"gray",hex:"#6b7280"}];function h(e){let{open:r,onOpenChange:t,onCreateFolder:h,isCreating:g,defaultColor:f="blue",predefinedColors:v=x}=e,{t:b}
1=(0,u.s9)(),y=(0,p.mc)(),[j,N]=(0,s.useState)(""),[w,k]=(0,s.useState)("blue"),S=(0,s.useCallback)(e=>{t(e),e||N(""),k(f)},[f,t]),C=async()=>{j.trim()&&(await h(j.trim(),w),N(""),k(f))};return(0,a.jsx)(l.lG,{open:r,onOpenChange:S,children:(0,a.jsxs)(l.Cf,{className:"sm:max-w-[425px] z-[10002]","data-tour-id":"folder-modal",onInteractOutside:e=>{y&&e.preventDefault()},children:[(0,a.jsxs)(l.c7,{children:[(0,a.jsx)(l.L3,{children:b("scenarios:scenarioDetails.createFolderDialog.title")}),(0,a.jsx)(l.rr,{children:b("scenarios:scenarioDetails.createFolderDialog.description")})]}),(0,a.jsxs)("div",{className:"space-y-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(o.J,{htmlFor:"folder-name",className:"text-sm font-medium",children:b("scenarios:scenarioDetails.createFolderDialog.folderName")}),(0,a.jsx)(n.p,{id:"folder-name","data-tour-id":"folder-name-input",value:j,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j.trim()&&!g&&(e.preventDefault(),C())},placeholder:b("scenarios:scenarioDetails.createFolderDialog.folderNamePlaceholder"),disabled:g})]}),(0,a.jsxs)("div",{className:"space-y-2","data-tour-id":"folder-color-selection",children:[(0,a.jsx)(o.J,{className:"text-sm font-medium",children:b("scenarios:scenarioDetails.createFolderDialog.folderColor")}),(0,a.jsx)("div",{className:"grid grid-cols-5 gap-3",children:v.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>k(e.value),disabled:g,className:"\n w-full aspect-square rounded-full border-2 relative\n ".concat(w===e.value?"border-white ring-2 ring-offset-2 ring-black dark:ring-white":"border-transparent hover:border-white hover:scale-110","\n transition-all duration-200\n disabled:opacity-50 disabled:cursor-not-allowed\n "),title:b("scenarios:scenarioDetails.createFolderDialog.colors.".concat(e.value))||e.value,style:{backgroundColor:e.hex},children:w===e.value&&(0,a.jsx)("span",{className:"absolute inset-0 flex items-center justify-center text-white",children:(0,a.jsx)(c.A,{className:"size-4 stroke-[3]"})})},e.value))})]}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)(o.J,{className:"text-sm font-medium mb-2 block",children:b("scenarios:scenarioDetails.createFolderDialog.customColor")}),(0,a.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,a.jsx)(d,{currentColor:w.startsWith("#")?w:"#3b82f6",onColorChange:k,disabled:g}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(n.p,{type:"text",placeholder:"#RRGGBB",value:w.startsWith("#")?w:"",onChange:e=>{let r=e.target.value;(/^#([0-9A-F]{3}){1,2}$/i.test(r)||"#"===r||""===r)&&k(r||"#3b82f6")},disabled:g,className:"font-mono"})})]})]})]}),(0,a.jsxs)(l.Es,{children:[(0,a.jsx)(i.$,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:g,children:b("scenarios:scenarioDetails.createFolderDialog.cancel")}),(0,a.jsx)(i.$,{type:"button","data-tour-id":"folder-create-button",onClick:C,disabled:!j.trim()||g,children:g?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.A,{className:"mr-2 size-4 animate-spin"}),b("scenarios:scenarioDetails.createFolderDialog.creating")]}):b("scenarios:scenarioDetails.createFolderDialog.createFolder")})]})]})})}},36031:(e,r,t)=>{t.r(r),t.d(r,{ImportScenariosDialog:()=>P});var a=t(95155),s=t(12115),l=t(52619),i=t.n(l),n=t(54679),o=t(9349),d=t.n(o),c=t(97003),m=t(84916),u=t(11024),p=t(46701),x=t(6132),h=t(35299),g=t(52056),f=t(21786),v=t(24033),b=t(12108),y=t(89715),j=t(5917),N=t(33745),w=t(20699),k=t(5518),S=t(67812),C=t(32559),A=t(55850),T=t(96633),I=t(69881),F=t(1076),E=t(62489),D=t(95088),z=t(68335),L=t(76222),R=t(85187),O=t(59100);function P(e){var r,t,l;let{open:o,onOpenChange:P,onImportComplete:_}=e,{t:M}=(0,I.s9)(),{user:U}=(0,F.A)(),{teams:V,isLoading:H}=(0,L.v)(null==U?void 0:U.companyId),$=(0,z.qK)({user:U,flow:"csv_import",teams:V,teamsLoading:H}),W=(null==U?void 0:U.accountType)==="company_owner",[B,J]=(0,s.useState)(!1),[X,q]=(0,s.useState)(!1),[K,G]=(0,s.useState)(""),[Q,Y]=(0,s.useState)(""),[Z,ee]=(0,s.useState)(null),[er,et]=(0,s.use
1State)([]),[ea,es]=(0,s.useState)([]),[el,ei]=(0,s.useState)("file"),[en,eo]=(0,s.useState)(null),[ed,ec]=(0,s.useState)([]),[em,eu]=(0,s.useState)([]),[ep,ex]=(0,s.useState)(0),[eh,eg]=(0,s.useState)(0),[ef,ev]=(0,s.useState)(0),[eb,ey]=(0,s.useState)(null),[ej,eN]=(0,s.useState)(!1),ew=(0,s.useRef)(null),ek=(0,s.useRef)(!1),eS=(0,s.useRef)(!1),eC=(0,s.useRef)(""),{folders:eA=[],foldersLoading:eT,createFolder:eI,refreshFolders:eF}=(0,k.n)({autoFetch:!0,teamId:"inline"===$&&K||void 0}),eE=(0,s.useMemo)(()=>eA&&K===R.N5?eA.filter(e=>!e.teamId||e.teamId===R.N5):eA,[eA,K]),eD="inline"===$&&!K,ez="inline"===$&&!K,eL=!Q||"uncategorized"===Q;(0,s.useEffect)(()=>{"inline"===$&&Q&&!eT&&((null==eE?void 0:eE.some(e=>e.id===Q))||Y(""))},[$,K,Q,eE,eT]);let[eR,eO]=(0,s.useState)(!1),[eP,e_]=(0,s.useState)(!1),eM=(0,s.useCallback)(async(e,r)=>{if(eI){e_(!0);try{let t=K?{name:e,color:r,teamId:K}:{name:e,color:r},a=await eI(t);(null==a?void 0:a.success)&&(eO(!1),eF())}catch(e){console.error("Failed to create folder:",e)}finally{e_(!1)}}},[eI,eF,K]),eU=(0,s.useMemo)(()=>new Set(ed),[ed]),eV=(0,s.useMemo)(()=>new Set(em),[em]),eH=(0,s.useMemo)(()=>{let e={};return er.forEach((r,t)=>{e[r.toLowerCase().trim()]=t}),e},[er]),e$=ea.length-em.length,eW=e$>0&&ed.length===e$,eB=(0,s.useCallback)((e,r)=>{let t=eH[r.toLowerCase()];return void 0!==t&&e[t]||""},[eH]),eJ=(0,s.useCallback)(e=>{var r;let t=null==(r=e.target.files)?void 0:r[0];if(!t)return;ee(t),eC.current="function"==typeof crypto.randomUUID?crypto.randomUUID():"portable-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));let a=new FileReader;a.onload=e=>{var r;let t=null==(r=e.target)?void 0:r.result;d().parse(t,{header:!0,skipEmptyLines:!0,transformHeader:e=>e.trim(),transform:e=>e.trim(),dynamicTyping:!1,comments:"#",complete:e=>{if(e.data&&e.data.length>0){let r=e.meta.fields||[];et(r);let t=e.data.map(e=>r.map(r=>e[r]||""));es(t);let a=r.findIndex(e=>"name"===e.trim().toLowerCase()),s=r.findIndex(e=>"steps"===e.trim().toLowerCase()),l=t.reduce((e,r,t)=>{var l,i;let n=-1!==a&&(null==(l=r[a])?void 0:l.trim()),o=-1!==s&&(null==(i=r[s])?void 0:i.trim());return n&&o||e.push(t),e},[]);eu(l);let i=new Set(l);ec(t.map((e,r)=>r).filter(e=>!i.has(e))),ei("preview")}},error:e=>{u.o.error("CSV parse error: ".concat(e.message))}})},a.readAsText(t)},[]),eX=(0,s.useCallback)(e=>{if(eV.has(e))return void u.o.error("This scenario is missing required fields and cannot be imported");ec(r=>r.includes(e)?r.filter(r=>r!==e):[...r,e])},[eV]),eq=(0,s.useCallback)(()=>{eW?ec([]):ec(ea.map((e,r)=>r).filter(e=>!eV.has(e)))},[eW,ea,eV]),eK=(0,s.useCallback)(async()=>{if(eS.current||B)return void u.o.warning("Import iÅlemi zaten devam ediyor");let e=Q&&"uncategorized"!==Q?Q:void 0;if(0===ea.length)return void u.o.error("Please select a CSV file");if(0===ed.length)return void u.o.error("Please select at least one scenario to import");if(ez)return void u.o.error("L\xfctfen \xf6nce hedef takım se\xe7in");if(!e)return void u.o.error("L\xfctfen bir klas\xf6r se\xe7in");if((0,z.Wr)(U,H))return void u.o.error(z.lh);let r=K||void 0;eS.current=!0,ek.current=!1,q(!1),J(!0),ex(0),eg(0),ey(null),ei("importing");try{let a=[];for(let e of ed){if(e>=ea.length)continue;let r=ea[e],t={clientId:"row-".concat(e)};try{if(er.forEach((e,a)=>{var s;let l=e.toLowerCase().trim(),i=null==(s=r[a])?void 0:s.trim();if(i)if("name"===l)t.name=i;else if("description"===l)t.description=i;else if("steps"===l)t.steps=function(e){let r=[e];for(let t of(e.startsWith('"')&&e.endsWith('"')&&r.push(e.slice(1,-1).replace(/""/g,'"')),r))try{let e=JSON.parse(t),r=Array.isArray(e)?e:null==e?void 0:e.steps,a=(0,O.m)(r);if(a.length>0)return a}catch(e){}return[]}(i);else if("tags"===l)t.tags=i.split(/[,;]/).map(e=>e.trim()).filter(Boolean);else if("status"===l)t.status="passive"===i.trim().toLowerCase()?"passive":"active";else if("platform"===l){let e=i.toLowerCase();t.platform=["web","android","ios","api"].includes(e)?e:"web"}else("aiprompt"===l||"ai prompt"===l)&&(t.aiPrompt=i)}),!t.name||!Array.isArray(t.steps)||0===t.steps.length)continue;t.status||(t.status="active"),t.platform||(t.platform="web"),a.push(t)}catch(r){console.warn("[Import] Satır ".concat(e+1," iÅlenemedi:"),r)}}if(0===a.length){ey("No valid scenarios could be parsed from the selected rows"),u.o.error("No valid scenarios could be parsed from the selected rows"),J(!1),ei("preview");return}let s=ed.length-a.length;ev(a.length);let l=[],i=0,n=0,o=eC.current||"portable-".concat(Date.now());for(let s=0;s<a.length;s+=40){var t;if(ek.current)break;let d=a.slice(s,s+40),c=await (0,E.importPortableScenarioBatch)({importId:o,scenarios:d,folderId:e,targetTeamId:r}),m=Array.isArray(null==(t=c.data)?void 0:t.results)?c.data.results:[];for(let e=0;e<d.length;e++){let r=m[e];(null==r?void 0:r.success)?l.push({...d[e],id:r.scenarioId}
1):(i+=1,console.warn("[Import] Senaryo ".concat(s+e+1," import edilemedi:"),null==r?void 0:r.error))}n+=d.length,eg(n),ex(Math.round(n/a.length*100))}let d=ek.current,c=a.length-n,m=s+i+c,p=d?"Import cancelled. ".concat(l.length," of ").concat(ed.length," selected scenarios were imported."):m>0?"".concat(l.length," scenarios imported successfully. ").concat(m," scenarios could not be imported due to validation or processing issues."):"".concat(l.length," scenarios imported successfully.");eo({success:!d&&0===m,cancelled:d,failed:m,skipped:m,selected:ed.length,message:p,scenarios:l}),ei("results"),d?u.o.info(p):m>0?u.o.warning(p):u.o.success(p),l.length>0&&_&&_()}catch(r){console.error("[Import] Error:",r);let e=r instanceof Error?r.message:"An error occurred while importing scenarios";ey("".concat(e,". You can retry safely; completed batches will be reused.")),ei("preview"),u.o.error(e)}finally{eS.current=!1,q(!1),J(!1)}},[H,er,ea,B,_,Q,ed,K,ez,U]),eG=(0,s.useCallback)(()=>{ek.current=!0,q(!0)},[]),eQ=(0,s.useCallback)(()=>{ee(null),et([]),es([]),ei("file")},[]),eY=(0,s.useCallback)(()=>{var e;null==(e=ew.current)||e.click()},[]),eZ=(0,s.useCallback)(()=>{P(!1)},[P]),e0=(0,s.useCallback)(e=>{if(!e&&B)return void u.o.info("Cancel the import before closing this dialog");P(e)},[B,P]);return(0,a.jsxs)(n.lG,{open:o,onOpenChange:e0,children:[(0,a.jsxs)(n.Cf,{className:"w-[95vw] sm:max-w-[850px] max-h-[90vh] border-0 shadow-xl bg-white dark:bg-gray-900 rounded-xl overflow-hidden flex flex-col p-0",children:[(0,a.jsx)(n.c7,{className:"pb-3 sm:pb-4 px-4 sm:px-6 pt-4 sm:pt-6 border-b border-gray-100 dark:border-gray-800 bg-gradient-to-r from-indigo-50 to-blue-50 dark:from-indigo-900/10 dark:to-blue-900/10",children:(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,a.jsx)("div",{className:"p-1.5 sm:p-2 rounded-full bg-indigo-100 dark:bg-indigo-900/30",children:(0,a.jsx)(p.A,{className:"size-4 sm:size-5 text-indigo-600 dark:text-indigo-400"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)(n.L3,{className:"text-lg sm:text-xl font-bold bg-gradient-to-r from-indigo-600 to-blue-600 bg-clip-text text-transparent",children:M("scenario-import:portableDialog.title")}),(0,a.jsxs)(n.rr,{className:"mt-1 hidden items-start gap-2 text-sm font-normal leading-5 text-red-600 dark:text-red-400 sm:flex",children:[(0,a.jsx)(x.A,{"aria-hidden":"true",className:"mt-0.5 size-4 shrink-0"}),(0,a.jsx)("span",{children:M("scenario-import:portableDialog.description")})]})]})]})})}),(0,a.jsxs)("div",{className:"p-4 sm:p-6 overflow-y-auto flex-grow",children:["importing"===el&&(0,a.jsxs)("div",{className:"space-y-6 py-8",children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center p-3 bg-blue-100 dark:bg-blue-900/30 rounded-full mb-4",children:(0,a.jsx)(h.A,{className:"size-8 text-blue-600 dark:text-blue-400 animate-spin"})}),(0,a.jsx)("h3",{className:"text-xl font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Importing Scenarios"}),(0,a.jsx)("p",{className:"text-gray-500 dark:text-gray-400 mb-6",children:"Please wait while your scenarios are being importedâ¦"})]}),(0,a.jsxs)("div",{className:"space-y-2 max-w-md mx-auto",children:[(0,a.jsxs)("div",{className:"flex justify-between text-sm text-gray-500 dark:text-gray-400 mb-1",children:[(0,a.jsx)("span",{children:"Progress"}),(0,a.jsxs)("span",{children:[ep,"%"]})]}),(0,a.jsx)(A.k,{value:ep,className:"h-2"}),(0,a.jsxs)("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 mt-2",children:["Processed ",eh," of ",ef," scenarios"]})]}),eb&&(0,a.jsxs)(C.Fc,{className:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800 mt-4",children:[(0,a.jsx)(x.A,{className:"size-4 text-red-600 dark:text-red-400"}),(0,a.jsx)(C.XL,{className:"text-red-800 dark:text-red-300",children:"Import Error"}),(0,a.jsx)(C.TN,{className:"text-red-700 dark:text-red-400",children:eb})]})]}),"file"===el&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(C.Fc,{className:"border-amber-200 bg-amber-50 text-amber-950 dar
1k:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100",children:[(0,a.jsx)(g.A,{className:"size-4 text-amber-600 dark:text-amber-400"}),(0,a.jsx)(C.XL,{children:M("scenario-import:portableDialog.warningTitle")}),(0,a.jsxs)(C.TN,{className:"text-amber-800 dark:text-amber-200",children:[M("scenario-import:portableDialog.warningDescription")," ",(0,a.jsx)(i(),{href:"/scenarios/import/csv",className:"font-semibold underline underline-offset-4 hover:text-amber-950 dark:hover:text-amber-50",children:M("scenario-import:portableDialog.warningLink")})]})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center p-6 border-2 border-dashed border-indigo-200 dark:border-indigo-800/50 rounded-lg bg-indigo-50/50 dark:bg-indigo-900/10 transition-colors duration-200 hover:bg-indigo-50 dark:hover:bg-indigo-900/20 group",children:[(0,a.jsx)("input",{type:"file",ref:ew,accept:".csv",className:"hidden",onChange:eJ}),(0,a.jsx)("div",{className:"mb-4 p-3 rounded-full bg-indigo-100 dark:bg-indigo-900/30 group-hover:scale-110 transition-transform duration-200",children:(0,a.jsx)(f.A,{className:"size-6 text-indigo-600 dark:text-indigo-400"})}),(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Upload CSV File"}),(0,a.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 text-center mb-4",children:"Drag and drop your CSV file here, or click to browse"}),(0,a.jsxs)(c.$,{onClick:eY,className:"bg-gradient-to-r from-indigo-600 to-blue-600 hover:from-indigo-700 hover:to-blue-700 text-white shadow-md hover:shadow-lg transition-shadow duration-200 border-0",children:[(0,a.jsx)(p.A,{className:"mr-2 size-4"}),"Select CSV File"]})]}),"inline"===$&&W?(0,a.jsx)(D.T,{companyId:null==U?void 0:U.companyId,value:K,onChange:G,label:"Hedef takım",placeholder:"Senaryonun kaydedileceÄi takımı se\xe7in",includeAllTeamsOption:!0}):null,(0,a.jsx)(w.S,{folders:eE,foldersLoading:eT,selectedFolder:Q,onFolderChange:Y,disabled:eD,needsTeamFirst:eD,onAddFolder:()=>eO(!0)})]}),"preview"===el&&Z&&(0,a.jsxs)("div",{className:"space-y-4",children:[eb&&(0,a.jsxs)(C.Fc,{className:"border-amber-200 bg-amber-50 dark:border-amber-800 dark:bg-amber-900/20",children:[(0,a.jsx)(x.A,{className:"size-4 text-amber-600 dark:text-amber-400"}),(0,a.jsx)(C.XL,{children:"Import paused"}),(0,a.jsx)(C.TN,{children:eb})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:"Preview"}),(0,a.jsxs)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[ea.length," scenarios found in ",Z.name]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.$,{variant:"outline",size:"sm",className:"h-8 px-2 flex items-center gap-1",onClick:()=>eN(!ej),children:ej?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{className:"size-4"}),"Show Scenarios"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.A,{className:"size-4"}),"Hide Scenarios"]})}),(0,a.jsxs)(S.E,{variant:"outline",className:"flex items-center gap-1",children:[(0,a.jsx)(y.A,{className:"size-3"}),Z.name]})]})]}),!ej&&(0,a.jsx)("div",{className:"border border-indigo-100 dark:border-indigo-800/50 rounded-md overflow-hidden shadow-sm",children:(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto overflow-x-auto",children:(0,a.jsxs)(T.XI,{className:"min-w-[800px]",children:[(0,a.jsx)(T.A0,{children:(0,a.jsxs)(T.Hj,{children:[(0,a.jsx)(T.nd,{className:"w-12 sticky left-0 bg-white dark:bg-gray-900",children:(0,a.jsx)(m.S,{checked:eW,onCheckedChange:eq,"aria-label":"Select all scenarios"})}),(0,a.jsxs)(T.nd,{className:"min-w-[150px] max-w-[200px]",children:["Name",(0,a.jsx)("span",{className:"ml-1 text-red-500",children:"*"})]}),(0,a.jsx)(T.nd,{className:"min-w-[150px] max-w-[200px]",children:"Description"}),(0,a.jsx)(T.nd,{className:"min-w-[100px] max-w-[150px]",children:"Tags"}),(0,a.jsxs)(T.nd,{className:"min-w-[200px]",children:["Steps",(0,a.jsx)("span",{className:"ml-1 text-red-500",children:"*"})]})]})}),(0,a.jsx)(T.BF,{children:ea.map((e,r)=>{let t=eU.has(r),s=eV.has(r),l=eB(e,"name"),i=eB(e,"description"),n=eB(e,"tags"),o=eB(e,"steps"),d=function(e){if(!e)return null;try{let r=JSON.parse(e);if(Array.isArray(r))return r.length;if((null==r?void 0:r.steps)&&Array.isArray(r.steps))return r.steps.length;return null}catch(e){return null}}(o);return(0,a.jsxs)(T.Hj,{className:s?"bg-red-50 dark:bg-red-900/10":t?"bg-blue-50 dark:bg-blue-900/10":"",children:[(0,a.jsx)(T.nA,{className:"w-12 sticky left-0 bg-white dark:bg-gray-900",children:(0,a.jsx)(m.S,{checked:t,onCheckedChange:()=>eX(r),"aria-label":"Select scenario ".concat(r+1),disabled:s})}),(0,a.jsx)(T.nA,{className:"min-w-[150px] max-w-[200px] truncate",children:(0,a.jsx)("div",{className:"truncate",title:l,children:l||"-"})}),(0,a.jsx)(T.nA,{className:"min-w-[150px] max-w-[200px] truncate",children:(0,a.jsx)("div",{className:"truncate",title:i,children:i||"-"})}),(0,a.jsx)(T.nA,{className:"min-w-[100px] max-w-[150px] truncate",children:(0,a.jsx)("div",{className:"truncate",title:n,children:n||"-"})}),(0,a.jsx)(T.nA,{className:"min-w-[200px] overflow-hidden",children:(0,a.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-800 py-1 px-2 sm:px-3 rounded-full border border-gray-200 dark:border-gray-700 inline-flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium",children:null!==d?d:o?"Invalid":"-"}),null!==d&&(0,a.jsx)("span",{className:"text-gray-500",children:"steps"}),o&&null===d&&(0,a.jsx)("span",{className:"text-gray-500",children:"JSON"})]})})]},r)})})]})})}),(0,a.jsxs)("div",{className:"flex justify-between items-center mt-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,a.jsxs)("div",{children:[ed.length," of ",e$," valid scenarios selected",em.length>0&&(0,a.jsxs)("span",{className:"ml-2 text-red-500",children:["(",em.length," invalid scenarios found)"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[em.length>0&&(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"size-3 bg-red-100 dark:bg-red-900/30 mr-1"}),(0,a.jsx)("span",{children:"Missing required fields"})]}),(0,a.jsx)(c.$,{variant:"link",onClick:eq,className:"h-auto p-0",children:eW?"Deselect All":"Select All Valid"})]})]}),em.length>0&&(0,a.jsxs)(C.Fc,{className:"bg-gradient-to-r from-red-50 to-pink-50 dark:from-red-900/20 dark:to-pink-900/20 border-red-200 dark:border-red-800 shadow-sm mt-2",children:[(0,a.jsx)(x.A,{className:"size-4 text-red-600 dark:text-red-400"}),(0,a.jsx)(C.XL,{className:"text-red-800 dark:text-red-300",children:"CSV Format Issue"}),(0,a.jsxs)(C.TN,{className:"text-red-700 dark:text-red-400",children:[(0,a.jsx)("div",{children:"Some scenarios are missing required fields (name or steps). Please check your CSV file format."}),(0,a.jsxs)("div",{className:"mt-1",children:["Make sure column names are exactly ",(0,a.jsx)("strong",{children:"Name"})," and ",(0,a.jsx)("strong",{children:"Steps"})," (case-insensitive)."]}),(0,a.jsx)("div",{className:"mt-1",children:"If you exported this file from the system, it should be compatible. The steps field must be in valid JSON format."})]})]}),"inline"===$&&W?(0,a.jsx)(D.T,{companyId:null==U?void 0:U.companyId,value:K,onChange:G,label:"Hedef takım",placeholder:"Senaryonun kaydedileceÄi takımı se\xe7in",disabled:B,includeAllTeamsOption:!0}):null,(0,a.jsx)(w.S,{folders:eE,foldersLoading:eT,selectedFolder:Q,onFolderChange:Y,disabled:B||eD,needsTeamFirst:eD,onAddFolder:()=>eO(!0)}),(0,a.jsxs)(C.Fc,{className:"bg-gradient-to-r from-amber-50 to-yellow-50 dark:from-amber-900/20 dark:to-yellow-900/20 border-amber-200 dark:border-amber-800 shadow-sm",children:[(0,a.jsx)(x.A,{className:"size-4 text-amber-600 dar
1k:text-amber-400"}),(0,a.jsx)(C.XL,{className:"text-amber-800 dark:text-amber-300",children:"Important"}),(0,a.jsxs)(C.TN,{className:"text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("div",{children:"Make sure your CSV file has the correct format. The first row should contain headers, and each scenario must have the following required fields:"}),(0,a.jsxs)("ul",{className:"list-disc list-inside mt-2 ml-2 space-y-1",children:[(0,a.jsx)("li",{className:"font-medium",children:"name - The name of the scenario"}),(0,a.jsx)("li",{className:"font-medium",children:"steps - The steps of the scenario (in JSON format)"})]}),(0,a.jsx)("div",{className:"mt-2",children:"Other fields like description and tags are optional. System fields like createdAt, updatedAt, id will be ignored."})]})]})]}),"results"===el&&en&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"flex items-center justify-center p-6 rounded-lg border ".concat(en.failed>0?"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800":"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800"),children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"mx-auto mb-4 size-12 rounded-full flex items-center justify-center ".concat(en.failed>0?"bg-amber-100 dark:bg-amber-900/30":"bg-green-100 dark:bg-green-900/30"),children:en.failed>0?(0,a.jsx)(g.A,{className:"size-6 text-amber-600 dark:text-amber-400"}):(0,a.jsx)(j.A,{className:"size-6 text-green-600 dark:text-green-400"})}),(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-2",children:en.cancelled?"Import Cancelled":en.failed>0?"Import Completed with Warnings":"Import Successful"}),(0,a.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:en.message||"".concat((null==(r=en.scenarios)?void 0:r.length)||0," scenarios imported successfully")}),(0,a.jsxs)("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:[null!=(l=en.selected)?l:ed.length," selected \xb7"," ",(null==(t=en.scenarios)?void 0:t.length)||0," imported \xb7"," ",en.skipped||0," skipped"]})]})}),en.scenarios&&en.scenarios.length>0&&(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:"Imported Scenarios"}),(0,a.jsx)(c.$,{variant:"outline",size:"sm",className:"h-8 px-2 flex items-center gap-1",onClick:()=>eN(!ej),children:ej?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{className:"size-4"}),"Show Details"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.A,{className:"size-4"}),"Hide Details"]})})]}),!ej&&(0,a.jsx)("div",{className:"border border-green-100 dark:border-green-800/50 rounded-md overflow-hidden shadow-sm",children:(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto overflow-x-auto",children:(0,a.jsxs)(T.XI,{className:"min-w-[700px]",children:[(0,a.jsx)(T.A0,{children:(0,a.jsxs)(T.Hj,{children:[(0,a.jsx)(T.nd,{className:"min-w-[150px] max-w-[200px]",children:"Name"}),(0,a.jsx)(T.nd,{className:"min-w-[150px] max-w-[200px]",children:"Description"}),(0,a.jsx)(T.nd,{className:"min-w-[100px] max-w-[120px]",children:"Status"}),(0,a.jsx)(T.nd,{className:"min-w-[150px]",children:"Steps"})]})}),(0,a.jsxs)(T.BF,{children:[en.scenarios.slice(0,5).map(e=>(0,a.jsxs)(T.Hj,{children:[(0,a.jsx)(T.nA,{className:"font-medium min-w-[150px] max-w-[200px] truncate",children:(0,a.jsx)("div",{className:"truncate",title:e.name,children:e.name})}),(0,a.jsx)(T.nA,{className:"min-w-[150px] max-w-[200px] truncate",children:(0,a.jsx)("div",{className:"truncate",title:e.description,children:e.description||"-"})}),(0,a.jsx)(T.nA,{className:"min-w-[100px] max-w-[120px]",children:(0,a.jsx)(S.E,{className:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 text-xs",children:e.status||"active"})}),(0,a.jsx)(T.nA,{className:"min-w-[150px] overflow-hidden",children:(0,a.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-800 py-1 px-2 sm:px-3 rounded-full border border-gray-200 dark:border-gray-700 inline-flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium",children:e.steps&&Array.isArray(e.steps)?e.steps.length:0}),(0,a.jsx)("span",{className:"text-gray-500",children:"steps"})]})})]},e.id||e.clientId)),en.scenarios.length>5&&(0,a.jsx)(T.Hj,{children:(0,a.jsxs)(T.nA,{colSpan:4,className:"text-center text-sm text-gray-500",children:[en.scenarios.length-5," more scenarios importedâ¦"]})})]})]})})})]})]})]}),(0,a.jsxs)(n.Es,{className:"border-t border-gray-100 dark:border-gray-800 pt-4 pb-4 px-4 sm:px-6 bg-gradient-to-r from-gray-50 to-gray-100 dark:from-gray-900/50 dark:to-gray-800/50 !flex !flex-col sm:!flex-row !justify-stretch sm:!justify-end !space-y-2 sm:!space-y-0 sm:!space-x-3 !gap-0",children:["file"===el&&(0,a.jsx)(c.$,{variant:"outline",onClick:eZ,className:"w-full sm:w-auto",children:"Cancel"}),"preview"===el&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$,{variant:"outline",onClick:eQ,className:"w-full sm:w-auto",disabled:B,children:"Back"}),(0,a.jsx)(c.$,{onClick:eK,className:"w-full sm:w-auto bg-gradient-to-r from-indigo-600 to-blue-600 hover:from-indigo-700 hover:to-blue-700 text-white shadow-md hover:shadow-lg transition-shadow duration-200 border-0",disabled:B||0===ed.length||ez||eL,children:B?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.A,{className:"mr-2 size-4 animate-spin"}),"Importingâ¦"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.A,{className:"mr-2 size-4"}),"Import Scenarios"]})})]}),"importing"===el&&(0,a.jsx)(c.$,{variant:"outline",onClick:eG,className:"w-full sm:w-auto",disabled:X,children:X?"Cancelling after current batchâ¦"
1:"Cancel Import"}),"results"===el&&(0,a.jsx)(c.$,{onClick:eZ,className:"w-full sm:w-auto bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-700 hover:to-emerald-700 text-white shadow-md hover:shadow-lg transition-shadow duration-200 border-0",children:"Done"})]})]}),(0,a.jsx)(N.w,{open:eR,onOpenChange:eO,onCreateFolder:eM,isCreating:eP})]})}},55850:(e,r,t)=>{t.d(r,{k:()=>l});var a=t(95155);t(12115);var s=t(29939);let l=e=>{let{className:r,value:t,max:l=100,indicatorClassName:i,ref:n,...o}=e;return(0,a.jsx)("div",{ref:n,role:"progressbar","aria-valuemin":0,"aria-valuemax":l,"aria-valuenow":t,className:(0,s.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",r),...o,children:(0,a.jsx)("div",{className:(0,s.cn)("size-full flex-1 bg-primary transition-all",i),style:{transform:"translateX(-".concat(100-t/l*100,"%)")}})})};l.displayName="Progress"},59100:(e,r,t)=>{t.d(r,{V:()=>h,m:()=>f});let a=new Set(["goto","sleep","aiAction","aiClick","aiTap","aiInput","aiSelectOption","aiHover","aiRightClick","aiKeyboardPress","aiDragDrop","aiAssertion","aiWaitElement","aiLocate","aiScroll","aiQuery","aiBoolean","aiNumber","aiString","aiFileUpload","uploadFile","ifElse","forLoop","whileLoop","apiRequest","apiAssert","apiExtract","apiAuth","waitRetry"]),s=["steps","trueSteps","falseSteps","loopSteps"],l=new Set(["aiAction","aiTap","aiHover","aiScroll","aiRightClick","aiAssertion","aiWaitElement","aiLocate","aiQuery","aiBoolean","aiNumber","aiString"]),i=new Set(["id","type","name","description","purpose","endpointId","prompt","target","value","condition","url","duration","timeoutMs","checkIntervalMs","cleanInputFirst","iterationCount","maxIterations","variableName","trueSteps","falseSteps","loopSteps","method","endpoint","path","baseUrl","endpointData","collectionData","collectionId","headers","defaultHeaders","params","queryParams","pathParams","body","auth","authentication","assertionType","statusCode","expectedValue","actualValue","jsonPath","operator","responseTime","headerName","headerValue","outputVariable","pattern","extractors","assertions","jsonPathAssertions","headerAssertions","selectedPaths","pathMappings","saveToGlobalVariables","targetEnvironments","targetStepIndex","phaseIndex","instanceIndex","maxRetry","intervalMs","stopOnMaxRetry","retryCount","retry","retries","aiQueryFields","testFileId","testFileName","fileInputTarget","selector","optional","windowTarget","direction","amount","waitTime","comparison","customProperties"]);function n(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function o(e){if("string"==typeof e){let r=e.trim();return r.length>0?r:void 0}if(!n(e)||void 0!==e.type||void 0!==e.prompt||void 0!==e.target||void 0!==e.value||void 0!==e.name||void 0!==e.description||void 0!==e.condition)return;let r=Object.keys(e).filter(e=>/^\d+$/.test(e)).map(e=>Number(e)).sort((e,r)=>e-r);if(0===r.length)return;for(let t=0;t<r.length;t++){if(r[t]!==t)return;let a=e[String(t)];if("string"!=typeof a||1!==a.length)return}let t=r.map(r=>e[String(r)]).join("").trim();return t.length>0?t:void 0}function d(e){return n(e)&&"string"==typeof e.id?e.id:void 0}function c(){var e,r;return(null==(r=globalThis.crypto)||null==(e=r.randomUUID)?void 0:e.call(r))||"step_".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2))}function m(e){return"string"==typeof e&&e.trim().length>0?e:void 0}function u(e){return"number"==typeof e&&Number.isFinite(e)?e:m(e)}function p(e){if("number"==typeof e&&Number.isFinite(e))return e;let r=m(e);return r&&/^\d+$/.test(r)?Number(r):void 0}function x(e){let r={...e};for(let t of s)Array.isArray(e[t])&&(r[t]=h(e[t]));return function(e){var r,t,a,s,i,n,o;let d={...e},c=(e,r)=>{var t;let a=null!=(t=m(d[e]))?t:r.map(e=>m(d[e])).find(Boolean);return void 0!==a&&(d[e]=a),a},x=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.forEach(e=>delete d[e])};"uploadFile"===d.type&&(d.type="aiFileUpload"),"aiClick"===d.type&&(d.type="aiTap");let h=m(d.type);switch(h){case"goto":c("url",["value"]),x("value");break;case"sleep":{let e=null!=(t=null!=(r=p(d.duration))?r:p(d.value))?t:p(d.prompt);void 0!==e&&(d.duration=e),x("value","prompt");break}case"aiInput":c("target",["demand","name","description"]),"boolean"!=typeof d.cleanInputFirst&&(d.cleanInputFirst=!0),x("demand","clearInputFirst");break;case"aiSelectOption":c("target",["demand"]),x("demand");break;case"aiDragDrop":if(c("target",["demand"]),void 0===d.value||null===d.value||""===d.value){let e=m(d.dragTarget);void 0!==e&&(d.value=e)}x("demand","dragTarget");break;case"aiKeyboardPress":{let e=null!=(a=m(d.value))?a:"number"==typeof d.value||"boolean"==typeof d.value?d.value:void 0,r=null!=(s=null!=e?e:m(d.key))?s:m(d.prompt);void 0!==r&&(d.value=r),c("target",["demand"]),x("key","prompt","demand");break}case"aiFileUpload":c("testFileId",["fileId"]),c("testFileName",["originalName","fileName","testFileOriginalName"]),c("fileInputTarget",["target","demand"]),x("fileId","originalName","fileName","testFileOriginalName","target","demand");break;case"ifElse":case"whileLoop":c("condition",["prompt","value"]),x("prompt","value");break;case"forLoop":{let e=null!=(o=null!=(n=null!=(i=u(d.iterationCount))?i:u(d.iterations))?n:u(d.value))?o:u(d.prompt);void 0!==e&&(d.iterationCount=String(e)),x("iterations","value","prompt");break}
1default:h&&l.has(h)&&(c("prompt","aiAssertion"===h?["condition","value","name","description"]:["value","name","description"]),x("value",..."aiAssertion"===h?["condition"]:[]))}return d}(r)}function h(e){if(!Array.isArray(e))return[];let r=[];for(let t=0;t<e.length;t++){let s=e[t],l=o(s),i=e[t+1],m=o(i);if(l&&a.has(l)&&m){r.push(x({id:d(s)||d(i)||c(),type:l,name:"",prompt:m})),t++;continue}if(l){r.push({id:d(s)||c(),type:"aiAction",name:"",prompt:l});continue}if(n(s)){r.push(x(s));continue}}return r}function g(e){let r={};for(let t of i)Object.prototype.hasOwnProperty.call(e,t)&&void 0!==e[t]&&("trueSteps"===t||"falseSteps"===t||"loopSteps"===t?r[t]=f(e[t]):r[t]=e[t]);return r}function f(e){return h(e).filter(e=>"string"==typeof e.type&&e.type.trim().length>0).map(g)}},66900:(e,r,t)=>{t.d(r,{mc:()=>p,nG:()=>u});var a=t(25959),s=t(89863),l=t(79250),i=t(18415),n=t(67132),o=t(81391);async function d(){var e;let r=await (0,n.Jt)(o.Op.COMPLETIONS);return{success:r.success,completions:r.success&&(null==(e=r.data)?void 0:e.completions)?r.data.completions:r.completions||{}}}async function c(e){var r,t;let a=await (0,n.post)(o.Op.COMPLETIONS,{tourId:e});return{success:a.success,message:a.message||(null==(r=a.data)?void 0:r.message)||"",completion:(null==(t=a.data)?void 0:t.completion)||a.completion||null}}let m={tour:null,currentStepIndex:0,isPaused:!1,highlightedElementRect:null,error:null,validationPulse:!1,selectedActionType:null},u=(0,a.v)()((0,s.lt)((0,s.Zr)((e,r)=>({isActive:!1,activeTour:m,completions:{},isLoadingCompletions:!1,showConfirmDialog:!1,pendingTourId:null,showExitConfirmation:!1,showCelebration:!1,currentUserAccountType:null,currentUserRoleId:null,requestStartTour:r=>{e({showConfirmDialog:!0,pendingTourId:r})},confirmStartTour:()=>{e({showConfirmDialog:!1})},cancelStartTour:()=>{e({showConfirmDialog:!1,pendingTourId:null})},startTour:r=>{e({isActive:!0,pendingTourId:null,activeTour:{tour:r,currentStepIndex:0,isPaused:!1,highlightedElementRect:null,error:null,validationPulse:!1,selectedActionType:null}})},endTour:async t=>{let{activeTour:a}=r();t&&a.tour&&(await r().markTourCompleted(a.tour.id),e({showCelebration:!0}),setTimeout(()=>{e({showCelebration:!1})},3e3)),e({isActive:!1,activeTour:m,showExitConfirmation:!1})},pauseTour:()=>{e(e=>({activeTour:{...e.activeTour,isPaused:!0}}))},resumeTour:()=>{e(e=>({activeTour:{...e.activeTour,isPaused:!1}}))},nextStep:()=>{e(e=>{let{activeTour:r}=e;if(!r.tour)return e;let t=r.currentStepIndex+1;return t>=r.tour.steps.length?e:{activeTour:{...r,currentStepIndex:t,highlightedElementRect:null,error:null}}})},previousStep:()=>{e(e=>{let{activeTour:r}=e;return!r.tour||r.currentStepIndex<=0?e:{activeTour:{...r,currentStepIndex:r.currentStepIndex-1,highlightedElementRect:null,error:null}}})},goToStep:r=>{e(e=>{let{activeTour:t}=e;return!t.tour||r<0||r>=t.tour.steps.length?e:{activeTour:{...t,currentStepIndex:r,highlightedElementRect:null,error:null}}})},setHighlightedElementRect:r=>{e(e=>({activeTour:{...e.activeTour,highlightedElementRect:r}}))},setError:r=>{e(e=>({activeTour:{...e.activeTour,error:r}}))},triggerValidationPulse:()=>{e(e=>({activeTour:{...e.activeTour,validationPulse:!0}})),setTimeout(()=>{e(e=>({activeTour:{...e.activeTour,validationPulse:!1}}))},600)},setSelectedActionType:r=>{e(e=>({activeTour:{...e.activeTour,selectedActionType:r}}))},setCurrentUserAccountType:r=>{e({currentUserAccountType:r})},setCurrentUserRoleId:r=>{e({currentUserRoleId:r})},requestExitTour:()=>{e({showExitConfirmation:!0})},confirmExitTour:()=>{r().endTour(!1)},cancelExitTour:()=>{e({showExitConfirmation:!1})},hideCelebration:()=>{e({showCelebration:!1})},fetchCompletions:async()=>{e({isLoadingCompletions:!0});try{let r=await d();r.success&&e({completions:r.completions})}catch(e){console.error("Failed to fetch tutorial completions:",e)}finally{e({isLoadingCompletions:!1})}},markTourCompleted:async r=>{try{let t=await c(r);t.success&&t.completion&&e(e=>({completions:{...e.completions,[r]:{completedAt:t.completion.completedAt,completionCount:t.completion.completionCount}}}))}catch(t){console.error("Failed to mark tour as completed:",t),e(e=>{var t;return{completions:{...e.completions,[r]:{completedAt:new Date().toISOString(),completionCount:((null==(t=e.completions[r])?void 0:t.completionCount)||0)+1}}}})}},isTourCompleted:e=>!!r().completions[e],getCurrentStep:()=>{let{activeTour:e}=r();return e.tour&&e.tour.steps[e.currentStepIndex]||null},getTotalSteps:()=>{var e;let{activeTour:t}=r();return(null==(e=t.tour)?void 0:e.steps.length)||0},getCompletedToursCount:()=>Object.keys(r().completions).length,clearPersistedState:()=>{e({isActive:!1,activeTour:m,completions:{},isLoadingCompletions:!1,showConfirmDialog:!1,pendingTourId:null,showExitConfirmation:!1,showCelebration:!1})}}),{name:"tour-store",storage:i.Rx,partialize:e=>({completions:e.completions})}),{name:"tour-store"}));function p(){return u(e=>e.isActive)}l.bX.registerStore({clearPersistedState:()=>u.getState().clearPersistedState()})},96633:(e,r,t)=>{t.d(r,{A0:()=>i,BF:()=>n,Hj:()=>o,XI:()=>l,nA:()=>c,nd:()=>d});var a=t(95155);t(12115);var s=t(29939);let l=e=>{let{className:r,ref:t,...l}=e;return(0,a.jsx)("div",{className:"relative w-full overflow-auto",children:(0,a.jsx)("table",{ref:t,className:(0,s.cn)("w-full caption-bottom text-sm",r),...l})})};l.displayName="Table";let i=e=>{let{className:r,ref:t,...l}=e;return(0,a.jsx)("thead",{ref:t,className:(0,s.cn)("[&_tr]:border-b",r),...l})};i.displayName="TableHeader";let n=e=>{let{className:r,ref:t,...l}=e;return(0,a.jsx)("tbody",{ref:t,className:(0,s.cn)("[&_tr:last-child]:border-0",r),...l})};n.displayName="TableBody";let o=e=>{let{className:r,ref:t,...l}=e;return(0,a.jsx)("tr",{ref:t,className:(0,s.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...l})};o.displayName="TableRow";let d=e=>{let{className:r,ref:t,...l}=e;return(0,a.jsx)("th",{ref:t,className:(0,s.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...l})};d.displayName="TableHead";let c=e=>{let{className:r,ref:t,...l}=e;return(0,a.jsx)("td",{ref:t,className:(0,s.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...l})};c.displayName="TableCell"}}]);
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.