PageSourceSearch

https://livis.ai/static/js/9860.3b6e372b.chunk.js

js livis.ai collected 2026-10-05 12:20:37 UTC 32,631 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunklivis_product_fe=self.webpackChunklivis_product_fe||[]).push([[9860],{22932(e,a,t){t.d(a,{A:()=>j});var i=t(89379),n=t(5544),s=t(65043),l=t(69392),o=t(81e3),d=t(43845),r=t(27108),c=t(67784),u=t(42518),m=t(74802),v=t(74117),g=t(93950),p=t.n(g),h=t(63604),f=t(85829),_=t(94730),x=t(29465),y=t(70579);const A=e=>{const a=(0,v.Bd)().t,t=e.label_name,g=e.name,A=e.list,j=e.setList,b=e.sugesstedParameters,w=e.setSugesstedParameters,S=e.set_form_value,I=e.type,N=e.defaultSuggestion,C=e.disableApiFetch,k=void 0!==C&&C,E=e.otherSelectedList,R=void 0===E?[]:E,P=e.otherType,D=void 0===P?"":P,F=e.isCustomModelUpload,z=void 0!==F&&F,L=e.maxVisibleChips,B=e.truncateAt,O=(0,s.useState)(""),W=(0,n.A)(O,2),V=W[0],q=W[1],M=(0,s.useState)(""),T=(0,n.A)(M,2),U=T[0],G=T[1],H=(0,s.useState)(!1),K=(0,n.A)(H,2),Y=K[0],X=K[1];(0,s.useEffect)(()=>{if(G(""),V.length>=2&&!k)J(V);else{const e=Z(null===N||void 0===N?void 0:N[I],A);w(e)}},[V,k]);const J=(0,s.useCallback)(p()(async e=>{var a;X(!1);const t={parameter:e},i=((0,x.ND)(124),await(0,h.i1)(t)),n=null===i||void 0===i||null===(a=i.data)||void 0===a?void 0:a.data,s=Z(n,A);X(!0),w(s)},500),[]),Z=(e,a)=>null===e||void 0===e?void 0:e.filter(e=>!(null!==a&&void 0!==a&&a.includes(e))),$=e=>{const t=e.trim();if(k&&z&&null!==R&&void 0!==R&&R.includes(t)){const e=D||("features"===I?"defect":"feature");return void(0,_.o)("".concat(t," is already added as ").concat(e),"warning")}if(k&&!z&&null!==R&&void 0!==R&&R.includes(t)){const e=D||("features"===I?"defect":"feature");return void(0,_.o)("".concat(t," ").concat(a("is already added as")," ").concat(e),"warning")}if(null!==A&&void 0!==A&&A.includes(t)){if("defects"===I)return void(0,_.o)("".concat(a("Selected defect already exists in the list")),"warning");if("features"===I)return void(0,_.o)("".concat(a("Selected feature already exists in the list")),"warning")}const i=[...A,t];j(i);const n=[...b];n.splice(n.indexOf(t),1),w(n),S(g,i),q("")},Q=e=>{var a;const t=[...A];t.splice(t.indexOf(e),1),j(t),null!==N&&void 0!==N&&null!==(a=N[I])&&void 0!==a&&a.includes(e)&&w([...b,e]),S(g,t)};return(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(r.A,{value:A,inputValue:V,onChange:(e,a)=>{if(k){const e=(a||[]).filter(e=>!(null!==A&&void 0!==A&&A.includes(e)));if(e.length>0)if(z){if(e.find(e=>null===R||void 0===R?void 0:R.includes((e||"").toString().trim()))){const a=e.find(e=>null===R||void 0===R?void 0:R.includes((e||"").toString().trim())),t=D||("features"===I?"defect":"feature");return(0,_.o)("".concat(a," is already added as ").concat(t),"warning"),void q("")}if(e.find(e=>!(null!==b&&void 0!==b&&b.includes((e||"").toString().trim()))))return(0,_.o)("Cannot add new parameters for uploaded model","error"),void q("")}else if(e.find(e=>null===R||void 0===R?void 0:R.includes((e||"").toString().trim()))){const a=e.find(e=>null===R||void 0===R?void 0:R.includes((e||"").toString().trim())),t=D||("features"===I?"defect":"feature");return(0,_.o)("".concat(a," is already added as ").concat(t),"warning"),void q("")}}j(a),S(g,a),q("")},onInputChange:(e,a)=>{q(a)},multiple:!0,id:"tags-filled",options:[],defaultValue:[],freeSolo:!0,disableClearable:!0,renderTags:()=>A.map((e,a)=>{if(void 0!==L&&a===L){const e=A.slice(L);return e.join(", "),(0,y.jsx)(l.A,{title:(0,y.jsx)(o.A,{sx:{display:"flex",flexWrap:"wrap",gap:"4px",padding:"4px",maxWidth:"260px"},children:e.map((e,a)=>(0,y.jsx)(d.A,{label:e,size:"small",className:"livis-autocomplete-parameter-".concat(I),sx:{height:"20px",fontSize:"11px","& .MuiChip-label":{padding:"0 6px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"120px"}}},a))}),arrow:!0,placement:"bottom",PopperProps:{modifiers:[{name:"preventOverflow",options:{boundary:"window"}},{name:"flip",options:{fallbackPlacements:["top","right","left"]}}]},children:(0,y.jsx)(d.A,{className:"livis-autocomplete-parameter-".concat(I," livis-chip-overflow"),label:"+".concat(e.length),size:"small",style:{cursor:"default",fontWeight:600}})},"overflow-chip")}if(void 0!==L&&a>L)return null;const t=void 0!==B&&e.length>B,i=t?(s=B,(n=e).length>s?"".concat(n.slice(0,s),"\u2026"):n):e;var n,s;const r=(0,y.jsx)(d.A,{className:"livis-autocomplete-parameter-".concat(I
1),label:i,onDelete:()=>Q(e),deleteIcon:(0,y.jsx)(m.A,{tabIndex:0,onKeyDown:a=>{"Enter"===a.key&&Q(e)}}),tabIndex:-1},"".concat(e,"-tag-").concat(a));return t?(0,y.jsx)(l.A,{title:e,arrow:!0,placement:"top",children:(0,y.jsx)("span",{style:{display:"inline-flex"},children:r})},"".concat(e,"-tag-").concat(a)):r}),tabIndex:-1,renderInput:e=>(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(c.A,(0,i.A)((0,i.A)({},e),{},{variant:"standard",margin:"normal",fullWidth:!0,label:t,type:"text",className:"livis-input-field-".concat(I),InputLabelProps:{className:"livis-input-field-component-label"},onChange:e=>{q(e.target.value)},inputProps:(0,i.A)((0,i.A)({},e.inputProps),{},{onKeyDown:e=>{"Enter"===e.key&&(()=>{const e=V.trim(),t={parameter:e};if((0,f.Q9)(!0),e.length>=1)if(k)if(z){if(null!==R&&void 0!==R&&R.includes(e)){const t=D||("features"===I?"defect":"feature");return void(0,_.o)("".concat(e," ").concat(a("is already added as")," ").concat(t),"warning")}if(!(null===b||void 0===b?void 0:b.includes(e)))return void(0,_.o)("".concat(a("Cannot add new parameters for uploaded model")),"error");$(e)}else(e=>e.split(",").map(e=>e.trim()).filter(e=>e.length>0))(e).forEach(e=>{$(e)});else $(e),(0,x.ND)(123),(0,h.sX)(t);else G("Please enter at least 1 character");w(null===N||void 0===N?void 0:N[I])})()}}),value:V})),(0,y.jsx)("small",{className:"livis-text-danger",children:U&&a("".concat(U))}),k&&z&&b.length>0&&(0,y.jsx)("div",{className:"livis-no-data-found-placeholder",children:a("Available Classes from the uploaded model")}),(0,y.jsxs)("div",{children:[null===b||void 0===b?void 0:b.map((e,a)=>(0,y.jsx)(u.A,{className:"livis-autocomplete-chip-btn",variant:"outlined",onClick:()=>$(e),children:(0,y.jsx)("span",{className:"livis-autocomplete-chip-btn-text",children:e})},"".concat(e,"-option-").concat(a+1))),!k&&!Y&&0===b.length&&(0,y.jsx)("div",{className:"livis-no-data-found-placeholder",children:a("Type Something To Show Recommendations")}),Y&&0===b.length&&(0,y.jsx)("div",{className:"livis-no-data-found-placeholder",children:a("No Suggestions Found")})]})]})})})};A.defaultProps={sugesstedParameters:[],type:"",disableApiFetch:!1,otherSelectedList:[],otherType:"",isCustomModelUpload:!1,maxVisibleChips:void 0,truncateAt:void 0};const j=A},40648(e,a,t){t.d(a,{A:()=>o});var i=t(81e3),n=t(90329),s=t(57604),l=t(70579);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(i.A,{className:"livis-auth-main",children:[(0,l.jsx)("div",{className:"livis-auth-header-wrap",children:(0,l.jsx)(n.A,{landing_page_props:e.landing_page_props})}),(0,l.jsx)("div",{className:"livis-main-body-wrap",children:e.children}),(0,l.jsx)("div",{className:"livis-main-footer-wrap",children:(0,l.jsx)(s.A,{})})]})})}},77582(e,a,t){t.d(a,{H:()=>n});var i=t(29465);const n=()=>{try{var e,a,t,n;const s=localStorage.getItem("livis_user_info");if(!s)return" | LIVIS";const l=JSON.parse(s),o=null===l||void 0===l?void 0:l.email;if(!o)return" | LIVIS";const d=null===(e=o.split("@"))||void 0===e||null===(a=e[1])||void 0===a||null===(t=a.split("."))||void 0===t||null===(n=t[0])||void 0===n?void 0:n.replace(/-/g," ");return d?" | "+(0,i.Wr)((0,i.JT)(d)):" | LIVIS"}catch(s){return" | LIVIS"}}},39860(e,a,t){t.r(a),t.d(a,{ClassBasedAugmentationRoutes:()=>q});var i=t(73216),n=t(60817),s=t(89379),l=t(5544),o=t(81e3),d=t(53193),r=t(72221),c=t(32143),u=t(68903),m=t(42518),v=t(67784),g=t(70856),p=t(21337),h=t(22932),f=t(65043),_=t(44978),x=t(8e3),y=t(80790),A=t(966),j=t(79456),b=t(14320),w=t(94730),S=t(70579);const I=e=>{const a=e.boundingElement,t=(0,f.useRef)(null),i=a.url,n=a.bounding_box;return console.log(n,"regions"),(0,f.useEffect)(()=>{const e=t.current;if(!e)return;if(!e.getContext("2d"))return;const a=new Image;a.src=i,a.onload=()=>{var t,i;const s=document.getElementsByClassName("livis-inference-canvas-wrap"),l=null===(t=s[0])||void 0===t?void 0:t.offsetWidth,o=null===(i=s[0])||void 0===i?void 0:i.offsetHeight;e.width=l,e.height=o;const d=e.getContext("2d");if(!d)return void console.error("Canvas context is not available.");const r=a.width,c=a.height;d.clearRect(0,0,e.width,e.height),d.fillStyle="#000",d.fillRect(0,0,e.width,e.height);let u=1;if(r>l||c>o){const e=l/r,a=o/c;u=Math.min(e,a)}const m=(l-r*u)/2,v=(o-c*u)/2;d.drawImage(a,m,v,r*u,c*u);for(let e=0;e<(null===n||void 0===n?void 0:n.length);e++){const a=n[e],t=a.x,i=a.y,s=a.w,l=a.h,o=a.cls,g=m+t*r*u,p=v+i*c*u,h=s*r*u,f=l*c*u;d.strokeStyle="#ff0000",d.strokeRect(g,p,h,f),d.fillStyle="#ff000030",d.fillRect(g,p,h,f),d.font="16px Arial",d.fillStyle="#ff0000",d.fillText(o,g,p-5)}}},[i,a]),(0,S.jsx)("div",{className:"livis-inference-canvas-wrap",children:(0,S.jsx)("canvas",{ref:t,className:"livis-testing-inference-result-image"})})};var N=t(40648),C=t(44980);const k=()=>{var e;const a=(0,f.useState)([]),t=(0,l.A)(a,2),n=t[0],k=t[1],E=(0,f.useState)([]),R=(0,l.A)(E,2),P=R[0],D=R[1],F=(0,f.useState)(["Feature 1","Feature 3"]),z=(0,l.A)(F,1)[0],L=(0,f.useState)(!1),B=(0,l.A)(L,2),O=B[0],W=B[1],V=(0,f.useState)(!1),q=(0,l.A)(V,2),M=q[0],T=q[1],U=(0,f.useState)(["Select a Process"]),G=(0,l.A)(U,2),H=G[0],K=G[1],Y=(0,f.useState)(""),X=(0,l.A)(Y,2),J=X[0],Z=X[1],$=(0,f.useState)([]),Q=(0,l.A)($,2),ee=Q[0],ae=Q[1],te=(0,f.useState)([]),ie=(0,l.A)(te,2),ne=ie[0],se=ie[1],le=(0,f.useState)(20),oe=(0,l.A)(le,2),de=oe[0],re=oe[1],ce=(0,f.useState)([]),ue=(0,l.A)(ce,2),me=ue[0],ve=ue[1],ge=(0,f.useState)(1),pe=(0,l.A)(ge,2),he=pe[0],fe=pe[1],_e=(0,f.useState)(0),xe=(0,l.A)(_e,2),ye=xe[0],Ae=xe[1],je=(0,f.useState)(0),be=(0,l.A)(je,2),we=be[0],Se=(be[1],(0,f.useState)([])),Ie=(0,l.A)(Se,2),Ne=Ie[0],Ce=Ie[1],ke=(0,f.useState)(!1),Ee=(0,l.A)(ke,2),Re=Ee[0],Pe=Ee[1],De=(0,f.useState)(""),Fe=(0,l.A)(De,2),ze=Fe[0],Le=Fe[1],Be=(0,f.useState)(!1),Oe=(0,l.A)(Be,2),We=Oe[0],Ve=Oe[1],qe=(0,f.useState)({}),Me=(0,l.A)(qe,2),Te=Me[0],Ue=Me[1],Ge=(0,j.wA)(),He=(0,i.Zp)(),Ke=(0,i.g)().marked,Ye=async(e,a)=>{var t,i,n;console.log("Setting form value for ".concat(e,":"),a),ae(a),ee[0]!=J&&ee.unshift(J);const s={limit_to:de,current:he,tags:ee},l=await y.p.post("synthetic_data/get_images_by_tags/",s);console.log("Response -------\x3e",null===l||void 0===l?void 0:l.data),se(null===l||void 0===l||null===(t=l.data)||void 0===t||null===(i=t.data)||void 0===i?void 0:i.images),ve(null===l||void 0===l||null===(n=l.data)||void 0===n?void 0:n.data)};(0,f.useEffect)(()=>{Ke||Xe()},[]);const Xe=async()=>{var e;const a=await y.p.get("synthetic_data/get_manufacturing_processes/");var t,i;(K(null===a||void 0===a||null===(e=a.data)||void 0===e?void 0:e.data),null!==a&&void 0!==a&&a.data.data)&&(Z(null===a||void 0===a||null===(t=a.data)||void 0===t?void 0:t.data[0]),Ge((0,b.hV)(null===a||void 0===a||null===(i=a.data)||void 0===i?void 0:i.data[0])))};(0,f.useEffect)(()=>{ee.length&&Ye("tags",ee),Ae(de*(he-1)+1)},[de,he]);const Je=()=>{Pe(!1),He("/app/class-based-augmentation/"),localStorage.removeItem("selectedImage"),localStorage.removeItem("partId"),localStorage.removeItem("count"),window.location.reload()}
1,Ze=e=>{var a,t,i,n;He("/app/class-based-augmentation/roi/"+(null===(a=ne[e])||void 0===a?void 0:a._id)+"/"+(null===(t=ne[e])||void 0===t?void 0:t.part_id)),localStorage.setItem("selectedImage",null===(i=ne[e])||void 0===i?void 0:i._id),localStorage.setItem("partId",null===(n=ne[e])||void 0===n?void 0:n.part_id)},$e=()=>{Ke&&(async()=>{var e,a,t;localStorage.setItem("count","1");const i=localStorage.getItem("selectedImage"),n={part_id:localStorage.getItem("partId"),image_document_id:i},s=await y.p.post("synthetic_data/get_synthetic_data/",n);200==(null===s||void 0===s?void 0:s.status)?(Ce(null===s||void 0===s||null===(e=s.data)||void 0===e||null===(a=e.data)||void 0===a?void 0:a.images_list),Pe(!0),console.log("reponse synthetic data",null===s||void 0===s||null===(t=s.data)||void 0===t?void 0:t.images_list)):(0,w.o)("".concat((0,_.t)("Error Fetching Images")),"Error")})(),console.log(Ke,"<<<<<<<<--------------------------")};(0,f.useEffect)(()=>{"1"!=localStorage.getItem("count")&&Ke&&localStorage.setItem("count","0"),"0"==localStorage.getItem("count")&&Ke&&window.location.reload(),$e()},[]);console.log("Response images -----------\x3e",ne);return(0,S.jsxs)(N.A,{landing_page_props:{livis_logo:"/image/icons/lincode_livis.svg",search_icon:"/image/icons/search.svg",livis_hamburger:"/image/icons/hamburger.svg",setting_icon:"/image/icons/settings.svg",setting_icon_bold:"/image/icons/settings_bold.svg",alert_icon:"/image/icons/alert.svg",alert_icon_bold:"/image/icons/alert_bold.svg",profile_icon:"/image/icons/profile.svg",intro_icon:"/image/misc/intro_icon.svg",page_title:"Inspection Station"},children:[(0,S.jsx)(o.A,{className:"livis-manage-user-header livis-manage-part-header livis-manage-data-header",children:(0,S.jsxs)(o.A,{className:"livis-manage-user-filters-wrap",display:"flex",alignItems:"center",children:[(0,S.jsx)(o.A,{className:"livis-manage-user-filters-wrap",children:(0,S.jsx)(d.A,{variant:"standard",children:(0,S.jsx)(r.A,{labelId:"demo-simple-select-standard-label",id:"demo-simple-select-standard",value:J,onChange:e=>{const a=e.target.value;Z(a),Ge((0,b.hV)(a))},IconComponent:e=>(0,S.jsx)(p.A,(0,s.A)({},e)),children:null===H||void 0===H?void 0:H.map((e,a)=>(0,S.jsx)(c.A,{className:"livis-menu-item",value:e,children:(0,_.t)(e)},"".concat(e,"-filter-").concat(a)))})})}),J&&(0,S.jsx)(o.A,{className:"livis-manage-user-filters-wrap",ml:2,children:(0,S.jsx)(h.A,{label_name:(0,_.t)("Tags"),name:"classes",list:n,setList:k,sugesstedParameters:P,setSugesstedParameters:D,set_form_value:Ye,type:"classes",defaultSuggestion:z})})]})}),(0,S.jsxs)("div",{className:"livis-manage-data-image-grid-sub-header",children:[(0,S.jsxs)(u.Ay,{className:"livis-manage-data-image-grid-sub-header-content",container:!0,justifyContent:"space-between",alignItems:"center",children:[(0,S.jsx)(u.Ay,{item:!0,xs:12,sm:6,md:5,lg:5,container:!0,justifyContent:"start",flexWrap:"wrap",children:(0,S.jsx)(g.s,{value:"all",onChange:()=>{},ariaLabel:"secondary tabs example",tabs:[{value:"all",label:(0,_.t)("All")}]})}),(0,S.jsx)(u.Ay,{item:!0,xs:12,sm:6,md:7,lg:7,container:!0,justifyContent:"end",flexWrap:"wrap",className:"livis-manage-data-sortby-pagination-wrap",children:(0,S.jsx)(C.m,{currentPage:he,pageLength:de,totalCount:(null===me||void 0===me?void 0:me.total)||0,startCount:ye,onPrev:()=>{he>1&&fe(he-1)},onNext:()=>{fe(he+1)},frequency:{value:de.toString(),onChange:e=>(e=>{const a=e.target.value;re(parseInt(a))})({target:{value:e}}),options:["20","50","100","200"]}})})]}),ne.length?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("p",{children:"All Images"}),(0,S.jsx)("div",{className:"livis-usecase-data livis-usecase-data-modifier",children:(0,S.jsx)("div",{className:"livis-usecase-cards-wrap livis-usecase-cards-wrap-modifier",children:(0,S.jsx)(u.Ay,{container:!0,className:"livis-usecase-card-wrap",children:ne.map((e,a)=>(0,S.jsx)(u.Ay,{item:!0,lg:2,md:3,sm:4,xs:6,className:"livis-manage-data-card-wrap",children:(0,S.jsx)("img",{src:null===e||void 0===e?void 0:e.file_url,className:"livis-part-data-card-thumbnail",onClick:()=>Ze(a)})},a))})})})]}):(0,S.jsx)(A.A,{})]}),(0,S.jsx)(x.Ay,{modal_open:O||M,size:"medium",title:(0,_.t)("Class Based Augmentation"),disable_outside_click:!0,cancel_icon:!0,animation_type:"slideup",livis_dismiss_btn:Je,children:(0,S.jsxs)("div",{className:"livis-class-based-augmentation-modal-content",children:[(0,S.jsxs)(o.A,{className:"livis-testing-inference-result-image-container livis-class-based-augmentation-image-container",children:[(0,S.jsx)("img",{src:null===(e=ne[we])||void 0===e?void 0:e.file_url,alt:"ROI",className:"livis-part-data-card-thumbnail livis-class-based-augmentation-response-image"}),!M&&(0,S.jsx)(m.A,{variant:"contained",size:"medium",className:"livis-modal-btn-round livis-inference-annotate-icon",onClick:()=>Ze(we),style:{position:"absolute",bottom:"10px",right:"10px"},children:(0,_.t)("Mark ROI")})]}),(0,S.jsxs)(o.A,{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"flex-end",alignItems:"flex-end"},children:[(0,S.jsx)(v.A,{id:"outlined-basic",variant:"outlined",placeholder:"Enter the number of images needed ?",style:{width:"80%",marginBottom:"1rem"}}),(0,S.jsx)(m.A,{variant:"contained",size:"medium",className:"livis-modal-btn-round livis-inference-annotate-icon",onClick:()=>{W(!1),He("/class-based-augmentation"),T(!1)},disabled:!M,children:(0,_.t)("Generate Images")})]})]})}),(0,S.jsx)(x.Ay,{modal_open:Re,size:"medium",title:(0,_.t)("Synthetic Images"),disable_outside_click:!0,cancel_icon:!0,animation_type:"slideup",livis_dismiss_btn:Je,livis_modal_class:"livis-synthetic-augmentation-modal",children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"livis-usecase-data",style:{height:"90%",overflowY:"auto"},children:(0,S.jsx)("div",{className:"livis-usecase-cards-wrap",style:{height:"70vh",overflowY:"auto",overflowX:"hidden",paddingRight:"1rem"},children:(0,S.jsx)(u.Ay,{container:!0,className:"livis-usecase-card-wrap",children:null===Ne||void 0===Ne?void 0:Ne.map((e,a)=>
1(0,S.jsx)(u.Ay,{item:!0,lg:4,md:3,sm:4,xs:6,className:"livis-manage-data-card-wrap",children:(0,S.jsx)("img",{src:null===e||void 0===e?void 0:e.file_url,className:"livis-part-data-card-thumbnail",onClick:()=>((e,a)=>{Le(e),Ve(!0),console.log(a,"boxes");const t=a.map(e=>({x:e.x,y:e.y,w:e.w,h:e.h,cls:e.cls,color:e.color}));console.log("newBoxes",t),Ue(t)})(null===e||void 0===e?void 0:e.file_url,null===e||void 0===e?void 0:e.annotation_detection)})},a))})})}),(0,S.jsxs)(u.Ay,{container:!0,justifyContent:"flex-end",className:"livis-part-manage-data-augmentation-container",children:[(0,S.jsx)(m.A,{variant:"outlined",style:{borderColor:"#1a26c1",color:"#1a26c1"},size:"medium",className:"livis-modal-btn-round livis-modal-cancel-close-btn",onClick:Je,children:(0,_.t)("Cancel")}),(0,S.jsx)(m.A,{size:"medium",style:{backgroundColor:"#1a26c1"},variant:"contained",className:"livis-modal-btn-round livis-modal-cancel-close-btn",onClick:async()=>{console.log("Download");await y.p.get("")},children:(0,_.t)("Download")})]})]})}),ze?(0,S.jsx)(x.Ay,{modal_open:We,size:"medium",title:"Synthetic Image",disable_outside_click:!0,cancel_icon:!0,animation_type:"slideup",livis_dismiss_btn:()=>{Ve(!1)},children:(0,S.jsx)(o.A,{className:"livis-testing-inference-result-image-container",children:(0,S.jsx)(I,{boundingElement:{url:ze,bounding_box:Te}})})}):null]})};var E=t(74117),R=t(57686),P=t(90889),D=t(69570),F=t(40710),z=t(51962),L=t(85865),B=t(36930),O=t(29465),W=t(86988);t(18382),t(77582);const V=()=>{var e,a,t;console.log("Came here......................");const n=(0,i.Zp)(),d=(0,E.Bd)().t,r=(0,i.g)(),m=r.part_id,g=r.image_id,h=m.replace(":",""),_=g.replace(":",""),A=(0,f.useState)(""),I=(0,l.A)(A,2),C=(I[0],I[1]),k=(0,f.useState)({}),V=(0,l.A)(k,2),q=V[0],M=V[1],T=(0,f.useState)([]),U=(0,l.A)(T,2),G=U[0],H=U[1],K=(0,f.useState)({current_image_index:0,total_images:1}),Y=(0,l.A)(K,2),X=(Y[0],Y[1],(0,f.useState)("")),J=(0,l.A)(X,2),Z=J[0],$=J[1],Q=(0,j.d4)(e=>e.processNameReducer),ee=(0,f.useState)([]),ae=(0,l.A)(ee,2),te=ae[0],ie=ae[1],ne=(0,f.useState)([]),se=(0,l.A)(ne,2),le=se[0],oe=se[1],de=(0,f.useState)(!1),re=(0,l.A)(de,2),ce=re[0],ue=re[1],me=(0,f.useState)([]),ve=(0,l.A)(me,2),ge=ve[0],pe=ve[1],he=(0,f.useState)(!0),fe=(0,l.A)(he,2),_e=fe[0],xe=fe[1],ye=(0,f.useState)([]),Ae=(0,l.A)(ye,2),je=Ae[0],be=Ae[1],we=(0,f.useState)(!1),Se=(0,l.A)(we,2),Ie=Se[0],Ne=Se[1],Ce=(0,f.useState)(!1),ke=(0,l.A)(Ce,2),Ee=(ke[0],ke[1],(0,f.useState)([])),Re=(0,l.A)(Ee,2),Pe=(Re[0],Re[1],(0,f.useState)([])),De=(0,l.A)(Pe,2),Fe=(De[0],De[1],(0,f.useState)(!1)),ze=(0,l.A)(Fe,2),Le=(ze[0],ze[1],(0,f.useState)(!1)),Be=(0,l.A)(Le,2),Oe=Be[0],We=Be[1],Ve=((0,E.Bd)().i18n,(0,j.wA)()),qe=(0,f.useState)(0),Me=(0,l.A)(qe,2),Te=Me[0],Ue=Me[1];(0,f.useEffect)(()=>{(0,O.ND)(52)?((async()=>{try{var e,a,t,i,n,l,o;const c=await(0,R.aK)(h,_),u=null===c||void 0===c||null===(e=c.data)||void 0===e||null===(a=e.data)||void 0===a?void 0:a.file_url;var d,r;null!==c&&void 0!==c&&null!==(t=c.data)&&void 0!==t&&null!==(i=t.data)&&void 0!==i&&i.annotation_detection&&Ue(null===c||void 0===c||null===(d=c.data)||void 0===d||null===(r=d.data)||void 0===r?void 0:r.annotation_detection.length);let m={};m.annotation=null===c||void 0===c||null===(n=c.data)||void 0===n||null===(l=n.data)||void 0===l||null===(o=l.annotation_detection)||void 0===o?void 0:o.map(e=>{const a=parseFloat(e.x),t=parseFloat(e.y),i=parseFloat(e.w),n=parseFloat(e.h),s=a+i/2,l=t+n/2;return{classification:e.cls,color:e.color,centerX:s,centerY:l,width:i,height:n,regionType:"bounding-box"}}),H([(0,s.A)((0,s.A)({},m),{},{imageUrl:u})]),console.log(m,"temp_data"),u?$(u):console.error("Image URL not found in the response")}catch(c){console.error("Error fetching the image URL:",c)}})(),(async()=>{var e;const a={part_id:h,process_name:Q,image_document_id:_},t=await y.p.post("/synthetic_data/get_defect_library_and_part_defects/",a);console.log(t),ie(null===t||void 0===t||null===(e=t.data)||void 0===e?void 0:e.data)})()):(0,w.o)(d("You do not have access to this page. Please contact your administrator."),"warning")},[]);(0,f.useEffect)(()=>{1==(null===je||void 0===je?void 0:je.is_completed)&&n("/app/class-based-augmentation/marked")},[je]),(0,f.useEffect)(()=>
1{if(Z){const e={imageUrl:decodeURIComponent(Z),annotation:[]};H([e])}},[Z]),(0,f.useEffect)(()=>{if(G&&G.length>0){const e=document.getElementById("udt");console.log(G,"part Details"),window.UniversalDataTool.open({container:e,udt:{interface:{type:"image_segmentation",labels:["ROI"]},samples:G},onSaveSample:e=>{M(e),We(!0),console.log("Output ------------\x3e",e)},onExit:e=>{C("go-to-next"===e?"next":"go-to-previous"===e?"prev":"save")}})}},[G]);(0,f.useEffect)(()=>{var e;null!==te&&void 0!==te&&null!==(e=te.defect_library_list)&&void 0!==e&&e.length&&oe(new Array(te.defect_library_list.length).fill(!1))},[te]),(0,f.useEffect)(()=>{var e;null!==q&&void 0!==q&&null!==(e=q.annotation)&&void 0!==e&&e.length&&h&&_&&Q&&(null===ge||void 0===ge?void 0:ge.length)>0?ue(!0):ue(!1)},[q,ge]);const Ge=e=>{const a=e.target,t=a.name,i=a.value;pe(e=>e.map(e=>e.defect_class_name===t?(0,s.A)((0,s.A)({},e),{},{actual_part_class_name:i}):e))},He=e=>{const a=e.target,t=a.name,i=a.value;if(!/^\d*$/.test(i)||parseInt(i)<1||parseInt(i)>20)return xe(!1),void(0,w.o)("".concat(d("No of Images to generate needs to be lesser than or equal to 20")),"error");xe(!0);const n=ge.findIndex(e=>e.defect_class_name===t);-1!==n&&pe(e=>{const a=[...e];return a[n]=(0,s.A)((0,s.A)({},a[n]),{},{no_of_imgs_to_generate:parseInt(i)}),a})},Ke=e=>{const a=e.target,t=a.name,i=a.value;if(!/^\d*$/.test(i)||parseInt(i)<1)return void xe(!1);xe(!0);const n=ge.findIndex(e=>e.defect_class_name===t);-1!==n&&pe(e=>{const a=[...e];return a[n]=(0,s.A)((0,s.A)({},a[n]),{},{max_defect_per_image:parseInt(i)}),a})};console.log(je,"Synthetic data");return(0,f.useEffect)(()=>{const e=ge.some(e=>""===e.actual_part_class_name.trim()||e.no_of_imgs_to_generate<=0||e.max_defect_per_image<=0);le.includes(!0)&&!e&&Oe?ue(!0):ue(!1)},[ge,le,Oe]),(0,S.jsx)(N.A,{landing_page_props:{livis_logo:"/image/icons/lincode_livis.svg",search_icon:"/image/icons/search.svg",livis_hamburger:"/image/icons/hamburger.svg",setting_icon:"/image/icons/settings.svg",setting_icon_bold:"/image/icons/settings_bold.svg",alert_icon:"/image/icons/alert.svg",alert_icon_bold:"/image/icons/alert_bold.svg",profile_icon:"/image/icons/profile.svg",intro_icon:"/image/misc/intro_icon.svg",page_title:"Inspection Station"},children:(0,S.jsxs)(u.Ay,{container:!0,children:[(0,S.jsx)(u.Ay,{item:!0,lg:6.1,md:8,sm:12,xs:12,height:"100vh",children:(0,S.jsx)("div",{id:"udt",className:"livis-annoatate-new-udt",style:{height:"100vh"}})}),(0,S.jsxs)(u.Ay,{container:!0,lg:5.9,md:4,sm:12,xs:12,alignContent:"flex-start",paddingBlock:"0.75rem",paddingInline:"0.5rem",spacing:1,children:[(0,S.jsx)(u.Ay,{item:!0,lg:12,md:12,sm:6,xs:12,className:"livis-synthetic-data-parameters-wrap",children:(0,S.jsx)("div",{className:"livis-operator-panel-info-wrap livis-reports-panel-preivew-info-wrap livis-add-parameter-bl-accordian-wrap livis-annotation-info-wrap ",children:(0,S.jsxs)("div",{className:"livis-operator-panel-accordian-wrap livis-reports-preivew-accordian-wrap livis-define-bl-accordian-wrap",children:[(0,S.jsx)(W.A,{label:"Generate Data",livis_click_function:async()=>{var e;const a=null===q||void 0===q?void 0:q.annotation,t=(null===a||void 0===a?void 0:a.slice(Te,null===a||void 0===a?void 0:a.length))||[];console.log("annotation count",Te),console.log("annotation output",a),console.log("ROI data",t);const i=t.map(e=>({x:e.centerX-e.width/2,y:e.centerY-e.height/2,w:e.width,h:e.height})),n={part_id:h,image_document_id:_,manufacturing_process:Q,region_of_interest:i,defect_library_mapping:ge};let s=!1;if(null===n||void 0===n||null===(e=n.defect_library_mapping)||void 0===e||e.map(e=>(null===e||void 0===e?void 0:e.max_defect_per_image)<3||e.max_defect_per_image>5?((0,w.o)("".concat(d("Max Defects per image needs to be greater than or equal to 3 and less than or equal to 5")),"error"),void(s=!0)):(null===e||void 0===e?void 0:e.no_of_imgs_to_generate)>20?((0,w.o)("".concat(d("No of Images to generate needs to be lesser than or equal to 20")),"error"),void(s=!0)):void 0),console.log(s,"payload"),!s){Ve((0,b.AH)(!0));const e=await y.p.post("synthetic_data/update_augmentation_per_image_configurations_and_roi/",n);200!=(null===e||void 0===e?void 0:e.status)&&((0,w.o)("".concat(d("Error in generating synthetic data")),"error"),Ve((0,b.AH)(!1))),200==(null===e||void 0===e?void 0:e.status)&&((async()=>{document.getElementById("udt").style.display="none";let e=null;const a=async()=>{var a,t,i;const n={part_id:h,image_document_id:_},s=await y.p.post("synthetic_data/get_synthetic_data_updates/",n);if(200!=(null===s||void 0===s?void 0:s.status))return(0,w.o)("".concat(d("Error in generating synthetic data")),"error"),clearInterval(e),void(document.getElementById("udt").style.display="visible");Ne(!0),be(null===s||void 0===s||null===(a=s.data)||void 0===a?void 0:a.data),null!==s&&void 0!==s&&null!==(t=s.data)&&void 0!==t&&null!==(i=t.data)&&void 0!==i&&i.is_completed&&(clearInterval(e),Ne(!1))};e=setInterval(a,5e3),a()})(),Ve((0,b.AH)(!1)))}},disabled:!ce||!_e}),(0,S.jsxs)(P.A,{expanded:!0,children:[(0,S.jsx)(D.A,{expandIcon:(0,S.jsx)(p.A,{}),"aria-controls":"panel1a-content",id:"panel1a-header",className:"livis-annotation-inso-accoridan-summary",children:(0,S.jsx)(o.A,{className:"livis-add-part-parameter-select-defect-feature-heading livis-add-part-parameter-bl-heading",children:d("Synthetic Data Generation Parameters")})}),(0,S.jsx)(F.A,{children:(0,S.jsxs)(u.Ay,{container:!0,spacing:2,children:[(null===te||void 0===te||null===(e=te.defect_library_list)||void 0===e?void 0:e.length)>0?(null===te||void 0===te||null===(a=te.defects_per_part_list)||void 0===a?void 0:a.length)>0?null===te||void 0===te||null===(t=te.defect_library_list)||void 0===t?void 0:t.map((e,a)=>{var t,i;return(0,S.jsxs)(u.Ay,{item:!0,xs:12,container:!0,spacing:2,className:"livis-synthetic-data-parameters-input",children:[(0,S.jsxs)(u.Ay,{item:!0,xs:12,container:!0,children:[(0,S.jsx)(u.Ay,{item:!0,mr:2,children:(0,S.jsx)(z.A,{onChange:()=>(e=>{const a=te.defect_library_list[e],t=le.map((a,t)=>t===e?!a:a);oe(t),t[e]?ge.some(e=>e.defect_class_name===a)||pe(e=>[...e,{defect_class_name:a,actual_part_class_name:"",no_of_imgs_to_generate:0,max_defect_per_image:0}]):(pe(e=>e.filter(e=>e.defect_class_name!==a)),document.querySelectorAll('[name="'.concat(a,'"]')).forEac
1h(e=>{e.value=""})),ue(t.includes(!0))})(a),checked:le[a]})}),(0,S.jsxs)(u.Ay,{item:!0,xs:5,container:!0,alignItems:"start",justifyContent:"start",flexDirection:"column",children:[(0,S.jsx)(L.A,{variant:"body2",children:"Library Class Name"}),(0,S.jsx)(L.A,{variant:"body2",sx:{whiteSpace:"nowrap",marginRight:2},className:"livis-dashboard-top-values-pie-text",children:(0,S.jsxs)("strong",{children:[" ",(0,O.JT)(e.replace(/_/g," "))]})})]}),(0,S.jsxs)(u.Ay,{item:!0,xs:6,alignItems:"start",justifyContent:"start",flexDirection:"column",className:"livis-synthetic-data-text-field-wrap",children:[(0,S.jsx)(L.A,{variant:"body2",children:"Part Class Name"}),(0,S.jsx)(v.A,{select:!0,fullWidth:!0,size:"small",disabled:!le[a],onChange:Ge,style:{width:"8rem"},value:(null===(t=ge.find(a=>a.defect_class_name===e))||void 0===t?void 0:t.actual_part_class_name)||"",name:e,sx:{borderRadius:2,"& .MuiOutlinedInput-root":{borderRadius:2}},children:null===te||void 0===te||null===(i=te.defects_per_part_list)||void 0===i?void 0:i.map(e=>(0,S.jsx)(c.A,{value:e,style:{padding:"4px"},children:e},e))})]})]}),(0,S.jsxs)(u.Ay,{item:!0,xs:12,container:!0,alignItems:"center",className:"livis-synthetic-data-image-inputs",children:[(0,S.jsx)(u.Ay,{item:!0,xs:8,justifyContent:"center",children:(0,S.jsx)(L.A,{variant:"body2",children:"No. of Images to generate"})}),(0,S.jsx)(u.Ay,{item:!0,xs:4,children:(0,S.jsx)(v.A,{size:"small",fullWidth:!0,disabled:!le[a],onChange:He,name:e,inputProps:{style:{textAlign:"center"}},sx:{borderRadius:2,"& .MuiOutlinedInput-root":{borderRadius:2}}})})]}),(0,S.jsxs)(u.Ay,{item:!0,xs:12,container:!0,alignItems:"center",className:"livis-synthetic-data-image-inputs",children:[(0,S.jsx)(u.Ay,{item:!0,xs:8,children:(0,S.jsx)(L.A,{variant:"body2",className:"livis-dashboard-top-values-pie-text",children:"Maximum defects per image"})}),(0,S.jsx)(u.Ay,{item:!0,xs:4,children:(0,S.jsx)(v.A,{size:"small",fullWidth:!0,disabled:!le[a],name:e,onChange:Ke,inputProps:{style:{textAlign:"center"}},sx:{borderRadius:2,"& .MuiOutlinedInput-root":{borderRadius:2}}})})]})]},a)}):(0,S.jsx)(u.Ay,{item:!0,xs:12,children:(0,S.jsx)(L.A,{variant:"body1",color:"error",children:"Given image does not have any defects"})}):(0,S.jsx)(u.Ay,{item:!0,xs:12,children:(0,S.jsx)(L.A,{variant:"body1",color:"error",children:"No defect library available for this part"})}),!_e&&(0,S.jsx)(u.Ay,{item:!0,xs:12,textAlign:"center",children:(0,S.jsx)(L.A,{color:"error",variant:"body2",children:"* Number of images should be between 1 and 20."})})]})})]})]})})}),1!=(null===je||void 0===je?void 0:je.is_completed)?(0,S.jsx)(x.Ay,{size:"small",animation_type:"slideup",modal_open:Ie,title:"".concat(d("Generating Synthetic Images")),disable_outside_click:!0,children:(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)("div",{className:"livis-augmentation-data-generating-progress-container",style:{zIndex:1e12},children:[(0,S.jsxs)("div",{className:"livis-augmentation-progress-details",children:[(0,S.jsx)("div",{className:"livis-augmentation-progress-details-wrap",children:(0,S.jsx)("span",{children:"Generating Images"})}),(0,S.jsxs)("div",{className:"livis-augmentation-progress-percentage",children:[null!==je&&void 0!==je&&je.total_images&&null!==je&&void 0!==je&&je.images_generated?parseInt((null===je||void 0===je?void 0:je.images_generated)/(null===je||void 0===je?void 0:je.total_images)*100):0,"%"]})]}),(0,S.jsx)("div",{className:"livis-augmentation-progress-bar",children:(0,S.jsx)("div",{className:"livis-augmentation-progress-bar",children:(0,S.jsx)(B.A,{variant:"determinate",color:"primary",value:null!==je&&void 0!==je&&je.total_images&&null!==je&&void 0!==je&&je.images_generated?(null===je||void 0===je?void 0:je.images_generated)/(null===je||void 0===je?void 0:je.total_images)*100:0})})}),(0,S.jsxs)("div",{className:"livis-augmentation-progress-message",children:[d("Please wait while LIVIS generates the synthetic data needed for your model"),"..."]})]})})}):null]})]})})},q=()=>(0,S.jsxs)(i.BV,{children:[(0,S.jsx)(i.qh,{path:"/",element:(0,S.jsx)(k,{})}),(0,S.jsx)(i.qh,{path:"/:marked",element:(0,S.jsx)(k,{})}),(0,S.jsx)(i.qh,{path:"/roi",element:(0,S.jsx)(V,{})}),(0,S.jsx)(i.qh,{path:"/roi/:image_id/:part_id",element:(0,S.jsx)(V,{})}),(0,S.jsx)(i.qh,{path:"*",element:(0,S.jsx)(n.M,{})})]})},57686(e,a,t){t.d(a,{WK:()=>s,aK:()=>n,bi:()=>l,h9:()=>o});var i=t(80790);const n=(e,a,t)=>i.p.get("annotate/get_img/?part_id=".concat(e,"&file_id=").concat(a,"&bucket_type=").concat(t)),s=e=>i.p.post("annotate/submit_annotations/",e),l=(e,a,t)=>i.p.get("annotate/next_img/?part_id=".concat(e,"&file_id=").concat(a,"&bucket_type=").concat(t)),o=(e,a,t)=>i.p.get("annotate/prev_img/?part_id=".concat(e,"&file_id=").concat(a,"&bucket_type=").concat(t))}}]);
2//# sourceMappingURL=9860.3b6e372b.chunk.js.map

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