1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[191],{1998:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/odkrivanje-koreferencnosti",function(){return t(401)}])},6250:function(e,n,t){"use strict";t.d(n,{Z:function(){return i}});var r=t(5893),a=t(7814),o=t(9417),s=t(2444);function i(e){var n=e.title,t=e.children,i=e.handleClose,c=(0,s.$G)(["common"]).t;return(0,r.jsxs)("div",{className:"fixed z-[9999] w-[540px] max-w-[90%] top-1/2 -translate-y-1/2 left-0 right-0 mx-auto rounded-3xl overflow-hidden shadow-[0_4px_40px_rgba(0,0,0,0.2)]",children:[(0,r.jsxs)("button",{className:"absolute text-3xl text-gray-700 top-4 right-6",onClick:i,children:[(0,r.jsx)("span",{className:"sr-only",children:c("common:close")}),"\xd7"]}),(0,r.jsxs)("div",{className:"max-h-[600px] pt-11 pb-6 px-4 md:px-8 lg:px-16 overflow-y-scroll bg-gray-300 text-gray-700 text-center",children:[(0,r.jsx)(a.G,{icon:o.ik8,className:"text-red text-6xl mb-3"}),(0,r.jsx)("p",{className:"font-bold text-red text-2xl mb-3",children:n||c("common:error")}),(0,r.jsx)("p",{className:"leading-tight",children:t})]}),(0,r.jsx)("div",{className:"bg-white text-center py-5",children:(0,r.jsx)("button",{onClick:i,className:"py-2.5 px-16 rounded-md bg-primary shadow-[0_4px_4px_rgba(0,0,0,0.12)] text-white",children:c("common:ok")})})]})}},791:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});var r=t(5893);function a(e){var n=e.min,t=e.max,a=e.step,o=e.label,s=e.value,i=e.onValueChange,c=e.disabled,l=void 0!==c&&c;return(0,r.jsxs)("div",{className:"md:flex items-center",children:[(0,r.jsx)("label",{className:"text-gray-700 shrink-0",htmlFor:"range",children:o}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("input",{className:"mt-2 md:mt-0 md:ml-2 range lg:max-w-[150px] 2xl:max-w-[200px]",type:"range",min:n,max:t,disabled:l,value:s,onChange:i,step:a}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:s})]})]})}},4953:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(5893),a=t(7814),o=t(4288),s=t(9417),i=t(7294),c=t(2444);function l(e){var n=e.text,t=e.placeholder,l=e.onTextChange,u=e.customClass,d=void 0===u?"":u,h=e.id,m=void 0===h?"textarea":h,f=e.maxLength,x=void 0===f?void 0:f,p=e.showCopyBtn,g=void 0!==p&&p,v=e.onClear,b=void 0===v?null:v,y=e.onShowExample,j=void 0===y?null:y,N=(0,i.useState)(!1),w=N[0],k=N[1],C=(0,c.$G)(["common","wsd"]).t;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"grow w-full flex items-stretch relative",children:[n&&b&&(0,r.jsx)("button",{className:"absolute top-1 right-3 text-gray-600 text-2xl",onClick:b,children:"\xd7"}),(0,r.jsx)("textarea",{id:m,className:"".concat(d," resize-none w-full border border-gray-400 ").concat(j||x||g?"px-5 pt-5 pb-8":"p-5"," text-gray-700 placeholder:text-gray-700/50 focus:outline-none focus:ring focus:ring-gray-400 transition duration-300 focus:ease-in"),placeholder:t,autoComplete:"off",maxLength:x,value:n,onChange:l,readOnly:!l}),(0,r.jsxs)("div",{className:"absolute bg-white bottom-[1px] left-5 right-3 pb-1 flex items-center space-x-3",children:[(0,r.jsx)("div",{className:"grow",children:j&&(0,r.jsx)("button",{className:"text-gray-500 text-xs hover:underline",onClick:j,children:C("common:example-text")})}),x&&(0,r.jsxs)("span",{className:"text-gray-700/50",children:[n.length,"/",x]}),g&&(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("button",{onClick:function(){navigator.clipboard.writeText(n),k(!0),setTimeout((function(){return k(!1)}),1500)},children:[(0,r.jsx)("span",{className:"sr-only",children:C(w?"common:copied":"common:copy")}),(0,r.jsx)(a.G,{icon:w?s.LEp:o.kZ_})]})})]})]})})}},401:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return p},default:function(){return g}});var r=t(797),a=t(5893),o=t(7294),s=t(9008),i=t.n(s),c=t(6250),l=t(4953),u=t(7814),d=t(9417),h=t(791),m=t(2023),f=t.n(m),x=t(2444),p=!0;function g(){var e=function(e){var n=e.mentions,t=e.coreferences.reduce((function(e,n){var t=e.findIndex((function(e){return e.includes(n.id1)||e.includes(n.id2)}));return t>=0?(e[t].includes(n.id1)&&e[t].push(n.id2),e[t].includes(n.id2)&&e[t].push(n.id1)):e.push([n.id1,n.id2]),e}),[]),a=["#69BEF9","#FFB700","#F9776F","#94C9A9","#cff4b0","#4ed263","#9eadb5","#c8c8c8","#FB62C5","#A86B6B","#c40000"];t.length>a.length&&(a=(0,r.Z)(a).concat((0,r.Z)(f()({count:t.length-a.length,format:"hex"}
1))));var o=n.reduce((function(e,n){var o=e.length?e[e.length-1]:w,s=o.indexOf(n.text),i=s+n.text.length,c=t.findIndex((function(e){return e.includes(n.id)}));return c<0&&(t.push([n.id]),c=t.length-1,t.length>a.length&&(a=(0,r.Z)(a).concat((0,r.Z)(f()({count:t.length-a.length,format:"hex"}))))),e.pop(),e.push(o.substring(0,s)),e.push('<mark id="mention'.concat(n.id,'" data-chain="').concat(c,'" style="background-color: ').concat(a[c],'; transition: opacity 400ms ease-out">').concat(n.text,' <span class="tag" style="background-color: rgba(255, 255, 255, 0.7); color: #000;">').concat(n.ner_type,"</span></mark>")),e.push(o.substring(i)),e}),[]);F.current.innerHTML+='<div id="sentence" class="sentence wrapped">'.concat(o.join(" "),"</div>");var s=document.getElementById("sentence");s.querySelectorAll("mark").forEach((function(e){var n=e.getAttribute("data-chain"),t=s.querySelectorAll('mark:not([data-chain="'.concat(n,'"])'));e.addEventListener("mouseover",(function(){t.forEach((function(e){e.style.opacity="0.2"}))})),e.addEventListener("mouseout",(function(){t.forEach((function(e){e.style.opacity="1.0"}))}))}))},n=(0,x.$G)(["common","coref"]).t,t=(0,o.useState)(!1),s=t[0],m=t[1],p=(0,o.useState)(!1),g=p[0],v=p[1],b=(0,o.useState)(""),y=b[0],j=b[1],N=(0,o.useState)("Janez Novak je \u0161el v avtomobilski salon, kjer je presku\u0161al novo vozilo. Le to mu je bilo zelo v\u0161e\u010d, zato se je odlo\u010dil za nakup novega Golfa 9."),w=N[0],k=N[1],C=(0,o.useState)(!0),_=C[0],S=C[1],A=(0,o.useState)("0.25"),E=A[0],R=A[1],F=(0,o.useRef)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i(),{children:[(0,a.jsx)("title",{children:n("coref:title")}),(0,a.jsx)("meta",{property:"og:title",content:n("coref:title")}),(0,a.jsx)("meta",{property:"og:description",content:n("coref:description")}),(0,a.jsx)("meta",{property:"description",content:n("coref:description")})]}),y&&(0,a.jsx)(c.Z,{title:n("common:error"),handleClose:function(){return j("")},children:y}),(0,a.jsxs)("section",{className:"grow flex flex-col container py-8",children:[(0,a.jsx)("h1",{className:"text-primary text-2xl mb-1",children:n("coref:title")}),(0,a.jsxs)("div",{className:"text-gray-700 text-sm mb-6",children:[(0,a.jsx)("p",{className:"mb-3",children:n("coref:intro")}),(0,a.jsx)("p",{children:n("common:for-demo-purposes-only")})]}),(0,a.jsx)("div",{className:"h-[210px] flex mb-6",children:(0,a.jsx)(l.Z,{text:w,placeholder:n("common:textarea-placeholder"),maxLength:"200",customClass:"rounded-md shadow-[0_4px_12px_rgba(0,0,0,0.12)]",onTextChange:function(e){return k(e.target.value)},onClear:function(){return k("")},onShowExample:function(){return k("Janez Novak je \u0161el v avtomobilski salon, kjer je presku\u0161al novo vozilo. Le to mu je bilo zelo v\u0161e\u010d, zato se je odlo\u010dil za nakup novega Golfa 9.")}})}),(0,a.jsxs)("div",{className:"mb-4 lg:flex space-y-4 lg:space-y-0 justify-between items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"text-gray-700 inline-block mb-2",children:[(0,a.jsx)("input",{type:"checkbox",className:"mr-2",checked:!!_,disabled:g,onChange:function(){return S(!_)}}),n("coref:singletons")]}),(0,a.jsx)(h.Z,{label:"".concat(n("coref:threshold-label"),":"),min:0,max:1,step:.05,disabled:g,value:E,onValueChange:function(e){return R(e.target.value)}})]}),(0,a.jsx)("button",{className:"py-2 px-8 md:px-10 lg:px-12 rounded-lg text-white shadow-[0_4px_4px_rgba(0,0,0,0.12)] ".concat(g?"cursor-wait bg-primary/50":"bg-primary"),onClick:function(){if(m(!1),F.current.innerHTML="",w){var t=setTimeout((function(){return v(!0)}),300);fetch("/api/predict/coref",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:w,singletons:_,threshold:E})}).then((function(e){if(!e.ok){if(503===e.status)throw n("common:too-many-requests");throw n("common:unknown-error")}return e.json()})).then((function(n){e(n.result),m(!0)})).catch((function(e){return j(e)})).finally((function(){v(!1),clearTimeout(t)}))}else j(n("common:empty-text-error"))},disabled:g,children:g?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"sr-only",children:n("common:loading")}),(0,a.jsx)(u.G,{icon:d.LM3,className:"animate-spin"})]}):n("coref:submit")})]}),!g&&!y&&s&&(0,a.jsx)("h2",{className:"text-primary text-2xl mt-4 2xl:mt-5 mb-3",children:n("common:result")}),(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)("div",{ref:F,className:g||y||!s?"":"bg-white rounded-md border border-gray-400 min-h-[200px] flex flex-nowrap items-center"})})]}
1),(0,a.jsx)("div",{className:"container py-4 2xl:py-5",children:(0,a.jsxs)("p",{className:"text-sm text-gray-500",children:[n("common:available-at"),": ",(0,a.jsx)("a",{href:"https://github.com/RSDO-DS3/SloCOREF",className:"underline",children:"https://github.com/RSDO-DS3/SloCOREF"})]})})]})}},9008:function(e,n,t){e.exports=t(5443)},2023:function(e,n,t){e=t.nmd(e),function(t,r){var a=function(){var e=null,n={};x();var t=[],r=function(n){if(void 0!==(n=n||{}).seed&&null!==n.seed&&n.seed===parseInt(n.seed,10))e=n.seed;else if("string"===typeof n.seed)e=b(n.seed);else{if(void 0!==n.seed&&null!==n.seed)throw new TypeError("The seed value must be an integer or string");e=null}var c,l;if(null!==n.count&&void 0!==n.count){for(var u=n.count,d=[],h=0;h<n.count;h++)t.push(!1);for(n.count=null;u>d.length;){var m=r(n);null!==e&&(n.seed=e),d.push(m)}return n.count=u,d}return i([c=a(n),l=o(c,n),s(c,l,n)],n)};function a(e){if(t.length>0){var n=h(o=y(e.hue)),r=(o[1]-o[0])/t.length,a=parseInt((n-o[0])/r);return!0===t[a]?a=(a+2)%t.length:t[a]=!0,(n=h(o=[(o[0]+a*r)%359,(o[0]+(a+1)*r)%359]))<0&&(n=360+n),n}var o;return(n=h(o=l(e.hue)))<0&&(n=360+n),n}function o(e,n){if("monochrome"===n.hue)return 0;if("random"===n.luminosity)return h([0,100]);var t=u(e),r=t[0],a=t[1];switch(n.luminosity){case"bright":r=55;break;case"dark":r=a-10;break;case"light":a=55}return h([r,a])}function s(e,n,t){var r=c(e,n),a=100;switch(t.luminosity){case"dark":a=r+20;break;case"light":r=(a+r)/2;break;case"random":r=0,a=100}return h([r,a])}function i(e,n){switch(n.format){case"hsvArray":return e;case"hslArray":return v(e);case"hsl":var t=v(e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)";case"hsla":var r=v(e),a=n.alpha||Math.random();return"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+a+")";case"rgbArray":return p(e);case"rgb":return"rgb("+p(e).join(", ")+")";case"rgba":var o=p(e);a=n.alpha||Math.random();return"rgba("+o.join(", ")+", "+a+")";default:return m(e)}}function c(e,n){for(var t=d(e).lowerBounds,r=0;r<t.length-1;r++){var a=t[r][0],o=t[r][1],s=t[r+1][0],i=t[r+1][1];if(n>=a&&n<=s){var c=(i-o)/(s-a);return c*n+(o-c*a)}}return 0}function l(e){if("number"===typeof parseInt(e)){var t=parseInt(e);if(t<360&&t>0)return[t,t]}if("string"===typeof e)if(n[e]){var r=n[e];if(r.hueRange)return r.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var a=g(e)[0];return[a,a]}return[0,360]}function u(e){return d(e).saturationRange}function d(e){for(var t in e>=334&&e<=360&&(e-=360),n){var r=n[t];if(r.hueRange&&e>=r.hueRange[0]&&e<=r.hueRange[1])return n[t]}return"Color not found"}function h(n){if(null===e){var t=.618033988749895,r=Math.random();return r+=t,r%=1,Math.floor(n[0]+r*(n[1]+1-n[0]))}var a=n[1]||1,o=n[0]||0,s=(e=(9301*e+49297)%233280)/233280;return Math.floor(o+s*(a-o))}function m(e){var n=p(e);function t(e){var n=e.toString(16);return 1==n.length?"0"+n:n}return"#"+t(n[0])+t(n[1])+t(n[2])}function f(e,t,r){var a=r[0][0],o=r[r.length-1][0],s=r[r.length-1][1],i=r[0][1];n[e]={hueRange:t,lowerBounds:r,saturationRange:[a,o],brightnessRange:[s,i]}}function x(){f("monochrome",null,[[0,0],[100,0]]),f("red",[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]),f("orange",[18,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]),f("yellow",[46,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]),f("green",[62,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]),f("blue",[178,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]),f("purple",[257,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]),f("pink",[282,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]])}function p(e){var n=e[0];0===n&&(n=1),360===n&&(n=359),n/=360;var t=e[1]/100,r=e[2]/100,a=Math.floor(6*n),o=6*n-a,s=r*(1-t),i=r*(1-o*t),c=r*(1-(1-o)*t),l=256,u=256,d=256;switch(a){case 0:l=r,u=c,d=s;break;case 1:l=i,u=r,d=s;break;case 2:l=s,u=r,d=c;break;case 3:l=s,u=i,d=r;break;case 4:l=c,u=s,d=r;break;case 5:l=r,u=s,d=i}return[Math.floor(255*l),Math.floor(255*u),Math.floor(255*d)]}function g(e){e=3===(e=e.replace(/^#/,"")).length?e.replace(/(.)/g,"$1$1"):e;var n=parseInt(e.substr(0,2),16)/255,t=parseInt(e.substr(2,2),16)/255,r=parseInt(e.substr(4,2),16)/255,a=Math.max(n,t,r),o=a-Math.min(n,t,r),s=a?o/a:0;switch(a){case n:return[(t-r)/o%6*60||0,s,a];case t:return[60*((r-n)/o+2)||0,s,a];case r:return[60*((n-t)/o+4)||0,s,a]}}function v(e){var n=e[0],t=e[1]/100,r=e[2]/100,a=(2-t)*r;return[n,Math.round(t*r/(a<1?a:2-a)*1e4)/100,a/2*100]}function b(e){for(var n=0,t=0;t!==e.length&&!(n>=Number.MAX_SAFE_INTEGER);t++)n+=e.charCodeAt(t);return n}function y(e){if(isNaN(e)){if("string"===typeof e)if(n[e]){var t=n[e];if(t.hueRange)return t.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){return d(g(e)[0]).hueRange}}else{var r=parseInt(e);if(r<360&&r>0)return d(e).hueRange}return[0,360]}return r}();e&&e.exports&&(n=e.exports=a),n.randomColor=a}()},797:function(e,n,t){"use strict";function r(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function a(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"===typeof e)return r(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?r(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}t.d(n,{Z:function(){return a}})}},function(e){e.O(0,[423,774,888,179],(function(){return n=1998,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.