summaryrefslogtreecommitdiffhomepage
path: root/712.67ca3937367603e5061e.js
diff options
context:
space:
mode:
Diffstat (limited to '712.67ca3937367603e5061e.js')
-rw-r--r--712.67ca3937367603e5061e.js3
1 files changed, 0 insertions, 3 deletions
diff --git a/712.67ca3937367603e5061e.js b/712.67ca3937367603e5061e.js
deleted file mode 100644
index 063de06..0000000
--- a/712.67ca3937367603e5061e.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! For license information please see 712.67ca3937367603e5061e.js.LICENSE.txt */
-(self.webpackChunkapp=self.webpackChunkapp||[]).push([[712],{92087:function(e,t,r){"use strict";var n=r(45697),o=r.n(n),i=r(96186),a=r(64261),c=r(80031),s=r(85893);function l(e){var t=e.onDismiss;return(0,s.jsx)(a.Z,{children:(0,s.jsxs)(i.Z,{onDismiss:t,children:[(0,s.jsx)("h2",{children:"Automatic Layout Generation Failed"}),(0,s.jsx)("p",{children:"No accompanying layout was found with your keymap file and the Keymap Editor was unable to generate one automatically for you."}),(0,s.jsx)("p",{children:"Something went wrong with the attempted automatic layout generation for your keyboard and there's no automatic way to recover, but if you want to reach out for assistance maybe we can work together to resolve any technical issues or else craft a manual layout for your keyboard."}),(0,s.jsxs)("p",{children:["Share your experience at ",c.qM,"."]})]})})}l.propTypes={onDismiss:o().func.isRequired},t.Z=l},80712:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return we}});var n=r(13311),o=r.n(n),i=r(66379),a=r.n(i),c=r(67294),s=r(45697),l=r.n(s),u=r(93965),d=r(96186),h=r(64261),f=r(85893),p={maxHeight:"300px",overflow:"auto",padding:"10px",fontFamily:"monospace",fontSize:"80%",backgroundColor:"rgb(239, 239, 239, 0.5)"},y={margin:"10px"};function m(e){var t=e.onDismiss,r=e.title,n=e.errors,o=function(e){return"InfoValidationError"===e?"config/info.json":"KeymapValidationError"===e?"config/keymap.json":void 0}(r);return(0,f.jsx)(h.Z,{children:(0,f.jsxs)(d.Z,{onDismiss:t,children:[(0,f.jsx)("h2",{children:r}),o&&(0,f.jsxs)("p",{children:["Errors in the file ",(0,f.jsx)("code",{children:o}),"."]}),(0,f.jsx)("ul",{style:p,children:n.map((function(e,t){return(0,f.jsx)("li",{style:y,children:e},t)}))})]})})}var v=r(97168),g=r(35161),b=r.n(g),x="selectedGithubRepository",j="selectedGithubBranch",w="selectedGithubKeyboard";function k(e,t){try{return JSON.parse(localStorage.getItem("".concat(w,":").concat(e,":").concat(t)))}catch(e){return null}}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var S={blocked:!1,initialized:!1,selectedRepoId:null,selectedBranchName:null,selectedKeyboard:null,noBranches:!1,branches:[],keyboards:[],loading:!1,warningFlags:[]},O=(0,v.oM)({name:"github-picker",initialState:S,reducers:{clearSelection:function(e){e.warningFlags=[],e.loading=!1},integrationInitialized:function(e){var t,r=function(){try{return JSON.parse(localStorage.getItem(x))}catch(e){return null}}(),n=u.Z.repositories||[];o()(n,{id:r})?t=r:n.length>0&&(t=n[0].id),e.initialized=!0,e.selectedRepoId=t},loadingBranchesList:function(e){e.noBranches=!1,e.loading=!0},loadedBranchesList:function(e,t){var r=e.selectedRepoId,n=t.payload.branches,i=o()(u.Z.repositories,{id:r});e.noBranches=0===n.length,e.branches=n,e.keyboard=null,e.keyboards=[],e.loading=!1;for(var a=b()(n,"name"),c=i.default_branch,s=function(e){try{return JSON.parse(localStorage.getItem("".concat(j,":").concat(e)))}catch(e){return null}}(r),l=0,d=[1===n.length?n[0].name:null,s,c];l<d.length;l++){var h=d[l];if(a.includes(h)){e.selectedBranchName=h,e.selectedKeyboard=k(r,h);break}}},loadingKeyboardsList:function(e){e.loading=!0},loadedKeyboardsList:function(e,t){var r=e.selectedRepoId,n=e.selectedBranchName,o=t.payload,i=o.keyboards,a=o.default;e.keyboards=i,e.loading=!1;for(var c=k(r,n),s=0,l=[1===i.length?i[0]:null,c,a];s<l.length;s++){var u=l[s];if(i.includes(u)){e.selectedKeyboard=u;break}}},selectedRepository:function(e,t){var r;e.selectedRepoId=t.payload.repository.id,e.selectedBranchName=null,e.selectedKeyboard=null,e.noBranches=!1,e.branches=[],r=e.selectedRepoId,localStorage.setItem(x,JSON.stringify(r))},selectedBranch:function(e,t){var r,n;e.selectedBranchName=t.payload.name,e.selectedKeyboard=k(e.selectedRepoId,e.selectedBranchName),r=e.selectedRepoId,n=e.selectedBranchName,localStorage.setItem("".concat(j,":").concat(r),JSON.stringify(n))},selectedKeyboard:function(e,t){var r,n,o;e.selectedKeyboard=t.payload.name,r=e.selectedRepoId,n=e.selectedBranchName,o=e.selectedKeyboard,localStorage.setItem("".concat(w,":").concat(r,":").concat(n),JSON.stringify(o))},keyboardLoading:function(e,t){e.loading=!0},keyboardLoadedSuccess:function(e,t){var r=t.payload.response.keymap;e.warningFlags=r.warningFlags||[],e.loading=!1}}});function E(){var e,t,r,n=(t=(0,c.useReducer)(O.reducer,S),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,c=[],s=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,r)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=n[0],i=(e=n[1],(0,c.useMemo)((function(){return Object.keys(O.actions).reduce((function(t,r){return t[r]=function(){var t;return e((t=O.actions)[r].apply(t,arguments))},t}),{})}),[e]));return[o,i]}var Z=r(69247);function I(e){var t=e.onDismiss,r=e.missingPath;return(0,f.jsx)(h.Z,{children:(0,f.jsxs)(d.Z,{onDismiss:t,children:[(0,f.jsx)("h2",{children:"Missing keyboard definition?"}),(0,f.jsxs)("p",{children:["Hi there! The repository you're trying to load from doesn't have a defined ",(0,f.jsx)("code",{children:r}),". Right now this application is expecting to look at that directory to discover keyboard definitions for experimental features like automatic layout generation."]}),(0,f.jsx)("p",{children:"Is it possible that the keyboard you're trying to edit relies on data from the ZMK or other repositories? Fetching from other repositories is not currently supported."}),(0,f.jsx)("p",{children:"I'm a humble developer and have only worked with configurations for my own handwired builds, so if you feel you're receiving this message in error then please consider opening an issue on this project's GitHub repository to let me know what I can do differently."})]})})}I.propTypes={onDismiss:l().func.isRequired,missingPath:l().string.isRequired};var R=I,A=r(2968),P=r(62092);function N(e){var t=e.installation,r="https://github.com/settings/installations/".concat(t.id);return(0,f.jsx)(h.Z,{children:(0,f.jsxs)(d.Z,{style:{maxWidth:"min-content"},dismissText:null,children:[(0,f.jsx)("h2",{children:"App Disabled"}),(0,f.jsxs)("p",{children:["Hello there, your installation of the keymap editor's GitHub app is currently disabled. ",(0,f.jsx)("em",{children:"This is not a ban!"})]}),(0,f.jsxs)("p",{children:["When you installed this app for your GitHub account you installed it for ",(0,f.jsx)("em",{children:"all"})," of your repositories, and we need to do a little cleanup as we roll out some new features as it's very likely you will have other repositories unrelated to ZMK keyboard configurations."]}),(0,f.jsx)("h3",{children:"How to fix this"}),(0,f.jsxs)("p",{children:["If you're still interested in using the keymap editor (and I'd love for you to be able to) please go to your ",(0,f.jsx)(A.Z,{href:r,children:"installation settings"})," on GitHub and select only the repositories you want to use with this tool. As soon as that's done you'll be sent back here and ready to go."]}),(0,f.jsxs)("div",{style:{display:"flex",gap:"20px",textAlign:"center"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{children:(0,f.jsx)("img",{alt:"Example correct GitHub installation selection",src:"repo-selection-good.png"})}),(0,f.jsx)("p",{children:(0,f.jsx)("strong",{children:"Do this!"})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{children:(0,f.jsx)("img",{alt:"Example incorrect GitHub installation selection",src:"repo-selection-bad.png"})}),(0,f.jsx)("p",{children:(0,f.jsx)("strong",{children:"Don't do this!"})})]})]}),(0,f.jsx)(P.Z,{collection:"brands",icon:"github",text:"Fix Repository Selection",style:{display:"block",margin:"0 auto",fontSize:"120%",padding:"5px 10px"},onClick:function(){window.location.href=r}}),(0,f.jsx)("p",{children:"As always, if you're looking for clarification or further assistance please visit our GitHub repo and open an issue or start a discussion."})]})})}N.propTypes={installation:l().shape({id:l().number.isRequired}).isRequired};var T=N,G=r(80031);function C(e){var t=e.onDismiss;return(0,f.jsx)(h.Z,{children:(0,f.jsxs)(d.Z,{onDismiss:t,children:[(0,f.jsx)("h2",{children:"Is this a zmk-config repo?"}),(0,f.jsxs)("p",{children:["Hi there! The repository you're trying to load from doesn't have a defined ",(0,f.jsx)("code",{children:"config"})," directory. Right now this application is expecting to look at that directory to discover keymaps and other metadata."]}),G.t6]})})}C.propTypes={onDismiss:l().func.isRequired,otherRepoOrBranchAvailable:l().bool};var _=C,F=r(92087),B=function(){return(0,f.jsx)(h.Z,{children:(0,f.jsxs)(d.Z,{dismissText:null,children:[(0,f.jsx)("h2",{children:"GitHub Account Blocked"}),(0,f.jsx)("p",{children:"Hi, your access to this application has been disabled."}),(0,f.jsxs)("p",{children:["This could be an innocent mistake. Possibly you've misunderstood the intended purpose of this app, possibly I got carried away with some housekeeping. If you want more information or feel this was done in error, please reach out to ",(0,f.jsx)("em",{children:"nickcoutsos"})," on GitHub or Discord (you can find me on the ZMK server)."]})]})})};function K(e){var t=e.onDismiss;return(0,f.jsx)(h.Z,{children:(0,f.jsxs)(d.Z,{onDismiss:t,children:[(0,f.jsx)("h2",{children:"No Layout Available"}),(0,f.jsx)("p",{children:"Your keymap doesn't have an accompanying layout and we don't know enough about your keyboard to generate one for you automatically."}),(0,f.jsxs)("p",{children:["If you meant to include layout data, please make sure that its in the same directory as your keymap, like ",(0,f.jsx)("code",{children:"config/info.json"})," or ",(0,f.jsx)("code",{children:"config/<keyboard>.json"}),"."]}),G.Yo,G.t6]})})}K.propTypes={onDismiss:l().func.isRequired};var D=K;function M(){return(0,f.jsx)(h.Z,{centerOnly:!0,children:(0,f.jsxs)(d.Z,{dismissText:null,style:{width:"400px"},children:[(0,f.jsx)("h2",{children:"Authenticate with GitHub"}),(0,f.jsx)("p",{children:"Please log-in to GitHub to continue."}),(0,f.jsx)(P.Z,{collection:"brands",icon:"github",text:"Login with GitHub",style:{display:"block",margin:"0 auto"},onClick:function(){return u.Z.beginLoginFlow()}})]})})}M.propTypes={};var H=M;function q(){var e=u.Z.username?"Welcome, ".concat(u.Z.username,"!"):"Welcome!";return(0,f.jsx)(h.Z,{centerOnly:!0,children:(0,f.jsxs)(d.Z,{style:{maxWidth:"min-content"},dismissText:null,children:[(0,f.jsx)("h2",{children:e}),(0,f.jsxs)("p",{children:["To begin importing your own keymaps, you'll need to grant the Keymap Editor app access to your relevant GitHub repositories. Please make sure to ",(0,f.jsx)("em",{children:"only"})," select repositories that are set up for ZMK keyboard configurations."]}),(0,f.jsxs)("p",{children:["This app requires read and write access to the repositories you select in order to write to arbitrary ",(0,f.jsx)("code",{children:".keymap"})," files. It also receives all build action events for the repository, which generates quite a bit of traffic."]}),(0,f.jsxs)("div",{style:{display:"flex",gap:"20px",textAlign:"center"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{children:(0,f.jsx)("img",{alt:"Example correct GitHub installation selection",src:"repo-selection-good.png"})}),(0,f.jsx)("p",{children:(0,f.jsx)("strong",{children:"Do this!"})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{children:(0,f.jsx)("img",{alt:"Example incorrect GitHub installation selection",src:"repo-selection-bad.png"})}),(0,f.jsx)("p",{children:(0,f.jsx)("strong",{children:"Don't do this!"})})]})]}),(0,f.jsxs)("p",{children:["Selecting ",(0,f.jsx)("code",{children:"All repositories"})," for the app installation will lead to a suspension."]}),(0,f.jsx)(P.Z,{collection:"brands",icon:"github",text:"Add Repository",style:{display:"block",margin:"0 auto",fontSize:"120%",padding:"5px 10px"},onClick:function(){return u.Z.beginInstallAppFlow()}})]})})}q.propTypes={};var z=q,W=(0,f.jsx)(A.Z,{external:!0,href:"https://zmk.dev/docs/user-setup#user-config-setup-script",children:"User Config Setup Script"});function J(e){var t=e.onDismiss;return(0,f.jsx)(h.Z,{children:(0,f.jsxs)(d.Z,{onDismiss:t,children:[(0,f.jsx)("h2",{children:"Empty Repository"}),(0,f.jsxs)("p",{children:["The selected repository doesn't appear to contain anything yet. please be sure to use ZMK's ",W," to initialize your repo first."]}),G.t6]})})}var V=r(41051);function Y(e){var t=e.onDismiss;return(0,f.jsx)(h.Z,{children:(0,f.jsxs)(d.Z,{onDismiss:t,children:[(0,f.jsx)("h2",{children:"No Keymap Available"}),(0,f.jsxs)("p",{children:["We couldn't find a ",(0,f.jsx)("code",{children:".keymap"})," file in your ",(0,f.jsx)("code",{children:"config/"})," folder."]}),(0,f.jsxs)("p",{children:["Please ensure that any keymap(s) you wish to edit are placed in that directory even if an accompanying keyboard definition exists in your under the ",(0,f.jsx)("code",{children:"config/boards/..."})," directory."]}),(0,f.jsxs)("p",{children:["If you have any questions please feel free to reach out by creating an issue at ",G.qM,"."]})]})})}Y.propTypes={onDismiss:l().func.isRequired};var U=Y,$=r(10593);function Q(){return(0,f.jsx)(V.Z,{name:"shield",title:"Branch is protected -- cannot commit changes"})}function X(e){var t=e.state,r=e.actions,n=e.choices,i=e.selections,a=n.repositories,c=n.repositoryChoices,s=n.branchChoices,l=n.keyboardChoices,d=i.selectedRepoChoice,h=i.selectedBranchChoice,p=i.selectedKeyboardChoice,y=t.branches,m=t.keyboards,v=t.loading;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Z.Ph,{label:"Repository",value:d,options:c,onChange:function(e){var t=e.id;if("installation"!==e.type){var n=o()(a,{id:t});r.selectedRepository({repository:n})}else u.Z.manageInstallationRepos(t)},getValue:function(e){return e.id},getOptionValue:function(e){return e.id},getOptionLabel:function(e){return e.full||e.name},formatOptionLabel:function(e,t){var r=t.context;return(0,f.jsx)(f.Fragment,{children:"value"===r?e.name:e.full||e.name})}}),y.length>1&&(0,f.jsx)(Z.Ph,{label:"Branch",value:h,options:s,onChange:function(e){var t=e.id;return r.selectedBranch({name:t})},getOptionValue:function(e){return e.id},getOptionLabel:function(e){return e.name},formatOptionLabel:function(e){return(0,f.jsxs)(f.Fragment,{children:[e.protected&&(0,f.jsx)(Q,{})," ",e.name]})}}),m.length>1&&(0,f.jsx)(Z.Ph,{label:"Keyboard",value:p,options:l,getOptionValue:function(e){return e.id},getOptionLabel:function(e){return e.name},onChange:function(e){var t=e.id;return r.selectedKeyboard({name:t})}}),v&&(0,f.jsx)(Z.oT,{children:(0,f.jsx)($.Z,{})})]})}var ee=r(34383);function te(e){var t,r=e.choices,n=e.selections,o=e.state,i=e.onExpand,a=r.keyboardChoices,c=n.selectedRepoChoice,s=o.selectedBranchName,l=o.selectedKeyboard,u=o.loading;return(0,f.jsx)("div",{onClick:i,children:(0,f.jsxs)("div",{className:ee.Z.compactWrapper,children:[(0,f.jsxs)(Z.oT,{id:"compact-github-picker",style:{display:"flex",flexDirection:"column",justifyContent:"center",lineHeight:"normal"},children:[(0,f.jsx)("span",{children:c.name}),(0,f.jsxs)("span",{style:{marginLeft:"10px",fontSize:"65%"},children:[(0,f.jsx)(V.Z,{name:"code-branch"}),s]})]}),(0,f.jsxs)(Z.oT,{style:{},children:["/ ",u?(0,f.jsx)($.Z,{}):l||(null===(t=a[0])||void 0===t?void 0:t.name)]})]})})}function re(e){return re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},re(e)}function ne(){ne=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var i=t&&t.prototype instanceof h?t:h,a=Object.create(i.prototype),c=new S(o||[]);return n(a,"_invoke",{value:j(e,r,c)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d={};function h(){}function f(){}function p(){}var y={};s(y,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(O([])));v&&v!==t&&r.call(v,i)&&(y=v);var g=p.prototype=h.prototype=Object.create(y);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function o(n,i,a,c){var s=u(e[n],e,i);if("throw"!==s.type){var l=s.arg,d=l.value;return d&&"object"==re(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,a,c)}),(function(e){o("throw",e,a,c)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,c)}))}c(s.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function j(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=w(a,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,d;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function O(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=p,n(g,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:f,configurable:!0}),f.displayName=s(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(x.prototype),s(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(g),s(g,c,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=O,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function oe(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function ie(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){oe(i,n,o,a,c,"next",e)}function c(e){oe(i,n,o,a,c,"throw",e)}a(void 0)}))}}function ae(e){return function(e){if(Array.isArray(e))return ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ce(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ce(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var se=r(8374);function le(e){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(e)}function ue(){ue=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var i=t&&t.prototype instanceof h?t:h,a=Object.create(i.prototype),c=new S(o||[]);return n(a,"_invoke",{value:j(e,r,c)}),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d={};function h(){}function f(){}function p(){}var y={};s(y,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(O([])));v&&v!==t&&r.call(v,i)&&(y=v);var g=p.prototype=h.prototype=Object.create(y);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function o(n,i,a,c){var s=u(e[n],e,i);if("throw"!==s.type){var l=s.arg,d=l.value;return d&&"object"==le(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,a,c)}),(function(e){o("throw",e,a,c)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,c)}))}c(s.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function j(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=w(a,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function w(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,d;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function O(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=p,n(g,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:f,configurable:!0}),f.displayName=s(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(x.prototype),s(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(g),s(g,c,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=O,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function de(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function he(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?de(Object(r),!0).forEach((function(t){fe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):de(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function fe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==le(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===le(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pe(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function ye(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,c=[],s=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return me(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?me(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ve=function(e){return a()(e,{name:"MissingRepoFile",path:"config"})},ge=function(e){return a()(e,{name:"MissingRepoFile",intent:"directory-structure"})},be=function(e){return a()(e,{name:"MissingRepoFile",path:"config/info.json"})||a()(e,{name:"MissingRepoFile",intent:"metadata"})},xe=function(e){return"MissingRepoFile"===(null==e?void 0:e.name)&&(null==e?void 0:e.path.match(/config\/boards\/[^/]+\/[^/]+\/[^/]+?\..*$/))};function je(e){var t=ye(E(),2),r=t[0],n=t[1],i=function(e,t){var r=e.branches,n=e.keyboards,i=e.selectedRepoId,a=e.selectedBranchName,s=e.selectedKeyboard,l=(u.Z.repositories||[]).map((function(e){return{id:e.id,name:e.name,full:e.full_name}})),d=(u.Z.installations||[]).map((function(e){return{id:e.id,type:"installation",name:"[Manage available repos for ".concat(e.account.login,"...]")}})),h=(0,c.useMemo)((function(){return[].concat(ae(l),ae(d))}),[l,d]),f=(0,c.useMemo)((function(){return r.map((function(e){return{id:e.name,name:e.name,protected:e.protected}}))}),[r]),p=(0,c.useMemo)((function(){return n.map((function(e){return{id:e,name:e}}))}),[n]),y=(0,c.useMemo)((function(){return o()(l,{id:i})}),[l,i]),m=(0,c.useMemo)((function(){return o()(f,{id:a})}),[f,a]),v=(0,c.useMemo)((function(){return o()(p,{id:s})}),[p,s]);return(0,c.useEffect)((function(){i&&ie(ne().mark((function e(){var r,n;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.loadingBranchesList(),r=o()(u.Z.repositories,{id:i}),e.next=4,u.Z.fetchRepoBranches(r);case 4:n=e.sent,t.loadedBranchesList({branches:n});case 6:case"end":return e.stop()}}),e)})))()}),[i,t]),(0,c.useEffect)((function(){i&&a&&ie(ne().mark((function e(){var r,n;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.loadingKeyboardsList(),r=o()(u.Z.repositories,{id:i}),e.next=4,u.Z.fetchBranchKeyboards(r,a);case 4:n=e.sent,t.loadedKeyboardsList(n);case 6:case"end":return e.stop()}}),e)})))()}),[i,a,t]),[{repositories:l,repositoryChoices:h,branchChoices:f,keyboardChoices:p},{selectedRepoChoice:y,selectedBranchChoice:m,selectedKeyboardChoice:v}]}(r,n),a=ye(i,2),s=a[0],l=a[1],d=r.initialized,h=r.selectedRepoId,p=r.selectedBranchName,y=r.selectedKeyboard,v=r.loading,g=e.expanded,b=e.onSelect,x=e.onExpand,j=e.onError;(0,c.useEffect)((function(){var e=function(){return u.Z.beginLoginFlow()},t=function(){n.clearSelection(),j({dialog:B})},r=function(){n.clearSelection(),j({dialog:F.Z})},o=function(e){var t=m;ve(e)&&(t=_),xe(e)&&(t=R),be(e)&&(t=D),ge(e)&&(t=U),n.clearSelection(),j({dialog:t,dialogProps:{title:e.name,errors:e.errors}})};return u.Z.init().then(n.integrationInitialized),u.Z.on("authentication-failed",e),u.Z.on("blocked",t),u.Z.on("repo-validation-error",o),u.Z.on("layout-generation-failed",r),function(){u.Z.off("authentication-failed",e),u.Z.off("blocked",t),u.Z.off("repo-validation-error",o),u.Z.off("layout-generation-failed",r)}}),[n,j]),(0,c.useEffect)((function(){!r.loading&&r.noBranches&&j({dialog:J})}),[r,j]);var w=(0,c.useCallback)(function(){var e,t=(e=ue().mark((function e(t,r,i){var a,c,l,d,h,f;return ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=u.Z.repositories,d=null===(a=o()(l,{id:t}))||void 0===a?void 0:a.full_name,h=null===(c=o()(s.branchChoices,{id:r}))||void 0===c?void 0:c.protected,n.keyboardLoading(),e.next=6,u.Z.fetchLayoutAndKeymap(d,r,{keyboard:i});case 6:f=e.sent,n.keyboardLoadedSuccess({response:f}),b(he({github:{repository:d,branch:r,keyboard:i,isProtected:h}},f));case 9:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){pe(i,n,o,a,c,"next",e)}function c(e){pe(i,n,o,a,c,"throw",e)}a(void 0)}))});return function(e,r,n){return t.apply(this,arguments)}}(),[n,s.branchChoices,b]),k=(0,c.useCallback)((function(){return w(h,p,y)}),[w,h,p,y]);return(0,c.useEffect)((function(){h&&p&&w(h,p,y)}),[h,p,y,w]),d?r.blocked?(0,f.jsx)(B,{}):u.Z.isGitHubAuthorized()?u.Z.isAppSuspendedForRepoSelection()?(0,f.jsx)(T,{installation:u.Z.installations[0]}):u.Z.isAppInstalled()?(0,f.jsxs)(f.Fragment,{children:[g?(0,f.jsx)(X,{state:r,actions:n,choices:s,selections:l}):(0,f.jsx)(te,{onExpand:x,state:r,actions:n,choices:s,selections:l}),p&&!v&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Z.zx,{onClick:k,children:(0,f.jsx)(V.Z,{name:"sync"})}),(0,f.jsx)(se.e,{})]})]}):(0,f.jsx)(z,{}):(0,f.jsx)(H,{}):null}je.propTypes={expanded:l().bool.isRequired,onExpand:l().func.isRequired,onError:l().func.isRequired,onSelect:l().func.isRequired};var we=je},66379:function(e,t,r){var n=r(2958),o=r(1499);e.exports=function(e,t){return e===t||n(e,t,o(t))}}}]);
-//# sourceMappingURL=712.67ca3937367603e5061e.js.map \ No newline at end of file