summaryrefslogtreecommitdiffhomepage
path: root/954.234578a05d7ee3f50b3d.js
diff options
context:
space:
mode:
Diffstat (limited to '954.234578a05d7ee3f50b3d.js')
-rw-r--r--954.234578a05d7ee3f50b3d.js3
1 files changed, 0 insertions, 3 deletions
diff --git a/954.234578a05d7ee3f50b3d.js b/954.234578a05d7ee3f50b3d.js
deleted file mode 100644
index 50853ff..0000000
--- a/954.234578a05d7ee3f50b3d.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! For license information please see 954.234578a05d7ee3f50b3d.js.LICENSE.txt */
-(self.webpackChunkapp=self.webpackChunkapp||[]).push([[954],{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},90954:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return xe}});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),f=r(64261),h=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,h.jsx)(f.Z,{children:(0,h.jsxs)(d.Z,{onDismiss:t,children:[(0,h.jsx)("h2",{children:r}),o&&(0,h.jsxs)("p",{children:["Errors in the file ",(0,h.jsx)("code",{children:o}),"."]}),(0,h.jsx)("ul",{style:p,children:n.map((function(e,t){return(0,h.jsx)("li",{style:y,children:e},t)}))})]})})}var v=r(97168),g=r(35161),b=r.n(g),x="selectedGithubRepository",w="selectedGithubBranch",j="selectedGithubKeyboard";function k(e,t){try{return JSON.parse(localStorage.getItem("".concat(j,":").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 O={blocked:!1,initialized:!1,selectedRepoId:null,selectedBranchName:null,selectedKeyboard:null,branches:[],keyboards:[],loading:!1,warningFlags:[]},S=(0,v.oM)({name:"github-picker",initialState:O,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.loading=!0},loadedBranchesList:function(e,t){var r=e.selectedRepoId,n=t.payload.branches,i=o()(u.Z.repositories,{id:r});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(w,":").concat(e)))}catch(e){return null}}(r),l=0,d=[1===n.length?n[0].name:null,s,c];l<d.length;l++){var f=d[l];if(a.includes(f)){e.selectedBranchName=f,e.selectedKeyboard=k(r,f);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,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(w,":").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(j,":").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)(S.reducer,O),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(S.actions).reduce((function(t,r){return t[r]=function(){var t;return e((t=S.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,h.jsx)(f.Z,{children:(0,h.jsxs)(d.Z,{onDismiss:t,children:[(0,h.jsx)("h2",{children:"Missing keyboard definition?"}),(0,h.jsxs)("p",{children:["Hi there! The repository you're trying to load from doesn't have a defined ",(0,h.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,h.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,h.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,P=r(2968);function A(e){var t=e.installation,r="https://github.com/settings/installations/".concat(t.id);return(0,h.jsx)(f.Z,{children:(0,h.jsxs)(d.Z,{dismissText:null,children:[(0,h.jsx)("h2",{children:"App Disabled"}),(0,h.jsxs)("p",{children:["Hello there, your installation of the keymap editor's GitHub app is currently disabled. ",(0,h.jsx)("em",{children:"This is not a ban!"})]}),(0,h.jsxs)("p",{children:["When you installed this app for your GitHub account you installed it for ",(0,h.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,h.jsx)("h3",{children:"How to fix this"}),(0,h.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,h.jsx)(P.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,h.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."})]})})}A.propTypes={installation:l().shape({id:l().number.isRequired}).isRequired};var N=A,T=r(80031);function _(e){var t=e.onDismiss;return(0,h.jsx)(f.Z,{children:(0,h.jsxs)(d.Z,{onDismiss:t,children:[(0,h.jsx)("h2",{children:"Is this a zmk-config repo?"}),(0,h.jsxs)("p",{children:["Hi there! The repository you're trying to load from doesn't have a defined ",(0,h.jsx)("code",{children:"config"})," directory. Right now this application is expecting to look at that directory to discover keymaps and other metadata."]}),T.t6]})})}_.propTypes={onDismiss:l().func.isRequired,otherRepoOrBranchAvailable:l().bool};var C=_,G=r(92087),F=function(){return(0,h.jsx)(f.Z,{children:(0,h.jsxs)(d.Z,{dismissText:null,children:[(0,h.jsx)("h2",{children:"GitHub Account Blocked"}),(0,h.jsx)("p",{children:"Hi, your access to this application has been disabled."}),(0,h.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,h.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,h.jsx)(f.Z,{children:(0,h.jsxs)(d.Z,{onDismiss:t,children:[(0,h.jsx)("h2",{children:"No Layout Available"}),(0,h.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,h.jsxs)("p",{children:["If you meant to include layout data, please make sure that its in the same directory as your keymap, like ",(0,h.jsx)("code",{children:"config/info.json"})," or ",(0,h.jsx)("code",{children:"config/<keyboard>.json"}),"."]}),T.Yo,T.t6]})})}K.propTypes={onDismiss:l().func.isRequired};var B=K,D=r(62092);function M(){return(0,h.jsx)(f.Z,{centerOnly:!0,children:(0,h.jsxs)(d.Z,{dismissText:null,style:{width:"400px"},children:[(0,h.jsx)("h2",{children:"Authenticate with GitHub"}),(0,h.jsx)("p",{children:"Please log-in to GitHub to continue."}),(0,h.jsx)(D.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,h.jsx)(f.Z,{centerOnly:!0,children:(0,h.jsxs)(d.Z,{dismissText:null,children:[(0,h.jsx)("h2",{children:e}),(0,h.jsx)("p",{children:"To begin import your own keymaps, you'll need to grant the Keymap Editor app access to the relevant GitHub repositories. Please make sure to only select repositories that are set up for ZMK keyboard configurations."}),(0,h.jsxs)("p",{children:["This app requires read and write access to the repositories you select in order to write to arbitrary ",(0,h.jsx)("code",{children:".keymap"})," files. It also receives all build action events for the repository, which generates quite a bit of traffic. Selecting ",(0,h.jsx)("code",{children:"All repositories"})," for the app installation will lead to a suspension."]}),(0,h.jsx)(D.Z,{collection:"brands",icon:"github",text:"Add Repository",style:{display:"block",margin:"0 auto"},onClick:function(){return u.Z.beginInstallAppFlow()}})]})})}q.propTypes={};var z=q,J=r(41051);function V(e){var t=e.onDismiss;return(0,h.jsx)(f.Z,{children:(0,h.jsxs)(d.Z,{onDismiss:t,children:[(0,h.jsx)("h2",{children:"No Keymap Available"}),(0,h.jsxs)("p",{children:["We couldn't find a ",(0,h.jsx)("code",{children:".keymap"})," file in your ",(0,h.jsx)("code",{children:"config/"})," folder."]}),(0,h.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,h.jsx)("code",{children:"config/boards/..."})," directory."]}),(0,h.jsxs)("p",{children:["If you have any questions please feel free to reach out by creating an issue at ",T.qM,"."]})]})})}V.propTypes={onDismiss:l().func.isRequired};var Y=V,W=r(10593);function $(){return(0,h.jsx)(J.Z,{name:"shield",title:"Branch is protected -- cannot commit changes"})}function U(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,f=i.selectedBranchChoice,p=i.selectedKeyboardChoice,y=t.branches,m=t.keyboards,v=t.loading;return(0,h.jsxs)(h.Fragment,{children:[(0,h.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,h.jsx)(h.Fragment,{children:"value"===r?e.name:e.full||e.name})}}),y.length>1&&(0,h.jsx)(Z.Ph,{label:"Branch",value:f,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,h.jsxs)(h.Fragment,{children:[e.protected&&(0,h.jsx)($,{})," ",e.name]})}}),m.length>1&&(0,h.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,h.jsx)(Z.oT,{children:(0,h.jsx)(W.Z,{})})]})}var Q=r(34383);function X(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,h.jsx)("div",{onClick:i,children:(0,h.jsxs)("div",{className:Q.Z.compactWrapper,children:[(0,h.jsxs)(Z.oT,{id:"compact-github-picker",style:{display:"flex",flexDirection:"column",justifyContent:"center",lineHeight:"normal"},children:[(0,h.jsx)("span",{children:c.name}),(0,h.jsxs)("span",{style:{marginLeft:"10px",fontSize:"65%"},children:[(0,h.jsx)(J.Z,{name:"code-branch"}),s]})]}),(0,h.jsxs)(Z.oT,{style:{},children:["/ ",u?(0,h.jsx)(W.Z,{}):l||(null===(t=a[0])||void 0===t?void 0:t.name)]})]})})}function ee(e){return ee="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},ee(e)}function te(){te=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 f?t:f,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:w(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 f(){}function h(){}function p(){}var y={};s(y,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==t&&r.call(v,i)&&(y=v);var g=p.prototype=f.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"==ee(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 w(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=j(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 j(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,j(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 O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function S(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 h.prototype=p,n(g,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:h,configurable:!0}),h.displayName=s(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"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=S,O.prototype={constructor:O,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:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function re(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 ne(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){re(i,n,o,a,c,"next",e)}function c(e){re(i,n,o,a,c,"throw",e)}a(void 0)}))}}function oe(e){return function(e){if(Array.isArray(e))return ie(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 ie(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)?ie(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 ie(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 ae=r(8374);function ce(e){return ce="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},ce(e)}function se(){se=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 f?t:f,a=Object.create(i.prototype),c=new O(o||[]);return n(a,"_invoke",{value:w(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 f(){}function h(){}function p(){}var y={};s(y,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==t&&r.call(v,i)&&(y=v);var g=p.prototype=f.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"==ce(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 w(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=j(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 j(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,j(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 O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function S(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 h.prototype=p,n(g,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:h,configurable:!0}),h.displayName=s(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"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=S,O.prototype={constructor:O,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:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function le(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 ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach((function(t){de(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function de(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==ce(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ce(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fe(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 he(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 pe(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)?pe(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 pe(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 ye=function(e){return a()(e,{name:"MissingRepoFile",path:"config"})},me=function(e){return a()(e,{name:"MissingRepoFile",intent:"directory-structure"})},ve=function(e){return a()(e,{name:"MissingRepoFile",path:"config/info.json"})||a()(e,{name:"MissingRepoFile",intent:"metadata"})},ge=function(e){return"MissingRepoFile"===(null==e?void 0:e.name)&&(null==e?void 0:e.path.match(/config\/boards\/[^/]+\/[^/]+\/[^/]+?\..*$/))};function be(e){var t=he(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,"...]")}})),f=(0,c.useMemo)((function(){return[].concat(oe(l),oe(d))}),[l,d]),h=(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()(h,{id:a})}),[h,a]),v=(0,c.useMemo)((function(){return o()(p,{id:s})}),[p,s]);return(0,c.useEffect)((function(){i&&ne(te().mark((function e(){var r,n;return te().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&&ne(te().mark((function e(){var r,n;return te().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:f,branchChoices:h,keyboardChoices:p},{selectedRepoChoice:y,selectedBranchChoice:m,selectedKeyboardChoice:v}]}(r,n),a=he(i,2),s=a[0],l=a[1],d=r.initialized,f=r.selectedRepoId,p=r.selectedBranchName,y=r.selectedKeyboard,v=r.loading,g=e.expanded,b=e.onSelect,x=e.onExpand,w=e.onError;(0,c.useEffect)((function(){var e=function(){return u.Z.beginLoginFlow()},t=function(){n.clearSelection(),w({dialog:F})},r=function(){n.clearSelection(),w({dialog:G.Z})},o=function(e){var t=m;ye(e)&&(t=C),ge(e)&&(t=R),ve(e)&&(t=B),me(e)&&(t=Y),n.clearSelection(),w({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,w]);var j=(0,c.useCallback)(function(){var e,t=(e=se().mark((function e(t,r,i){var a,c,l,d,f,h;return se().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,f=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:h=e.sent,n.keyboardLoadedSuccess({response:h}),b(ue({github:{repository:d,branch:r,keyboard:i,isProtected:f}},h));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){fe(i,n,o,a,c,"next",e)}function c(e){fe(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 j(f,p,y)}),[j,f,p,y]);return(0,c.useEffect)((function(){f&&p&&j(f,p,y)}),[f,p,y,j]),d?r.blocked?(0,h.jsx)(F,{}):u.Z.isGitHubAuthorized()?u.Z.isAppInstalled()?u.Z.isAppSuspendedForRepoSelection()?(0,h.jsx)(N,{installation:u.Z.installations[0]}):(0,h.jsxs)(h.Fragment,{children:[g?(0,h.jsx)(U,{state:r,actions:n,choices:s,selections:l}):(0,h.jsx)(X,{onExpand:x,state:r,actions:n,choices:s,selections:l}),p&&!v&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Z.zx,{onClick:k,children:(0,h.jsx)(J.Z,{name:"sync"})}),(0,h.jsx)(ae.e,{})]})]}):(0,h.jsx)(z,{}):(0,h.jsx)(H,{}):null}be.propTypes={expanded:l().bool.isRequired,onExpand:l().func.isRequired,onError:l().func.isRequired,onSelect:l().func.isRequired};var xe=be},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=954.234578a05d7ee3f50b3d.js.map \ No newline at end of file