PageSourceSearch

https://nf.video/assets/qrcanvas.c8aed397.1691389795218.js

js nf.video collected 2026-09-24 10:19:07 UTC 7,812 bytes, 3 lines download raw bytes

1import{a as e}from"./qrcode-generator.ce3f3b7b.1691389795218.js";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},t.apply(null,arguments)}var n=Object.freeze(Object.defineProperty({__proto__:null,get default(){return t}},Symbol.toStringTag,{value:"Module"}));
2/*! qrcanvas v3.1.2 | ISC License */
3var a={createCanvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},isCanvas:i,isDrawable:function(e){return i(e)||e instanceof HTMLImageElement},getCanvas:o,updateCanvas:function(e,t,n){if(e)return e.width=t,e.height=null==n?t:n,e;return o(t,n)},drawCanvas:function(e,t,n){void 0===n&&(n={});var i=n,o=i.cellSize,r=i.context,l=i.clear,c=void 0===l||l,f=e.width,s=e.height,u=[t],v=r||e.getContext("2d");c&&v.clearRect(0,0,f,s);v.globalCompositeOperation="source-over";for(;u.length;){var d=u.shift();if(Array.isArray(d))u=d.concat(u);else if(d){var g=void 0,h=(null==(g=a.isDrawable(d)?{image:d}:"string"==typeof d?{style:d}:d).col?g.x:g.col*o)||0,p=(null==g.row?g.y:g.row*o)||0;h<0&&(h+=f),p<0&&(p+=f);var m=("cols"in g?g.cols*o:g.w)||f,C=("rows"in g?g.rows*o:g.h)||f;g.image?v.drawImage(g.image,h,p,m,C):(v.fillStyle=g.style||"black",v.fillRect(h,p,m,C))}}return e},drawText:function(e,t){var n,a=t||{},i=a.fontSize,r=void 0===i?64:i,l=a.fontStyle,c=void 0===l?"":l,f=a.fontFamily,s=void 0===f?"Cursive":f,u=a.color,v=void 0===u?null:u,d=a.pad,g=void 0===d?8:d,h=a.padColor,p=void 0===h?"#fff":h,m=a.mode,C=void 0===m?1:m,y=o(1),w=y.getContext("2d");if(p){w.fillStyle=p,w.fillRect(0,0,1,1);var S=w.getImageData(0,0,1,1);(n=S.data)[3]||(n=null)}var z=r+2*g,x=[c,r+"px",s].filter(Boolean).join(" "),b=function(){w.textAlign="center",w.textBaseline="middle",w.font=x};b();var T=Math.ceil(w.measureText(e).width)+2*g;y.width=T,y.height=z,b();var O=function(){w.fillStyle=v||"#000",w.fillText(e,T/2,z/2)};1===C?(w.fillStyle=p,w.fillRect(0,0,T,z),O()):(O(),n&&function(){for(var e=w.getImageData(0,0,T,z),t=e.data,a=T*z,i=[],o=0,r=function(e){var r=[],l={};i[o]=r;var c=i[o=1-o];if(!c){c=[];for(var f=0;f<a;f+=1)c.push(f)}c.forEach((function(e){t[4*e+3]&&[e%T?e-1:-1,(e+1)%T?e+1:-1,e-T,e+T].forEach((function(e){var n=4*e;n>=0&&n<=t.length&&!l[e]&&(l[e]=1,r.push(e))}))})),r.forEach((function(e){var a=4*e;if(!t[a+3])for(var i=0;i<4;i+=1)t[a+i]=n[i]}))},l=0;l<g;l+=1)r();w.putImageData(e,0,0)}());return y}};function i(e){return e instanceof HTMLCanvasElement}function o(e,t){return a.createCanvas(e,null==t?e:t)}var r={default:function(e){var t=e.foreground,n=e.cellSize,i=e.isDark,o=e.count,r=a.getCanvas,c=a.drawCanvas,f=n*o,s=r(f),u=s.getContext("2d");u.fillStyle="#000",l({cellSize:n,count:o},(function(e){var t=e.i,a=e.j,o=e.x,r=e.y;i(t,a)&&u.fillRect(o,r,n,n)}));var v=r(f);c(v,t,{cellSize:n});var d=v.getContext("2d");return d.globalCompositeOperation="destination-in",d.drawImage(s,0,0),v},round:function(e,t){var n=e.foreground,i=e.cellSize,o=e.isDark,r=e.count,f=a.getCanvas,s=a.drawCanvas,u=i*r,v=f(u),d=t.value,g=(void 0===d?1:d)*i/2,h=v.getContext("2d");h.fillStyle="#000",l({cellSize:i,count:r},(function(e){var t=e.i,n=e.j,a=e.x,r=e.y;o(t,n)&&(h.beginPath(),h.moveTo(a+.5*i,r),c(h,a+i,r,a+i,r+.5*i,g),c(h,a+i,r+i,a+.5*i,r+i,g),c(h,a,r+i,a,r+.5*i,g),c(h,a,r,a+.5*i,r,g),h.fill())}));var p=f(u);s(p,n,{cellSize:i});var m=p.getContext("2d");return m.globalCompositeOperation="destination-in",m.drawImage(v,0,0),p},fusion:function(e,t){var n=e.foreground,i=e.cellSize,o=e.isDark,r=e.count,s=a.getCanvas,u=a.drawCanvas,v=i*r,d=s(v),g=d.getContext("2d");g.fillStyle="#000";var h=t.value,p=(void 0===h?1:h)*i/2;l({cellSize:i,count:r},(function(e){var t=e.i,n=e.j,a=e.x,r=e.y,l=[0,0,0,0];o(t-1,n)&&(l[0]+=1,l[1]+=1),o(t+1,n)&&(l[2]+=1,l[3]+=1),o(t,n-1)&&(l[0]+=1,l[3]+=1),o(t,n+1)&&(l[1]+=1,l[2]+=1),o(t,n)?(o(t-1,n-1)&&(l[0]+=1),o(t-1,n+1)&&(l[1]+=1),o(t+1,n+1)&&(l[2]+=1),o(t+1,n-1)&&(l[3]+=1),g.beginPath(),g.moveTo(a+.5*i,r),c(g,a+i,r,a+i,r+.5*i,l[1]?0:p),c(g,a+i,r+i,a+.5*i,r+i,l[2]?0:p),c(g,a,r+i,a,r+.5*i,l[3]?0:p),c(g,a,r,a+.5*i,r,l[0]?0:p),g.fill()):(2===l[0]&&f(g,a,r+.5*i,a,r,a+.5*i,r,p),2===l[1]&&f(g,a+.5*i,r,a+i,r,a+i,r+.5*i,p),2===l[2]&&f(g,a+i,r+.5*i,a+i,r+i,a+.5*i,r+i,p),2===l[3]&&f(g,a+.5*i,r+i,a,r+i,a,r+.5*i,p))}));var m=s(v);
3u(m,n,{cellSize:i});var C=m.getContext("2d");return C.globalCompositeOperation="destination-in",C.drawImage(d,0,0),m},spot:function(e,t){var n=e.foreground,i=e.cellSize,o=e.isDark,r=e.count,c=a.getCanvas,f=a.drawCanvas,s=i*r,u=c(s),v=t.value,d=t.foregroundLight,g=void 0===d?"#fff":d,h=u.getContext("2d"),p=c(s),m=c(s),C=p.getContext("2d");return[{dark:!0,foreground:n},{dark:!1,foreground:g}].forEach((function(e){h.fillStyle="#000",h.clearRect(0,0,s,s),l({cellSize:i,count:r},(function(t){var n=t.i,a=t.j,l=t.x,c=t.y;if(o(n,a)^+!e.dark){var f,s=(1-(f=n<=7&&a<=7||n<=7&&r-a-1<=7||r-n-1<=7&&a<=7||n+5<=r&&n+9>=r&&a+5<=r&&a+9>=r||7===n||7===a?1-.1*v:.25))/2;h.fillRect(l+s*i,c+s*i,f*i,f*i)}})),f(p,e.foreground,{cellSize:i,context:C}),C.globalCompositeOperation="destination-in",C.drawImage(u,0,0),f(m,p,{cellSize:i,clear:!1})})),m}};function l(e,t){for(var n=e.cellSize,a=e.count,i=0;i<a;i+=1)for(var o=0;o<a;o+=1){t({i:i,j:o,x:o*n,y:i*n})}}function c(e,t,n,a,i,o){o?e.arcTo(t,n,a,i,o):(e.lineTo(t,n),e.lineTo(a,i))}function f(e,t,n,a,i,o,r,l){e.beginPath(),e.moveTo(t,n),c(e,a,i,o,r,l),e.lineTo(a,i),e.lineTo(t,n),e.fill()}e.stringToBytes=e.stringToBytesFuncs["UTF-8"];var s={background:"white",foreground:"black",typeNumber:0,correctLevel:"L",data:"",padding:0,resize:!0},u=function(){function n(e){var n=this;this.options=t({},s),this.cache={},this.isDark=function(e,t){var a=n.cache,i=a.qr,o=a.count;return!(e<0||e>=o||t<0||t>=o)&&i.isDark(e,t)},this.setOptions(e)}var i=n.prototype;return i.render=function(e,n){void 0===n&&(n={});var i,o,l,c=this.options,f=c.background,s=c.foreground,u=c.padding,v=c.effect,d=c.logo,g=c.resize,h=r[v.type]||r.default,p=this.cache.count,m=a.drawCanvas,C=n.size,y=n.cellSize;e||y||C||(y=6),y&&(C=p*y+u+u),C?i=g||!e?a.updateCanvas(e,C):e:(C=e.width,i=e);var w=C-u-u,S=Math.ceil(w/p),z=S*p;if(m(o=a.getCanvas(S*p),f,{cellSize:S}),l=h(t({foreground:s,cellSize:S,isDark:this.isDark},this.cache),this.options.effect),d){var x=t({},d);if(!(d.w||d.h||d.cols||d.rows)){var b=d.image,T=b.width,O=b.height,k=T/O,D=Math.min((p-18)/p,.38),j=Math.min(O,z*D,z*D/k),I=j*k,M=(z-I)/2,E=(z-j)/2;x.w=I,x.h=j,x.x=M,x.y=E}m(l,x,{clear:!1})}return m(i,[{image:o},{image:l,x:u,y:u,w:w,h:w}]),i},i.setOptions=function(n){this.options=t({},this.options,n),this.normalizeEffect(),this.normalizeLogo();var a=this.options,i=a.typeNumber,o=a.data,r=a.logo,l=this.options.correctLevel;r&&["Q","H"].indexOf(l)<0&&(l="H");var c=e(i,l);c.addData(o||""),c.make();var f=c.getModuleCount();this.cache={qr:c,count:f}},i.normalizeEffect=function(){var e=this.options.effect;"string"==typeof e&&(e={type:e}),this.options.effect=e||{}},i.normalizeLogo=function(){var e=a.isDrawable,t=a.drawText,n=this.options.logo;n&&(e(n)?n={image:n}:e(n.image)||("string"==typeof n&&(n={text:n}),n="string"==typeof n.text?{image:t(n.text,n.options)}:null)),this.options.logo=n},n}();var v=Object.freeze(Object.defineProperty({__proto__:null,effects:r,helpers:a,qrcanvas:function(e){var t=e.canvas,n=e.size,a=e.cellSize,i=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;n[a]=e[a]}return n}(e,["canvas","size","cellSize"]);return new u(i).render(t,{size:n,cellSize:a})},setCanvasModule:function(e){var t=e.Canvas,n=e.Image,i=e.createCanvas,o=function(e){return e instanceof t};a.createCanvas=i,a.isCanvas=o,a.isDrawable=function(e){return o(e)||e instanceof n}}},Symbol.toStringTag,{value:"Module"}));export{n as _,t as a,v as q};

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.