!function(e,n){"object"==typeofexports&&"undefined"!=typeofmodule?n(exports):"function"==typeofdefine&&define.amd?define(["exports"],n):n(e.wanakana=e.wanakana||{})}(this,function(e){"use strict";functionn(e){return"string"!=typeofe||!e.length}functiont(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"",t=arguments[1],a=arguments[2];if(n(e))return!1;varr=e.charCodeAt(0);returnr>=t&&a>=r}functiona(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"";return[].concat(le(e)).map(function(e,n){vara=e.charCodeAt(0),r=t(e,re,oe),o=t(e,ie,ue);returnr?String.fromCharCode(a-re+V):o?String.fromCharCode(a-ie+W):e}).join("")}functionr(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"",t=1>=arguments.length||void0===arguments[1]||arguments[1];if(n(e))return!1;vara=t?/[bcdfghjklmnpqrstvwxyz]/:/[bcdfghjklmnpqrstvwxz]/;return-1!==e.toLowerCase().charAt(0).search(a)}functiono(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"";return!n(e)&&t(e,W,Y)}functioni(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void0!==arguments[1]?arguments[1]:0;returnMath.min(e,n)}functionu(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void0!==arguments[1]?arguments[1]:0,t=arguments[2];returne.slice(n,t)}functiony(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"",t=1>=arguments.length||void0===arguments[1]||arguments[1];if(n(e))return!1;vara=t?/[aeiouy]/:/[aeiou]/;return-1!==e.toLowerCase().charAt(0).search(a)}functionc(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"";return!n(e)&&e.charCodeAt(0)===ye}functionh(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"";return!n(e)&&e.charCodeAt(0)===ce}functions(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"";return!n(e)&&(!!c(e)||t(e,Z,$))}functionf(){vare=[];return(arguments.length>0&&void0!==arguments[0]?arguments[0]:"").split("").forEach(function(n){if(c(n)||h(n))e.push(n);elseif(s(n)){vart=n.charCodeAt(0)+(ee-Z),a=String.fromCharCode(t);e.push(a)}elsee.push(n)}),e.join("")}functiond(){returnt(arguments.length>0&&void0!==arguments[0]?arguments[0]:"",ee,ne)}functionv(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"";return!n(e)&&(s(e)||d(e))}functionl(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"";return!n(e)&&[].concat(le(e)).every(v)}functiong(){for(vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void0!==arguments[2]&&arguments[2],c=Object.assign({},X,n),h=[],s=0,d=e.length,v=3,g="",w="";d>s;){varp=null;for(v=i(3,d-s);v>0;){if(g=u(e,s,s+v),w=g.toLowerCase(),se.includes(w)&&d-s>=4)w=(g=u(e,s,s+(v+=1))).toLowerCase();else{if("n"===w.charAt(0)){if(2===v){if(!c.IMEMode&&" "===w.charAt(1)){p="ん ";break}if(c.IMEMode&&"n'"===w){p="ん";break}}r(w.charAt(1),!1)&&y(w.charAt(2))&&(w=(g=u(e,s,s+(v=1))).toLowerCase())}"n"!==w.charAt(0)&&r(w.charAt(0))&&g.charAt(0)===g.charAt(1)&&(v=1,t(g.charAt(0),W,Y)?(w="ッ",g="ッ"):(w="っ",g="っ"))}if(null!=(p=fe[w]))break;v-=4===v?2:1}null==p&&(p=g),c.useObsoleteKana&&("wi"===w&&(p="ゐ"),"we"===w&&(p="ゑ")),c.IMEMode&&"n"===w.charAt(0)&&("y"===e.charAt(s+1).toLowerCase()&&!1===y(e.charAt(s+2))||s===d-1||l(e.charAt(s+1)))&&(p=g.charAt(0)),a||o(g.charAt(0))&&(p=f(p)),h.push(p),s+=v||1}returnh.join("")}functionw(e){varn=m(arguments.length>1&&void0!==arguments[1]?arguments[1]:{});if(einstanceofElement&&ge.includes(e.nodeName)){vart=be();e.setAttribute("data-wanakana-id",t),e.autocapitalize="none",e.addEventListener("compositionupdate",b),e.addEventListener("input",n),we=k(n,t)}elseconsole.warn("Input provided to wanakana.bind was not a valid input field.")}functionp(e){varn=j(e);null!=n?(e.removeAttribute("data-wanakana-id"),e.removeEventListener("compositionupdate",b),e.removeEventListener("input",n.handler),we=A(n)):console.warn("Input had no listener registered.")}functionm(e){varn=Object.assign(