UNPKG

jcuts

Version:
1 lines 18 kB
!function(){var t,e;!function(){var n=function(e){t=e()};n.amd=!0,function(t){"use strict";function e(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function a(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])}function i(t,n,i){var s=e(n,t);return i=a(n,t)+i,[n[0]+Math.cos(i)*s,n[1]+Math.sin(i)*s]}function s(t,e){if(t&&t.length){var n,a=t[0],i=t[1],r=a instanceof Array?a.length:0;switch(t.length){case 1:return r?a.slice():a;case 2:if(r){var o=[];for(n=0;r>n;n++)o[n]=s([a[n],i[n]],e);return o}return a+(i-a)*e;default:var h=[];for(n=1;n<t.length;n++)h.push(s([t[n-1],t[n]],e));return s(h,e)}}}function r(t,e){if(t&&!(t.length<2)){for(var n=[],a=[],i=[],r=[],o=0;o<t.length;o++)n.push(t[o]),i.push(s(n,e)),a.unshift(t[t.length-o-1]),r.unshift(s(a,e));return[i,r]}}function o(t,n,a){if(n[0]==a[0]&&n[1]==a[1])return 0;var i=((n[0]-a[0])*(n[0]-t[0])+(n[1]-a[1])*(n[1]-t[1]))/((n[0]-a[0])*(n[0]-a[0])+(n[1]-a[1])*(n[1]-a[1]));return e(t,s([n,a],Math.max(0,Math.min(1,i))))}function h(t){return 0===t?0:0>t?-1:1}function l(t,e,n,a){var i=(a[0]-n[0])*(t[1]-n[1])-(a[1]-n[1])*(t[0]-n[0]),s=(e[0]-t[0])*(t[1]-n[1])-(e[1]-t[1])*(t[0]-n[0]),r=(a[1]-n[1])*(e[0]-t[0])-(a[0]-n[0])*(e[1]-t[1]);if(0!==r){var o=i/r,h=s/r;if(o>=0&&1>=o&&h>=0&&1>=h)return[t[0]+o*(e[0]-t[0]),t[1]+o*(e[1]-t[1])]}}function c(t,n){if(t&&n&&n.length){for(var a=e(t,n[0]),i=1,s=n.length;s>i;i++)a=Math.min(a,o(t,n[i-1],n[i]));return a}}function u(t,e){for(var n=0,a=0;a<e.length;a++){var i=e[a],s=e[(a+1)%e.length];if(i[1]!==s[1]&&!(t[1]<Math.min(i[1],s[1])||t[1]>=Math.max(i[1],s[1]))){var r=(t[1]-i[1])*(s[0]-i[0])/(s[1]-i[1])+i[0];r>t[0]&&n++}}return n%2===1}function f(t,e,n,a,i){for(var s=i||0,r=[],o=0;t>o;o++){var h=s+o/t*Math.PI*2,l=[e+Math.cos(h)*a,n+Math.sin(h)*a];r.push(l)}return r}var p=p||{};p.pointToPoint=e,p.pointToAngle=a,p.rotatePoint=i,p.bezier=s,p.cutBezier=r,p.pointToLine=o,p.sign=h,p.doubleLineIntersect=l,p.pointToPolyline=c,p.pointInPolygon=u,p.regularPolygon=f,"function"==typeof n?(n.amd||n.cmd)&&n(function(){return p}):"undefined"!=typeof module&&module.exports?module.exports=p:window[t]=p}("jmaths");var n=function(t){e=t()};n.amd=!0,function(t){"use strict";function e(t,e){return t.replace(/#\{(.*?)\}/g,function(t,n){return e&&n in e?e[n]:""})}function a(t){var e=[0,0],n=[0,0],a=[];return String(t).replace(/([mlcza])((\s*,?\s*([+-]?\d+(?:\.\d+)?)+)*)/gi,function(t,i,s){switch(i){case"M":case"L":var r=!1;s.replace(/\s*,?\s*([+-]?\d+(?:\.\d+)?)\s*,?\s*([+-]?\d+(?:\.\d+)?)/gi,function(t,s,o){e=[+s,+o],a.push(["L"===i||r?"L":"M",e]),r=!0,"M"===i&&(n=e)});break;case"C":s.replace(/\s*,?\s*([+-]?\d+(?:\.\d+)?)\s*,?\s*([+-]?\d+(?:\.\d+)?)\s*,?\s*([+-]?\d+(?:\.\d+)?)\s*,?\s*([+-]?\d+(?:\.\d+)?)\s*,?\s*([+-]?\d+(?:\.\d+)?)\s*,?\s*([+-]?\d+(?:\.\d+)?)/gi,function(t,n,i,s,r,o,h){e=[0,0],a.push(["C",[+n+e[0],+i+e[1],+s+e[0],+r+e[1],+o+e[0],+h+e[1]]]),e=[+o+e[0],+h+e[1]]});break;case"Z":a.push(["Z"]),e=n}}),a}function i(t){t=t||{},this.parent="string"==typeof t.parent?document.getElementById(t.parent):t.parent||document.body,this.fill=t.fill||"none",this.fillOpacity=t.fillOpacity||t["fill-opacity"]||1,this.stroke=t.stroke||"black",this.strokeWidth=t.strokeWidth||t["stroke-width"]||1,this.strokeOpacity=t.strokeOpacity||t["stroke-opacity"]||1,this.path=t.path||"M 0,0";for(var n,i=u.length-1;i>=0;i--){var s=u[i];if(s.parent===this.parent){n=s;break}}/^canvas$/i.test(this.parent.tagName)&&(c="canvas",this.pathDetails=a(this.path),this.repaint(!0));var r;switch(c){case"canvas":this.canvas=this.parent,n?this.canvasPaths=n.paths:(this.canvasPaths=[],u.push({parent:this.parent,paths:this.canvasPaths})),this.canvasPaths.push(this),this.repaint(!0);break;case"svg":r=document.createElement("div"),r.innerHTML=e('\n<svg width=100% height=100% xmlns="http://www.w3.org/2000/svg">\n <path fill="#{fill}"\n fill-rule="evenodd"\n stroke-linejoin="round"\n fill-opacity="#{fillOpacity}"\n stroke="#{stroke}"\n stroke-opacity="#{strokeOpacity}"\n stroke-width="#{strokeWidth}" d="#{path}"\n</svg>\n',this),this.elementPath=r.lastChild.lastChild,n?(this.element=n.element,this.element.appendChild(this.elementPath)):(this.element=r.lastChild,u.push({parent:this.parent,element:this.element}),this.parent.appendChild(this.element));break;case"vml":r=document.createElement("div"),this.filled="none"==this.fill?"f":"t",this.stroked="none"==this.stroke?"f":"t",this.zoom=h,r.innerHTML=e('\n<v:shape class="jpaths_path_shape jpaths_vml"\n coordsize="#{zoom},#{zoom}"\n stroked="#{stroked}"\n filled="#{filled}"\n path="#{path}">\n <v:stroke class="jpaths_vml"\n opacity="#{strokeOpacity}"\n color="#{stroke}"\n weight="#{strokeWidth}">\n </v:stroke>\n <v:fill class="jpaths_vml"\n opacity="#{fillOpacity}"\n color="#{fill}">\n </v:fill>\n</v:shape>\n',this),this.elementPath=r.lastChild,n?(this.element=n.element,this.element.appendChild(this.elementPath)):(this.element=r,r.className="jpaths_path_panel",u.push({parent:this.parent,element:this.element}),this.parent.appendChild(this.element)),this.elementFill=this.elementPath.getElementsByTagName("fill")[0],this.elementStroke=this.elementPath.getElementsByTagName("stroke")[0]}}function s(t){return new i(t)}var r=r||{},o=document.all&&document.attachEvent,h=1e3,l=o&&window.XMLHttpRequest&&window.addEventListener&&document.documentMode>=9,c=!o||l?"svg":"vml",u=[];i.prototype.repaint=function(t){if(this.canvas){var e=this.canvas.getContext("2d");if(e){var n;if(t)for(e.save(),e.fillStyle="transparent",e.globalCompositeOperation="copy",e.fillRect(0,0,this.canvas.width,this.canvas.height),e.restore(),n=0;n<this.canvasPaths.length;n++)this.canvasPaths[n].repaint();else if(this.pathDetails){e.save(),e.beginPath();var a=[0,0],i=[0,0];for(n=0;n<this.pathDetails.length;n++){var s=this.pathDetails[n];switch(s[0]){case"Z":e.closePath(),a=i;break;case"C":e.bezierCurveTo(s[1][0],s[1][1],s[1][2],s[1][3],s[1][4],s[1][5]),a=[s[1][2],s[1][3]];break;case"L":a=[s[1][0],s[1][1]],e.lineTo(s[1][0],s[1][1]);break;case"M":a=[s[1][0],s[1][1]],i=[s[1][0],s[1][1]],e.moveTo(s[1][0],s[1][1])}}"none"!==this.stroke&&(e.strokeStyle=this.stroke,e.stroke()),e.lineWidth=this.strokeWidth,"none"!==this.fill&&(e.fillStyle=this.fill,e.fill()),e.restore()}}}},i.prototype.attr=function(t,e){if(!this.freed)if(1===arguments.length){if("string"==typeof t)return"stroke-width"===t&&(t="strokeWidth"),this[t];if("object"==typeof t){for(var n in t)this.attr(n,t[n],!0);return this}}else if(arguments.length>1){switch(t){case"path":if(this.path===e)break;switch(this.path=e,c){case"svg":this.elementPath.setAttribute("d",e||"M 0,0");break;case"vml":this.elementPath.path=String(e||"M 0,0").replace(/\d+(\.\d+)?/g,function(t){return parseInt(t*h)}).replace(/z/gi,"X");break;case"canvas":this.pathDetails=a(this.path),this.repaint(!0)}break;case"fill":if(this.fill===e)break;switch(this.fill=e,c){case"svg":this.elementPath.setAttribute("fill",e);break;case"vml":this.elementPath.Filled=this.filled="none"===this.fill?"f":"t",this.elementFill.Color=e;break;case"canvas":batch&&this.repaint(!0)}break;case"stroke":if(this.stroke===e)break;switch(this.stroke=e,c){case"svg":this.elementPath.setAttribute("stroke",e);break;case"vml":this.elementPath.Stroked=this.stroked="none"===this.stroke?"f":"t",this.elementStroke.Color=e;break;case"canvas":batch&&this.repaint(!0)}break;case"fillOpacity":case"fill-opacity":if(this.fillOpacity===e)break;switch(this.fillOpacity=e,c){case"svg":this.elementPath.setAttribute("fill-opacity",e);break;case"vml":this.elementFill.Opacity=Math.min(Math.max(0,e),1);break;case"canvas":batch&&this.repaint(!0)}break;case"strokeOpacity":case"stroke-opacity":if(this.strokeOpacity===e)break;switch(this.strokeOpacity=e,c){case"svg":this.elementPath.setAttribute("stroke-opacity",e);break;case"vml":this.elementStroke.Opacity=Math.min(Math.max(0,e),1);break;case"canvas":batch&&this.repaint(!0)}break;case"strokeWidth":case"stroke-width":if(this.strokeWidth==e)break;switch(this.strokeWidth=e,c){case"svg":this.elementPath.setAttribute("stroke-width",e);break;case"vml":this.elementStroke.weight=e;break;case"canvas":batch&&this.repaint(!0)}}return this}},i.prototype.free=function(){if(!this.freed)switch(this.freed=!0,c){case"svg":case"vml":this.elementPath.parentNode.removeChild(this.elementPath),this.elementPath=null;break;case"canvas":for(var t=0;t<this.canvasPaths.length;t++)if(this.canvasPaths[t]===this){this.canvasPaths.splice(t,1),this.repaint(!0);break}}},"vml"===c&&(document.createStyleSheet().cssText=e("\n.#{this}_vml {\n behavior: url(#default#VML);\n}\n.#{this}_path_shape {\n width: 1px;\n height: 1px;\n padding: 0;\n margin: 0;\n left: 0;\n top: 0;\n position: absolute;\n}\n.#{this}_path_panel {\n width: 100%;\n height: 100%;\n overflow: hidden;\n padding: 0;\n margin: 0;\n position: relative;\n}\n",t)),r.create=s,"function"==typeof n?(n.amd||n.cmd)&&n(function(){return r}):"undefined"!=typeof module&&module.exports?module.exports=r:window[t]=r}("jpaths")}(),function(n){"use strict";function a(t,e){var n,a,i=document.createElement("canvas"),s=document.createElement("canvas"),h=1/0,l=1/0,c=0,u=0;for(a=0;a<t.length;a++)n=t[a],h=h>n[0]?n[0]:h,l=l>n[1]?n[1]:l,c=c<n[0]?n[0]:c,u=u<n[1]?n[1]:u;for(a=0;a<e.length;a++)n=e[a],h=h>n[0]?n[0]:h,l=l>n[1]?n[1]:l,c=c<n[0]?n[0]:c,u=u<n[1]?n[1]:u;var f=c-h+1,p=u-l+1;i.width=f,i.height=p,s.width=f,s.height=p,r(i,t,h,l),r(s,e,h,l);var d=1-o(i,s,f,p);return d}function i(t,e){if(t.radius>e.radius){var n=t;t=e,e=n}return a(t.polygon,c(e.polygon,t.base,e.base))}function s(e,n,a){var i,s,r=[],o=360/(4*e);for(i=0;i<a.length;i++){var h,l=a[i][0],c=a[i][1];h=c===n[1]?90:180*Math.atan(Math.abs(l-n[0])/Math.abs(c-n[1]))/Math.PI,h=l>n[0]?o-h:o+h,s=2*h*Math.PI/180,r.push(t.rotatePoint(a[i],n,s))}var u=[];for(u.push(a),u.push(r),i=1;e>i;i++){s=360*i/e*Math.PI/180;for(var f=[],p=[],d=0;d<a.length;d++)f.push(t.rotatePoint(a[d],n,s)),p.push(t.rotatePoint(r[d],n,s));u.push(f),u.push(p)}return u}function r(t,e,n,a,i){n=n||0,a=a||0;var s=t.getContext("2d");s.beginPath();for(var r,o,h=0;h<e.length;h++){var l=e[h],c=l[0]-n,u=l[1]-a;0===h?(r=c,o=u,s.moveTo(c,u)):s.lineTo(c,u)}s.lineTo(r,o),s.closePath(),i&&(s.fillStyle=i),s.fill()}function o(t,e,n,a){for(var i=t.getContext("2d"),s=e.getContext("2d"),r=i.getImageData(0,0,n,a),o=s.getImageData(0,0,n,a),h=0,l=0,c=0;c<r.data.length;c+=4){l+=r.data[c+3]/255,l+=o.data[c+3]/255;var u=Math.abs(r.data[c+3]-o.data[c+3])/255;h+=u}return h/l}function h(t,e,n){for(var a=document.createElement("canvas"),i=1/0,s=1/0,o=0,h=0,l=0;l<t.length;l++){var c=t[l];i=i>c[0]?c[0]:i,s=s>c[1]?c[1]:s,o=o<c[0]?c[0]:o,h=h<c[1]?c[1]:h}var u=o-i+1,f=h-s+1;a.width=u,a.height=f,r(a,t,i,s,e);var p=document.createElement("div");p.className+="paper-wrap ",p.className+="fall ";var d=document.getElementsByTagName("body")[0];n&&(d=n);var v=document.body.getBoundingClientRect(),g=v.top+s,m=v.left+i;p.style.width=u+"px",p.style.height=f+"px",p.style.top=g+"px",p.style.left=m+"px";var y=u*f;if(1600>y){var k=document.createElement("div");k.className+="rotate ",k.appendChild(a),p.appendChild(k)}else if(y>1e4){var k=document.createElement("div");k.className+="sway3d ",k.appendChild(a),p.appendChild(k)}else{var k=document.createElement("div");k.className+="rotate-slow ",k.appendChild(a);var b=document.createElement("div");b.className+="sway2d ",b.appendChild(k),p.appendChild(b)}d.appendChild(p),setTimeout(function(){d.removeChild(p)},2800)}function l(t,e){return t.replace(/#\{(.*?)\}/g,function(t,n){return e&&n in e?e[n]:""})}function c(e,n,a){var i=[];return console.log(JSON.stringify(e)),e.forEach(function(e){var s=e.slice(),r=n.radius/a.radius,o=t.pointToPoint(n.center,e)/r,h=t.pointToAngle(n.center,e);s[0]=a.center[0]+Math.cos(h)*o,s[1]=a.center[1]+Math.sin(h)*o,i.push(s)}),console.log(JSON.stringify(i)),i}function u(e,n,a){function i(){var t=v[0],e=v[1];p=[],d=[],p.push([t,n,"synechiaA"]),p.push([n,e,"synechiaB"]),p.push([e,t,"boundary"])}function s(){var n=t.regularPolygon(2*e,x,y,a,.5*-Math.PI-Math.PI/e/2);return l("M #{start} L #{lines} Z",{start:n[0],lines:n.slice(1).join(" "),center:[x,y]})}function r(){var t=[];return p.forEach(function(e){t.push([e[0].slice(),e[1].slice()])}),l("M #{start} L #{lines}",{start:t[0][0],lines:t.join(" ")})}function o(){var t=[];return p.forEach(function(e){t.push(e[0].slice())}),t}function h(){var t=[];return d.forEach(function(e){t.push(e[0].slice())}),t}function c(){var t=[];return d.forEach(function(e){t.push([e[0].slice(),e[1].slice()])}),l("M #{start} L #{lines}M #{start} m -5,0 h 10 M #{start} m 0,-5 v 10M #{end} m -8,0 h 16 M #{end} m 0,-8 v 16",{start:t[0][0],end:t[t.length-1][1],lines:t.join(" ")})}function u(e){function n(e,n){var a,i,s,r,o=[],h=[],l=d[0][0],c=d[d.length-1][1];if(e!==n){for(a=e,i=l,s=0;s<p.length;s++){if(m=p[a][1],a===n){for(o.push([i,c,p[a][2]]),r=d.length-1;r>=0;r--)o.push([d[r][1],d[r][0],d[r][2]]);break}o.push([i,m,p[a][2]]),i=m,a=(a+1)%p.length}for(a=e,i=l,s=0;s<p.length;s++){if(m=p[a][0],a===n){for(h.push([i,c,p[a][2]]),r=d.length-1;r>=0;r--)h.push([d[r][1],d[r][0],d[r][2]]);break}h.push([i,m,p[a][2]]),i=m,a--,0>a&&(a=p.length-1)}}else if(t.pointToPoint(p[e][0],l)<t.pointToPoint(p[e][0],c)){for(o.push([p[e][0],l,p[e][2]]),r=0;r<d.length;r++)o.push(d[r]);for(o.push([c,p[e][1],p[e][2]]),s=1;s<p.length;s++)o.push(p[(e+s)%p.length]);for(r=0;r<d.length;r++)h.push(d[r]);h.push([c,l,p[e][2]])}else{for(o.push([l,p[e][1],p[e][2]]),s=1;s<p.length;s++)o.push(p[(e+s)%p.length]);for(o.push([p[e][0],c,p[e][2]]),r=d.length-1;r>=0;r--)o.push([d[r][1],d[r][0],d[r][2]]);for(h.push([c,l,p[e][2]]),r=0;r<d.length;r++)h.push(d[r])}var u=0,f={};o.forEach(function(e){f[e[2]]=!0,0===e[2].indexOf("synechia")&&(u+=t.pointToPoint(e[0],e[1]))});var v=0,g={};if(h.forEach(function(e){g[e[2]]=!0,0===e[2].indexOf("synechia")&&(v+=t.pointToPoint(e[0],e[1]))}),f.synechiaA&&f.synechiaB){if(!g.synechiaA||!g.synechiaB)return p=o,void(d=h)}else if(g.synechiaA&&g.synechiaB&&(!f.synechiaA||!f.synechiaB))return p=h,void(d=o);u>=v?(p=o,d=h):(p=h,d=o)}function a(a,i,s){d=[];for(var r=a,o=i;o<e.length;o++){for(var h=e[o],l=0;l<p.length;l++){var c=p[l];if(o!==i||s!==l){var u=t.doubleLineIntersect(r,h,c[0],c[1]);if(u)return d.push([r,u,"scar"]),void n(s,l)}}d.push([r,h,"scar"]),r=h}}if(e&&!(e.length<2)){var i=o();if(!t.pointInPolygon(e[0],i)&&!t.pointInPolygon(e[e.length-1],i)){var s,r;if(e.length>=3){var h=[e[0]];for(s=1;s<e.length-1;s++){var l=e[s-1],c=e[s],u=e[s+1];t.pointToLine(c,l,u)>.27&&h.push(c)}h.push(e[e.length-1]),e=h}for(s=1;s<e.length-2;s++){var f=[e[s-1],e[s]];for(r=s+2;r<e.length;r++){var v=[e[r-1],e[r]];if(t.doubleLineIntersect(f[0],f[1],v[0],v[1]))return}}var g=e[0];for(s=1;s<e.length-1;s++){var m=e[s];for(r=0;r<p.length;r++){var y=p[r],k=t.doubleLineIntersect(g,m,y[0],y[1]);if(k)return a(k,s,r),!0}g=m}}}}var f={};n=n||[0,0],a=a||100,f.getCenter=function(){return n},f.getRadius=function(){return a};var p=[],d=[],v=t.regularPolygon(2*e,n[0],n[1],a,.5*-Math.PI-Math.PI/e/2);return f.rebuild=i,i(),f.getFullPath=s,f.getModelPolygon=o,f.getCutPolygon=h,f.getCutModelPath=c,f.cut=u,f.getModelPath=r,f}function f(t){function n(){k.attr({path:y.getModelPath()})}function a(){n(),"function"==typeof p&&p.call(d,{type:"change"})}function i(t){if(o){var e="mousemove"===t.type?[t.pageX-this.offsetLeft,t.pageY-this.offsetTop]:[t.targetTouches[0].pageX-this.offsetLeft,t.targetTouches[0].pageY-this.offsetTop];l.push(e),b.attr({path:jcuts.format("M #{from} L #{lines}",{from:l[0],lines:l.slice(1)})})}}function s(t){"running"===v&&(o="mousedown"===t.type?[t.pageX-this.offsetLeft,t.pageY-this.offsetTop]:[t.targetTouches[0].pageX-this.offsetLeft,t.targetTouches[0].pageY-this.offsetTop],l=[o])}function r(){if(o&&(o=null,b.attr({path:""}),"running"===v)){var e=y.cut(l);e&&(h(y.getCutPolygon(),t.fill||"none",c),a())}}t=t||{};var o,l,c="string"==typeof t.container?document.querySelector(t.container):t.container||document.body,f=t.edges||6,p=t.onchange,d={},v="running",g=[c.clientWidth/2,c.clientHeight/2*1.8],m=.8*Math.min(c.clientWidth,c.clientHeight),y=u(f,g,m),k=e.create({parent:c,stroke:t.stroke||"black",fill:t.fill||"none"}),b=e.create({parent:c,stroke:t.cutStroke||"green",strokeWidth:2});n(),console.log("createGame"),d.getShape=function(){return console.log("getShape()"),{edges:f,base:{center:g,radius:m},polygon:y.getModelPolygon()}},d.getCutPolygon=function(){return console.log("getCutPolygon()"),y.getCutPolygon()},d.replay=function(){console.log("replay()"),v="running",y.rebuild(),a()},d.stop=function(){console.log("stop()"),"stop"!==v&&(v="stop")};var P;return d.free=function(){P||(P=!0,c.removeEventListener("touchmove",i),c.removeEventListener("touchstart",s),c.removeEventListener("touchend",r),c.removeEventListener("mousedown",s),c.removeEventListener("mousemove",i),document.removeEventListener("mouseup",r),k.free(),b.free())},c.addEventListener("touchmove",i),c.addEventListener("touchstart",s),c.addEventListener("touchend",r),c.addEventListener("mousedown",s),c.addEventListener("mousemove",i),document.addEventListener("mouseup",r),d}function p(t){function n(t){var e=c(t.polygon,t.base,u),n=s(t.edges,o,e),a="";n.forEach(function(t){a+=l("M #{start} L #{lines} Z",{start:t[0],lines:t.slice(1).join(" ")})}),r.attr({path:a})}t=t||{};var a="string"==typeof t.container?document.querySelector(t.container):t.container||document.body,i={},r=e.create({parent:a,stroke:t.stroke||"none",fill:t.fill||"yellow"}),o=[a.clientWidth/2,a.clientHeight/2],h=.5*Math.min(a.clientWidth,a.clientHeight),u={center:o,radius:h};i.render=n;var f;return i.free=function(){f||(f=!0,r.free(),console.log("free"))},i}var d=d||{};d.diffPolygon=a,d.diffShape=i,d.getCutPolygons=s,d.polygonDrop=h,d.format=l,d.coordinateTransformation=c,d.createPaper=u,d.createGame=f,d.createRender=p,"function"==typeof define?(define.amd||define.cmd)&&define(function(){return d}):"undefined"!=typeof module&&module.exports?module.exports=d:window[n]=d}("jcuts")}();