text: import{S as A,i as P,s as I,e as _,a as i,b as S,n as g,d as D,t as be,c as d,f,g as me,l as W,h as he,j as fe,k as j,m as E,o as h,p as pe,q as y,r as B,u as w,v as $,w as k,x as ye}from"./vendor.a9430f2f.js";const we=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const n of s)if(n.type==="childList")for(const l of n.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function t(s){const n={};return s.integrity&&(n.integrity=s.integrity),s.referrerpolicy&&(n.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?n.credentials="include":s.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function a(s){if(s.ep)return;s.ep=!0;const n=t(s);fetch(s.href,n)}};we();function $e(r){let e;return{c(){e=_("content"),e.innerHTML=`Welcome to 3d gear maker! You can use this tool to generate the STL file for any reasonable spur gear.
      This site is entirely free and as such, I humbly request that you please do not automate/spam this API. Thank you!
      
      <br/> 
      <br/> 
  
      <b>Units = mm</b>`,i(e,"class","svelte-zeodk5")},m(t,a){S(t,e,a)},p:g,i:g,o:g,d(t){t&&D(e)}}}class ke extends A{constructor(e){super();P(this,e,null,$e,I,{})}}function qe(r){let e,t,a,s,n,l,m;return{c(){e=_("div"),t=_("span"),a=be(r[1]),s=d(),n=_("input"),i(t,"class","svelte-iptpbk"),i(n,"type","number"),i(n,"step",r[3]),i(n,"name",r[2]),i(n,"min",r[4]),i(n,"max",r[5]),i(n,"class","svelte-iptpbk"),i(e,"class","label svelte-iptpbk")},m(o,c){S(o,e,c),f(e,t),f(t,a),f(e,s),f(e,n),me(n,r[0]),l||(m=W(n,"input",r[6]),l=!0)},p(o,[c]){c&2&&he(a,o[1]),c&8&&i(n,"step",o[3]),c&4&&i(n,"name",o[2]),c&16&&i(n,"min",o[4]),c&32&&i(n,"max",o[5]),c&1&&fe(n.value)!==o[0]&&me(n,o[0])},i:g,o:g,d(o){o&&D(e),l=!1,m()}}}function Te(r,e,t){let{label:a}=e,{name:s}=e,{value:n}=e,{step:l="1"}=e,{min:m=0}=e,{max:o=1e3}=e;function c(){n=fe(this.value),t(0,n)}return r.$$set=p=>{"label"in p&&t(1,a=p.label),"name"in p&&t(2,s=p.name),"value"in p&&t(0,n=p.value),"step"in p&&t(3,l=p.step),"min"in p&&t(4,m=p.min),"max"in p&&t(5,o=p.max)},[n,a,s,l,m,o,c]}class z extends A{constructor(e){super();P(this,e,Te,qe,I,{label:1,name:2,value:0,step:3,min:4,max:5})}}function Ce(r){let e,t,a,s,n,l,m,o,c,p,O,J,b,G,v,q,U,Y,K,T,R,Q,C,F,X,N,Z,H,M,V,x;function ce(u){r[7](u)}let ee={label:"Teeth",name:"teeth",step:"1",min:15};r[0]!==void 0&&(ee.value=r[0]),s=new z({props:ee}),j.push(()=>E(s,"value",ce));function _e(u){r[8](u)}let te={label:"Pitch",name:"pitch",step:"1"};r[1]!==void 0&&(te.value=r[1]),m=new z({props:te}),j.push(()=>E(m,"value",_e));function ge(u){r[9](u)}let ne={label:"Pressure Angle",name:"pa",step:"0.1"};r[2]!==void 0&&(ne.value=r[2]),p=new z({props:ne}),j.push(()=>E(p,"value",ge));function ve(u){r[10](u)}let se={label:"Bore",name:"bore",step:"0.1"};r[3]!==void 0&&(se.value=r[3]),b=new z({props:se}),j.push(()=>E(b,"value",ve));function de(u){r[11](u)}let re={label:"Thickness",name:"thickness",step:"1"};return r[4]!==void 0&&(re.value=r[4]),q=new z({props:re}),j.push(()=>E(q,"value",de)),{c(){e=_("form"),t=_("div"),a=_("div"),h(s.$$.fragment),l=d(),h(m.$$.fragment),c=d(),h(p.$$.fragment),J=d(),h(b.$$.fragment),v=d(),h(q.$$.fragment),Y=d(),K=_("div"),T=_("img"),Q=d(),C=_("div"),F=_("input"),X=d(),N=_("input"),Z=d(),H=_("input"),i(a,"class","gear-parameters"),i(T,"alt","preview of the gear"),pe(T.src,R=`https://api.3dgearmaker.com/gearmaker/spur/preview?teeth=${r[0]}&pitch=${r[1]}&pa=${r[2]}&bore=${r[3]}&thickness=${r[4]}`)||i(T,"src",R),i(T,"class","svelte-qwt49y"),i(K,"class","gear-preview svelte-qwt49y"),i(t,"class","form svelte-qwt49y"),i(F,"class","button svelte-qwt49y"),i(F,"type","button"),F.value="Reset",i(N,"class","button svelte-qwt49y"),i(N,"type","button"),N.value="View OpenSCAD Code",i(H,"class","button svelte-qwt49y"),i(H,"type","submit"),H.value="Download STL",i(C,"class","actions svelte-qwt49y"),i(e,"action","https://api.3dgearmaker.com/gearmaker/spur/stl"),i(e,"method","GET"),i(e,"class","svelte-qwt49y")},m(u,L){S(u,e,L),f(e,t),f(t,a),y(s,a,null),f(a,l),y(m,a,null),f(a,c),y(p,a,null),f(a,J),y(b,a,null),f(a,v),y(q,a,null),f(t,Y),f(t,K),f(K,T),f(e,Q),f(e,C),f(C,F),f(C,X),f(C,N),f(C,Z),f(C,H),M=!0,V||(x=[W(F,"click",r[5]),W(N,"click",r[6])],V=!0)},p(u,[L]){const ae={};!n&&L&1&&(n=!0,ae.value=u[0],B(()=>n=!1)),s.$set(ae);const le={};!o&&L&2&&(o=!0,le.value=u[1],B(()=>o=!1)),m.$set(le);const ue={};!O&&L&4&&(O=!0,ue.value=u[2],B(()=>O=!1)),p.$set(ue);const ie={};!G&&L&8&&(G=!0,ie.value=u[3],B(()=>G=!1)),b.$set(ie);const oe={};!U&&L&16&&(U=!0,oe.value=u[4],B(()=>U=!1)),q.$set(oe),(!M||L&31&&!pe(T.src,R=`https://api.3dgearmaker.com/gearmaker/spur/preview?teeth=${u[0]}&pitch=${u[1]}&pa=${u[2]}&bore=${u[3]}&thickness=${u[4]}`))&&i(T,"src",R)},i(u){M||(w(s.$$.fragment,u),w(m.$$.fragment,u),w(p.$$.fragment,u),w(b.$$.fragment,u),w(q.$$.fragment,u),M=!0)},o(u){$(s.$$.fragment,u),$(m.$$.fragment,u),$(p.$$.fragment,u),$(b.$$.fragment,u),$(q.$$.fragment,u),M=!1},d(u){u&&D(e),k(s),k(m),k(p),k(b),k(q),V=!1,ye(x)}}}function Le(r,e,t){let a=24,s=20,n=14.5,l=5,m=6;function o(){t(0,a=24),t(1,s=20),t(2,n=14.5),t(3,l=5),t(4,m=6)}function c(){window.location.assign(`https://api.3dgearmaker.com/gearmaker/spur/code?teeth=${a}&pitch=${s}&pa=${n}&bore=${l}&thickness=${m}`)}function p(v){a=v,t(0,a)}function O(v){s=v,t(1,s)}function J(v){n=v,t(2,n)}function b(v){l=v,t(3,l)}function G(v){m=v,t(4,m)}return[a,s,n,l,m,o,c,p,O,J,b,G]}class Ae extends A{constructor(e){super();P(this,e,Le,Ce,I,{})}}function Pe(r){let e,t,a,s,n;return t=new ke({}),s=new Ae({}),{c(){e=_("content"),h(t.$$.fragment),a=d(),h(s.$$.fragment),i(e,"class","svelte-dh2jpw")},m(l,m){S(l,e,m),y(t,e,null),f(e,a),y(s,e,null),n=!0},p:g,i(l){n||(w(t.$$.fragment,l),w(s.$$.fragment,l),n=!0)},o(l){$(t.$$.fragment,l),$(s.$$.fragment,l),n=!1},d(l){l&&D(e),k(t),k(s)}}}class Ie extends A{constructor(e){super();P(this,e,null,Pe,I,{})}}function Se(r){let e;return{c(){e=_("footer"),e.innerHTML='Copyright \xA9 2022, <a href="https://joshcole.dev/" target="_blank">Josh Cole</a>',i(e,"class","svelte-1tgbrng")},m(t,a){S(t,e,a)},p:g,i:g,o:g,d(t){t&&D(e)}}}class De extends A{constructor(e){super();P(this,e,null,Se,I,{})}}function Fe(r){let e;return{c(){e=_("div"),e.textContent="3D Gear Maker",i(e,"class","header svelte-ake2t5")},m(t,a){S(t,e,a)},p:g,i:g,o:g,d(t){t&&D(e)}}}class Ne extends A{constructor(e){super();P(this,e,null,Fe,I,{})}}function Oe(r){let e,t,a,s,n,l,m;return t=new Ne({}),s=new Ie({}),l=new De({}),{c(){e=_("main"),h(t.$$.fragment),a=d(),h(s.$$.fragment),n=d(),h(l.$$.fragment),i(e,"class","svelte-1oyedop")},m(o,c){S(o,e,c),y(t,e,null),f(e,a),y(s,e,null),f(e,n),y(l,e,null),m=!0},p:g,i(o){m||(w(t.$$.fragment,o),w(s.$$.fragment,o),w(l.$$.fragment,o),m=!0)},o(o){$(t.$$.fragment,o),$(s.$$.fragment,o),$(l.$$.fragment,o),m=!1},d(o){o&&D(e),k(t),k(s),k(l)}}}class Ge extends A{constructor(e){super();P(this,e,null,Oe,I,{})}}new Ge({target:document.getElementById("app")});
  