(self.webpackChunkpp_label_frontend=self.webpackChunkpp_label_frontend||[]).push([[672],{41435:function(B,P,e){"use strict";e.d(P,{Z:function(){return _}});var E=e(94663),m=e(80112);function M(c){return Function.toString.call(c).indexOf("[native code]")!==-1}var O=e(18597);function s(c,a,u){return(0,O.Z)()?s=Reflect.construct:s=function(r,d,p){var g=[null];g.push.apply(g,d);var j=Function.bind.apply(r,g),h=new j;return p&&(0,m.Z)(h,p.prototype),h},s.apply(null,arguments)}function _(c){var a=typeof Map=="function"?new Map:void 0;return _=function(o){if(o===null||!M(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(o))return a.get(o);a.set(o,r)}function r(){return s(o,arguments,(0,E.Z)(this).constructor)}return r.prototype=Object.create(o.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,m.Z)(r,o)},_(c)}},73199:function(){},10137:function(B,P,e){"use strict";var E=e(34669),m=e(54458),M=e(67294),O=e(47704),s=e(85893),_=function(a){var u,o,r=(0,O.Ad)("pages.toolBar.progress");return(0,s.jsxs)("div",{className:"progress",children:[(0,s.jsx)(m.Z,{className:"progressBar",percent:Math.ceil(a.project.finished/((u=a.task.all)===null||u===void 0?void 0:u.length)*100),status:"active",showInfo:!1})," ",(0,s.jsx)("span",{className:"progressDesc",children:"".concat(r(""),": ").concat(a.project.finished||0,"/").concat((o=a.task.all)===null||o===void 0?void 0:o.length,`
        `).concat(r("currentId"),": ").concat(a.task.currIdx==null?1:a.task.currIdx+1," ")})]})};P.Z=_},29214:function(B,P,e){"use strict";e.r(P);var E=e(11849),m=e(20228),M=e(11382),O=e(34792),s=e(48086),_=e(91220),c=e(67294),a=e(48971),u=e(73199),o=e.n(u),r=e(8088),d=e(61541),p=e(44434),g=e(5041),j=e(57436),h=e(10137),R=e(47704),t=e(85893),K=function(){var l=(0,R.$L)(c.useState,c.useEffect,{label:{oneHot:!1,postSelect:S},tool:{defaultTool:"mover"},effectTrigger:{postTaskChange:k,postProjectChanged:Z}}),T=l.tool,b=l.loading,A=l.scale,D=l.annotation,I=l.task,y=l.data,L=l.project,i=l.label,U=l.refreshVar,f=(0,R.Ad)("pages.toolBar");function Z(){var n;((n=L.curr)===null||n===void 0?void 0:n.labelFormat)=="single_class"&&i.setOneHot(!0)}function S(n,v){if(console.log("selectLabel",n),v.has(n.labelId))i.isOneHot&&D.clear(),D.create({taskId:I.curr.taskId,labelId:n.labelId,dataId:y.curr.dataId});else{var N=D.all.filter(function(x){return x.labelId==n.labelId}),C=(0,_.Z)(N),W;try{for(C.s();!(W=C.n()).done;){var $=W.value;D.remove($.annotationId)}}catch(x){C.e(x)}finally{C.f()}}}function k(n,v){b.setCurr(!0),!(!n||!v)&&(i.initActive(v),b.setCurr(!1))}return(0,t.jsxs)(r.Z,{className:o().classes,children:[(0,t.jsxs)(p.Z,{children:[(0,t.jsx)(d.Z,{imgSrc:"./pics/buttons/zoom_in.png",onClick:function(){A.change(.1)},children:f("zoomIn")}),(0,t.jsx)(d.Z,{imgSrc:"./pics/buttons/zoom_out.png",onClick:function(){A.change(-.1)},children:f("zoomOut")}),(0,t.jsx)(d.Z,{imgSrc:"./pics/buttons/save.png",onClick:function(){s.default.success(f("autoSave"))},children:f("save")}),(0,t.jsx)(d.Z,{imgSrc:"./pics/buttons/move.png",active:T.curr=="mover",onClick:function(){T.setCurr("mover")},children:f("move")})]}),(0,t.jsx)("div",{id:"dr",className:"mainStage",children:(0,t.jsxs)(M.Z,{tip:"loading",spinning:b.curr,children:[(0,t.jsx)("div",{className:"draw",children:(0,t.jsx)(j.Z,{scale:A.curr,currentTool:T.curr,setCurrentAnnotation:function(){},onAnnotationModify:function(){},onAnnotationModifyComplete:function(){},imgSrc:y.imgSrc})}),(0,t.jsx)("div",{className:"pblock",children:(0,t.jsx)(h.Z,{task:I,project:L})}),(0,t.jsx)("div",{className:"prevTask",onClick:I.prevTask}),(0,t.jsx)("div",{className:"nextTask",onClick:I.nextTask})]})}),(0,t.jsx)(p.Z,{disLoc:"right",children:(0,t.jsx)(d.Z,{imgSrc:"./pics/buttons/data_division.png",onClick:function(){a.m8.push("/project_overview?projectId=".concat(L.curr.projectId))},children:f("projectOverview")})}),(0,t.jsx)("div",{className:"rightSideBar",children:(0,t.jsx)(g.Z,{labels:i.all,activeIds:i.activeIds,onLabelSelect:i.onSelect,onLabelAdd:function(v){return i.create((0,E.Z)((0,E.Z)({},v),{},{projectId:L.curr.projectId}))},onLabelDelete:i.remove,onLabelModify:function(){},hideColorPicker:!0,hideEye:!0,refresh:U})})]})};P.default=K}}]);
