const t=t=>typeof t,e=t(""),r=t(!0),n=t(0),o="type",a=t=>(e,r,n)=>t(e)?n?.():r(e),s=t=>null==t,c=a(s),l=a(t=>void 0===t),u=Object,i=t=>u.getPrototypeOf(t),y=u.entries,f=u.keys,p=u.freeze,g=(t=[])=>u.fromEntries(t),d=(t,e)=>((t,e)=>t.forEach(e))(y(t),([t,r])=>e(r,t)),h=(t,e,r)=>{const n=t.ast||t,a=n._tag;if("Union"===a){const t=n.types;return[{[o]:m(t[0]._tag)},e,r||(s=t,c=t=>"Literal"===t._tag&&null===t.literal,!!s.find(c))]}var s,c;return[{[o]:m(a)},e,r||!1]},m=t=>"StringKeyword"===t?e:"NumberKeyword"===t?n:"BooleanKeyword"===t?r:"",w=t=>{const e=t.ast;if("TypeLiteral"===e._tag){const t=e.propertySignatures;if(t){const e={};return t.forEach(t=>{e[t.name]=t.type}),e}}},S=()=>((t,a)=>{const y=a=>{const[s,c,u]=t(a),i=s?.type;if(i!==e&&i!==n&&i!==r)return;const y={[o]:i};return l(c,t=>{y.default=t}),u&&(y.allowNull=!0),y};return p({toTablesSchema:t=>{const e=g();return d(t,(t,r)=>{const n=g();var o;l(a(t),t=>d(t,(t,e)=>l(y(t),t=>{n[e]=t}))),(t=>!s(t)&&c(i(t),t=>t==u.prototype||s(i(t)),()=>!0))(o=n)&&0==(t=>f(t).length)(o)||(e[r]=n)}),e},toValuesSchema:t=>{const e=g();return d(t,(t,r)=>l(y(t),t=>{e[r]=t})),e}})})(h,w);export{S as createEffectSchematizer};
