!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("highlight.js/lib/core"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","highlight.js/lib/core"],t);else{var r="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("highlight.js/lib/core")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["highlight.js/lib/core"]);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(self,(e,t,r,i,o,n)=>(()=>{"use strict";var a,s,l,c,p,u={291(e){e.exports=o},318(e){e.exports=i},429(e){e.exports=t},2364(e,t,r){new WeakMap},5001(e){e.exports=n},5125(e){e.exports=r},6436(e,t,r){r.r(t),r.d(t,{InputFile:()=>i}),r(5983);var i,o=r(7704),n=r(4084),a=r(5001),s=r.n(a),l=r(7161),c=r(429),p=r(291),u=r(3241),d=function(e,t,r,i){var o,n=arguments.length,a=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,r,a):o(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a},f=function(e,t,r,i){return new(r||(r=Promise))(function(o,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};!function(e){let t=class extends l.LitElement{constructor(){super(...arguments),this.acceptLanguage="javascript",this.getLocalization="Input File",this.acceptTypes="",this.fileName=""}static get styles(){return[n.A,u.A]}triggerFileLoad(e){e.preventDefault(),this.input.click()}handleFile(e){return f(this,void 0,void 0,function*(){e.preventDefault();const t=this.input.files;if(t&&0!==t.length)for(const e of t){this.fileName=e.name;try{yield this.readFile(e)}catch(e){console.error("Error reading file",e)}}})}readFile(e){return new Promise((t,r)=>{const i=new FileReader;i.onload=e=>{t(e.target.result)},i.onerror=e=>r(e),i.readAsText(e)})}importLanguage(e){return f(this,void 0,void 0,function*(){try{const{default:t}=yield r(2908)(`./${e}`);s().registerLanguage(`${e}`,t),this.setAcceptTypes()}catch(e){console.warn("Please set correct language name")}})}getAllAcceptTypes(){const e=s().listLanguages();return e.length?e.map(e=>s().getLanguage(`${e}`).aliases).map(e=>e.map(e=>`.${e}`)).join(","):""}setAcceptTypes(){this.acceptTypes=this.getAllAcceptTypes()}updated(e){super.updated(e),e.has("acceptLanguage")&&this.importLanguage(this.acceptLanguage)}render(){return l.html`
        <div class="md-input-file">
          <label for="file-input">
            <md-button color="blue" class="md-input-file-btn" @click=${this.triggerFileLoad}>
              ${this.getLocalization.trim()}
            </md-button>
            ${this.fileName.length?this.fileName:l.nothing}
          </label>
          <input
            type="file"
            id="file-input"
            name="file-input"
            accept=${(0,p.ifDefined)(this.acceptTypes||void 0)}
            @change=${e=>this.handleFile(e)}
          />
        </div>
      `}};d([(0,c.property)({type:String,attribute:"accept-language"})],t.prototype,"acceptLanguage",void 0),d([(0,c.property)({type:String})],t.prototype,"getLocalization",void 0),d([(0,c.query)("input[type='file']")],t.prototype,"input",void 0),d([(0,c.state)()],t.prototype,"acceptTypes",void 0),d([(0,c.state)()],t.prototype,"fileName",void 0),t=d([(0,o.wW)("md-input-file")],t),e.ELEMENT=t}(i||(i={}))},7161(t){t.exports=e},7704(e,t,r){r.d(t,{wW:()=>i.w}),r(2364),r(3203),r(9938),r(5201),r(4781),r(608);var i=r(9609)}},d={};function f(e){var t=d[e];if(void 0!==t)return t.exports;var r=d[e]={exports:{}};return u[e](r,r.exports,f),r.exports}f.m=u,a=[],f.O=(e,t,r,i)=>{if(!t){var o=1/0;for(c=0;c<a.length;c++){for(var[t,r,i]=a[c],n=!0,s=0;s<t.length;s++)(!1&i||o>=i)&&Object.keys(f.O).every(e=>f.O[e](t[s]))?t.splice(s--,1):(n=!1,i<o&&(o=i));if(n){a.splice(c--,1);var l=r();void 0!==l&&(e=l)}}return e}i=i||0;for(var c=a.length;c>0&&a[c-1][2]>i;c--)a[c]=a[c-1];a[c]=[t,r,i]},f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},l=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);f.r(r);var i={};s=s||[null,l({}),l([]),l(l)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~s.indexOf(o);o=l(o))Object.getOwnPropertyNames(o).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,f.d(r,i),r},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce((t,r)=>(f.f[r](e,t),t),[])),f.u=e=>"chunks/md-"+e+".js",f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c={},p="@momentum-ui/web-components:",f.l=(e,t,r,i)=>{if(c[e])c[e].push(t);else{var o,n;if(void 0!==r)for(var a=document.getElementsByTagName("script"),s=0;s<a.length;s++){var l=a[s];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==p+r){o=l;break}}o||(n=!0,(o=document.createElement("script")).charset="utf-8",f.nc&&o.setAttribute("nonce",f.nc),o.setAttribute("data-webpack",p+r),o.src=e),c[e]=[t];var u=(t,r)=>{o.onerror=o.onload=null,clearTimeout(d);var i=c[e];if(delete c[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach(e=>e(r)),t)return t(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),n&&document.head.appendChild(o)}},f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.p="/",(()=>{var e={561:0,2364:0,2942:0,5323:0,7032:0,7704:0,8180:0,9983:0};f.f.j=(t,r)=>{var i=f.o(e,t)?e[t]:void 0;if(0!==i)if(i)r.push(i[2]);else{var o=new Promise((r,o)=>i=e[t]=[r,o]);r.push(i[2]=o);var n=f.p+f.u(t),a=new Error;f.l(n,r=>{if(f.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",a.name="ChunkLoadError",a.type=o,a.request=n,i[1](a)}},"chunk-"+t,t)}},f.O.j=t=>0===e[t];var t=(t,r)=>{var i,o,[n,a,s]=r,l=0;if(n.some(t=>0!==e[t])){for(i in a)f.o(a,i)&&(f.m[i]=a[i]);if(s)var c=s(f)}for(t&&t(r);l<n.length;l++)o=n[l],f.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return f.O(c)},r=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var g=f.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9938,4781,5201,8227,2900,3203,5734],()=>f(6436));return f.O(g)})());