All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
312 lines
274 KiB
JavaScript
312 lines
274 KiB
JavaScript
/*! For license information please see decap-cms-backend-github.js.LICENSE.txt */
|
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("decap-cms-lib-util"),require("@emotion/react"),require("prop-types"),require("decap-cms-lib-auth"),require("decap-cms-ui-default")):"function"==typeof define&&define.amd?define("DecapCmsBackendGithub",["react","decap-cms-lib-util","@emotion/react","prop-types","decap-cms-lib-auth","decap-cms-ui-default"],t):"object"==typeof exports?exports.DecapCmsBackendGithub=t(require("react"),require("decap-cms-lib-util"),require("@emotion/react"),require("prop-types"),require("decap-cms-lib-auth"),require("decap-cms-ui-default")):e.DecapCmsBackendGithub=t(e.React,e.DecapCmsLibUtil,e.DecapCmsDefaultExports.EmotionCore,e.DecapCmsDefaultExports.PropTypes,e.DecapCmsLibAuth,e.DecapCmsUiDefault)}(window,((e,t,r,n,i,o)=>(()=>{var a={8969:e=>{e.exports={__schema:{types:[{kind:"INTERFACE",name:"Node",possibleTypes:[{name:"AddedToProjectEvent"},{name:"App"},{name:"AssignedEvent"},{name:"BaseRefChangedEvent"},{name:"BaseRefForcePushedEvent"},{name:"Blob"},{name:"Bot"},{name:"BranchProtectionRule"},{name:"ClosedEvent"},{name:"CodeOfConduct"},{name:"CommentDeletedEvent"},{name:"Commit"},{name:"CommitComment"},{name:"CommitCommentThread"},{name:"ConvertedNoteToIssueEvent"},{name:"CrossReferencedEvent"},{name:"DemilestonedEvent"},{name:"DeployKey"},{name:"DeployedEvent"},{name:"Deployment"},{name:"DeploymentEnvironmentChangedEvent"},{name:"DeploymentStatus"},{name:"ExternalIdentity"},{name:"Gist"},{name:"GistComment"},{name:"HeadRefDeletedEvent"},{name:"HeadRefForcePushedEvent"},{name:"HeadRefRestoredEvent"},{name:"Issue"},{name:"IssueComment"},{name:"Label"},{name:"LabeledEvent"},{name:"Language"},{name:"License"},{name:"LockedEvent"},{name:"Mannequin"},{name:"MarketplaceCategory"},{name:"MarketplaceListing"},{name:"MentionedEvent"},{name:"MergedEvent"},{name:"Milestone"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"Organization"},{name:"OrganizationIdentityProvider"},{name:"OrganizationInvitation"},{name:"PinnedEvent"},{name:"Project"},{name:"ProjectCard"},{name:"ProjectColumn"},{name:"PublicKey"},{name:"PullRequest"},{name:"PullRequestCommit"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"},{name:"PullRequestReviewThread"},{name:"PushAllowance"},{name:"Reaction"},{name:"ReadyForReviewEvent"},{name:"Ref"},{name:"ReferencedEvent"},{name:"RegistryPackage"},{name:"RegistryPackageDependency"},{name:"RegistryPackageFile"},{name:"RegistryPackageTag"},{name:"RegistryPackageVersion"},{name:"Release"},{name:"ReleaseAsset"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"Repository"},{name:"RepositoryInvitation"},{name:"RepositoryTopic"},{name:"ReviewDismissalAllowance"},{name:"ReviewDismissedEvent"},{name:"ReviewRequest"},{name:"ReviewRequestRemovedEvent"},{name:"ReviewRequestedEvent"},{name:"SavedReply"},{name:"SecurityAdvisory"},{name:"SponsorsListing"},{name:"Sponsorship"},{name:"Status"},{name:"StatusContext"},{name:"SubscribedEvent"},{name:"Tag"},{name:"Team"},{name:"Topic"},{name:"TransferredEvent"},{name:"Tree"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"},{name:"User"},{name:"UserBlockedEvent"},{name:"UserContentEdit"},{name:"UserStatus"}]},{kind:"INTERFACE",name:"UniformResourceLocatable",possibleTypes:[{name:"Bot"},{name:"ClosedEvent"},{name:"Commit"},{name:"CrossReferencedEvent"},{name:"Gist"},{name:"Issue"},{name:"Mannequin"},{name:"MergedEvent"},{name:"Milestone"},{name:"Organization"},{name:"PullRequest"},{name:"PullRequestCommit"},{name:"ReadyForReviewEvent"},{name:"Release"},{name:"Repository"},{name:"RepositoryTopic"},{name:"ReviewDismissedEvent"},{name:"User"}]},{kind:"INTERFACE",name:"Actor",possibleTypes:[{name:"Bot"},{name:"Mannequin"},{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"RegistryPackageOwner",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"User"}]},{kind:"INTERFACE",name:"ProjectOwner",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"User"}]},{kind:"INTERFACE",name:"Closable",possibleTypes:[{name:"Issue"},{name:"Milestone"},{name:"Project"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Updatable",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"Project"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"UNION",name:"ProjectCardItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Assignable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Comment",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"UpdatableComment",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Labelable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"Lockable",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"INTERFACE",name:"RegistryPackageSearch",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"RepositoryOwner",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"INTERFACE",name:"MemberStatusable",possibleTypes:[{name:"Organization"},{name:"Team"}]},{kind:"INTERFACE",name:"ProfileOwner",possibleTypes:[{name:"Organization"},{name:"User"}]},{kind:"UNION",name:"PinnableItem",possibleTypes:[{name:"Gist"},{name:"Repository"}]},{kind:"INTERFACE",name:"Starrable",possibleTypes:[{name:"Gist"},{name:"Repository"},{name:"Topic"}]},{kind:"INTERFACE",name:"RepositoryInfo",possibleTypes:[{name:"Repository"}]},{kind:"INTERFACE",name:"GitObject",possibleTypes:[{name:"Blob"},{name:"Commit"},{name:"Tag"},{name:"Tree"}]},{kind:"INTERFACE",name:"RepositoryNode",possibleTypes:[{name:"CommitComment"},{name:"CommitCommentThread"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Subscribable",possibleTypes:[{name:"Commit"},{name:"Issue"},{name:"PullRequest"},{name:"Repository"},{name:"Team"}]},{kind:"INTERFACE",name:"Deletable",possibleTypes:[{name:"CommitComment"},{name:"GistComment"},{name:"IssueComment"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"Reactable",possibleTypes:[{name:"CommitComment"},{name:"Issue"},{name:"IssueComment"},{name:"PullRequest"},{name:"PullRequestReview"},{name:"PullRequestReviewComment"}]},{kind:"INTERFACE",name:"GitSignature",possibleTypes:[{name:"GpgSignature"},{name:"SmimeSignature"},{name:"UnknownSignature"}]},{kind:"UNION",name:"RequestedReviewer",possibleTypes:[{name:"User"},{name:"Team"},{name:"Mannequin"}]},{kind:"UNION",name:"PullRequestTimelineItem",possibleTypes:[{name:"Commit"},{name:"CommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewThread"},{name:"PullRequestReviewComment"},{name:"IssueComment"},{name:"ClosedEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"UnsubscribedEvent"},{name:"MergedEvent"},{name:"ReferencedEvent"},{name:"CrossReferencedEvent"},{name:"AssignedEvent"},{name:"UnassignedEvent"},{name:"LabeledEvent"},{name:"UnlabeledEvent"},{name:"MilestonedEvent"},{name:"DemilestonedEvent"},{name:"RenamedTitleEvent"},{name:"LockedEvent"},{name:"UnlockedEvent"},{name:"DeployedEvent"},{name:"DeploymentEnvironmentChangedEvent"},{name:"HeadRefDeletedEvent"},{name:"HeadRefRestoredEvent"},{name:"HeadRefForcePushedEvent"},{name:"BaseRefForcePushedEvent"},{name:"ReviewRequestedEvent"},{name:"ReviewRequestRemovedEvent"},{name:"ReviewDismissedEvent"},{name:"UserBlockedEvent"}]},{kind:"UNION",name:"Closer",possibleTypes:[{name:"Commit"},{name:"PullRequest"}]},{kind:"UNION",name:"ReferencedSubject",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"Assignee",possibleTypes:[{name:"Bot"},{name:"Mannequin"},{name:"Organization"},{name:"User"}]},{kind:"UNION",name:"MilestoneItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"RenamedTitleSubject",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"PullRequestTimelineItems",possibleTypes:[{name:"PullRequestCommit"},{name:"PullRequestCommitCommentThread"},{name:"PullRequestReview"},{name:"PullRequestReviewThread"},{name:"PullRequestRevisionMarker"},{name:"BaseRefChangedEvent"},{name:"BaseRefForcePushedEvent"},{name:"DeployedEvent"},{name:"DeploymentEnvironmentChangedEvent"},{name:"HeadRefDeletedEvent"},{name:"HeadRefForcePushedEvent"},{name:"HeadRefRestoredEvent"},{name:"MergedEvent"},{name:"ReviewDismissedEvent"},{name:"ReviewRequestedEvent"},{name:"ReviewRequestRemovedEvent"},{name:"ReadyForReviewEvent"},{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"AddedToProjectEvent"},{name:"AssignedEvent"},{name:"ClosedEvent"},{name:"CommentDeletedEvent"},{name:"ConvertedNoteToIssueEvent"},{name:"DemilestonedEvent"},{name:"LabeledEvent"},{name:"LockedEvent"},{name:"MentionedEvent"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"PinnedEvent"},{name:"ReferencedEvent"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"TransferredEvent"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UserBlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"}]},{kind:"UNION",name:"IssueOrPullRequest",possibleTypes:[{name:"Issue"},{name:"PullRequest"}]},{kind:"UNION",name:"IssueTimelineItem",possibleTypes:[{name:"Commit"},{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"ClosedEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"UnsubscribedEvent"},{name:"ReferencedEvent"},{name:"AssignedEvent"},{name:"UnassignedEvent"},{name:"LabeledEvent"},{name:"UnlabeledEvent"},{name:"UserBlockedEvent"},{name:"MilestonedEvent"},{name:"DemilestonedEvent"},{name:"RenamedTitleEvent"},{name:"LockedEvent"},{name:"UnlockedEvent"},{name:"TransferredEvent"}]},{kind:"UNION",name:"IssueTimelineItems",possibleTypes:[{name:"IssueComment"},{name:"CrossReferencedEvent"},{name:"AddedToProjectEvent"},{name:"AssignedEvent"},{name:"ClosedEvent"},{name:"CommentDeletedEvent"},{name:"ConvertedNoteToIssueEvent"},{name:"DemilestonedEvent"},{name:"LabeledEvent"},{name:"LockedEvent"},{name:"MentionedEvent"},{name:"MilestonedEvent"},{name:"MovedColumnsInProjectEvent"},{name:"PinnedEvent"},{name:"ReferencedEvent"},{name:"RemovedFromProjectEvent"},{name:"RenamedTitleEvent"},{name:"ReopenedEvent"},{name:"SubscribedEvent"},{name:"TransferredEvent"},{name:"UnassignedEvent"},{name:"UnlabeledEvent"},{name:"UnlockedEvent"},{name:"UserBlockedEvent"},{name:"UnpinnedEvent"},{name:"UnsubscribedEvent"}]},{kind:"UNION",name:"ReviewDismissalAllowanceActor",possibleTypes:[{name:"User"},{name:"Team"}]},{kind:"UNION",name:"PushAllowanceActor",possibleTypes:[{name:"User"},{name:"Team"}]},{kind:"UNION",name:"PermissionGranter",possibleTypes:[{name:"Organization"},{name:"Repository"},{name:"Team"}]},{kind:"INTERFACE",name:"Sponsorable",possibleTypes:[{name:"User"}]},{kind:"INTERFACE",name:"Contribution",possibleTypes:[{name:"CreatedCommitContribution"},{name:"CreatedIssueContribution"},{name:"CreatedPullRequestContribution"},{name:"CreatedPullRequestReviewContribution"},{name:"CreatedRepositoryContribution"},{name:"JoinedGitHubContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedRepositoryOrRestrictedContribution",possibleTypes:[{name:"CreatedRepositoryContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedIssueOrRestrictedContribution",possibleTypes:[{name:"CreatedIssueContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"CreatedPullRequestOrRestrictedContribution",possibleTypes:[{name:"CreatedPullRequestContribution"},{name:"RestrictedContribution"}]},{kind:"UNION",name:"SearchResultItem",possibleTypes:[{name:"Issue"},{name:"PullRequest"},{name:"Repository"},{name:"User"},{name:"Organization"},{name:"MarketplaceListing"},{name:"App"}]},{kind:"UNION",name:"CollectionItemContent",possibleTypes:[{name:"Repository"},{name:"Organization"},{name:"User"}]}]}}},5766:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=s(e),a=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,h=u>0?a-4:a;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,c=n-i;s<c;s+=a)o.push(u(e,s,s+a>c?c:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8834:(e,t,r)=>{"use strict";const n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=u,t.h2=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=s(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(H(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return l(e),s(e<0?0:0|d(e))}function f(e){const t=e.length<0?0:0|d(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function d(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(J(n))return a;e[r+a]=n}return a}function R(e,t,r,n){return W(K(t,e.length-r),e,r,n)}function E(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function O(e,t,r,n){return W(G(t),e,r,n)}function k(e,t,r,n){return W(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=_));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return h(e)},u.allocUnsafeSlow=function(e){return h(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(H(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(H(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(H(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==l[e]){o=c[e],a=l[e];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return R(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function P(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function T(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function A(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function q(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function D(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function F(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,o){return t=+t,r>>>=0,o||F(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,o){return t=+t,r>>>=0,o||F(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return q(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return q(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const L={};function M(e,t,r){L[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function U(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function $(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new L.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){Q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function Q(e,t){if("number"!=typeof e)throw new L.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw Q(e,r),new L.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new L.ERR_BUFFER_OUT_OF_BOUNDS;throw new L.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=U(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=U(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function H(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},5695:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,a;if(Array.isArray(t)){for(a="[",r=0;r<t.length;r++)r&&(a+=","),a+=e(t[r])||"null";return a+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(t)-1,u=Object.keys(t).sort(i&&i(t));for(a="",r=0;r<u.length;r++){var c=u[r],l=e(t[c]);l&&(a&&(a+=","),a+=JSON.stringify(c)+":"+l)}return o.splice(s,1),"{"+a+"}"}}(e)}},2678:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=o(r(5006)),i=o(r(8019));function o(e){return e&&e.__esModule?e:{default:e}}},8048:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return u(e,[])};var n,i=(n=r(8019))&&n.__esModule?n:{default:n};function o(e){return o="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},o(e)}var a=10,s=2;function u(e,t){switch(o(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var o=n.call(e);if(o!==e)return"string"==typeof o?o:u(o,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>s)return"[Array]";for(var r=Math.min(a,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(u(e[o],t));return 1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>s?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map((function(r){return r+": "+u(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},5006:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8019:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},4560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(2678))&&n.__esModule?n:{default:n},o=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=o,(0,i.default)(o);var a=function(){function e(e,t,r,n,i,o,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=a,(0,i.default)(a)},9501:(e,t)=>{"use strict";function r(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function n(e){for(var t,r=!0,n=!0,i=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===o||i<o)&&(o=i),n=!1}return null!==(t=o)&&void 0!==t?t:0}Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringValue=function(e){var t=e.split(/\r\n|[\n\r]/g),i=n(e);if(0!==i)for(var o=1;o<t.length;o++)t[o]=t[o].slice(i);for(var a=0;a<t.length&&r(t[a]);)++a;for(var s=t.length;s>a&&r(t[s-1]);)--s;return t.slice(a,s).join("\n")},t.getBlockStringIndentation=n,t.printBlockString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!n||o||a||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}},3083:(e,t,r)=>{"use strict";t.S=function(e){return(0,n.visit)(e,{leave:o})};var n=r(2624),i=r(9501),o={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return s(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=c("(",s(e.variableDefinitions,", "),")"),i=s(e.directives," "),o=e.selectionSet;return r||i||n||"query"!==t?s([t,s([r,n]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+c(" = ",n)+c(" ",s(i," "))},SelectionSet:function(e){return u(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,o=e.selectionSet,a=c("",t,": ")+r,u=a+c("(",s(n,", "),")");return u.length>80&&(u=a+c("(\n",l(s(n,"\n")),"\n)")),s([u,s(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+c(" ",s(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return s(["...",c("on ",t),s(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(c("(",s(n,", "),")")," ")+"on ".concat(r," ").concat(c("",s(i," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,i.printBlockString)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+s(e.values,", ")+"]"},ObjectValue:function(e){return"{"+s(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+c("(",s(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:a((function(e){var t=e.directives,r=e.operationTypes;return s(["schema",s(t," "),u(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:a((function(e){return s(["scalar",e.name,s(e.directives," ")]," ")})),ObjectTypeDefinition:a((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["type",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")})),FieldDefinition:a((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(f(r)?c("(\n",l(s(r,"\n")),"\n)"):c("(",s(r,", "),")"))+": "+n+c(" ",s(i," "))})),InputValueDefinition:a((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return s([t+": "+r,c("= ",n),s(i," ")]," ")})),InterfaceTypeDefinition:a((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["interface",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")})),UnionTypeDefinition:a((function(e){var t=e.name,r=e.directives,n=e.types;return s(["union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")})),EnumTypeDefinition:a((function(e){var t=e.name,r=e.directives,n=e.values;return s(["enum",t,s(r," "),u(n)]," ")})),EnumValueDefinition:a((function(e){return s([e.name,s(e.directives," ")]," ")})),InputObjectTypeDefinition:a((function(e){var t=e.name,r=e.directives,n=e.fields;return s(["input",t,s(r," "),u(n)]," ")})),DirectiveDefinition:a((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(f(r)?c("(\n",l(s(r,"\n")),"\n)"):c("(",s(r,", "),")"))+(n?" repeatable":"")+" on "+s(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return s(["extend schema",s(t," "),u(r)]," ")},ScalarTypeExtension:function(e){return s(["extend scalar",e.name,s(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend type",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend interface",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return s(["extend union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return s(["extend enum",t,s(r," "),u(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return s(["extend input",t,s(r," "),u(n)]," ")}};function a(e){return function(t){return s([t.description,e(t)],"\n")}}function s(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function u(e){return c("{\n",l(s(e,"\n")),"\n}")}function c(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function l(e){return c(" ",e.replace(/\n/g,"\n "))}function h(e){return-1!==e.indexOf("\n")}function f(e){return null!=e&&e.some(h)}},2624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visit=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,n=void 0,c=Array.isArray(e),l=[e],h=-1,f=[],p=void 0,d=void 0,m=void 0,y=[],v=[],g=e;do{var b=++h===l.length,w=b&&0!==f.length;if(b){if(d=0===v.length?void 0:y[y.length-1],p=m,m=v.pop(),w){if(c)p=p.slice();else{for(var R={},E=0,O=Object.keys(p);E<O.length;E++){var k=O[E];R[k]=p[k]}p=R}for(var S=0,x=0;x<f.length;x++){var _=f[x][0],I=f[x][1];c&&(_-=S),c&&null===I?(p.splice(_,1),S++):p[_]=I}}h=n.index,l=n.keys,f=n.edits,c=n.inArray,n=n.prev}else{if(d=m?c?h:l[h]:void 0,null==(p=m?m[d]:g))continue;m&&y.push(d)}var P,T=void 0;if(!Array.isArray(p)){if(!(0,o.isNode)(p))throw new Error("Invalid AST Node: ".concat((0,i.default)(p),"."));var A=u(t,p.kind,b);if(A){if((T=A.call(t,p,d,m,y,v))===s)break;if(!1===T){if(!b){y.pop();continue}}else if(void 0!==T&&(f.push([d,T]),!b)){if(!(0,o.isNode)(T)){y.pop();continue}p=T}}}void 0===T&&w&&f.push([d,p]),b?y.pop():(n={inArray:c,index:h,keys:l,edits:f,prev:n},l=(c=Array.isArray(p))?p:null!==(P=r[p.kind])&&void 0!==P?P:[],h=-1,f=[],m&&v.push(m),m=p)}while(void 0!==n);return 0!==f.length&&(g=f[f.length-1][1]),g},t.visitInParallel=function(e){var t=new Array(e.length);return{enter:function(r){for(var n=0;n<e.length;n++)if(null==t[n]){var i=u(e[n],r.kind,!1);if(i){var o=i.apply(e[n],arguments);if(!1===o)t[n]=r;else if(o===s)t[n]=s;else if(void 0!==o)return o}}},leave:function(r){for(var n=0;n<e.length;n++)if(null==t[n]){var i=u(e[n],r.kind,!0);if(i){var o=i.apply(e[n],arguments);if(o===s)t[n]=s;else if(void 0!==o&&!1!==o)return o}}else t[n]===r&&(t[n]=null)}}},t.getVisitFn=u,t.BREAK=t.QueryDocumentKeys=void 0;var n,i=(n=r(8048))&&n.__esModule?n:{default:n},o=r(4560),a={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=a;var s=Object.freeze({});function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var o=r?e.leave:e.enter;if(o){if("function"==typeof o)return o;var a=o[t];if("function"==typeof a)return a}}}t.BREAK=s},2333:(e,t)=>{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*u-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+p]=255&a,p+=d,a/=256,c-=8);e[r+p-d]|=128*m}},9612:(e,t,r)=>{var n=r(2118),i=r(6909),o=r(8138),a=r(4174),s=r(7942);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},6504:(e,t,r)=>{var n=r(9413),i=r(3620);function o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=n(i.prototype),o.prototype.constructor=o,e.exports=o},235:(e,t,r)=>{var n=r(3945),i=r(1846),o=r(8028),a=r(2344),s=r(4769);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},5859:(e,t,r)=>{var n=r(9413),i=r(3620);function o(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}o.prototype=n(i.prototype),o.prototype.constructor=o,e.exports=o},326:(e,t,r)=>{var n=r(8761)(r(7772),"Map");e.exports=n},6738:(e,t,r)=>{var n=r(2411),i=r(6417),o=r(6928),a=r(9493),s=r(4150);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},857:(e,t,r)=>{var n=r(7772).Symbol;e.exports=n},3215:(e,t,r)=>{var n=r(8761)(r(7772),"WeakMap");e.exports=n},9432:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},2517:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},8333:(e,t,r)=>{var n=r(7832);e.exports=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1}},343:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},217:e=>{e.exports=function(e){return e.split("")}},2218:(e,t,r)=>{var n=r(1225);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},9413:(e,t,r)=>{var n=r(9259),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},1359:e=>{e.exports=function(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},3366:(e,t,r)=>{var n=r(857),i=r(2107),o=r(7157),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},7832:(e,t,r)=>{var n=r(1359),i=r(2195),o=r(6024);e.exports=function(e,t,r){return t==t?o(e,t,r):n(e,i,r)}},2195:e=>{e.exports=function(e){return e!=e}},6840:(e,t,r)=>{var n=r(1049),i=r(7394),o=r(9259),a=r(7035),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,h=c.hasOwnProperty,f=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?f:s).test(a(e))}},3620:e=>{e.exports=function(){}},6060:(e,t,r)=>{var n=r(3059),i=r(3114),o=r(5251);e.exports=function(e,t){return o(i(e,t,n),e+"")}},4817:(e,t,r)=>{var n=r(3059),i=r(529),o=i?function(e,t){return i.set(e,t),e}:n;e.exports=o},6532:(e,t,r)=>{var n=r(6874),i=r(3043),o=r(3059),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=a},9872:e=>{e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}},1054:(e,t,r)=>{var n=r(857),i=r(343),o=r(6152),a=r(4795),s=n?n.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},1704:(e,t,r)=>{var n=r(2153),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},7297:(e,t,r)=>{var n=r(6152),i=r(1401),o=r(4452),a=r(6188);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:o(a(e))}},3895:(e,t,r)=>{var n=r(9872);e.exports=function(e,t,r){var i=e.length;return r=void 0===r?i:r,!t&&r>=i?e:n(e,t,r)}},768:(e,t,r)=>{var n=r(7832);e.exports=function(e,t){for(var r=e.length;r--&&n(t,e[r],0)>-1;);return r}},1821:(e,t,r)=>{var n=r(7832);e.exports=function(e,t){for(var r=-1,i=e.length;++r<i&&n(t,e[r],0)>-1;);return r}},1495:e=>{var t=Math.max;e.exports=function(e,r,n,i){for(var o=-1,a=e.length,s=n.length,u=-1,c=r.length,l=t(a-s,0),h=Array(c+l),f=!i;++u<c;)h[u]=r[u];for(;++o<s;)(f||o<a)&&(h[n[o]]=e[o]);for(;l--;)h[u++]=e[o++];return h}},152:e=>{var t=Math.max;e.exports=function(e,r,n,i){for(var o=-1,a=e.length,s=-1,u=n.length,c=-1,l=r.length,h=t(a-u,0),f=Array(h+l),p=!i;++o<h;)f[o]=e[o];for(var d=o;++c<l;)f[d+c]=r[c];for(;++s<u;)(p||o<a)&&(f[d+n[s]]=e[o++]);return f}},1522:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},4019:(e,t,r)=>{var n=r(7772)["__core-js_shared__"];e.exports=n},1176:e=>{e.exports=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}},3485:(e,t,r)=>{var n=r(2248),i=r(7772);e.exports=function(e,t,r){var o=1&t,a=n(e);return function t(){return(this&&this!==i&&this instanceof t?a:e).apply(o?r:this,arguments)}}},2248:(e,t,r)=>{var n=r(9413),i=r(9259);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),o=e.apply(r,t);return i(o)?o:r}}},8462:(e,t,r)=>{var n=r(9432),i=r(2248),o=r(764),a=r(7891),s=r(3325),u=r(527),c=r(7772);e.exports=function(e,t,r){var l=i(e);return function i(){for(var h=arguments.length,f=Array(h),p=h,d=s(i);p--;)f[p]=arguments[p];var m=h<3&&f[0]!==d&&f[h-1]!==d?[]:u(f,d);return(h-=m.length)<r?a(e,t,o,i.placeholder,void 0,f,m,void 0,void 0,r-h):n(this&&this!==c&&this instanceof i?l:e,this,f)}}},764:(e,t,r)=>{var n=r(1495),i=r(152),o=r(1176),a=r(2248),s=r(7891),u=r(3325),c=r(3418),l=r(527),h=r(7772);e.exports=function e(t,r,f,p,d,m,y,v,g,b){var w=128&r,R=1&r,E=2&r,O=24&r,k=512&r,S=E?void 0:a(t);return function x(){for(var _=arguments.length,I=Array(_),P=_;P--;)I[P]=arguments[P];if(O)var T=u(x),A=o(I,T);if(p&&(I=n(I,p,d,O)),m&&(I=i(I,m,y,O)),_-=A,O&&_<b){var C=l(I,T);return s(t,r,e,x.placeholder,f,I,C,v,g,b-_)}var N=R?f:this,q=E?N[t]:t;return _=I.length,v?I=c(I,v):k&&_>1&&I.reverse(),w&&g<_&&(I.length=g),this&&this!==h&&this instanceof x&&(q=S||a(q)),q.apply(N,I)}}},5468:(e,t,r)=>{var n=r(9432),i=r(2248),o=r(7772);e.exports=function(e,t,r,a){var s=1&t,u=i(e);return function t(){for(var i=-1,c=arguments.length,l=-1,h=a.length,f=Array(h+c),p=this&&this!==o&&this instanceof t?u:e;++l<h;)f[l]=a[l];for(;c--;)f[l++]=arguments[++i];return n(p,s?r:this,f)}}},7891:(e,t,r)=>{var n=r(3735),i=r(9890),o=r(5877);e.exports=function(e,t,r,a,s,u,c,l,h,f){var p=8&t;t|=p?32:64,4&(t&=~(p?64:32))||(t&=-4);var d=[e,t,s,p?u:void 0,p?c:void 0,p?void 0:u,p?void 0:c,l,h,f],m=r.apply(void 0,d);return n(e)&&i(m,d),m.placeholder=a,o(m,e,t)}},7902:(e,t,r)=>{var n=r(4817),i=r(3485),o=r(8462),a=r(764),s=r(5468),u=r(8203),c=r(9e3),l=r(9890),h=r(5877),f=r(8101),p=Math.max;e.exports=function(e,t,r,d,m,y,v,g){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var w=d?d.length:0;if(w||(t&=-97,d=m=void 0),v=void 0===v?v:p(f(v),0),g=void 0===g?g:f(g),w-=m?m.length:0,64&t){var R=d,E=m;d=m=void 0}var O=b?void 0:u(e),k=[e,t,r,d,m,R,E,y,v,g];if(O&&c(k,O),e=k[0],t=k[1],r=k[2],d=k[3],m=k[4],!(g=k[9]=void 0===k[9]?b?0:e.length:p(k[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)S=8==t||16==t?o(e,t,g):32!=t&&33!=t||m.length?a.apply(void 0,k):s(e,t,r,d);else var S=i(e,t,r);return h((O?n:l)(S,k),e,t)}},3043:(e,t,r)=>{var n=r(8761),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},1242:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},8203:(e,t,r)=>{var n=r(529),i=r(4291),o=n?function(e){return n.get(e)}:i;e.exports=o},9350:(e,t,r)=>{var n=r(9212),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",r=n[t],o=i.call(n,t)?r.length:0;o--;){var a=r[o],s=a.func;if(null==s||s==e)return a.name}return t}},3325:e=>{e.exports=function(e){return e.placeholder}},7937:(e,t,r)=>{var n=r(8304);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},8761:(e,t,r)=>{var n=r(6840),i=r(8109);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},2107:(e,t,r)=>{var n=r(857),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},8109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},4842:e=>{var t=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var n=e.match(t);return n?n[1].split(r):[]}},3880:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2118:(e,t,r)=>{var n=r(9191);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},6909:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},8138:(e,t,r)=>{var n=r(9191),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},4174:(e,t,r)=>{var n=r(9191),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},7942:(e,t,r)=>{var n=r(9191);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},8442:e=>{var t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,r){var n=r.length;if(!n)return e;var i=n-1;return r[i]=(n>1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},9045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},1401:(e,t,r)=>{var n=r(6152),i=r(4795),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},8304:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},3735:(e,t,r)=>{var n=r(6504),i=r(8203),o=r(9350),a=r(8674);e.exports=function(e){var t=o(e),r=a[t];if("function"!=typeof r||!(t in n.prototype))return!1;if(e===r)return!0;var s=i(r);return!!s&&e===s[0]}},7394:(e,t,r)=>{var n,i=r(4019),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},3945:e=>{e.exports=function(){this.__data__=[],this.size=0}},1846:(e,t,r)=>{var n=r(2218),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},8028:(e,t,r)=>{var n=r(2218);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},2344:(e,t,r)=>{var n=r(2218);e.exports=function(e){return n(this.__data__,e)>-1}},4769:(e,t,r)=>{var n=r(2218);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},2411:(e,t,r)=>{var n=r(9612),i=r(235),o=r(326);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},6417:(e,t,r)=>{var n=r(7937);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6928:(e,t,r)=>{var n=r(7937);e.exports=function(e){return n(this,e).get(e)}},9493:(e,t,r)=>{var n=r(7937);e.exports=function(e){return n(this,e).has(e)}},4150:(e,t,r)=>{var n=r(7937);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},7777:(e,t,r)=>{var n=r(733);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},9e3:(e,t,r)=>{var n=r(1495),i=r(152),o=r(527),a="__lodash_placeholder__",s=Math.min;e.exports=function(e,t){var r=e[1],u=t[1],c=r|u,l=c<131,h=128==u&&8==r||128==u&&256==r&&e[7].length<=t[8]||384==u&&t[7].length<=t[8]&&8==r;if(!l&&!h)return e;1&u&&(e[2]=t[2],c|=1&r?0:4);var f=t[3];if(f){var p=e[3];e[3]=p?n(p,f,t[4]):f,e[4]=p?o(e[3],a):t[4]}return(f=t[5])&&(p=e[5],e[5]=p?i(p,f,t[6]):f,e[6]=p?o(e[5],a):t[6]),(f=t[7])&&(e[7]=f),128&u&&(e[8]=null==e[8]?t[8]:s(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}},529:(e,t,r)=>{var n=r(3215),i=n&&new n;e.exports=i},9191:(e,t,r)=>{var n=r(8761)(Object,"create");e.exports=n},7157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},3114:(e,t,r)=>{var n=r(9432),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),u=Array(s);++a<s;)u[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=r(u),n(e,this,c)}}},9212:e=>{e.exports={}},3418:(e,t,r)=>{var n=r(1522),i=r(9045),o=Math.min;e.exports=function(e,t){for(var r=e.length,a=o(t.length,r),s=n(e);a--;){var u=t[a];e[a]=i(u,r)?s[u]:void 0}return e}},527:e=>{var t="__lodash_placeholder__";e.exports=function(e,r){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var s=e[n];s!==r&&s!==t||(e[n]=t,a[o++]=n)}return a}},7772:(e,t,r)=>{var n=r(1242),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},9890:(e,t,r)=>{var n=r(4817),i=r(7787)(n);e.exports=i},5251:(e,t,r)=>{var n=r(6532),i=r(7787)(n);e.exports=i},5877:(e,t,r)=>{var n=r(4842),i=r(8442),o=r(5251),a=r(6985);e.exports=function(e,t,r){var s=t+"";return o(e,i(s,a(n(s),r)))}},7787:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},6024:e=>{e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}},8435:(e,t,r)=>{var n=r(217),i=r(3880),o=r(3344);e.exports=function(e){return i(e)?o(e):n(e)}},4452:(e,t,r)=>{var n=r(7777),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(o,"$1"):r||e)})),t}));e.exports=a},3812:(e,t,r)=>{var n=r(4795);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7035:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},2153:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},3344:e=>{var t="\\ud800-\\udfff",r="["+t+"]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+n+"|"+i+")?",c="[\\ufe0e\\ufe0f]?",l=c+u+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+c+u+")*",h="(?:"+[o+n+"?",n,a,s,r].join("|")+")",f=RegExp(i+"(?="+i+")|"+h+l,"g");e.exports=function(e){return e.match(f)||[]}},6985:(e,t,r)=>{var n=r(2517),i=r(8333),o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return n(o,(function(r){var n="_."+r[0];t&r[1]&&!i(e,n)&&e.push(n)})),e.sort()}},7366:(e,t,r)=>{var n=r(6504),i=r(5859),o=r(1522);e.exports=function(e){if(e instanceof n)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=o(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},6874:e=>{e.exports=function(e){return function(){return e}}},1225:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},3059:e=>{e.exports=function(e){return e}},7613:(e,t,r)=>{var n=r(9872);e.exports=function(e){return null!=e&&e.length?n(e,0,-1):[]}},6152:e=>{var t=Array.isArray;e.exports=t},1049:(e,t,r)=>{var n=r(3366),i=r(9259);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},9259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},4795:(e,t,r)=>{var n=r(3366),i=r(5125);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},6974:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},733:(e,t,r)=>{var n=r(6738);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},4291:e=>{e.exports=function(){}},3465:(e,t,r)=>{var n=r(6060),i=r(7902),o=r(3325),a=r(527),s=n((function(e,t){var r=a(t,o(s));return i(e,32,void 0,t,r)}));s.placeholder={},e.exports=s},6346:(e,t,r)=>{var n=r(7297),i=r(1049),o=r(3812);e.exports=function(e,t,r){var a=-1,s=(t=n(t,e)).length;for(s||(s=1,e=void 0);++a<s;){var u=null==e?void 0:e[o(t[a])];void 0===u&&(a=s,u=r),e=i(u)?u.call(e):u}return e}},5707:(e,t,r)=>{var n=r(7642);e.exports=function(e){return e?Infinity===(e=n(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},8101:(e,t,r)=>{var n=r(5707);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},7642:(e,t,r)=>{var n=r(1704),i=r(9259),o=r(4795),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):a.test(e)?NaN:+e}},6188:(e,t,r)=>{var n=r(1054);e.exports=function(e){return null==e?"":n(e)}},5648:(e,t,r)=>{var n=r(1054),i=r(1704),o=r(3895),a=r(768),s=r(1821),u=r(8435),c=r(6188);e.exports=function(e,t,r){if((e=c(e))&&(r||void 0===t))return i(e);if(!e||!(t=n(t)))return e;var l=u(e),h=u(t),f=s(l,h),p=a(l,h)+1;return o(l,f,p).join("")}},3433:(e,t,r)=>{var n=r(1054),i=r(3895),o=r(1821),a=r(8435),s=r(6188),u=/^\s+/;e.exports=function(e,t,r){if((e=s(e))&&(r||void 0===t))return e.replace(u,"");if(!e||!(t=n(t)))return e;var c=a(e),l=o(c,a(t));return i(c,l).join("")}},8674:(e,t,r)=>{var n=r(6504),i=r(5859),o=r(3620),a=r(6152),s=r(5125),u=r(7366),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!a(e)&&!(e instanceof n)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=o.prototype,l.prototype.constructor=l,e.exports=l},1023:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(o===s-1||1===a);else if(o!==s-1&&2===a){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=s,a=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),i=s-o-1;o=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var e,n="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a;o>=0?a=arguments[o]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(n=a+"/"+n,i=47===a.charCodeAt(0))}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,a=o-i,s=1;s<r.length&&47===r.charCodeAt(s);++s);for(var u=r.length-s,c=a<u?a:u,l=-1,h=0;h<=c;++h){if(h===c){if(u>c){if(47===r.charCodeAt(s+h))return r.slice(s+h+1);if(0===h)return r.slice(s+h)}else a>c&&(47===e.charCodeAt(i+h)?l=h:0===h&&(l=0));break}var f=e.charCodeAt(i+h);if(f!==r.charCodeAt(s+h))break;47===f&&(l=h)}var p="";for(h=i+l+1;h<=o;++h)h!==o&&47!==e.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(s+l):(s+=l,47===r.charCodeAt(s)&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,a=e.length-1;a>=1;--a)if(47===(r=e.charCodeAt(a))){if(!o){i=a;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var s=r.length-1,u=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(47===c){if(!a){i=n+1;break}}else-1===u&&(a=!1,u=n+1),s>=0&&(c===r.charCodeAt(s)?-1==--s&&(o=n):(s=-1,o=u))}return i===o?o=u:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){i=n+1;break}}else-1===o&&(a=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,a=0,s=e.length-1;s>=0;--s){var u=e.charCodeAt(s);if(47!==u)-1===i&&(o=!1,i=s+1),46===u?-1===r?r=s:1!==a&&(a=1):-1!==r&&(a=-1);else if(!o){n=s+1;break}}return-1===r||-1===i||0===a||1===a&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var a=-1,s=0,u=-1,c=!0,l=e.length-1,h=0;l>=n;--l)if(47!==(i=e.charCodeAt(l)))-1===u&&(c=!1,u=l+1),46===i?-1===a?a=l:1!==h&&(h=1):-1!==a&&(h=-1);else if(!c){s=l+1;break}return-1===a||-1===u||0===h||1===h&&a===u-1&&a===s+1?-1!==u&&(r.base=r.name=0===s&&o?e.slice(1,u):e.slice(s,u)):(0===s&&o?(r.name=e.slice(1,a),r.base=e.slice(1,u)):(r.name=e.slice(s,a),r.base=e.slice(s,u)),r.ext=e.slice(a,u)),s>0?r.dir=e.slice(0,s-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},3252:function(e){!function(t){"use strict";var r=function(e){setTimeout(e,0)};"undefined"!=typeof process&&process&&"function"==typeof process.nextTick&&(r=process.nextTick),e.exports=function(e){var t={capacity:e||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===t.firstHere){t.current++,t.firstHere=!0;var e=1}else e=0;var r={n:1};"function"==typeof arguments[0]?r.task=arguments[0]:r.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var n=r.task;if(r.task=function(){n(t.leave)},t.current+r.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(r);t.current+=r.n-e,r.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var n=t.queue[0];n.n+t.current>t.capacity||(t.queue.shift(),t.current+=n.n,r(n.task))}else if(t.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,t.current+e<=t.capacity}};return t}}()},7288:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n}),e=r.hmd(e);const n=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:e)},2394:(e,t,r)=>{e.exports=r(5757).Observable},5757:(e,t)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}t.Observable=void 0;var o=function(){return"function"==typeof Symbol},a=function(e){return o()&&Boolean(Symbol[e])},s=function(e){return a(e)?Symbol[e]:"@@"+e};o()&&!a("observable")&&(Symbol.observable=Symbol("observable"));var u=s("iterator"),c=s("observable"),l=s("species");function h(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function f(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:E}function p(e){return e instanceof E}function d(e){d.log?d.log(e):setTimeout((function(){throw e}))}function m(e){Promise.resolve().then((function(){try{e()}catch(e){d(e)}}))}function y(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=h(t,"unsubscribe");r&&r.call(t)}}catch(e){d(e)}}function v(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,r){e._state="running";var n=e._observer;try{var i=h(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(v(e),!i)throw r;i.call(n,r);break;case"complete":v(e),i&&i.call(n)}}catch(e){d(e)}"closed"===e._state?y(e):"running"===e._state&&(e._state="ready")}function b(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void m((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(g(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)}))):void g(e,t,r);e._queue.push({type:t,value:r})}}var w=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new R(this);try{this._cleanup=n.call(void 0,i)}catch(e){i.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(v(this),y(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),R=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),E=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new w(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),r()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))((function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(f(this))((function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=f(this),n=arguments.length>1,i=!1,o=arguments[1];return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=f(this);return new i((function(t){var n,o=0;return function e(a){n=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===r.length?(n=void 0,t.complete()):e(i.from(r[o++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=f(this);return new r((function(n){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var o=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){n.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=h(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(a("iterator")&&(n=h(t,u)))return new r((function(e){m((function(){if(!e.closed){var r=!0,i=!1,o=void 0;try{for(var a,s=n.call(t)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){m((function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)((function(e){m((function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=E,o()&&Object.defineProperty(E,Symbol("extensions"),{value:{symbol:c,hostReportError:d},configurable:!0})},2244:t=>{"use strict";t.exports=e},1756:e=>{"use strict";e.exports=r},2673:e=>{"use strict";e.exports=n},82:e=>{"use strict";e.exports=i},4688:e=>{"use strict";e.exports=t},3327:e=>{"use strict";e.exports=o}},s={};function u(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={id:e,loaded:!1,exports:{}};return a[e].call(r.exports,r,r.exports,u),r.loaded=!0,r.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var c={};return(()=>{"use strict";u.d(c,{DecapCmsBackendGithub:()=>Sa});var e,t,r=u(2244),n=u.n(r),i=u(3252),o=u.n(i),a=u(3433),s=u.n(a),l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=(e=["",""],t=["",""],Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))),f=function(){function e(){for(var t=this,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tag=function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return"function"==typeof e?t.interimTag.bind(t,e):"string"==typeof e?t.transformEndResult(e):(e=e.map(t.transformString.bind(t)),t.transformEndResult(e.reduce(t.processSubstitutions.bind(t,n))))},n.length>0&&Array.isArray(n[0])&&(n=n[0]),this.transformers=n.map((function(e){return"function"==typeof e?e():e})),this.tag}return l(e,[{key:"interimTag",value:function(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return this.tag(h,e.apply(void 0,[t].concat(n)))}},{key:"processSubstitutions",value:function(e,t,r){var n=this.transformSubstitution(e.shift(),t);return"".concat(t,n,r)}},{key:"transformString",value:function(e){return this.transformers.reduce((function(e,t){return t.onString?t.onString(e):e}),e)}},{key:"transformSubstitution",value:function(e,t){return this.transformers.reduce((function(e,r){return r.onSubstitution?r.onSubstitution(e,t):e}),e)}},{key:"transformEndResult",value:function(e){return this.transformers.reduce((function(e,t){return t.onEndResult?t.onEndResult(e):e}),e)}}]),e}();const p=f;var d={separator:"",conjunction:"",serial:!1};const m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;return{onSubstitution:function(t,r){if(Array.isArray(t)){var n=t.length,i=e.separator,o=e.conjunction,a=e.serial,s=r.match(/(\n?[^\S\n]+)$/);if(t=s?t.join(i+s[1]):t.join(i+" "),o&&n>1){var u=t.lastIndexOf(i);t=t.slice(0,u)+(a?i:"")+" "+o+t.slice(u+1)}}return t}}},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initial";return{onEndResult:function(t){if("initial"===e){var r=t.match(/^[^\S\n]*(?=\S)/gm),n=r&&Math.min.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(r.map((function(e){return e.length}))));if(n){var i=new RegExp("^.{"+n+"}","gm");return t.replace(i,"")}return t}if("all"===e)return t.replace(/^[^\S\n]+/gm,"");throw new Error("Unknown type: "+e)}}},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{onEndResult:function(t){if(""===e)return t.trim();if("start"===(e=e.toLowerCase())||"left"===e)return t.replace(/^\s*/,"");if("end"===e||"right"===e)return t.replace(/\s*$/,"");throw new Error("Side not supported: "+e)}}};new p(m({separator:","}),y,v),new p(m({separator:",",conjunction:"and"}),y,v),new p(m({separator:",",conjunction:"or"}),y,v);const g=function(e){return{onSubstitution:function(t,r){if(null==e||"string"!=typeof e)throw new Error("You need to specify a string character to split by.");return"string"==typeof t&&t.includes(e)&&(t=t.split(e)),t}}};var b=function(e){return null!=e&&!Number.isNaN(e)&&"boolean"!=typeof e};new p(g("\n"),(function(){return{onSubstitution:function(e){return Array.isArray(e)?e.filter(b):b(e)?e:""}}}),m,y,v);const w=function(e,t){return{onSubstitution:function(r,n){if(null==e||null==t)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return null==r?r:r.toString().replace(e,t)}}};new p(g("\n"),m,y,v,w(/&/g,"&"),w(/</g,"<"),w(/>/g,">"),w(/"/g,"""),w(/'/g,"'"),w(/`/g,"`"));const R=function(e,t){return{onEndResult:function(r){if(null==e||null==t)throw new Error("replaceResultTransformer requires at least 2 arguments.");return r.replace(e,t)}}},E=new p(R(/(?:\n(?:\s*))+/g," "),v);new p(R(/(?:\n\s*)/g,""),v),new p(m({separator:","}),R(/(?:\s+)/g," "),v),new p(m({separator:",",conjunction:"or"}),R(/(?:\s+)/g," "),v),new p(m({separator:",",conjunction:"and"}),R(/(?:\s+)/g," "),v),new p(m,y,v),new p(m,R(/(?:\s+)/g," "),v);const O=new p(y,v);new p(y("all"),v);var k=u(4688);function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},S.apply(this,arguments)}function x(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var _=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,I=x((function(e){return _.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),P=u(1756),T=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},A={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},C=/[A-Z]|^ms/g,N=/_EMO_([^_]+?)_([^]*?)_EMO_/g,q=function(e){return 45===e.charCodeAt(1)},D=function(e){return null!=e&&"boolean"!=typeof e},F=x((function(e){return q(e)?e:e.replace(C,"-$&").toLowerCase()})),j=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(N,(function(e,t,r){return L={name:t,styles:r,next:L},t}))}return 1===A[e]||q(e)||"number"!=typeof t||0===t?t:t+"px"};function B(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return L={name:r.name,styles:r.styles,next:L},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)L={name:n.name,styles:n.styles,next:L},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=B(e,t,r[i])+";";else for(var o in r){var a=r[o];if("object"!=typeof a)null!=t&&void 0!==t[a]?n+=o+"{"+t[a]+"}":D(a)&&(n+=F(o)+":"+j(o,a)+";");else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=B(e,t,a);switch(o){case"animation":case"animationName":n+=F(o)+":"+s+";";break;default:n+=o+"{"+s+"}"}}else for(var u=0;u<a.length;u++)D(a[u])&&(n+=F(o)+":"+j(o,a[u])+";")}return n}(e,t,r);case"function":if(void 0!==e){var i=L,o=r(e);return L=i,B(e,t,o)}}if(null==t)return r;var a=t[r];return void 0!==a?a:r}var L,M=/label:\s*([^\s;\n{]+)\s*(;|$)/g,U=!!r.useInsertionEffect&&r.useInsertionEffect,$=U||function(e){return e()},Q=(U||r.useLayoutEffect,I),V=function(e){return"theme"!==e},z=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Q:V},K=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},G=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return T(t,r,n),$((function(){return function(e,t,r){T(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}(t,r,n)})),null},W=function e(t,n){var i,o,a=t.__emotion_real===t,s=a&&t.__emotion_base||t;void 0!==n&&(i=n.label,o=n.target);var u=K(t,n,a),c=u||z(s),l=!c("as");return function(){var h=arguments,f=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&f.push("label:"+i+";"),null==h[0]||void 0===h[0].raw)f.push.apply(f,h);else{f.push(h[0][0]);for(var p=h.length,d=1;d<p;d++)f.push(h[d],h[0][d])}var m=(0,P.withEmotionCache)((function(e,t,n){var i,a,h,p,d=l&&e.as||s,m="",y=[],v=e;if(null==e.theme){for(var g in v={},e)v[g]=e[g];v.theme=r.useContext(P.ThemeContext)}"string"==typeof e.className?(i=t.registered,a=y,h=e.className,p="",h.split(" ").forEach((function(e){void 0!==i[e]?a.push(i[e]+";"):p+=e+" "})),m=p):null!=e.className&&(m=e.className+" ");var b=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";L=void 0;var o=e[0];null==o||void 0===o.raw?(n=!1,i+=B(r,t,o)):i+=o[0];for(var a=1;a<e.length;a++)i+=B(r,t,e[a]),n&&(i+=o[a]);M.lastIndex=0;for(var s,u="";null!==(s=M.exec(i));)u+="-"+s[1];var c=function(e){for(var t,r=0,n=0,i=e.length;i>=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+u;return{name:c,styles:i,next:L}}(f.concat(y),t.registered,v);m+=t.key+"-"+b.name,void 0!==o&&(m+=" "+o);var w=l&&void 0===u?z(d):c,R={};for(var E in e)l&&"as"===E||w(E)&&(R[E]=e[E]);return R.className=m,R.ref=n,r.createElement(r.Fragment,null,r.createElement(G,{cache:t,serialized:b,isStringTag:"string"==typeof d}),r.createElement(d,R))}));return m.displayName=void 0!==i?i:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=s,m.__emotion_styles=f,m.__emotion_forwardProp=u,Object.defineProperty(m,"toString",{value:function(){return"."+o}}),m.withComponent=function(t,r){return e(t,S({},n,r,{shouldForwardProp:K(m,r,!0)})).apply(void 0,f)},m}},H=u(2673),J=u.n(H),Y=u(82),X=u(3327);function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Z.apply(this,arguments)}function ee(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const te=W(X.Icon,{target:"e1ko648l2",label:"LoginButtonIcon"})({name:"1gnqu05",styles:"margin-right:18px"}),re=W("div",{target:"e1ko648l1",label:"ForkApprovalContainer"})({name:"13alw87",styles:"display:flex;flex-flow:column nowrap;justify-content:space-around;flex-grow:0.2"}),ne=W("div",{target:"e1ko648l0",label:"ForkButtonsContainer"})({name:"125bg8c",styles:"display:flex;flex-flow:column nowrap;justify-content:space-around;align-items:center"});class ie extends n().Component{constructor(...e){super(...e),ee(this,"state",{}),ee(this,"getPermissionToFork",(()=>new Promise(((e,t)=>{this.setState({requestingFork:!0,approveFork:()=>{this.setState({requestingFork:!1}),e()},refuseFork:()=>{this.setState({requestingFork:!1}),t()}})})))),ee(this,"handleLogin",(e=>{e.preventDefault();const t={base_url:this.props.base_url,site_id:"localhost"===document.location.host.split(":")[0]?"demo.decapcms.org":this.props.siteId,auth_endpoint:this.props.authEndpoint},r=new Y.NetlifyAuthenticator(t),{open_authoring:n=!1,auth_scope:i=""}=this.props.config.backend,o=i||(n?"public_repo":"repo");r.authenticate({provider:"github",scope:o},((e,t)=>{if(!e)return n?this.loginWithOpenAuthoring(t).then((()=>this.props.onLogin(t))):void this.props.onLogin(t);this.setState({loginError:e.toString()})}))})),ee(this,"renderLoginButton",(()=>{const{inProgress:e,t}=this.props;return e||this.state.findingFork?t("auth.loggingIn"):(0,P.jsx)(n().Fragment,null,(0,P.jsx)(te,{type:"github"}),t("auth.loginWithGitHub"))}))}loginWithOpenAuthoring(e){const{backend:t}=this.props;return this.setState({findingFork:!0}),t.authenticateWithFork({userData:e,getPermissionToFork:this.getPermissionToFork}).catch((e=>{throw this.setState({findingFork:!1}),console.error(e),e}))}getAuthenticationPageRenderArgs(){const{requestingFork:e}=this.state;if(e){const{approveFork:e,refuseFork:t}=this.state;return{renderPageContent:({LoginButton:r,TextButton:n,showAbortButton:i})=>(0,P.jsx)(re,null,(0,P.jsx)("p",null,"Open Authoring is enabled: we need to use a fork on your github account. (If a fork already exists, we'll use that.)"),(0,P.jsx)(ne,null,(0,P.jsx)(r,{onClick:e},"Fork the repo"),i&&(0,P.jsx)(n,{onClick:t},"Don't fork the repo")))}}return{renderButtonContent:this.renderLoginButton}}render(){const{inProgress:e,config:t,t:r}=this.props,{loginError:n,requestingFork:i,findingFork:o}=this.state;return(0,P.jsx)(X.AuthenticationPage,Z({onLogin:this.handleLogin,loginDisabled:e||o||i,loginErrorMessage:n,logoUrl:t.logo_url,siteUrl:t.site_url},this.getAuthenticationPageRenderArgs(),{t:r}))}}ee(ie,"propTypes",{onLogin:J().func.isRequired,inProgress:J().bool,base_url:J().string,siteId:J().string,authEndpoint:J().string,config:J().object.isRequired,clearHash:J().func,t:J().func.isRequired});var oe=u(5648),ae=u.n(oe),se=u(6346),ue=u.n(se),ce=u(3465),le=u.n(ce),he=u(6974),fe=u.n(he),pe=u(7613),de=u.n(pe),me=u(8834).lW;const ye="3.7.5",ve=ye,ge="function"==typeof atob,be="function"==typeof btoa,we="function"==typeof me,Re="function"==typeof TextDecoder?new TextDecoder:void 0,Ee="function"==typeof TextEncoder?new TextEncoder:void 0,Oe=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),ke=(e=>{let t={};return e.forEach(((e,r)=>t[e]=r)),t})(Oe),Se=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,xe=String.fromCharCode.bind(String),_e="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Ie=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),Pe=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Te=e=>{let t,r,n,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=Oe[t>>18&63]+Oe[t>>12&63]+Oe[t>>6&63]+Oe[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},Ae=be?e=>btoa(e):we?e=>me.from(e,"binary").toString("base64"):Te,Ce=we?e=>me.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(xe.apply(null,e.subarray(r,r+4096)));return Ae(t.join(""))},Ne=(e,t=!1)=>t?Ie(Ce(e)):Ce(e),qe=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?xe(192|t>>>6)+xe(128|63&t):xe(224|t>>>12&15)+xe(128|t>>>6&63)+xe(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return xe(240|t>>>18&7)+xe(128|t>>>12&63)+xe(128|t>>>6&63)+xe(128|63&t)},De=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Fe=e=>e.replace(De,qe),je=we?e=>me.from(e,"utf8").toString("base64"):Ee?e=>Ce(Ee.encode(e)):e=>Ae(Fe(e)),Be=(e,t=!1)=>t?Ie(je(e)):je(e),Le=e=>Be(e,!0),Me=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Ue=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return xe(55296+(t>>>10))+xe(56320+(1023&t));case 3:return xe((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return xe((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},$e=e=>e.replace(Me,Ue),Qe=e=>{if(e=e.replace(/\s+/g,""),!Se.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=ke[e.charAt(o++)]<<18|ke[e.charAt(o++)]<<12|(r=ke[e.charAt(o++)])<<6|(n=ke[e.charAt(o++)]),i+=64===r?xe(t>>16&255):64===n?xe(t>>16&255,t>>8&255):xe(t>>16&255,t>>8&255,255&t);return i},Ve=ge?e=>atob(Pe(e)):we?e=>me.from(e,"base64").toString("binary"):Qe,ze=we?e=>_e(me.from(e,"base64")):e=>_e(Ve(e).split("").map((e=>e.charCodeAt(0)))),Ke=e=>ze(We(e)),Ge=we?e=>me.from(e,"base64").toString("utf8"):Re?e=>Re.decode(ze(e)):e=>$e(Ve(e)),We=e=>Pe(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),He=e=>Ge(We(e)),Je=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Ye=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,Je(t));e("fromBase64",(function(){return He(this)})),e("toBase64",(function(e){return Be(this,e)})),e("toBase64URI",(function(){return Be(this,!0)})),e("toBase64URL",(function(){return Be(this,!0)})),e("toUint8Array",(function(){return Ke(this)}))},Xe=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Je(t));e("toBase64",(function(e){return Ne(this,e)})),e("toBase64URI",(function(){return Ne(this,!0)})),e("toBase64URL",(function(){return Ne(this,!0)}))},Ze={version:ye,VERSION:ve,atob:Ve,atobPolyfill:Qe,btoa:Ae,btoaPolyfill:Te,fromBase64:He,toBase64:Be,encode:Be,encodeURI:Le,encodeURL:Le,utob:Fe,btou:$e,decode:He,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:Ne,toUint8Array:Ke,extendString:Ye,extendUint8Array:Xe,extendBuiltins:()=>{Ye(),Xe()}};var et=u(1023);function tt(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 rt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(r),!0).forEach((function(t){nt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function nt(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const it="GitHub",ot=-1;var at=function(e){return e.Error="error",e.Failure="failure",e.Pending="pending",e.Success="success",e}(at||{});let st=function(e){return e.Open="open",e.Closed="closed",e.All="all",e}({});function ut(e,t){return e.labels.some((e=>(0,k.isCMSLabel)(e.name,t)))}function ct(e){return e.reduce(((e,t)=>("removed"===t.status?e.push({sha:null,path:t.filename}):"renamed"===t.status?(e.push({sha:null,path:t.previous_filename}),e.push({sha:t.sha,path:t.filename})):e.push({sha:t.sha,path:t.filename}),e)),[])}let lt=!1;class ht{constructor(e){nt(this,"apiRoot",void 0),nt(this,"token",void 0),nt(this,"tokenKeyword",void 0),nt(this,"branch",void 0),nt(this,"useOpenAuthoring",void 0),nt(this,"repo",void 0),nt(this,"originRepo",void 0),nt(this,"repoOwner",void 0),nt(this,"repoName",void 0),nt(this,"originRepoOwner",void 0),nt(this,"originRepoName",void 0),nt(this,"repoURL",void 0),nt(this,"originRepoURL",void 0),nt(this,"mergeMethod",void 0),nt(this,"initialWorkflowStatus",void 0),nt(this,"cmsLabelPrefix",void 0),nt(this,"baseUrl",void 0),nt(this,"getUser",void 0),nt(this,"_userPromise",void 0),nt(this,"_metadataSemaphore",void 0),nt(this,"commitAuthor",void 0),nt(this,"filterOpenAuthoringBranches",(async e=>{try{const t=await this.getBranchPullRequest(e),{state:r,merged_at:n}=t;return t.number!==ot&&r===st.Closed&&n?(await this.deleteBranch(e),{branch:e,filter:!1}):{branch:e,filter:!0}}catch(t){return{branch:e,filter:!1}}})),this.apiRoot=e.apiRoot||"https://api.github.com",this.token=e.token||"",this.tokenKeyword=e.tokenKeyword||"token",this.branch=e.branch||"master",this.useOpenAuthoring=e.useOpenAuthoring,this.repo=e.repo||"",this.originRepo=e.originRepo||this.repo,this.repoURL=`/repos/${this.repo}`,this.originRepoURL=`/repos/${this.originRepo}`;const[t,r]=[this.repo.split("/"),this.originRepo.split("/")];this.repoOwner=t[0],this.repoName=t[1],this.originRepoOwner=r[0],this.originRepoName=r[1],this.mergeMethod=e.squashMerges?"squash":"merge",this.cmsLabelPrefix=e.cmsLabelPrefix,this.initialWorkflowStatus=e.initialWorkflowStatus,this.baseUrl=e.baseUrl,this.getUser=e.getUser}user(){return this._userPromise||(this._userPromise=this.getUser({token:this.token})),this._userPromise}async hasWriteAccess(){try{const e=await this.request(this.repoURL);return this.repoOwner=e.owner.login,e.permissions.push}catch(e){throw console.error("Problem fetching repo data from GitHub"),e}}reset(){}requestHeaders(e={}){const t=rt({"Content-Type":"application/json; charset=utf-8"},e);return this.token?(t.Authorization=`${this.tokenKeyword} ${this.token}`,Promise.resolve(t)):Promise.resolve(t)}parseJsonResponse(e){return e.json().then((t=>e.ok?t:Promise.reject(t)))}urlFor(e,t){const r=[];if(t.params)for(const e in t.params)r.push(`${e}=${encodeURIComponent(t.params[e])}`);return r.length&&(e+=`?${r.join("&")}`),this.apiRoot+e}parseResponse(e){const t=e.headers.get("Content-Type");return t&&t.match(/json/)?this.parseJsonResponse(e):e.text().then((t=>e.ok?t:Promise.reject(t)))}handleRequestError(e,t){throw new k.APIError(e.message,t,it)}buildRequest(e){return e}async request(e,t={},r=(e=>this.parseResponse(e))){t=rt({cache:"no-cache"},t);const n=await this.requestHeaders(t.headers||{}),i=this.urlFor(e,t);let o=500;try{const e=k.unsentRequest.fromFetchArguments(i,rt(rt({},t),{},{headers:n})),a=await(0,k.requestWithBackoff)(this,e);return o=a.status,await r(a)}catch(e){return this.handleRequestError(e,o)}}nextUrlProcessor(){return e=>e}async requestAllPages(e,t={}){t=rt({cache:"no-cache"},t);const r=await this.requestHeaders(t.headers||{}),n=this.urlFor(e,t),i=await(0,k.getAllResponses)(n,rt(rt({},t),{},{headers:r}),"next",this.nextUrlProcessor()),o=await Promise.all(i.map((e=>this.parseResponse(e))));return[].concat(...o)}generateContentKey(e,t){const r=(0,k.generateContentKey)(e,t);return this.useOpenAuthoring?`${this.repo}/${r}`:r}parseContentKey(e){return this.useOpenAuthoring?(0,k.parseContentKey)(e.slice(this.repo.length+1)):(0,k.parseContentKey)(e)}checkMetadataRef(){return this.request(`${this.repoURL}/git/refs/meta/_decap_cms`).then((e=>e.object)).catch((()=>this.uploadBlob({raw:"# Decap CMS\n\nThis tree is used by the Decap CMS to store metadata information for specific files and branches."}).then((e=>this.request(`${this.repoURL}/git/trees`,{method:"POST",body:JSON.stringify({tree:[{path:"README.md",mode:"100644",type:"blob",sha:e.sha}]})}))).then((e=>this.commit("First Commit",e))).then((e=>this.createRef("meta","_decap_cms",e.sha))).then((e=>e.object))))}async storeMetadata(e,t){return this._metadataSemaphore||(this._metadataSemaphore=o()(1)),new Promise(((r,n)=>{var i;return null===(i=this._metadataSemaphore)||void 0===i?void 0:i.take((async()=>{try{var i;const n=await this.checkMetadataRef(),o={path:`${e}.json`,raw:JSON.stringify(t)};await this.uploadBlob(o);const a=await this.updateTree(n.sha,[o]),{sha:s}=await this.commit(`Updating “${e}” metadata`,a);await this.patchRef("meta","_decap_cms",s),await k.localForage.setItem(`gh.meta.${e}`,{expires:Date.now()+3e5,data:t}),null===(i=this._metadataSemaphore)||void 0===i||i.leave(),r()}catch(e){n(e)}}))}))}deleteMetadata(e){return this._metadataSemaphore||(this._metadataSemaphore=o()(1)),new Promise((t=>{var r;return null===(r=this._metadataSemaphore)||void 0===r?void 0:r.take((async()=>{try{var r;const n=await this.checkMetadataRef(),i={path:`${e}.json`,sha:null},o=await this.updateTree(n.sha,[i]),{sha:a}=await this.commit(`Deleting “${e}” metadata`,o);await this.patchRef("meta","_decap_cms",a),null===(r=this._metadataSemaphore)||void 0===r||r.leave(),t()}catch(e){var n;null===(n=this._metadataSemaphore)||void 0===n||n.leave(),t()}}))}))}async retrieveMetadataOld(e){console.log("%c Checking for MetaData files","line-height: 30px;text-align: center;font-weight: bold");const t={params:{ref:"refs/meta/_decap_cms"},headers:{Accept:"application/vnd.github.v3.raw"}};function r(t){throw"Not Found"===t.message&&console.log("%c %s does not have metadata","line-height: 30px;text-align: center;font-weight: bold",e),t}if(!this.useOpenAuthoring)return await this.request(`${this.repoURL}/contents/${e}.json`,t).then((e=>JSON.parse(e))).catch(r);const[n,i]=e.split("/");return this.request(`/repos/${n}/${i}/contents/${e}.json`,t).then((e=>JSON.parse(e))).catch(r)}async getPullRequests(e,t,r){return(await this.requestAllPages(`${this.originRepoURL}/pulls`,{params:rt(rt({},e?{head:await this.getHeadReference(e)}:{}),{},{base:this.branch,state:t,per_page:100})})).filter((e=>e.head.ref.startsWith(`${k.CMS_BRANCH_PREFIX}/`)&&r(e)))}async getOpenAuthoringPullRequest(e,t){const r=await this.getBranch(e).catch((()=>{throw new k.EditorialWorkflowError("content is not under editorial workflow",!0)})),n=t.filter((e=>e.head.sha===r.commit.sha))[0];if(n){n.labels=n.labels.filter((e=>!(0,k.isCMSLabel)(e.name,this.cmsLabelPrefix)));const e=n.state===st.Closed?{name:(0,k.statusToLabel)(this.initialWorkflowStatus,this.cmsLabelPrefix)}:{name:(0,k.statusToLabel)("pending_review",this.cmsLabelPrefix)};return n.labels.push(e),n}try{return{head:{sha:r.commit.sha},number:ot,labels:[{name:(0,k.statusToLabel)(this.initialWorkflowStatus,this.cmsLabelPrefix)}],state:st.Open}}catch(e){throw new k.EditorialWorkflowError("content is not under editorial workflow",!0)}}async getBranchPullRequest(e){if(this.useOpenAuthoring){const t=await this.getPullRequests(e,st.All,(()=>!0));return this.getOpenAuthoringPullRequest(e,t)}{const t=await this.getPullRequests(e,st.Open,(e=>ut(e,this.cmsLabelPrefix)));if(t.length<=0)throw new k.EditorialWorkflowError("content is not under editorial workflow",!0);return t[0]}}async getPullRequestCommits(e){if(e===ot)return[];try{return await this.request(`${this.originRepoURL}/pulls/${e}/commits`)}catch(e){return console.log(e),[]}}async getPullRequestAuthor(e){var t;if(null!==(t=e.user)&&void 0!==t&&t.login)try{const t=await this.request(`/users/${e.user.login}`);return t.name||t.login}catch{return}}async retrieveUnpublishedEntryData(e){const{collection:t,slug:r}=this.parseContentKey(e),n=(0,k.branchFromContentKey)(e),i=await this.getBranchPullRequest(n),[{files:o},a]=await Promise.all([this.getDifferences(this.branch,i.head.sha),this.getPullRequestAuthor(i)]),s=await Promise.all(o.map((e=>this.diffFromFile(e)))),u=i.labels.find((e=>(0,k.isCMSLabel)(e.name,this.cmsLabelPrefix))),c=(0,k.labelToStatus)(u.name,this.cmsLabelPrefix),l=i.updated_at;return{collection:t,slug:r,status:c,diffs:s.map((e=>({path:e.path,newFile:e.newFile,id:e.sha}))),updatedAt:l,pullRequestAuthor:a}}async readFile(e,t,{branch:r=this.branch,repoURL:n=this.repoURL,parseText:i=!0}={}){return t||(t=await this.getFileSha(e,{repoURL:n,branch:r})),await this.fetchBlobContent({sha:t,repoURL:n,parseText:i})}async readFileMetadata(e,t){const r=await(0,k.readFileMetadata)(t,(async()=>{try{const t=await this.request(`${this.originRepoURL}/commits`,{params:{path:e,sha:this.branch}}),{commit:r}=t[0];return{author:r.author.name||r.author.email,updatedOn:r.author.date}}catch(e){return{author:"",updatedOn:""}}}),k.localForage);return r}async fetchBlobContent({sha:e,repoURL:t,parseText:r}){const n=await this.request(`${t}/git/blobs/${e}`,{cache:"force-cache"});if(r)return Ze.decode(n.content);{const e=Ze.atob(n.content),t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return new Blob([t])}}async listFiles(e,{repoURL:t=this.repoURL,branch:r=this.branch,depth:n=1}={}){const i=ae()(e,"/");try{return(await this.request(`${t}/git/trees/${r}:${i}`,{params:n>1?{recursive:1}:{}})).tree.filter((e=>"blob"===e.type&&e.path.split("/").length<=n)).map((e=>({type:e.type,id:e.sha,name:(0,k.basename)(e.path),path:`${i}/${e.path}`,size:e.size})))}catch(e){if(e&&404===e.status)return console.log("This 404 was expected and handled appropriately."),[];throw e}}async migrateToVersion1(e,t){const r=e.head.ref.slice(4),n=`${t.collection}/${r}`,i=`cms/${n}`;await this.getBranch(i).catch((()=>{}))||await this.createBranch(i,e.head.sha);const o=(await this.getPullRequests(i,st.All,(()=>!0)))[0]||await this.createPR(e.title,i),a=rt(rt({},t),{},{pr:{number:o.number,head:o.head.sha},branch:i,version:"1"});return await this.storeMetadata(n,a),await this.closePR(e.number),await this.deleteBranch(e.head.ref),await this.deleteMetadata(r),{metadata:a,pullRequest:o}}async migrateToPullRequestLabels(e,t){await this.setPullRequestStatus(e,t.status);const r=e.head.ref.slice(4);await this.deleteMetadata(r)}async migratePullRequest(e,t){const{number:r}=e;console.log(`Migrating Pull Request '${r}' (${t})`);const n=(0,k.contentKeyFromBranch)(e.head.ref);let i=await this.retrieveMetadataOld(n).catch((()=>{}));if(!i)return void console.log(`Skipped migrating Pull Request '${r}' (${t})`);let o=r;if(!i.version){console.log(`Migrating Pull Request '${r}' to version 1`);try{({metadata:i,pullRequest:e}=await this.migrateToVersion1(e,i))}catch(e){return console.log(`Failed to migrate Pull Request '${r}' to version 1. See error below.`),void console.error(e)}o=e.number,console.log(`Done migrating Pull Request '${r}' to version 1. New pull request '${o}' created.`)}"1"===i.version&&(console.log(`Migrating Pull Request '${o}' to labels`),await this.migrateToPullRequestLabels(e,i),console.log(`Done migrating Pull Request '${o}' to labels`)),console.log(`Done migrating Pull Request '${r===o?o:`${r} => ${o}`}'`)}async getOpenAuthoringBranches(){return await this.requestAllPages(`${this.repoURL}/git/refs/heads/cms/${this.repo}`).catch((()=>[]))}async listUnpublishedBranches(){let e;if(console.log("%c Checking for Unpublished entries","line-height: 30px;text-align: center;font-weight: bold"),this.useOpenAuthoring){e=(await this.getOpenAuthoringBranches()).map((e=>e.ref.slice(11)));const t=await Promise.all(e.map((e=>this.filterOpenAuthoringBranches(e))));e=t.filter((e=>e.filter)).map((e=>e.branch))}else{const t=await this.getPullRequests(void 0,st.Open,(e=>!e.head.repo.fork&&function(e,t){return e.labels.every((e=>!(0,k.isCMSLabel)(e.name,t)))}(e,this.cmsLabelPrefix)));let r=0;for(const e of t)lt||(lt=!0,alert(E`
|
|
Decap CMS is adding labels to ${t.length} of your Editorial Workflow
|
|
entries. The "Workflow" tab will be unavailable during this migration. You may use other
|
|
areas of the CMS during this time. Note that closing the CMS will pause the migration.
|
|
`)),r+=1,await this.migratePullRequest(e,`${r} of ${t.length}`);e=(await this.getPullRequests(void 0,st.Open,(e=>ut(e,this.cmsLabelPrefix)))).map((e=>e.head.ref))}return e}async getStatuses(e,t){const r=this.generateContentKey(e,t),n=(0,k.branchFromContentKey)(r),i=(await this.getBranchPullRequest(n)).head.sha;return(await this.request(`${this.originRepoURL}/commits/${i}/status`)).statuses.map((e=>({context:e.context,target_url:e.target_url,state:e.state===at.Success?k.PreviewState.Success:k.PreviewState.Other})))}async persistFiles(e,t,r){const n=t.concat(e),i=n.map((e=>this.uploadBlob(e)));if(await Promise.all(i),r.useWorkflow){const i=t.map((({sha:e,path:t})=>({path:s()(t,"/"),sha:e}))),o=e[0].slug;return this.editorialWorkflowGit(n,o,i,r)}return this.getDefaultBranch().then((e=>this.updateTree(e.commit.sha,n))).then((e=>this.commit(r.commitMessage,e))).then((e=>this.patchBranch(this.branch,e.sha)))}async getFileSha(e,{repoURL:t=this.repoURL,branch:r=this.branch}={}){const n=e.split("/"),i=fe()(n),o=de()(n).join("/"),a=`${t}/git/trees/${r}:${encodeURIComponent(o)}`,s=(await this.request(a)).tree.find((e=>e.path===i));if(s)return s.sha;throw new k.APIError("Not Found",404,it)}async deleteFiles(e,t){if(this.useOpenAuthoring)return Promise.reject("Cannot delete published entries as an Open Authoring user!");const r=await this.getDefaultBranch(),n=e.map((e=>({path:e,sha:null}))),i=await this.updateTree(r.commit.sha,n),o=await this.commit(t,i);await this.patchBranch(this.branch,o.sha)}async createBranchAndPullRequest(e,t,r){return await this.createBranch(e,t),this.createPR(r,e)}async updatePullRequestLabels(e,t){await this.request(`${this.repoURL}/issues/${e}/labels`,{method:"PUT",body:JSON.stringify({labels:t})})}async diffFromFile(e){return{path:e.filename,newFile:"added"===e.status,sha:e.sha,binary:"renamed"!==e.status&&!e.patch||e.filename.endsWith(".svg")}}async editorialWorkflowGit(e,t,r,n){const i=this.generateContentKey(n.collectionName,t),o=(0,k.branchFromContentKey)(i);if(n.unpublished){const{files:t}=await this.getDifferences(this.branch,await this.getHeadReference(o)),i=await Promise.all(t.map((e=>this.diffFromFile(e)))),a=[];for(const e of i.filter((e=>e.binary)))r.some((t=>t.path===e.path))||a.push({path:e.path,sha:null});const s=await this.rebaseBranch(o),u=a.concat(e),c=await this.updateTree(s.sha,u,o),l=await this.commit(n.commitMessage,c);return this.patchBranch(o,l.sha,{force:!0})}{const t=await this.getDefaultBranch(),r=await this.updateTree(t.commit.sha,e),i=await this.commit(n.commitMessage,r);if(this.useOpenAuthoring)await this.createBranch(o,i.sha);else{const e=await this.createBranchAndPullRequest(o,i.sha,n.commitMessage);await this.setPullRequestStatus(e,n.status||this.initialWorkflowStatus)}}}async getDifferences(e,t){const r=this.useOpenAuthoring?10:1;for(let n=1;n<=r;n++)try{return await this.request(`${this.originRepoURL}/compare/${e}...${t}`)}catch(e){if(n===r)throw console.warn(`Reached maximum number of attempts '${r}' for getDifferences`),e;await new Promise((e=>setTimeout(e,500*n)))}throw new k.APIError("Not Found",404,it)}async rebaseSingleCommit(e,t){const r=ct((await this.getDifferences(t.parents[0].sha,t.sha)).files);if(r.length>0){const n=await this.updateTree(e.sha,r),{message:i,author:o,committer:a}=t.commit;return await this.createCommit(i,n.sha,[e.sha],o,a)}return t}async rebaseCommits(e,t){return 0===t.length||t[0].parents[0].sha===e.sha?fe()(t):t.reduce(((e,t)=>e.then((e=>{const r=e,n=t;return this.rebaseSingleCommit(r,n)}))),Promise.resolve(e))}async rebaseBranch(e){try{const{base_commit:t,commits:r}=await this.getDifferences(this.branch,await this.getHeadReference(e));return await this.rebaseCommits(t,r)}catch(e){throw console.error(e),e}}async setPullRequestStatus(e,t){const r=[...e.labels.filter((e=>!(0,k.isCMSLabel)(e.name,this.cmsLabelPrefix))).map((e=>e.name)),(0,k.statusToLabel)(t,this.cmsLabelPrefix)];await this.updatePullRequestLabels(e.number,r)}async updateUnpublishedEntryStatus(e,t,r){const n=this.generateContentKey(e,t),i=(0,k.branchFromContentKey)(n),o=await this.getBranchPullRequest(i);if(this.useOpenAuthoring){if("pending_publish"===status)throw new Error('Open Authoring entries may not be set to the status "pending_publish".');if(o.number!==ot){const{state:e}=o;e===st.Open&&"draft"===r&&await this.closePR(o.number),e===st.Closed&&"pending_review"===r&&await this.openPR(o.number)}else if("pending_review"===r){var a,s;const e=(0,k.branchFromContentKey)(n),t=(null===(a=(await this.getDifferences(this.branch,await this.getHeadReference(e))).commits[0])||void 0===a||null===(s=a.commit)||void 0===s?void 0:s.message)||ht.DEFAULT_COMMIT_MESSAGE;await this.createPR(t,e)}}else await this.setPullRequestStatus(o,r)}async deleteUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,k.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);i.number!==ot&&await this.closePR(i.number),await this.deleteBranch(n)}async publishUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,k.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);await this.mergePR(i),await this.deleteBranch(n)}async createRef(e,t,r){return await this.request(`${this.repoURL}/git/refs`,{method:"POST",body:JSON.stringify({ref:`refs/${e}/${t}`,sha:r})})}async patchRef(e,t,r,n={}){const i=n.force||!1;return await this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({sha:r,force:i})})}deleteRef(e,t){return this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"DELETE"})}async getBranch(e){return await this.request(`${this.repoURL}/branches/${encodeURIComponent(e)}`)}async getDefaultBranch(){return await this.request(`${this.originRepoURL}/branches/${encodeURIComponent(this.branch)}`)}async backupBranch(e){try{const t=await this.getBranch(e);await this.createBranch(t.name.replace(new RegExp(`${k.CMS_BRANCH_PREFIX}/`),`${k.CMS_BRANCH_PREFIX}_${Date.now()}/`),t.commit.sha)}catch(e){console.warn(e)}}async createBranch(e,t){try{return await this.createRef("heads",e,t)}catch(r){const n=String(r.message||"");if("Reference update failed"===n)await(0,k.throwOnConflictingBranches)(e,(e=>this.getBranch(e)),it);else if("Reference already exists"===n&&e.startsWith(`${k.CMS_BRANCH_PREFIX}/`))try{return await this.backupBranch(e),await this.patchBranch(e,t,{force:!0})}catch(e){console.log(e)}throw r}}assertCmsBranch(e){return e.startsWith(`${k.CMS_BRANCH_PREFIX}/`)}patchBranch(e,t,r={}){const n=r.force||!1;if(n&&!this.assertCmsBranch(e))throw Error(`Only CMS branches can be force updated, cannot force update ${e}`);return this.patchRef("heads",e,t,{force:n})}deleteBranch(e){return this.deleteRef("heads",e).catch((e=>"Reference does not exist"===e.message?Promise.resolve():(console.error(e),Promise.reject(e))))}async getHeadReference(e){return`${this.repoOwner}:${e}`}async createPR(e,t){return await this.request(`${this.originRepoURL}/pulls`,{method:"POST",body:JSON.stringify({title:e,body:k.DEFAULT_PR_BODY,head:await this.getHeadReference(t),base:this.branch})})}async openPR(e){return console.log("%c Re-opening PR","line-height: 30px;text-align: center;font-weight: bold"),await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:st.Open})})}async closePR(e){return console.log("%c Deleting PR","line-height: 30px;text-align: center;font-weight: bold"),await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:st.Closed})})}async mergePR(e){console.log("%c Merging PR","line-height: 30px;text-align: center;font-weight: bold");try{return await this.request(`${this.originRepoURL}/pulls/${e.number}/merge`,{method:"PUT",body:JSON.stringify({commit_message:k.MERGE_COMMIT_MESSAGE,sha:e.head.sha,merge_method:this.mergeMethod})})}catch(t){if(t instanceof k.APIError&&405===t.status)return this.forceMergePR(e);throw t}}async forceMergePR(e){const t=ct((await this.getDifferences(e.base.sha,e.head.sha)).files);let r="Automatically generated. Merged on Decap CMS\n\nForce merge of:";return t.forEach((e=>{r+=`\n* "${e.path}"`})),console.log("%c Automatic merge not possible - Forcing merge.","line-height: 30px;text-align: center;font-weight: bold"),this.getDefaultBranch().then((e=>this.updateTree(e.commit.sha,t))).then((e=>this.commit(r,e))).then((e=>this.patchBranch(this.branch,e.sha)))}toBase64(e){return Promise.resolve(Ze.encode(e))}async uploadBlob(e){const t=await ue()(e,"toBase64",le()(this.toBase64,e.raw)),r=await this.request(`${this.repoURL}/git/blobs`,{method:"POST",body:JSON.stringify({content:t,encoding:"base64"})});return e.sha=r.sha,e}async updateTree(e,t,r=this.branch){const n=[],i=t.reduce(((e,t)=>{const r={path:s()(t.path,"/"),mode:"100644",type:"blob",sha:t.sha};return t.newPath?n.push({from:t.path,to:t.newPath,sha:t.sha}):e.push(r),e}),[]);for(const{from:e,to:t,sha:o}of n){const n=(0,et.dirname)(e),a=(0,et.dirname)(t),s=await this.listFiles(n,{branch:r,depth:100});for(const t of s)i.push({path:t.path,mode:"100644",type:"blob",sha:null}),i.push({path:t.path.replace(n,a),mode:"100644",type:"blob",sha:t.path===e?o:t.id})}return rt(rt({},await this.createTree(e,i)),{},{parentSha:e})}async createTree(e,t){return await this.request(`${this.repoURL}/git/trees`,{method:"POST",body:JSON.stringify({base_tree:e,tree:t})})}commit(e,t){const r=t.parentSha?[t.parentSha]:[];return this.createCommit(e,t.sha,r)}async createCommit(e,t,r,n,i){return await this.request(`${this.repoURL}/git/commits`,{method:"POST",body:JSON.stringify({message:e,tree:t,parents:r,author:n,committer:i})})}async getUnpublishedEntrySha(e,t){const r=this.generateContentKey(e,t),n=(0,k.branchFromContentKey)(r);return(await this.getBranchPullRequest(n)).head.sha}}nt(ht,"DEFAULT_COMMIT_MESSAGE","Automatically generated by Decap CMS");var ft=function(e,t){return ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},ft(e,t)};function pt(e,t){function r(){this.constructor=e}ft(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var dt=function(){return dt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},dt.apply(this,arguments)};function mt(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function yt(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var vt,gt=u(2624),bt=function(e,t){return bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},bt(e,t)},wt="Invariant Violation",Rt=Object.setPrototypeOf,Et=void 0===Rt?function(e,t){return e.__proto__=t,e}:Rt,Ot=function(e){function t(r){void 0===r&&(r=wt);var n=e.call(this,"number"==typeof r?wt+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=wt,Et(n,t.prototype),n}return function(e,t){function r(){this.constructor=e}bt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error);function kt(e,t){if(!e)throw new Ot(t)}function St(e){return function(){return console[e].apply(console,arguments)}}(vt=kt||(kt={})).warn=St("warn"),vt.error=St("error");var xt={env:{}};if("object"==typeof process)xt=process;else try{Function("stub","process = stub")(xt)}catch(e){}var _t=function(){return _t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_t.apply(this,arguments)};function It(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}var Pt=u(5695),Tt=u.n(Pt),At=Object.prototype,Ct=At.toString,Nt=At.hasOwnProperty,qt=new Map;function Dt(e,t){try{return Ft(e,t)}finally{qt.clear()}}function Ft(e,t){if(e===t)return!0;var r=Ct.call(e);if(r!==Ct.call(t))return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(jt(e,t))return!0;var n=Object.keys(e),i=Object.keys(t),o=n.length;if(o!==i.length)return!1;for(var a=0;a<o;++a)if(!Nt.call(t,n[a]))return!1;for(a=0;a<o;++a){var s=n[a];if(!Ft(e[s],t[s]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(jt(e,t))return!0;for(var u=e.entries(),c="[object Map]"===r;;){var l=u.next();if(l.done)break;var h=l.value,f=h[0],p=h[1];if(!t.has(f))return!1;if(c&&!Ft(p,t.get(f)))return!1}return!0}return!1}function jt(e,t){var r=qt.get(e);if(r){if(r.has(t))return!0}else qt.set(e,r=new Set);return r.add(t),!1}function Bt(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map((function(e){return Bt(i,e.name,e.value,n)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return Bt(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw new Ot(17);e[t.value]=null}}var Lt=["connection","include","skip","client","rest","export"];function Mt(e,t,r){if(r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i=t,o={};return n.forEach((function(e){o[e]=i[e]})),r.connection.key+"("+JSON.stringify(o)+")"}return r.connection.key}var a=e;if(t){var s=Tt()(t);a+="("+s+")"}return r&&Object.keys(r).forEach((function(e){-1===Lt.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)})),a}function Ut(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return Bt(r,n,i,t)})),r}return null}function $t(e){return e.alias?e.alias.value:e.name.value}function Qt(e){return"Field"===e.kind}function Vt(e){return"InlineFragment"===e.kind}function zt(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function Kt(e,t){return void 0===t&&(t=!1),_t({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function Gt(e,t){if(e.directives&&e.directives.length){var r={};return e.directives.forEach((function(e){r[e.name.value]=Ut(e,t)})),r}return null}function Wt(e,t){return void 0===t&&(t={}),(r=e.directives,r?r.filter(Yt).map((function(e){var t=e.arguments;e.name.value,kt(t&&1===t.length,14);var r=t[0];kt(r.name&&"if"===r.name.value,15);var n=r.value;return kt(n&&("Variable"===n.kind||"BooleanValue"===n.kind),16),{directive:e,ifArgument:r}})):[]).every((function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?kt(void 0!==(i=t[n.value.name.value]),13):i=n.value.value,"skip"===r.name.value?!i:i}));var r}function Ht(e,t){return function(e){var t=[];return(0,gt.visit)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function Jt(e){return e&&Ht(["client"],e)&&Ht(["export"],e)}function Yt(e){var t=e.name.value;return"skip"===t||"include"===t}function Xt(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new Ot(11);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&(kt(1===n.length,12),r=n[0].name.value),_t(_t({},e),{definitions:It([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function Zt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.forEach((function(t){null!=t&&Object.keys(t).forEach((function(r){e[r]=t[r]}))})),e}function er(e){return kt(e&&"Document"===e.kind,2),kt(e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw new Ot(3);return e})).length<=1,4),e}function tr(e){return er(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function rr(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function nr(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function ir(e){var t;er(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw new Ot(10)}function or(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function ar(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var t=e.variableDefinitions.filter((function(e){return e.defaultValue})).map((function(e){var t=e.variable,r=e.defaultValue,n={};return Bt(n,t.name,r),n}));return Zt.apply(void 0,It([{}],t))}return{}}function sr(e,t,r){var n=0;return e.forEach((function(r,i){t.call(this,r,i,e)&&(e[n++]=r)}),r),e.length=n,e}var ur={kind:"Field",name:{kind:"Name",value:"__typename"}};function cr(e,t){return e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&cr(t[e.name.value],t)}))}function lr(e){return cr(tr(e)||function(e){kt("Document"===e.kind,7),kt(e.definitions.length<=1,8);var t=e.definitions[0];return kt("FragmentDefinition"===t.kind,9),t}(e),or(nr(e)))?null:e}function hr(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function fr(e,t){var r=Object.create(null),n=[],i=Object.create(null),o=[],a=lr((0,gt.visit)(t,{Variable:{enter:function(e,t,n){"VariableDefinition"!==n.kind&&(r[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(hr(e)))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&n.push({name:e.value.name.value})})),t.selectionSet&&dr(t.selectionSet).forEach((function(e){o.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(hr(e)(t))return null}}}));return a&&sr(n,(function(e){return!r[e.name]})).length&&(a=function(e,t){var r=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return lr((0,gt.visit)(t,{OperationDefinition:{enter:function(t){return _t(_t({},t),{variableDefinitions:t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))}))})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var n=0;if(t.arguments.forEach((function(e){r(e)&&(n+=1)})),1===n)return null}}},Argument:{enter:function(e){if(r(e))return null}}}))}(n,a)),a&&sr(o,(function(e){return!i[e.name]})).length&&(a=function(e,t){function r(t){if(e.some((function(e){return e.name===t.name.value})))return null}return lr((0,gt.visit)(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}(o,a)),a}var pr={test:function(e){var t="connection"===e.name.value;return t&&(!e.arguments||e.arguments.some((function(e){return"key"===e.name.value}))),t}};function dr(e){var t=[];return e.selections.forEach((function(e){(Qt(e)||Vt(e))&&e.selectionSet?dr(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function mr(e){return"query"===ir(e).operation?e:(0,gt.visit)(e,{OperationDefinition:{enter:function(e){return _t(_t({},e),{operation:"query"})}}})}var yr="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),vr=Object.prototype.toString;function gr(e){return br(e,new Map)}function br(e,t){switch(vr.call(e)){case"[object Array]":if(t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=br(e,t)})),r;case"[object Object]":if(t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=br(e[r],t)})),n;default:return e}}function wr(e){return("undefined"!=typeof process?"production":"development")===e}function Rr(e){try{return e()}catch(e){console.error&&console.error(e)}}function Er(e){return e.errors&&e.errors.length}var Or=Object.prototype.hasOwnProperty;function kr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Sr(e)}function Sr(e){var t=e[0]||{},r=e.length;if(r>1){var n=[];t=Ir(t,n);for(var i=1;i<r;++i)t=_r(t,e[i],n)}return t}function xr(e){return null!==e&&"object"==typeof e}function _r(e,t,r){return xr(t)&&xr(e)?(Object.isExtensible&&!Object.isExtensible(e)&&(e=Ir(e,r)),Object.keys(t).forEach((function(n){var i=t[n];if(Or.call(e,n)){var o=e[n];i!==o&&(e[n]=_r(Ir(o,r),i,r))}else e[n]=i})),e):t}function Ir(e,t){return null!==e&&"object"==typeof e&&t.indexOf(e)<0&&(e=Array.isArray(e)?e.slice(0):_t({__proto__:Object.getPrototypeOf(e)},e),t.push(e)),e}Object.create({});var Pr=u(2394);const Tr=u.n(Pr)();var Ar,Cr=function(e,t){return Cr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},Cr(e,t)},Nr=function(){return Nr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Nr.apply(this,arguments)};function qr(e){return e.request.length<=1}function Dr(e){return new Tr((function(t){t.error(e)}))}function Fr(e,t){return t?t(e):Tr.of()}function jr(e){return"function"==typeof e?new $r(e):e}function Br(){return new $r((function(){return Tr.of()}))}function Lr(e){return 0===e.length?Br():e.map(jr).reduce((function(e,t){return e.concat(t)}))}function Mr(e,t,r){var n=jr(t),i=jr(r||new $r(Fr));return qr(n)&&qr(i)?new $r((function(t){return e(t)?n.request(t)||Tr.of():i.request(t)||Tr.of()})):new $r((function(t,r){return e(t)?n.request(t,r)||Tr.of():i.request(t,r)||Tr.of()}))}(function(e,t){function r(){this.constructor=e}Cr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})((function(e,t){var r=Ar.call(this,e)||this;return r.link=t,r}),Ar=Error);var Ur=function(e,t){var r=jr(e);if(qr(r))return r;var n=jr(t);return qr(n)?new $r((function(e){return r.request(e,(function(e){return n.request(e)||Tr.of()}))||Tr.of()})):new $r((function(e,t){return r.request(e,(function(e){return n.request(e,t)||Tr.of()}))||Tr.of()}))},$r=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,r,n){return this.concat(Mr(t,r,n||new e(Fr)))},e.prototype.concat=function(e){return Ur(this,e)},e.prototype.request=function(e,t){throw new Ot(1)},e.empty=Br,e.from=Lr,e.split=Mr,e.execute=Qr,e}();function Qr(e,t){return e.request(function(e,t){var r=Nr({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r=Nr({},r,"function"==typeof e?e(r):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return Nr({},r)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return function(e){var t=e.query,r=e.variables,n=e.operationName;return JSON.stringify([n,t,r])}(t)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?rr(t.query):""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw new Ot(2)}return e}(t))))||Tr.of()}var Vr,zr=u(7288);function Kr(e){return e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Vr||(Vr={}));var Gr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return pt(t,e),t.prototype[zr.Z]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(Tr);function Wr(e){return Array.isArray(e)&&e.length>0}var Hr,Jr=function(e){function t(r){var n,i,o=r.graphQLErrors,a=r.networkError,s=r.errorMessage,u=r.extraInfo,c=e.call(this,s)||this;return c.graphQLErrors=o||[],c.networkError=a||null,c.message=s||(i="",Wr((n=c).graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";i+="GraphQL error: "+t+"\n"})),n.networkError&&(i+="Network error: "+n.networkError.message+"\n"),i=i.replace(/\n$/,"")),c.extraInfo=u,c.__proto__=t.prototype,c}return pt(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(Hr||(Hr={}));var Yr=function(e){function t(t){var r=t.queryManager,n=t.options,i=t.shouldSubscribe,o=void 0===i||i,a=e.call(this,(function(e){return a.onSubscribe(e)}))||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=n,a.variables=n.variables||{},a.queryId=r.generateQueryId(),a.shouldSubscribe=o;var s=tr(n.query);return a.queryName=s&&s.name&&s.name.value,a.queryManager=r,a}return pt(t,e),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:Vr.error}}var t,r,n,i=this.queryManager.getCurrentQueryResult(this),o=i.data,a=i.partial,s=this.queryManager.queryStore.get(this.queryId),u=this.options.fetchPolicy,c="network-only"===u||"no-cache"===u;if(s){var l=s.networkStatus;if(r=s,void 0===(n=this.options.errorPolicy)&&(n="none"),r&&(r.networkError||"none"===n&&Wr(r.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:l,error:new Jr({graphQLErrors:s.graphQLErrors,networkError:s.networkError})};s.variables&&(this.options.variables=dt(dt({},this.options.variables),s.variables),this.variables=this.options.variables),t={data:o,loading:Kr(l),networkStatus:l},s.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=s.graphQLErrors)}else{var h=c||a&&"cache-only"!==u;t={data:o,loading:h,networkStatus:h?Vr.loading:Vr.ready}}return a||this.updateLastResult(dt(dt({},t),{stale:!1})),dt(dt({},t),{partial:a})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&Dt(t.data,e.data))},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new Ot(1)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),Dt(this.variables,e)||(this.variables=dt(dt({},this.variables),e)),Dt(this.options.variables,this.variables)||(this.options.variables=dt(dt({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,dt(dt({},this.options),{fetchPolicy:t}),Hr.refetch))},t.prototype.fetchMore=function(e){var t=this;kt(e.updateQuery,2);var r=dt(dt({},e.query?e:dt(dt(dt({},this.options),e),{variables:dt(dt({},this.variables),e.variables)})),{fetchPolicy:"network-only"}),n=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(n,r,Hr.normal,this.queryId).then((function(i){return t.updateQuery((function(t){return e.updateQuery(t,{fetchMoreResult:i.data,variables:r.variables})})),t.queryManager.stopQuery(n),i}),(function(e){throw t.queryManager.stopQuery(n),e}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=dt(dt({},this.options),e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var r=e.fetchPolicy;return this.setVariables(this.options.variables,t!==r&&("cache-only"===t||"standby"===t||"network-only"===r),e.fetchResults)},t.prototype.setVariables=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),this.isTornDown=!1,e=e||this.variables,!t&&Dt(e,this.variables)?this.observers.size&&r?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=t.getQueryWithPreviousResult(this.queryId),n=r.previousResult,i=r.variables,o=r.document,a=Rr((function(){return e(n,{variables:i})}));a&&(t.dataStore.markUpdateQueryResult(o,i,a),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){en(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:gr(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var r=e._subscription._observer;r&&!r.error&&(r.error=Xr)}catch(e){}var n=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),n&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,r=this.queryId;this.shouldSubscribe&&t.addObservableQuery(r,this),this.options.pollInterval&&(en(this),t.startPollingQuery(this.options,r));var n=function(t){e.updateLastResult(dt(dt({},e.lastResult),{errors:t.graphQLErrors,networkStatus:Vr.error,loading:!1})),Zr(e.observers,"error",e.lastError=t)};t.observeQuery(r,this.options,{next:function(r){if(e.lastError||e.isDifferentFromLastResult(r)){var n=e.updateLastResult(r),i=e.options,o=i.query,a=i.variables,s=i.fetchPolicy;t.transform(o).hasClientExports?t.getLocalState().addExportedVariables(o,a).then((function(i){var a=e.variables;e.variables=e.options.variables=i,!r.loading&&n&&"cache-only"!==s&&t.transform(o).serverQuery&&!Dt(a,i)?e.refetch():Zr(e.observers,"next",r)})):Zr(e.observers,"next",r)}},error:n}).catch(n)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(Gr);function Xr(e){}function Zr(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function en(e){var t=e.options.fetchPolicy;kt("cache-first"!==t&&"cache-only"!==t,3)}var tn=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,r){this.store[e]={mutation:t,variables:r||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var r=this.store[e];r&&(r.loading=!1,r.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),rn=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];kt(!t||t.document===e.document||Dt(t.document,e.document),19);var r,n=!1,i=null;e.storePreviousVariables&&t&&t.networkStatus!==Vr.loading&&(Dt(t.variables,e.variables)||(n=!0,i=t.variables)),r=n?Vr.setVariables:e.isPoll?Vr.poll:e.isRefetch?Vr.refetch:Vr.loading;var o=[];t&&t.graphQLErrors&&(o=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:i,networkError:null,graphQLErrors:o,networkStatus:r,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=Vr.fetchMore)},e.prototype.markQueryResult=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=Wr(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=Vr.ready,"string"==typeof r&&this.store[r]&&(this.store[r].networkStatus=Vr.ready))},e.prototype.markQueryError=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=Vr.error,"string"==typeof r&&this.markQueryResultClient(r,!0))},e.prototype.markQueryResultClient=function(e,t){var r=this.store&&this.store[e];r&&(r.networkError=null,r.previousVariables=null,t&&(r.networkStatus=Vr.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach((function(r){e.indexOf(r)<0?t.stopQuery(r):t.store[r].networkStatus=Vr.loading}))},e}(),nn=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=kr(t.resolvers,e)})):this.resolvers=kr(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return mt(this,void 0,void 0,(function(){return yt(this,(function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,a).then((function(e){return dt(dt({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Ht(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?function(e){er(e);var t=fr([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=(0,gt.visit)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return Qt(e)&&"__typename"===e.name.value})))return null}}})),t}(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return dt(dt({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);kt(!1,6)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),mt(this,void 0,void 0,(function(){return yt(this,(function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return dt(dt({},t),e.exportedVariables)}))]:[2,dt({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,gt.visit)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return gt.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:mr(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,o){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),mt(this,void 0,void 0,(function(){var a,s,u,c,l,h,f,p,d;return yt(this,(function(m){var y;return a=ir(e),s=nr(e),u=or(s),c=a.operation,l=c?(y=c).charAt(0).toUpperCase()+y.slice(1):"Query",f=(h=this).cache,p=h.client,d={fragmentMap:u,context:dt(dt({},r),{cache:f,client:p}),variables:n,fragmentMatcher:i,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,d).then((function(e){return{result:e,exportedVariables:d.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r){return mt(this,void 0,void 0,(function(){var n,i,o,a,s,u=this;return yt(this,(function(c){return n=r.fragmentMap,i=r.context,o=r.variables,a=[t],s=function(e){return mt(u,void 0,void 0,(function(){var s,u;return yt(this,(function(c){return Wt(e,o)?Qt(e)?[2,this.resolveField(e,t,r).then((function(t){var r;void 0!==t&&a.push(((r={})[$t(e)]=t,r))}))]:(Vt(e)?s=e:kt(s=n[e.name.value],7),s&&s.typeCondition&&(u=s.typeCondition.name.value,r.fragmentMatcher(t,u,i))?[2,this.resolveSelectionSet(s.selectionSet,t,r).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(s)).then((function(){return Sr(a)}))]}))}))},e.prototype.resolveField=function(e,t,r){return mt(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,h,f=this;return yt(this,(function(p){return n=r.variables,i=e.name.value,o=$t(e),a=i!==o,s=t[o]||t[i],u=Promise.resolve(s),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(c=t.__typename||r.defaultOperationType,(l=this.resolvers&&this.resolvers[c])&&(h=l[a?i:o])&&(u=Promise.resolve(h(t,Ut(e,n),r.context,{field:e,fragmentMap:r.fragmentMap})))),[2,u.then((function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?f.resolveSubSelectedArray(e,t,r):e.selectionSet?f.resolveSelectionSet(e.selectionSet,t,r):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0})))},e}();function on(e){var t=new Set,r=null;return new Gr((function(n){return t.add(n),r=r||e.subscribe({next:function(e){t.forEach((function(t){return t.next&&t.next(e)}))},error:function(e){t.forEach((function(t){return t.error&&t.error(e)}))},complete:function(){t.forEach((function(e){return e.complete&&e.complete()}))}}),function(){t.delete(n)&&!t.size&&r&&(r.unsubscribe(),r=null)}}))}var an=Object.prototype.hasOwnProperty,sn=function(){function e(e){var t=e.link,r=e.queryDeduplication,n=void 0!==r&&r,i=e.store,o=e.onBroadcast,a=void 0===o?function(){}:o,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,h=e.localState,f=e.assumeImmutableResults;this.mutationStore=new tn,this.queryStore=new rn,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(yr?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=n,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=l,this.localState=h||new nn({cache:i.getCache()}),this.ssrMode=u,this.assumeImmutableResults=!!f}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.fetchQueryRejectFns.forEach((function(e){e(new Ot(8))}))},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,n=e.optimisticResponse,i=e.updateQueries,o=e.refetchQueries,a=void 0===o?[]:o,s=e.awaitRefetchQueries,u=void 0!==s&&s,c=e.update,l=e.errorPolicy,h=void 0===l?"none":l,f=e.fetchPolicy,p=e.context,d=void 0===p?{}:p;return mt(this,void 0,void 0,(function(){var e,o,s,l=this;return yt(this,(function(p){switch(p.label){case 0:return kt(t,9),kt(!f||"no-cache"===f,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,(function(){return{document:t}})),r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,d)]:[3,2];case 1:r=p.sent(),p.label=2;case 2:return o=function(){var e={};return i&&l.queries.forEach((function(t,r){var n=t.observableQuery;if(n){var o=n.queryName;o&&an.call(i,o)&&(e[r]={updater:i[o],query:l.queryStore.get(r)})}})),e},this.mutationStore.initMutation(e,t,r),this.dataStore.markMutationInit({mutationId:e,document:t,variables:r,updateQueries:o(),update:c,optimisticResponse:n}),this.broadcastQueries(),s=this,[2,new Promise((function(i,l){var p,m;s.getObservableFromLink(t,dt(dt({},d),{optimisticResponse:n}),r,!1).subscribe({next:function(n){Er(n)&&"none"===h?m=new Jr({graphQLErrors:n.errors}):(s.mutationStore.markMutationResult(e),"no-cache"!==f&&s.dataStore.markMutationResult({mutationId:e,result:n,document:t,variables:r,updateQueries:o(),update:c}),p=n)},error:function(t){s.mutationStore.markMutationError(e,t),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),s.setQuery(e,(function(){return{document:null}})),l(new Jr({networkError:t}))},complete:function(){if(m&&s.mutationStore.markMutationError(e,m),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),m)l(m);else{"function"==typeof a&&(a=a(p));var t=[];Wr(a)&&a.forEach((function(e){if("string"==typeof e)s.queries.forEach((function(r){var n=r.observableQuery;n&&n.queryName===e&&t.push(n.refetch())}));else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(s.query(r))}})),Promise.all(u?t:[]).then((function(){s.setQuery(e,(function(){return{document:null}})),"ignore"===h&&p&&Er(p)&&delete p.errors,i(p)}))}}})}))]}}))}))},e.prototype.fetchQuery=function(e,t,r,n){return mt(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,h,f,p,d,m,y,v,g,b,w,R,E=this;return yt(this,(function(O){switch(O.label){case 0:return i=t.metadata,o=void 0===i?null:i,a=t.fetchPolicy,s=void 0===a?"cache-first":a,u=t.context,c=void 0===u?{}:u,l=this.transform(t.query).document,h=this.getVariables(l,t.variables),this.transform(l).hasClientExports?[4,this.localState.addExportedVariables(l,h,c)]:[3,2];case 1:h=O.sent(),O.label=2;case 2:if(t=dt(dt({},t),{variables:h}),d=p="network-only"===s||"no-cache"===s,p||(m=this.dataStore.getCache().diff({query:l,variables:h,returnPartialData:!0,optimistic:!1}),y=m.complete,v=m.result,d=!y||"cache-and-network"===s,f=v),g=d&&"cache-only"!==s&&"standby"!==s,Ht(["live"],l)&&(g=!0),b=this.idCounter++,w="no-cache"!==s?this.updateQueryWatch(e,l,t):void 0,this.setQuery(e,(function(){return{document:l,lastRequestId:b,invalidated:!0,cancel:w}})),this.invalidate(n),this.queryStore.initQuery({queryId:e,document:l,storePreviousVariables:g,variables:h,isPoll:r===Hr.poll,isRefetch:r===Hr.refetch,metadata:o,fetchMoreForQueryId:n}),this.broadcastQueries(),g){if(R=this.fetchRequest({requestId:b,queryId:e,document:l,options:t,fetchMoreForQueryId:n}).catch((function(t){throw t.hasOwnProperty("graphQLErrors")?t:(b>=E.getQuery(e).lastRequestId&&(E.queryStore.markQueryError(e,t,n),E.invalidate(e),E.invalidate(n),E.broadcastQueries()),new Jr({networkError:t}))})),"cache-and-network"!==s)return[2,R];R.catch((function(){}))}return this.queryStore.markQueryResultClient(e,!g),this.invalidate(e),this.invalidate(n),this.transform(l).hasForcedResolvers?[2,this.localState.runResolvers({document:l,remoteResult:{data:f},context:c,variables:h,onlyRunForcedResolvers:!0}).then((function(r){return E.markQueryResult(e,r,t,n),E.broadcastQueries(),r}))]:(this.broadcastQueries(),[2,{data:f}])}}))}))},e.prototype.markQueryResult=function(e,t,r,n){var i=r.fetchPolicy,o=r.variables,a=r.errorPolicy;"no-cache"===i?this.setQuery(e,(function(){return{newData:{result:t.data,complete:!0}}})):this.dataStore.markQueryResult(t,this.getQuery(e).document,o,n,"ignore"===a||"all"===a)},e.prototype.queryListenerForObserver=function(e,t,r){var n=this;function i(e,t){if(r[e])try{r[e](t)}catch(e){}}return function(r,o){if(n.invalidate(e,!1),r){var a=n.getQuery(e),s=a.observableQuery,u=a.document,c=s?s.options.fetchPolicy:t.fetchPolicy;if("standby"!==c){var l=Kr(r.networkStatus),h=s&&s.getLastResult(),f=!(!h||h.networkStatus===r.networkStatus),p=t.returnPartialData||!o&&r.previousVariables||f&&t.notifyOnNetworkStatusChange||"cache-only"===c||"cache-and-network"===c;if(!l||p){var d=Wr(r.graphQLErrors),m=s&&s.options.errorPolicy||t.errorPolicy||"none";if("none"===m&&d||r.networkError)return i("error",new Jr({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var y=void 0,v=void 0;if(o)"no-cache"!==c&&"network-only"!==c&&n.setQuery(e,(function(){return{newData:null}})),y=o.result,v=!o.complete;else{var g=s&&s.getLastError(),b="none"!==m&&(g&&g.graphQLErrors)!==r.graphQLErrors;if(h&&h.data&&!b)y=h.data,v=!1;else{var w=n.dataStore.getCache().diff({query:u,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});y=w.result,v=!w.complete}}var R=v&&!(t.returnPartialData||"cache-only"===c),E={data:R?h&&h.data:y,loading:l,networkStatus:r.networkStatus,stale:R};"all"===m&&d&&(E.errors=r.graphQLErrors),i("next",E)}catch(e){i("error",new Jr({networkError:e}))}}}}}},e.prototype.transform=function(e){var t,r=this.transformCache;if(!r.has(e)){var n=this.dataStore.getCache(),i=n.transformDocument(e),o=(t=n.transformForLink(i),fr([pr],er(t))),a=this.localState.clientQuery(i),s=this.localState.serverQuery(o),u={document:i,hasClientExports:Jt(i),hasForcedResolvers:this.localState.shouldForceResolvers(i),clientQuery:a,serverQuery:s,defaultVars:ar(tr(i))},c=function(e){e&&!r.has(e)&&r.set(e,u)};c(e),c(i),c(a),c(s)}return r.get(e)},e.prototype.getVariables=function(e,t){return dt(dt({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),kt("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var r=dt({},e);return new Yr({queryManager:this,options:r,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return kt(e.query,12),kt("Document"===e.query.kind,13),kt(!e.returnPartialData,14),kt(!e.pollInterval,15),new Promise((function(r,n){var i=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+i.queryId,n),i.result().then(r,n).then((function(){return t.fetchQueryRejectFns.delete("query:"+i.queryId)}))}))},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,(function(e){return e.listeners.add(t),{invalidated:!1}}))},e.prototype.updateQueryWatch=function(e,t,r){var n=this,i=this.getQuery(e).cancel;return i&&i(),this.dataStore.getCache().watch({query:t,variables:r.variables,optimistic:!0,previousResult:function(){var t=null,r=n.getQuery(e).observableQuery;if(r){var i=r.getLastResult();i&&(t=i.data)}return t},callback:function(t){n.setQuery(e,(function(){return{invalidated:!0,newData:t}}))}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,(function(){return{observableQuery:t}}))},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,(function(){return{observableQuery:null}})),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach((function(e){e(new Ot(16))}));var e=[];return this.queries.forEach((function(t,r){t.observableQuery&&e.push(r)})),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach((function(n,i){var o=n.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||r.push(o.refetch()),t.setQuery(i,(function(){return{newData:null}})),t.invalidate(i)}})),this.broadcastQueries(),Promise.all(r)},e.prototype.observeQuery=function(e,t,r){return this.addQueryListener(e,this.queryListenerForObserver(e,t,r)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,r){return this.addQueryListener(e,r),this.fetchQuery(e,t).catch((function(){})),e},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.variables;r=this.transform(r).document,i=this.getVariables(r,i);var o=function(e){return t.getObservableFromLink(r,{},e,!1).map((function(i){if(n&&"no-cache"===n||(t.dataStore.markSubscriptionResult(i,r,e),t.broadcastQueries()),Er(i))throw new Jr({graphQLErrors:i.errors});return i}))};if(this.transform(r).hasClientExports){var a=this.localState.addExportedVariables(r,i).then(o);return new Gr((function(e){var t=null;return a.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return o(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach((function(e){return e.unsubscribe()})),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var r=e.options,n=r.variables,i=r.query,o=r.fetchPolicy,a=r.returnPartialData,s=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===o||"network-only"===o)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:i,variables:n,previousResult:s?s.data:void 0,returnPartialData:!0,optimistic:t}),l=c.result,h=c.complete;return{data:h||a?l:void 0,partial:!h}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;kt(r,17),t=r}else t=e;var n=t.options,i=n.variables,o=n.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:o}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach((function(t,r){t.invalidated&&t.listeners.forEach((function(n){n&&n(e.queryStore.get(r),t.newData)}))}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,o=this;void 0===n&&(n=this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var s=this.inFlightLinkObservables,u=this.link,c={query:a,variables:r,operationName:rr(a)||void 0,context:this.prepareContext(dt(dt({},t),{forceFetch:!n}))};if(t=c.context,n){var l=s.get(a)||new Map;s.set(a,l);var h=JSON.stringify(r);if(!(i=l.get(h))){l.set(h,i=on(Qr(u,c)));var f=function(){l.delete(h),l.size||s.delete(a),p.unsubscribe()},p=i.subscribe({next:f,error:f,complete:f})}}else i=on(Qr(u,c))}else i=Gr.of({data:{}}),t=this.prepareContext(t);var d=this.transform(e).clientQuery;return d&&(i=function(e,n){return new Gr((function(n){var i=n.next,a=n.error,s=n.complete,u=0,c=!1,l={next:function(e){++u,new Promise((function(n){n(function(e){return o.localState.runResolvers({document:d,remoteResult:e,context:t,variables:r})}(e))})).then((function(e){--u,i&&i.call(n,e),c&&l.complete()}),(function(e){--u,a&&a.call(n,e)}))},error:function(e){a&&a.call(n,e)},complete:function(){c=!0,u||s&&s.call(n)}},h=e.subscribe(l);return function(){return h.unsubscribe()}}))}(i)),i},e.prototype.fetchRequest=function(e){var t,r,n=this,i=e.requestId,o=e.queryId,a=e.document,s=e.options,u=e.fetchMoreForQueryId,c=s.variables,l=s.errorPolicy,h=void 0===l?"none":l,f=s.fetchPolicy;return new Promise((function(e,l){var p=n.getObservableFromLink(a,s.context,c),d="fetchRequest:"+o;n.fetchQueryRejectFns.set(d,l);var m=function(){n.fetchQueryRejectFns.delete(d),n.setQuery(o,(function(e){e.subscriptions.delete(y)}))},y=p.map((function(e){if(i>=n.getQuery(o).lastRequestId&&(n.markQueryResult(o,e,s,u),n.queryStore.markQueryResult(o,e,u),n.invalidate(o),n.invalidate(u),n.broadcastQueries()),"none"===h&&Wr(e.errors))return l(new Jr({graphQLErrors:e.errors}));if("all"===h&&(r=e.errors),u||"no-cache"===f)t=e.data;else{var p=n.dataStore.getCache().diff({variables:c,query:a,optimistic:!1,returnPartialData:!0}),d=p.result;(p.complete||s.returnPartialData)&&(t=d)}})).subscribe({error:function(e){m(),l(e)},complete:function(){m(),e({data:t,errors:r,loading:!1,networkStatus:Vr.ready,stale:!1})}});n.setQuery(o,(function(e){e.subscriptions.add(y)}))}))},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var r=this.getQuery(e),n=dt(dt({},r),t(r));this.queries.set(e,n)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,(function(){return{invalidated:t}}))},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return dt(dt({},t),{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==Vr.ready&&t.networkStatus!==Vr.error},e.prototype.startPollingQuery=function(e,t,r){var n=this,i=e.pollInterval;if(kt(i,18),!this.ssrMode){var o=this.pollingInfoByQueryId.get(t);o||this.pollingInfoByQueryId.set(t,o={}),o.interval=i,o.options=dt(dt({},e),{fetchPolicy:"network-only"});var a=function(){var e=n.pollingInfoByQueryId.get(t);e&&(n.checkInFlight(t)?s():n.fetchQuery(t,e.options,Hr.poll).then(s,s))},s=function(){var e=n.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(a,e.interval))};r&&this.addQueryListener(t,r),s()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),un=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,n,i){void 0===i&&(i=!1);var o=!Er(e);i&&Er(e)&&e.data&&(o=!0),!n&&o&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:r})},e.prototype.markSubscriptionResult=function(e,t,r){Er(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:r})},e.prototype.markMutationInit=function(e){var t,r=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction((function(n){var i=r.cache;r.cache=n;try{r.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{r.cache=i}}),e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!Er(e.result)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],n=e.updateQueries;n&&Object.keys(n).forEach((function(i){var o=n[i],a=o.query,s=o.updater,u=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),c=u.result;if(u.complete){var l=Rr((function(){return s(c,{mutationResult:e.result,queryName:rr(a.document)||void 0,queryVariables:a.variables})}));l&&r.push({result:l,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}})),this.cache.performTransaction((function(t){r.forEach((function(e){return t.write(e)}));var n=e.update;n&&Rr((function(){return n(t,e.result)}))}))}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),cn=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.cache,n=e.ssrMode,i=void 0!==n&&n,o=e.ssrForceFetchDelay,a=void 0===o?0:o,s=e.connectToDevTools,u=e.queryDeduplication,c=void 0===u||u,l=e.defaultOptions,h=e.assumeImmutableResults,f=void 0!==h&&h,p=e.resolvers,d=e.typeDefs,m=e.fragmentMatcher,y=e.name,v=e.version,g=e.link;if(!g&&p&&(g=$r.empty()),!g||!r)throw new Ot(4);this.link=g,this.cache=r,this.store=new un(r),this.disableNetworkFetches=i||a>0,this.queryDeduplication=c,this.defaultOptions=l||{},this.typeDefs=d,a&&setTimeout((function(){return t.disableNetworkFetches=!1}),a),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),void 0!==s&&s&&"undefined"!=typeof window&&(window.__APOLLO_CLIENT__=this),this.version="2.6.10",this.localState=new nn({cache:r,client:this,resolvers:p,fragmentMatcher:m}),this.queryManager=new sn({link:this.link,store:this.store,queryDeduplication:c,ssrMode:i,clientAwareness:{name:y,version:v},localState:this.localState,assumeImmutableResults:f,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=dt(dt({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=dt(dt({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=dt(dt({},this.defaultOptions.query),e)),kt("cache-and-network"!==e.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=dt(dt({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=dt(dt({},this.defaultOptions.mutate),e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Qr(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e}(),ln=function(e,t){return ln=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},ln(e,t)};function hn(e,t){function r(){this.constructor=e}ln(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var fn=function(){return fn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fn.apply(this,arguments)};function pn(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:dn(e)}]}}function dn(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return dn(e[0]);var t=[];return Object.keys(e).forEach((function(r){var n={kind:"Field",name:{kind:"Name",value:r},selectionSet:dn(e[r])||void 0};t.push(n)})),{kind:"SelectionSet",selections:t}}var mn,yn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},vn=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:Xt(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:Xt(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t,r,n=e.id,i=e.data;if(void 0!==n){var o=null;try{o=this.read({rootId:n,optimistic:!1,query:yn})}catch(e){}var a=o&&o.__typename||"__ClientData",s=Object.assign({__typename:a},i);this.writeFragment({id:n,fragment:(t=s,r=a,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:r||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:dn(t)}]}),data:s})}else this.writeQuery({query:pn(i),data:i})},e}();mn||(mn={});var gn=null,bn={},wn=1,Rn="@wry/context:Slot",En=Array,On=En[Rn]||function(){var e=function(){function e(){this.id=["slot",wn++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=gn;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===bn)break;return e!==gn&&(gn.slots[this.id]=t),!0}return gn&&(gn.slots[this.id]=bn),!1},e.prototype.getValue=function(){if(this.hasValue())return gn.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),a=gn;gn={parent:a,slots:o};try{return t.apply(n,r)}finally{gn=a}},e.bind=function(e){var t=gn;return function(){var r=gn;try{return gn=t,e.apply(this,arguments)}finally{gn=r}}},e.noContext=function(e,t,r){if(!gn)return e.apply(r,t);var n=gn;try{return gn=null,e.apply(r,t)}finally{gn=n}},e}();try{Object.defineProperty(En,Rn,{value:En[Rn]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();function kn(){}On.bind,On.noContext;var Sn=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=kn),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getEntry(e);return t&&t.value},e.prototype.getEntry=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getEntry(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),xn=new On,_n=[],In=[],Pn=100;function Tn(e,t){if(!e)throw new Error(t||"assertion failure")}function An(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Cn=function(){function e(t,r){this.fn=t,this.args=r,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],++e.count}return e.prototype.recompute=function(){if(Tn(!this.recomputing,"already recomputing"),function(e){var t=xn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),qn(e)?jn(t,e):Bn(t,e),t}(this)||!Mn(this))return qn(this)?(t=Un(e=this),xn.withValue(e,Nn,[e]),function(e){if("function"==typeof e.subscribe)try{Qn(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)&&function(e){e.dirty=!1,qn(e)||Fn(e)}(e),t.forEach(Mn),An(e.value)):An(this.value);var e,t},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Dn(this),Qn(this))},e.prototype.dispose=function(){var e=this;Un(this).forEach(Mn),Qn(this),this.parents.forEach((function(t){t.setDirty(),$n(t,e)}))},e.count=0,e}();function Nn(e){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,e.args)}catch(t){e.value[1]=t}e.recomputing=!1}function qn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Dn(e){e.parents.forEach((function(t){return jn(t,e)}))}function Fn(e){e.parents.forEach((function(t){return Bn(t,e)}))}function jn(e,t){if(Tn(e.childValues.has(t)),Tn(qn(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=In.pop()||new Set;e.dirtyChildren.add(t),Dn(e)}function Bn(e,t){Tn(e.childValues.has(t)),Tn(!qn(t));var r,n,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(r=o,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),Ln(e,t),qn(e)||Fn(e)}function Ln(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(In.length<Pn&&In.push(r),e.dirtyChildren=null))}function Mn(e){return 0===e.parents.size&&"function"==typeof e.reportOrphan&&!0===e.reportOrphan()}function Un(e){var t=_n;return e.childValues.size>0&&(t=[],e.childValues.forEach((function(r,n){$n(e,n),t.push(n)}))),Tn(null===e.dirtyChildren),t}function $n(e,t){t.parents.delete(e),e.childValues.delete(t),Ln(e,t)}function Qn(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Vn=function(){function e(e){this.weakness=e}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return e.forEach((function(e){return t=t.getChildTrie(e)})),t.data||(t.data=Object.create(null))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness)),n},e}(),zn=new Vn("function"==typeof WeakMap);function Kn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zn.lookupArray(e)}var Gn=new Set;function Wn(e,t){void 0===t&&(t=Object.create(null));var r=new Sn(t.max||Math.pow(2,16),(function(e){return e.dispose()})),n=!!t.disposable,i=t.makeCacheKey||Kn;function o(){if(!n||xn.hasValue()){var o=i.apply(null,arguments);if(void 0===o)return e.apply(null,arguments);var a=Array.prototype.slice.call(arguments),s=r.get(o);s?s.args=a:(s=new Cn(e,a),r.set(o,s),s.subscribe=t.subscribe,n&&(s.reportOrphan=function(){return r.delete(o)}));var u=s.recompute();return r.set(o,s),Gn.add(r),xn.hasValue()||(Gn.forEach((function(e){return e.clean()})),Gn.clear()),n?void 0:u}}return o.dirty=function(){var e=i.apply(null,arguments),t=void 0!==e&&r.get(e);t&&t.setDirty()},o}var Hn=!1;function Jn(){var e=!Hn;return!0===wr("test")||(Hn=!0),e}var Yn=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,r){var n=r.store.get(e.id),i="ROOT_QUERY"===e.id;if(!n)return i;var o=n.__typename,a=void 0===o?i&&"Query":o;return a&&a===t||(Jn(),"heuristic")},e}(),Xn=function(){function e(e){e&&e.introspectionQueryResultData?(this.possibleTypesMap=this.parseIntrospectionResult(e.introspectionQueryResultData),this.isReady=!0):this.isReady=!1,this.match=this.match.bind(this)}return e.prototype.match=function(e,t,r){kt(this.isReady,1);var n=r.store.get(e.id),i="ROOT_QUERY"===e.id;if(!n)return i;var o=n.__typename,a=void 0===o?i&&"Query":o;if(kt(a,2),a===t)return!0;var s=this.possibleTypesMap[t];return!!(a&&s&&s.indexOf(a)>-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach((function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map((function(e){return e.name})))})),t},e}(),Zn=Object.prototype.hasOwnProperty,ei=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=Wn((function(e){return t.data[e]}),{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){Zn.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach((function(r){t.set(r,e[r])})),Object.keys(this.data).forEach((function(r){Zn.call(e,r)||t.delete(r)}))):Object.keys(this.data).forEach((function(e){t.delete(e)}))},e}();function ti(e){return new ei(e)}var ri=function(){function e(e){var t=this,r=void 0===e?{}:e,n=r.cacheKeyRoot,i=void 0===n?new Vn(yr):n,o=r.freezeResults,a=void 0!==o&&o,s=this,u=s.executeStoreQuery,c=s.executeSelectionSet,l=s.executeSubSelectedArray;this.freezeResults=a,this.executeStoreQuery=Wn((function(e){return u.call(t,e)}),{makeCacheKey:function(e){var t=e.query,r=e.rootValue,n=e.contextValue,o=e.variableValues,a=e.fragmentMatcher;if(n.store instanceof ei)return i.lookup(n.store,t,a,JSON.stringify(o),r.id)}}),this.executeSelectionSet=Wn((function(e){return c.call(t,e)}),{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,n=e.execContext;if(n.contextValue.store instanceof ei)return i.lookup(n.contextValue.store,t,n.fragmentMatcher,JSON.stringify(n.variableValues),r.id)}}),this.executeSubSelectedArray=Wn((function(e){return l.call(t,e)}),{makeCacheKey:function(e){var t=e.field,r=e.array,n=e.execContext;if(n.contextValue.store instanceof ei)return i.lookup(n.contextValue.store,t,r,JSON.stringify(n.variableValues))}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(fn(fn({},e),{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t,r=e.store,n=e.query,i=e.variables,o=e.previousResult,a=e.returnPartialData,s=void 0===a||a,u=e.rootId,c=void 0===u?"ROOT_QUERY":u,l=e.fragmentMatcherFunction,h=e.config;i=Zt({},ar((kt((t=tr(n))&&"query"===t.operation,6),t)),i);var f={store:r,dataIdFromObject:h&&h.dataIdFromObject,cacheRedirects:h&&h.cacheRedirects||{}},p=this.executeStoreQuery({query:n,rootValue:{type:"id",id:c,generated:!0,typename:"Query"},contextValue:f,variableValues:i,fragmentMatcher:l}),d=p.missing&&p.missing.length>0;return d&&!s&&p.missing.forEach((function(e){if(!e.tolerable)throw new Ot(8)})),o&&Dt(o,p.result)&&(p.result=o),{result:p.result,complete:!d}},e.prototype.executeStoreQuery=function(e){var t=e.query,r=e.rootValue,n=e.contextValue,i=e.variableValues,o=e.fragmentMatcher,a=void 0===o?ii:o,s=ir(t),u={query:t,fragmentMap:or(nr(t)),contextValue:n,variableValues:i,fragmentMatcher:a};return this.executeSelectionSet({selectionSet:s.selectionSet,rootValue:r,execContext:u})},e.prototype.executeSelectionSet=function(e){var t=this,r=e.selectionSet,n=e.rootValue,i=e.execContext,o=i.fragmentMap,a=i.contextValue,s=i.variableValues,u={result:null},c=[],l=a.store.get(n.id),h=l&&l.__typename||"ROOT_QUERY"===n.id&&"Query"||void 0;function f(e){var t;return e.missing&&(u.missing=u.missing||[],(t=u.missing).push.apply(t,e.missing)),e.result}return r.selections.forEach((function(e){var r;if(Wt(e,s))if(Qt(e)){var u=f(t.executeField(l,h,e,i));void 0!==u&&c.push(((r={})[$t(e)]=u,r))}else{var p=void 0;if(Vt(e))p=e;else if(!(p=o[e.name.value]))throw new Ot(9);var d=p.typeCondition&&p.typeCondition.name.value,m=!d||i.fragmentMatcher(n,d,a);if(m){var y=t.executeSelectionSet({selectionSet:p.selectionSet,rootValue:n,execContext:i});"heuristic"===m&&y.missing&&(y=fn(fn({},y),{missing:y.missing.map((function(e){return fn(fn({},e),{tolerable:!0})}))})),c.push(f(y))}}})),u.result=Sr(c),this.freezeResults,u},e.prototype.executeField=function(e,t,r,n){var i=n.variableValues,o=n.contextValue,a=function(e,t,r,n,i,o){var a=o.directives,s=r;(n||a)&&(s=Mt(s,n,a));var u,c=void 0;if(e&&void 0===(c=e[s])&&i.cacheRedirects&&"string"==typeof t){var l=i.cacheRedirects[t];if(l){var h=l[r];h&&(c=h(e,n,{getCacheKey:function(e){var t=i.dataIdFromObject(e);return t&&Kt({id:t,typename:e.__typename})}}))}}return void 0===c?{result:c,missing:[{object:e,fieldName:s,tolerable:!1}]}:(null!=(u=c)&&"object"==typeof u&&"json"===u.type&&(c=c.json),{result:c})}(e,t,r.name.value,Ut(r,i),o,{resultKey:$t(r),directives:Gt(r,i)});return Array.isArray(a.result)?this.combineExecResults(a,this.executeSubSelectedArray({field:r,array:a.result,execContext:n})):r.selectionSet?null==a.result?a:this.combineExecResults(a,this.executeSelectionSet({selectionSet:r.selectionSet,rootValue:a.result,execContext:n})):(ni(r,a.result),this.freezeResults,a)},e.prototype.combineExecResults=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.forEach((function(t){t.missing&&(e=e||[]).push.apply(e,t.missing)})),{result:t.pop().result,missing:e}},e.prototype.executeSubSelectedArray=function(e){var t,r=this,n=e.field,i=e.array,o=e.execContext;function a(e){return e.missing&&(t=t||[]).push.apply(t,e.missing),e.result}return i=i.map((function(e){return null===e?null:Array.isArray(e)?a(r.executeSubSelectedArray({field:n,array:e,execContext:o})):n.selectionSet?a(r.executeSelectionSet({selectionSet:n.selectionSet,rootValue:e,execContext:o})):(ni(n,e),e)})),this.freezeResults,{result:i,missing:t}},e}();function ni(e,t){if(!e.selectionSet&&zt(t))throw new Ot(10)}function ii(){return!0}var oi=function(){function e(e){void 0===e&&(e=Object.create(null)),this.data=e}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.delete=function(e){this.data[e]=void 0},e.prototype.clear=function(){this.data=Object.create(null)},e.prototype.replace=function(e){this.data=e||Object.create(null)},e}(),ai=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="WriteError",t}return hn(t,e),t}(Error),si=function(){function e(){}return e.prototype.writeQueryToStore=function(e){var t=e.query,r=e.result,n=e.store,i=void 0===n?ti():n,o=e.variables,a=e.dataIdFromObject,s=e.fragmentMatcherFunction;return this.writeResultToStore({dataId:"ROOT_QUERY",result:r,document:t,store:i,variables:o,dataIdFromObject:a,fragmentMatcherFunction:s})},e.prototype.writeResultToStore=function(e){var t=e.dataId,r=e.result,n=e.document,i=e.store,o=void 0===i?ti():i,a=e.variables,s=e.dataIdFromObject,u=e.fragmentMatcherFunction,c=tr(n);try{return this.writeSelectionSetToStore({result:r,dataId:t,selectionSet:c.selectionSet,context:{store:o,processedData:{},variables:Zt({},ar(c),a),dataIdFromObject:s,fragmentMap:or(nr(n)),fragmentMatcherFunction:u}})}catch(e){throw function(e,t){var r=new ai("Error writing result to store for query:\n "+JSON.stringify(t));return r.message+="\n"+e.message,r.stack=e.stack,r}(e,n)}},e.prototype.writeSelectionSetToStore=function(e){var t=this,r=e.result,n=e.dataId,i=e.selectionSet,o=e.context,a=o.variables,s=o.store,u=o.fragmentMap;return i.selections.forEach((function(e){var i;if(Wt(e,a))if(Qt(e)){var s=$t(e),c=r[s];if(void 0!==c)t.writeFieldToStore({dataId:n,value:c,field:e,context:o});else{var l=!1,h=!1;e.directives&&e.directives.length&&(l=e.directives.some((function(e){return e.name&&"defer"===e.name.value})),h=e.directives.some((function(e){return e.name&&"client"===e.name.value}))),!l&&!h&&o.fragmentMatcherFunction}}else{var f=void 0;Vt(e)?f=e:kt(f=(u||{})[e.name.value],3);var p=!0;if(o.fragmentMatcherFunction&&f.typeCondition){var d=n||"self",m=Kt({id:d,typename:void 0}),y={store:new oi((i={},i[d]=r,i)),cacheRedirects:{}},v=o.fragmentMatcherFunction(m,f.typeCondition.name.value,y);wr("production"),p=!!v}p&&t.writeSelectionSetToStore({result:r,selectionSet:f.selectionSet,dataId:n,context:o})}})),s},e.prototype.writeFieldToStore=function(e){var t,r,n,i=e.field,o=e.value,a=e.dataId,s=e.context,u=s.variables,c=s.dataIdFromObject,l=s.store,h=function(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,o=n.value;return Bt(r[e.name.value],i,o,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return Bt(n,r,i,t)}))),Mt(e.name.value,n,r)}(i,u);if(i.selectionSet&&null!==o)if(Array.isArray(o)){var f=a+"."+h;r=this.processArrayValue(o,f,i.selectionSet,s)}else{var p=a+"."+h,d=!0;if(ui(p)||(p="$"+p),c){var m=c(o);kt(!m||!ui(m),4),(m||"number"==typeof m&&0===m)&&(p=m,d=!1)}li(p,i,s.processedData)||this.writeSelectionSetToStore({dataId:p,result:o,selectionSet:i.selectionSet,context:s});var y=o.__typename;r=Kt({id:p,typename:y},d);var v=(n=l.get(a))&&n[h];if(v!==r&&zt(v)){var g=void 0!==v.typename,b=void 0!==y,w=g&&b&&v.typename!==y;kt(!d||v.generated||w,5),kt(!g||b,6),v.generated&&(w?d||l.delete(v.id):ci(v.id,r.id,l))}}else r=null!=o&&"object"==typeof o?{type:"json",json:o}:o;(n=l.get(a))&&Dt(r,n[h])||l.set(a,fn(fn({},n),((t={})[h]=r,t)))},e.prototype.processArrayValue=function(e,t,r,n){var i=this;return e.map((function(e,o){if(null===e)return null;var a=t+"."+o;if(Array.isArray(e))return i.processArrayValue(e,a,r,n);var s=!0;if(n.dataIdFromObject){var u=n.dataIdFromObject(e);u&&(a=u,s=!1)}return li(a,r,n.processedData)||i.writeSelectionSetToStore({dataId:a,result:e,selectionSet:r,context:n}),Kt({id:a,typename:e.__typename},s)}))},e}();function ui(e){return"$"===e[0]}function ci(e,t,r){if(e===t)return!1;var n=r.get(e),i=r.get(t),o=!1;Object.keys(n).forEach((function(e){var t=n[e],a=i[e];zt(t)&&ui(t.id)&&zt(a)&&!Dt(t,a)&&ci(t.id,a.id,r)&&(o=!0)})),r.delete(e);var a=fn(fn({},n),i);return Dt(a,i)?o:(r.set(t,a),!0)}function li(e,t,r){if(!r)return!1;if(r[e]){if(r[e].indexOf(t)>=0)return!0;r[e].push(t)}else r[e]=[t];return!1}var hi={fragmentMatcher:new Yn,dataIdFromObject:fi,addTypename:!0,resultCaching:!0,freezeResults:!1};function fi(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null}var pi=Object.prototype.hasOwnProperty,di=function(e){function t(t,r,n){var i=e.call(this,Object.create(null))||this;return i.optimisticId=t,i.parent=r,i.transaction=n,i}return hn(t,e),t.prototype.toObject=function(){return fn(fn({},this.parent.toObject()),this.data)},t.prototype.get=function(e){return pi.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(oi),mi=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;r.watches=new Set,r.typenameDocumentCache=new Map,r.cacheKeyRoot=new Vn(yr),r.silenceBroadcast=!1,r.config=fn(fn({},hi),t),r.config.customResolvers&&(r.config.cacheRedirects=r.config.customResolvers),r.config.cacheResolvers&&(r.config.cacheRedirects=r.config.cacheResolvers),r.addTypename=!!r.config.addTypename,r.data=r.config.resultCaching?new ei:new oi,r.optimisticData=r.data,r.storeWriter=new si,r.storeReader=new ri({cacheKeyRoot:r.cacheKeyRoot,freezeResults:t.freezeResults});var n=r,i=n.maybeBroadcastWatch;return r.maybeBroadcastWatch=Wn((function(e){return i.call(r,e)}),{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return n.data instanceof ei?n.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),r}return hn(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:r,previousResult:e.previousResult,config:this.config})||null},t.prototype.write=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:r}),this.broadcastWatches()},t.prototype.diff=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:r,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw new Ot(7)},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],r=0,n=this.optimisticData;n instanceof di;)n.optimisticId===e?++r:t.push(n),n=n.parent;if(r>0){for(this.optimisticData=n;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var r=this.data,n=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new di(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=n,this.data=r}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(r=e,t=(0,gt.visit)(er(r),{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n&&!n.some((function(e){return Qt(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=r;if(!(Qt(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return _t(_t({},e),{selections:It(n,[ur])})}}}}}),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}var r;return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach((function(t){return e.maybeBroadcastWatch(t)}))},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(vn),yi=function(e,t){return yi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},yi(e,t)},vi=function(){return vi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vi.apply(this,arguments)},gi=function(){return gi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},gi.apply(this,arguments)},bi=u(3083),wi={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},Ri=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},Ei=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new Ot(2);throw n.parseError=e,n}return r},Oi=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,n=e.fetch,i=e.includeExtensions,o=e.useGETForQueries,a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["uri","fetch","includeExtensions","useGETForQueries"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new Ot(1)}(n),n||(n=fetch);var s={http:{includeExtensions:i},options:a.fetchOptions,credentials:a.credentials,headers:a.headers};return new $r((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),i=e.getContext(),a={};if(i.clientAwareness){var u=i.clientAwareness,c=u.name,l=u.version;c&&(a["apollographql-client-name"]=c),l&&(a["apollographql-client-version"]=l)}var h,f=vi({},a,i.headers),p={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:f},d=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=gi({},t.options,{headers:t.headers,credentials:t.credentials}),o=t.http;r.forEach((function(e){i=gi({},i,e.options,{headers:gi({},i.headers,e.headers)}),e.credentials&&(i.credentials=e.credentials),o=gi({},o,e.http)}));var a=e.operationName,s=e.extensions,u=e.variables,c=e.query,l={operationName:a,variables:u};return o.includeExtensions&&(l.extensions=s),o.includeQuery&&(l.query=(0,bi.S)(c)),{options:i,body:l}}(e,wi,s,p),m=d.options,y=d.body;if(!m.signal){var v=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),g=v.controller,b=v.signal;(h=g)&&(m.signal=b)}if(o&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(m.method="GET"),"GET"===m.method){var w=function(e,t){var r=[],n=function(e,t){r.push(e+"="+encodeURIComponent(t))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=Ei(t.variables)}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=Ei(t.extensions)}catch(e){return{parseError:e}}n("extensions",o)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+r.join("&")+a}}(t,y),R=w.newURI,E=w.parseError;if(E)return Dr(E);t=R}else try{m.body=Ei(y)}catch(E){return Dr(E)}return new Tr((function(r){var i;return n(t,m).then((function(t){return e.setContext({response:t}),t})).then((i=e,function(e){return e.text().then((function(t){try{return JSON.parse(t)}catch(n){var r=n;return r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,Promise.reject(r)}})).then((function(t){return e.status>=300&&Ri(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||Ri(e,t,"Server response was missing for query '"+(Array.isArray(i)?i.map((function(e){return e.operationName})):i.operationName)+"'."),t}))})).then((function(e){return r.next(e),r.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))})),function(){h&&h.abort()}}))}))};!function(e){!function(e,t){function r(){this.constructor=e}yi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}((function(t){return e.call(this,Oi(t).request)||this}),e)}($r);var ki=u(8969),Si=u.n(ki),xi=function(){return xi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xi.apply(this,arguments)};function _i(e){return _i="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},_i(e)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError,"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var Ii="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function Pi(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,o=t+1;(r=n.exec(e.body))&&r.index<t;)i+=1,o=t+1-(r.index+r[0].length);return{line:i,column:o}}function Ti(e){return Ai(e.source,Pi(e.source,e.start))}function Ai(e,t){var r=e.locationOffset.column-1,n=Ni(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?r:0,u=t.column+s,c="".concat(e.name,":").concat(a,":").concat(u,"\n"),l=n.split(/\r\n|[\n\r]/g),h=l[i];if(h.length>120){for(var f=Math.floor(u/80),p=u%80,d=[],m=0;m<h.length;m+=80)d.push(h.slice(m,m+80));return c+Ci([["".concat(a),d[0]]].concat(d.slice(1,f+1).map((function(e){return["",e]})),[[" ",Ni(p-1)+"^"],["",d[f+1]]]))}return c+Ci([["".concat(a-1),l[i-1]],["".concat(a),h],["",Ni(u-1)+"^"],["".concat(a+1),l[i+1]]])}function Ci(e){var t=e.filter((function(e){return e[0],void 0!==e[1]})),r=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,n=e[0],i=e[1];return Ni(r-(t=n).length)+t+(i?" | "+i:" |")})).join("\n")}function Ni(e){return Array(e+1).join(" ")}function qi(e){return qi="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},qi(e)}function Di(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 Fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ji(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Bi(e,t){return!t||"object"!==qi(t)&&"function"!=typeof t?Li(e):t}function Li(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mi(e){var t="function"==typeof Map?new Map:void 0;return Mi=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Ui(e,arguments,Vi(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Qi(n,e)},Mi(e)}function Ui(e,t,r){return Ui=$i()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Qi(i,r.prototype),i},Ui.apply(null,arguments)}function $i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function Qi(e,t){return Qi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qi(e,t)}function Vi(e){return Vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Vi(e)}var zi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qi(e,t)}(a,e);var t,r,n,i,o=(t=a,r=$i(),function(){var e,n=Vi(t);if(r){var i=Vi(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return Bi(this,e)});function a(e,t,r,n,i,s,u){var c,l,h,f;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(f=o.call(this,e)).name="GraphQLError",f.originalError=null!=s?s:void 0,f.nodes=Ki(Array.isArray(t)?t:t?[t]:void 0);for(var p=[],d=0,m=null!==(y=f.nodes)&&void 0!==y?y:[];d<m.length;d++){var y,v=m[d].loc;null!=v&&p.push(v)}p=Ki(p),f.source=null!=r?r:null===(c=p)||void 0===c?void 0:c[0].source,f.positions=null!=n?n:null===(l=p)||void 0===l?void 0:l.map((function(e){return e.start})),f.locations=n&&r?n.map((function(e){return Pi(r,e)})):null===(h=p)||void 0===h?void 0:h.map((function(e){return Pi(e.source,e.start)})),f.path=null!=i?i:void 0;var g,b=null==s?void 0:s.extensions;return null==u&&"object"==_i(g=b)&&null!==g?f.extensions=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Di(Object(r),!0).forEach((function(t){Fi(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Di(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},b):f.extensions=null!=u?u:{},Object.defineProperties(Li(f),{message:{enumerable:!0},locations:{enumerable:null!=f.locations},path:{enumerable:null!=f.path},extensions:{enumerable:null!=f.extensions&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack?(Object.defineProperty(Li(f),"stack",{value:s.stack,writable:!0,configurable:!0}),Bi(f)):(Error.captureStackTrace?Error.captureStackTrace(Li(f),a):Object.defineProperty(Li(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return n=a,(i=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+="\n\n"+Ti(i.loc))}else if(e.source&&e.locations)for(var o=0,a=e.locations;o<a.length;o++){var s=a[o];t+="\n\n"+Ai(e.source,s)}return t}(this)}},{key:Ii,get:function(){return"Object"}}])&&ji(n.prototype,i),a}(Mi(Error));function Ki(e){return void 0===e||0===e.length?void 0:e}function Gi(e,t,r){return new zi("Syntax Error: ".concat(r),void 0,e,[t])}var Wi=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});const Hi="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function Ji(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(0))throw new Error("Unexpected invariant triggered.")}(),e.prototype.inspect=t,Hi&&(e.prototype[Hi]=t)}var Yi=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();Ji(Yi);var Xi=function(){function e(e,t,r,n,i,o,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();Ji(Xi);var Zi=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function eo(e){return eo="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},eo(e)}function to(e,t){switch(eo(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(Hi)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var i=n.call(e);if(i!==e)return"string"==typeof i?i:to(i,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(to(e[o],t));return 1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map((function(r){return r+": "+to(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}function ro(e,t){if(!Boolean(e))throw new Error(t)}function no(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var io=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||ro(0,"Body must be a string. Received: ".concat(to(e,[]),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||ro(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ro(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r;return t=e,(r=[{key:Ii,get:function(){return"Source"}}])&&no(t.prototype,r),e}(),oo=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function ao(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===o||i<o)&&(o=i),n=!1}return null!==(t=o)&&void 0!==t?t:0}(e);if(0!==r)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var i=0;i<t.length&&so(t[i]);)++i;for(var o=t.length;o>i&&so(t[o-1]);)--o;return t.slice(i,o).join("\n")}function so(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}var uo=function(){function e(e){var t=new Xi(Zi.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==Zi.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=lo(this,e)}while(e.kind===Zi.COMMENT);return e},e}();function co(e){return isNaN(e)?Zi.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function lo(e,t){for(var r=e.source,n=r.body,i=n.length,o=t.end;o<i;){var a=n.charCodeAt(o),s=e.line,u=1+o-e.lineStart;switch(a){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 33:return new Xi(Zi.BANG,o,o+1,s,u,t);case 35:return fo(r,o,s,u,t);case 36:return new Xi(Zi.DOLLAR,o,o+1,s,u,t);case 38:return new Xi(Zi.AMP,o,o+1,s,u,t);case 40:return new Xi(Zi.PAREN_L,o,o+1,s,u,t);case 41:return new Xi(Zi.PAREN_R,o,o+1,s,u,t);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return new Xi(Zi.SPREAD,o,o+3,s,u,t);break;case 58:return new Xi(Zi.COLON,o,o+1,s,u,t);case 61:return new Xi(Zi.EQUALS,o,o+1,s,u,t);case 64:return new Xi(Zi.AT,o,o+1,s,u,t);case 91:return new Xi(Zi.BRACKET_L,o,o+1,s,u,t);case 93:return new Xi(Zi.BRACKET_R,o,o+1,s,u,t);case 123:return new Xi(Zi.BRACE_L,o,o+1,s,u,t);case 124:return new Xi(Zi.PIPE,o,o+1,s,u,t);case 125:return new Xi(Zi.BRACE_R,o,o+1,s,u,t);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?vo(r,o,s,u,t,e):yo(r,o,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return po(r,o,a,s,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return bo(r,o,s,u,t)}throw Gi(r,o,ho(a))}var c=e.line,l=1+o-e.lineStart;return new Xi(Zi.EOF,i,i,c,l,t)}function ho(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(co(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(co(e),".")}function fo(e,t,r,n,i){var o,a=e.body,s=t;do{o=a.charCodeAt(++s)}while(!isNaN(o)&&(o>31||9===o));return new Xi(Zi.COMMENT,t,s,r,n,i,a.slice(t+1,s))}function po(e,t,r,n,i,o){var a=e.body,s=r,u=t,c=!1;if(45===s&&(s=a.charCodeAt(++u)),48===s){if((s=a.charCodeAt(++u))>=48&&s<=57)throw Gi(e,u,"Invalid number, unexpected digit after 0: ".concat(co(s),"."))}else u=mo(e,u,s),s=a.charCodeAt(u);if(46===s&&(c=!0,s=a.charCodeAt(++u),u=mo(e,u,s),s=a.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=a.charCodeAt(++u))&&45!==s||(s=a.charCodeAt(++u)),u=mo(e,u,s),s=a.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw Gi(e,u,"Invalid number, expected digit but got: ".concat(co(s),"."));return new Xi(c?Zi.FLOAT:Zi.INT,t,u,n,i,o,a.slice(t,u))}function mo(e,t,r){var n=e.body,i=t,o=r;if(o>=48&&o<=57){do{o=n.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw Gi(e,i,"Invalid number, expected digit but got: ".concat(co(o),"."))}function yo(e,t,r,n,i){for(var o,a,s,u,c=e.body,l=t+1,h=l,f=0,p="";l<c.length&&!isNaN(f=c.charCodeAt(l))&&10!==f&&13!==f;){if(34===f)return p+=c.slice(h,l),new Xi(Zi.STRING,t,l+1,r,n,i,p);if(f<32&&9!==f)throw Gi(e,l,"Invalid character within String: ".concat(co(f),"."));if(++l,92===f){switch(p+=c.slice(h,l-1),f=c.charCodeAt(l)){case 34:p+='"';break;case 47:p+="/";break;case 92:p+="\\";break;case 98:p+="\b";break;case 102:p+="\f";break;case 110:p+="\n";break;case 114:p+="\r";break;case 116:p+="\t";break;case 117:var d=(o=c.charCodeAt(l+1),a=c.charCodeAt(l+2),s=c.charCodeAt(l+3),u=c.charCodeAt(l+4),go(o)<<12|go(a)<<8|go(s)<<4|go(u));if(d<0){var m=c.slice(l+1,l+5);throw Gi(e,l,"Invalid character escape sequence: \\u".concat(m,"."))}p+=String.fromCharCode(d),l+=4;break;default:throw Gi(e,l,"Invalid character escape sequence: \\".concat(String.fromCharCode(f),"."))}h=++l}}throw Gi(e,l,"Unterminated string.")}function vo(e,t,r,n,i,o){for(var a=e.body,s=t+3,u=s,c=0,l="";s<a.length&&!isNaN(c=a.charCodeAt(s));){if(34===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2))return l+=a.slice(u,s),new Xi(Zi.BLOCK_STRING,t,s+3,r,n,i,ao(l));if(c<32&&9!==c&&10!==c&&13!==c)throw Gi(e,s,"Invalid character within String: ".concat(co(c),"."));10===c?(++s,++o.line,o.lineStart=s):13===c?(10===a.charCodeAt(s+1)?s+=2:++s,++o.line,o.lineStart=s):92===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2)&&34===a.charCodeAt(s+3)?(l+=a.slice(u,s)+'"""',u=s+=4):++s}throw Gi(e,s,"Unterminated string.")}function go(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function bo(e,t,r,n,i){for(var o=e.body,a=o.length,s=t+1,u=0;s!==a&&!isNaN(u=o.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Xi(Zi.NAME,t,s,r,n,i,o.slice(t,s))}var wo=function(){function e(e,t){var r=function(e){return e instanceof io}(e)?e:new io(e);this._lexer=new uo(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(Zi.NAME);return{kind:Wi.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:Wi.DOCUMENT,definitions:this.many(Zi.SOF,this.parseDefinition,Zi.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(Zi.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(Zi.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(Zi.BRACE_L))return{kind:Wi.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(Zi.NAME)&&(t=this.parseName()),{kind:Wi.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(Zi.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(Zi.PAREN_L,this.parseVariableDefinition,Zi.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:Wi.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Zi.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Zi.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(Zi.DOLLAR),{kind:Wi.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:Wi.SELECTION_SET,selections:this.many(Zi.BRACE_L,this.parseSelection,Zi.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(Zi.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(Zi.COLON)?(e=n,t=this.parseName()):t=n,{kind:Wi.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Zi.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Zi.PAREN_L,t,Zi.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(Zi.COLON),{kind:Wi.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:Wi.ARGUMENT,name:this.parseName(),value:(this.expectToken(Zi.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(Zi.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(Zi.NAME)?{kind:Wi.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:Wi.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:Wi.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:Wi.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case Zi.BRACKET_L:return this.parseList(e);case Zi.BRACE_L:return this.parseObject(e);case Zi.INT:return this._lexer.advance(),{kind:Wi.INT,value:t.value,loc:this.loc(t)};case Zi.FLOAT:return this._lexer.advance(),{kind:Wi.FLOAT,value:t.value,loc:this.loc(t)};case Zi.STRING:case Zi.BLOCK_STRING:return this.parseStringLiteral();case Zi.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:Wi.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:Wi.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:Wi.NULL,loc:this.loc(t)};default:return{kind:Wi.ENUM,value:t.value,loc:this.loc(t)}}case Zi.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:Wi.STRING,value:e.value,block:e.kind===Zi.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:Wi.LIST,values:this.any(Zi.BRACKET_L,(function(){return t.parseValueLiteral(e)}),Zi.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:Wi.OBJECT,fields:this.any(Zi.BRACE_L,(function(){return t.parseObjectField(e)}),Zi.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(Zi.COLON),{kind:Wi.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(Zi.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(Zi.AT),{kind:Wi.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(Zi.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(Zi.BRACKET_R),e={kind:Wi.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(Zi.BANG)?{kind:Wi.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:Wi.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===Zi.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(Zi.STRING)||this.peek(Zi.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(Zi.BRACE_L,this.parseOperationTypeDefinition,Zi.BRACE_R);return{kind:Wi.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(Zi.COLON);var r=this.parseNamedType();return{kind:Wi.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:Wi.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:Wi.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(Zi.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(Zi.AMP)||this.peek(Zi.NAME));return t}return this.delimitedMany(Zi.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(Zi.BRACE_L)&&this._lexer.lookahead().kind===Zi.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(Zi.BRACE_L,this.parseFieldDefinition,Zi.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(Zi.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:Wi.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(Zi.PAREN_L,this.parseInputValueDef,Zi.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(Zi.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(Zi.EQUALS)&&(n=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:Wi.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:o,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:Wi.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:Wi.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(Zi.EQUALS)?this.delimitedMany(Zi.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:Wi.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(Zi.BRACE_L,this.parseEnumValueDefinition,Zi.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:Wi.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:Wi.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(Zi.BRACE_L,this.parseInputValueDef,Zi.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===Zi.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(Zi.BRACE_L,this.parseOperationTypeDefinition,Zi.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:Wi.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:Wi.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:Wi.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:Wi.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:Wi.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:Wi.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:Wi.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Zi.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:Wi.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(Zi.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==oo[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new Yi(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw Gi(this._lexer.source,t.start,"Expected ".concat(Eo(e),", found ").concat(Ro(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==Zi.NAME||t.value!==e)throw Gi(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(Ro(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===Zi.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return Gi(this._lexer.source,t.start,"Unexpected ".concat(Ro(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function Ro(e){var t=e.value;return Eo(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function Eo(e){return function(e){return e===Zi.BANG||e===Zi.DOLLAR||e===Zi.AMP||e===Zi.PAREN_L||e===Zi.PAREN_R||e===Zi.SPREAD||e===Zi.COLON||e===Zi.EQUALS||e===Zi.AT||e===Zi.BRACKET_L||e===Zi.BRACKET_R||e===Zi.BRACE_L||e===Zi.PIPE||e===Zi.BRACE_R}(e)?'"'.concat(e,'"'):e}var Oo=new Map,ko=new Map,So=!0,xo=!1;function _o(e){return e.replace(/[\s,]+/g," ").trim()}function Io(e){var t,r,n,i=_o(e);if(!Oo.has(i)){var o=function(e,t){return new wo(e,t).parseDocument()}(e,{experimentalFragmentVariables:xo,allowLegacyFragmentVariables:xo});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");Oo.set(i,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=o,r=new Set,n=[],t.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=_o((a=e.loc).source.body.substring(a.start,a.end)),o=ko.get(t);o&&!o.has(i)?So&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||ko.set(t,o=new Set),o.add(i),r.has(i)||(r.add(i),n.push(e))}else n.push(e);var a})),xi(xi({},t),{definitions:n}))))}return Oo.get(i)}function Po(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach((function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]})),Io(n)}var To,Ao=Po;(To=Po||(Po={})).gql=Ao,To.resetCaches=function(){Oo.clear(),ko.clear()},To.disableFragmentWarnings=function(){So=!1},To.enableExperimentalFragmentVariables=function(){xo=!0},To.disableExperimentalFragmentVariables=function(){xo=!1},Po.default=Po;const Co=Po`
|
|
fragment RepositoryParts on Repository {
|
|
id
|
|
isFork
|
|
}
|
|
`,No=Po`
|
|
fragment BlobWithTextParts on Blob {
|
|
id
|
|
text
|
|
is_binary: isBinary
|
|
}
|
|
`,qo=Po`
|
|
fragment ObjectParts on GitObject {
|
|
id
|
|
sha: oid
|
|
}
|
|
`,Do=Po`
|
|
fragment BranchParts on Ref {
|
|
commit: target {
|
|
...ObjectParts
|
|
}
|
|
id
|
|
name
|
|
prefix
|
|
repository {
|
|
...RepositoryParts
|
|
}
|
|
}
|
|
${qo}
|
|
${Co}
|
|
`,Fo=Po`
|
|
fragment PullRequestParts on PullRequest {
|
|
id
|
|
baseRefName
|
|
baseRefOid
|
|
body
|
|
headRefName
|
|
headRefOid
|
|
number
|
|
state
|
|
title
|
|
merged_at: mergedAt
|
|
updated_at: updatedAt
|
|
user: author {
|
|
login
|
|
... on User {
|
|
name
|
|
}
|
|
}
|
|
repository {
|
|
...RepositoryParts
|
|
}
|
|
labels(last: 100) {
|
|
nodes {
|
|
name
|
|
}
|
|
}
|
|
}
|
|
${Co}
|
|
`,jo=(Po`
|
|
fragment TreeEntryParts on TreeEntry {
|
|
path: name
|
|
sha: oid
|
|
type
|
|
mode
|
|
}
|
|
`,Po`
|
|
fragment FileEntryParts on TreeEntry {
|
|
name
|
|
sha: oid
|
|
type
|
|
blob: object {
|
|
... on Blob {
|
|
size: byteSize
|
|
}
|
|
}
|
|
}
|
|
`),Bo=Po`
|
|
query repoPermission($owner: String!, $name: String!) {
|
|
repository(owner: $owner, name: $name) {
|
|
...RepositoryParts
|
|
viewerPermission
|
|
}
|
|
}
|
|
${Co}
|
|
`,Lo=Po`
|
|
query {
|
|
viewer {
|
|
id
|
|
avatar_url: avatarUrl
|
|
name
|
|
login
|
|
}
|
|
}
|
|
`,Mo=Po`
|
|
query blob($owner: String!, $name: String!, $expression: String!) {
|
|
repository(owner: $owner, name: $name) {
|
|
...RepositoryParts
|
|
object(expression: $expression) {
|
|
... on Blob {
|
|
...BlobWithTextParts
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${Co}
|
|
${No}
|
|
`,Uo=Po`
|
|
query statues($owner: String!, $name: String!, $sha: GitObjectID!) {
|
|
repository(owner: $owner, name: $name) {
|
|
...RepositoryParts
|
|
object(oid: $sha) {
|
|
...ObjectParts
|
|
... on Commit {
|
|
status {
|
|
id
|
|
contexts {
|
|
id
|
|
context
|
|
state
|
|
target_url: targetUrl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${Co}
|
|
${qo}
|
|
`;function $o(e){return Po`
|
|
query files($owner: String!, $name: String!, $expression: String!) {
|
|
repository(owner: $owner, name: $name) {
|
|
...RepositoryParts
|
|
object(expression: $expression) {
|
|
${function(e=1){const t="PLACE_HOLDER";let r=E`
|
|
...ObjectParts
|
|
... on Tree {
|
|
entries {
|
|
...FileEntryParts
|
|
${t}
|
|
}
|
|
}
|
|
`;for(let n=0;n<e-1;n++)r=r.replace(t,E`
|
|
object {
|
|
... on Tree {
|
|
entries {
|
|
...FileEntryParts
|
|
${t}
|
|
}
|
|
}
|
|
}
|
|
`);return r=r.replace(t,""),r}(e)}
|
|
}
|
|
}
|
|
}
|
|
${Co}
|
|
${qo}
|
|
${jo}
|
|
`}const Qo="\nbranch: ref(qualifiedName: $qualifiedName) {\n ...BranchParts\n}\n",Vo=Po`
|
|
query branch($owner: String!, $name: String!, $qualifiedName: String!) {
|
|
repository(owner: $owner, name: $name) {
|
|
...RepositoryParts
|
|
${Qo}
|
|
}
|
|
}
|
|
${Co}
|
|
${Do}
|
|
`,zo=Po`
|
|
query openAuthoringBranches($owner: String!, $name: String!, $refPrefix: String!) {
|
|
repository(owner: $owner, name: $name) {
|
|
...RepositoryParts
|
|
refs(refPrefix: $refPrefix, last: 100) {
|
|
nodes {
|
|
...BranchParts
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${Co}
|
|
${Do}
|
|
`,Ko=Po`
|
|
query repository($owner: String!, $name: String!) {
|
|
repository(owner: $owner, name: $name) {
|
|
...RepositoryParts
|
|
}
|
|
}
|
|
${Co}
|
|
`,Go="\npullRequest(number: $number) {\n ...PullRequestParts\n}\n",Wo=Po`
|
|
query pullRequest($owner: String!, $name: String!, $number: Int!) {
|
|
repository(owner: $owner, name: $name) {
|
|
id
|
|
${Go}
|
|
}
|
|
}
|
|
${Fo}
|
|
`,Ho=Po`
|
|
query pullRequests($owner: String!, $name: String!, $head: String, $states: [PullRequestState!]) {
|
|
repository(owner: $owner, name: $name) {
|
|
id
|
|
pullRequests(last: 100, headRefName: $head, states: $states) {
|
|
nodes {
|
|
...PullRequestParts
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${Fo}
|
|
`,Jo=Po`
|
|
query pullRequestAndBranch($owner: String!, $name: String!, $originRepoOwner: String!, $originRepoName: String!, $qualifiedName: String!, $number: Int!) {
|
|
repository(owner: $owner, name: $name) {
|
|
...RepositoryParts
|
|
${Qo}
|
|
}
|
|
origin: repository(owner: $originRepoOwner, name: $originRepoName) {
|
|
...RepositoryParts
|
|
${Go}
|
|
}
|
|
}
|
|
${Co}
|
|
${Do}
|
|
${Fo}
|
|
`,Yo=Po`
|
|
query fileSha($owner: String!, $name: String!, $expression: String!) {
|
|
repository(owner: $owner, name: $name) {
|
|
...RepositoryParts
|
|
file: object(expression: $expression) {
|
|
...ObjectParts
|
|
}
|
|
}
|
|
}
|
|
${Co}
|
|
${qo}
|
|
`,Xo=Po`
|
|
mutation updateRef($input: UpdateRefInput!) {
|
|
updateRef(input: $input) {
|
|
branch: ref {
|
|
...BranchParts
|
|
}
|
|
}
|
|
}
|
|
${Do}
|
|
`,Zo="\ndeleteRef(input: $deleteRefInput) {\n clientMutationId\n}\n",ea=Po`
|
|
mutation deleteRef($deleteRefInput: DeleteRefInput!) {
|
|
${Zo}
|
|
}
|
|
`,ta="\nclosePullRequest(input: $closePullRequestInput) {\n clientMutationId\n pullRequest {\n ...PullRequestParts\n }\n}\n",ra=Po`
|
|
mutation closePullRequestAndDeleteBranch($closePullRequestInput: ClosePullRequestInput!) {
|
|
${ta}
|
|
}
|
|
${Fo}
|
|
`,na=Po`
|
|
mutation closePullRequestAndDeleteBranch(
|
|
$closePullRequestInput: ClosePullRequestInput!
|
|
$deleteRefInput: DeleteRefInput!
|
|
) {
|
|
${ta}
|
|
${Zo}
|
|
}
|
|
${Fo}
|
|
`,ia="\n createPullRequest(input: $createPullRequestInput) {\n clientMutationId\n pullRequest {\n ...PullRequestParts\n }\n}\n ",oa=Po`
|
|
mutation createPullRequest($createPullRequestInput: CreatePullRequestInput!) {
|
|
${ia}
|
|
}
|
|
${Fo}
|
|
`,aa=Po`
|
|
mutation createBranch($createRefInput: CreateRefInput!) {
|
|
createRef(input: $createRefInput) {
|
|
branch: ref {
|
|
...BranchParts
|
|
}
|
|
}
|
|
}
|
|
${Do}
|
|
`,sa=Po`
|
|
mutation createBranchAndPullRequest(
|
|
$createRefInput: CreateRefInput!
|
|
$createPullRequestInput: CreatePullRequestInput!
|
|
) {
|
|
createRef(input: $createRefInput) {
|
|
branch: ref {
|
|
...BranchParts
|
|
}
|
|
}
|
|
${ia}
|
|
}
|
|
${Do}
|
|
${Fo}
|
|
`,ua=Po`
|
|
mutation reopenPullRequest($reopenPullRequestInput: ReopenPullRequestInput!) {
|
|
reopenPullRequest(input: $reopenPullRequestInput) {
|
|
clientMutationId
|
|
pullRequest {
|
|
...PullRequestParts
|
|
}
|
|
}
|
|
}
|
|
${Fo}
|
|
`;function ca(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 la(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ca(Object(r),!0).forEach((function(t){ha(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ca(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ha(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fa="no-cache",pa="cache-first",da=new Xn({introspectionQueryResultData:Si()});function ma(e){return la(la({},e),{},{labels:e.labels.nodes,head:{ref:e.headRefName,sha:e.headRefOid,repo:{fork:e.repository.isFork}},base:{ref:e.baseRefName,sha:e.baseRefOid}})}class ya extends ht{constructor(e){super(e),ha(this,"client",void 0),this.client=this.getApolloClient()}getApolloClient(){const e=(r=(e,{headers:t})=>({headers:la(la({"Content-Type":"application/json; charset=utf-8"},t),{},{authorization:this.token?`${this.tokenKeyword} ${this.token}`:""})}),new $r((function(e,t){var n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,[]);return new Tr((function(i){var o;return Promise.resolve(n).then((function(t){return r(t,e.getContext())})).then(e.setContext).then((function(){o=t(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)})})).catch(i.error.bind(i)),function(){o&&o.unsubscribe()}}))}))),t=Oi({uri:`${this.apiRoot}/graphql`});var r;return new cn({link:e.concat(t),cache:new mi({fragmentMatcher:da}),defaultOptions:{watchQuery:{fetchPolicy:fa,errorPolicy:"ignore"},query:{fetchPolicy:fa,errorPolicy:"all"}}})}reset(){return this.client.resetStore()}async getRepository(e,t){const{data:r}=await this.query({query:Ko,variables:{owner:e,name:t},fetchPolicy:pa});return r.repository}query(e){return this.client.query(e).catch((e=>{throw new k.APIError(e.message,500,"GitHub")}))}async mutate(e){try{return await this.client.mutate(e)}catch(u){const c=u.graphQLErrors;if(Array.isArray(c)&&c.some((e=>"Ref cannot be created."===e.message))){var t,r;const n=(null==e||null===(t=e.variables)||void 0===t||null===(r=t.createRefInput)||void 0===r?void 0:r.name)||"",i=s()(n,"refs/heads/");i&&await(0,k.throwOnConflictingBranches)(i,(e=>this.getBranch(e)),it)}else if(Array.isArray(c)&&c.some((e=>new RegExp(`A ref named "refs/heads/${k.CMS_BRANCH_PREFIX}/.+?" already exists in the repository.`).test(e.message)))){var n,i,o,a;const t=(null==e||null===(n=e.variables)||void 0===n||null===(i=n.createRefInput)||void 0===i?void 0:i.name)||"",r=(null==e||null===(o=e.variables)||void 0===o||null===(a=o.createRefInput)||void 0===a?void 0:a.oid)||"",u=s()(t,"refs/heads/");if(u&&u.startsWith(`${k.CMS_BRANCH_PREFIX}/`)&&r)try{return await this.backupBranch(u),await this.deleteBranch(u),await this.client.mutate(e)}catch(e){console.log(e)}}throw new k.APIError(u.message,500,"GitHub")}}async hasWriteAccess(){const{repoOwner:e,repoName:t}=this;try{const{data:r}=await this.query({query:Bo,variables:{owner:e,name:t},fetchPolicy:pa}),{viewerPermission:n}=r.repository;return["ADMIN","MAINTAIN","WRITE"].includes(n)}catch(e){throw console.error("Problem fetching repo data from GitHub"),e}}async user(){const{data:e}=await this.query({query:Lo,fetchPolicy:pa});return e.viewer}async retrieveBlobObject(e,t,r,n={}){const{data:i}=await this.query(la({query:Mo,variables:{owner:e,name:t,expression:r}},n));if(i.repository.object){const{is_binary:e,text:t}=i.repository.object;return{isNull:!1,isBinary:e,text:t}}return{isNull:!0}}getOwnerAndNameFromRepoUrl(e){let{repoOwner:t,repoName:r}=this;return e===this.originRepoURL&&({originRepoOwner:t,originRepoName:r}=this),{owner:t,name:r}}async readFile(e,t,{branch:r=this.branch,repoURL:n=this.repoURL,parseText:i=!0}={}){return t||(t=await this.getFileSha(e,{repoURL:n,branch:r})),await(0,k.readFile)(t,(()=>this.fetchBlobContent({sha:t,repoURL:n,parseText:i})),k.localForage,i)}async fetchBlobContent({sha:e,repoURL:t,parseText:r}){if(!r)return super.fetchBlobContent({sha:e,repoURL:t,parseText:r});const{owner:n,name:i}=this.getOwnerAndNameFromRepoUrl(t),{isNull:o,isBinary:a,text:s}=await this.retrieveBlobObject(n,i,e,{fetchPolicy:pa});if(o)throw new k.APIError("Not Found",404,"GitHub");return a?super.fetchBlobContent({sha:e,repoURL:t,parseText:r}):s}async getPullRequestAuthor(e){const t=e.user;return(null==t?void 0:t.name)||(null==t?void 0:t.login)}async getPullRequests(e,t,r){const{originRepoOwner:n,originRepoName:i}=this;let o;o=t===st.Open?["OPEN"]:t===st.Closed?["CLOSED","MERGED"]:["OPEN","CLOSED","MERGED"];const{data:a}=await this.query({query:Ho,variables:la(la({owner:n,name:i},e?{head:e}:{}),{},{states:o})}),{pullRequests:s}=a.repository;return s.nodes.map(ma).filter((e=>e.head.ref.startsWith(`${k.CMS_BRANCH_PREFIX}/`)&&r(e)))}async getOpenAuthoringBranches(){const{repoOwner:e,repoName:t}=this,{data:r}=await this.query({query:zo,variables:{owner:e,name:t,refPrefix:`refs/heads/cms/${this.repo}/`}});return r.repository.refs.nodes.map((({name:e,prefix:t})=>({ref:`${t}${e}`})))}async getStatuses(e,t){const r=this.generateContentKey(e,t),n=(0,k.branchFromContentKey)(r),i=(await this.getBranchPullRequest(n)).head.sha,{originRepoOwner:o,originRepoName:a}=this,{data:s}=await this.query({query:Uo,variables:{owner:o,name:a,sha:i}});if(s.repository.object){const{status:e}=s.repository.object,{contexts:t}=e||{contexts:[]};return t}return[]}getAllFiles(e,t){return e.reduce(((e,r)=>{if("tree"===r.type){var n;const i=(null===(n=r.object)||void 0===n?void 0:n.entries)||[];return[...e,...this.getAllFiles(i,`${t}/${r.name}`)]}return"blob"===r.type?[...e,{name:r.name,type:r.type,id:r.sha,path:`${t}/${r.name}`,size:r.blob?r.blob.size:0}]:e}),[])}async listFiles(e,{repoURL:t=this.repoURL,branch:r=this.branch,depth:n=1}={}){const{owner:i,name:o}=this.getOwnerAndNameFromRepoUrl(t),a=ae()(e,"/"),{data:s}=await this.query({query:$o(n),variables:{owner:i,name:o,expression:`${r}:${a}`}});return s.repository.object?this.getAllFiles(s.repository.object.entries,a):[]}getBranchQualifiedName(e){return`refs/heads/${e}`}getBranchQuery(e,t,r){return{query:Vo,variables:{owner:t,name:r,qualifiedName:this.getBranchQualifiedName(e)}}}async getDefaultBranch(){const{data:e}=await this.query(la({},this.getBranchQuery(this.branch,this.originRepoOwner,this.originRepoName)));return e.repository.branch}async getBranch(e){const{data:t}=await this.query(la(la({},this.getBranchQuery(e,this.repoOwner,this.repoName)),{},{fetchPolicy:pa}));if(!t.repository.branch)throw new k.APIError("Branch not found",404,it);return t.repository.branch}async patchRef(e,t,r,n={}){if("heads"!==e)return super.patchRef(e,t,r,n);const i=n.force||!1,o=await this.getBranch(t),{data:a}=await this.mutate({mutation:Xo,variables:{input:{oid:r,refId:o.id,force:i}}});return a.updateRef.branch}async deleteBranch(e){const t=await this.getBranch(e),{data:r}=await this.mutate({mutation:ea,variables:{deleteRefInput:{refId:t.id}},update:e=>e.data.delete(fi(t))});return r.deleteRef}getPullRequestQuery(e){const{originRepoOwner:t,originRepoName:r}=this;return{query:Wo,variables:{owner:t,name:r,number:e}}}async getPullRequest(e){const{data:t}=await this.query(la(la({},this.getPullRequestQuery(e)),{},{fetchPolicy:pa})),r="OPEN"===t.repository.pullRequest.state?st.Open:st.Closed;return la(la({},t.repository.pullRequest),{},{state:r})}getPullRequestAndBranchQuery(e,t){const{repoOwner:r,repoName:n}=this,{originRepoOwner:i,originRepoName:o}=this;return{query:Jo,variables:{owner:r,name:n,originRepoOwner:i,originRepoName:o,number:t,qualifiedName:this.getBranchQualifiedName(e)}}}async getPullRequestAndBranch(e,t){const{data:r}=await this.query(la(la({},this.getPullRequestAndBranchQuery(e,t)),{},{fetchPolicy:pa})),{repository:n,origin:i}=r;return{branch:n.branch,pullRequest:i.pullRequest}}async openPR(e){const t=await this.getPullRequest(e),{data:r}=await this.mutate({mutation:ua,variables:{reopenPullRequestInput:{pullRequestId:t.id}},update:(e,{data:t})=>{const{pullRequest:r}=t.reopenPullRequest,n={repository:la(la({},r.repository),{},{pullRequest:r})};e.writeQuery(la(la({},this.getPullRequestQuery(r.number)),{},{data:n}))}});return r.reopenPullRequest}async closePR(e){const t=await this.getPullRequest(e),{data:r}=await this.mutate({mutation:ra,variables:{closePullRequestInput:{pullRequestId:t.id}},update:(e,{data:t})=>{const{pullRequest:r}=t.closePullRequest,n={repository:la(la({},r.repository),{},{pullRequest:r})};e.writeQuery(la(la({},this.getPullRequestQuery(r.number)),{},{data:n}))}});return r.closePullRequest}async deleteUnpublishedEntry(e,t){try{const r=this.generateContentKey(e,t),n=(0,k.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);if(i.number!==ot){const{branch:e,pullRequest:t}=await this.getPullRequestAndBranch(n,i.number),{data:r}=await this.mutate({mutation:na,variables:{deleteRefInput:{refId:e.id},closePullRequestInput:{pullRequestId:t.id}},update:r=>{r.data.delete(fi(e)),r.data.delete(fi(t))}});return r.closePullRequest}return await this.deleteBranch(n)}catch(e){const{graphQLErrors:t}=e;if(t&&t.length>0){const e=t.some((e=>"NOT_FOUND"===e.type));if(e)return}throw e}}async createPR(e,t){const[r,n]=await Promise.all([this.getRepository(this.originRepoOwner,this.originRepoName),this.useOpenAuthoring?`${(await this.user()).login}:${t}`:t]),{data:i}=await this.mutate({mutation:oa,variables:{createPullRequestInput:{baseRefName:this.branch,body:k.DEFAULT_PR_BODY,title:e,headRefName:n,repositoryId:r.id}},update:(e,{data:t})=>{const{pullRequest:r}=t.createPullRequest,n={repository:la(la({},r.repository),{},{pullRequest:r})};e.writeQuery(la(la({},this.getPullRequestQuery(r.number)),{},{data:n}))}}),{pullRequest:o}=i.createPullRequest;return la(la({},o),{},{head:{sha:o.headRefOid}})}async createBranch(e,t){const r=this.repoOwner,n=this.repoName,i=await this.getRepository(r,n),{data:o}=await this.mutate({mutation:aa,variables:{createRefInput:{name:this.getBranchQualifiedName(e),oid:t,repositoryId:i.id}},update:(t,{data:i})=>{const{branch:o}=i.createRef,a={repository:la(la({},o.repository),{},{branch:o})};t.writeQuery(la(la({},this.getBranchQuery(e,r,n)),{},{data:a}))}}),{branch:a}=o.createRef;return la(la({},a),{},{ref:`${a.prefix}${a.name}`})}async createBranchAndPullRequest(e,t,r){const n=this.originRepoOwner,i=this.originRepoName,o=await this.getRepository(n,i),{data:a}=await this.mutate({mutation:sa,variables:{createRefInput:{name:this.getBranchQualifiedName(e),oid:t,repositoryId:o.id},createPullRequestInput:{baseRefName:this.branch,body:k.DEFAULT_PR_BODY,title:r,headRefName:e,repositoryId:o.id}},update:(t,{data:r})=>{const{branch:o}=r.createRef,{pullRequest:a}=r.createPullRequest,s={repository:la(la({},o.repository),{},{branch:o})},u={repository:la(la({},a.repository),{},{branch:o}),origin:la(la({},a.repository),{},{pullRequest:a})};t.writeQuery(la(la({},this.getBranchQuery(e,n,i)),{},{data:s})),t.writeQuery(la(la({},this.getPullRequestAndBranchQuery(e,a.number)),{},{data:u}))}}),{pullRequest:s}=a.createPullRequest;return ma(s)}async getFileSha(e,{repoURL:t=this.repoURL,branch:r=this.branch}={}){const{owner:n,name:i}=this.getOwnerAndNameFromRepoUrl(t),{data:o}=await this.query({query:Yo,variables:{owner:n,name:i,expression:`${r}:${e}`}});if(o.repository.file)return o.repository.file.sha;throw new k.APIError("Not Found",404,it)}}function va(){return va=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},va.apply(this,arguments)}function ga(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 ba(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ga(Object(r),!0).forEach((function(t){wa(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ga(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wa(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{fetchWithTimeout:Ra}=k.unsentRequest,Ea="https://www.githubstatus.com",Oa=`${Ea}/api/v2/components.json`,ka=["API Requests","Issues, Pull Requests, Projects"],Sa={GitHubBackend:class{constructor(e,t={}){var r;if(wa(this,"lock",void 0),wa(this,"api",void 0),wa(this,"options",void 0),wa(this,"originRepo",void 0),wa(this,"isBranchConfigured",void 0),wa(this,"repo",void 0),wa(this,"openAuthoringEnabled",void 0),wa(this,"useOpenAuthoring",void 0),wa(this,"alwaysForkEnabled",void 0),wa(this,"branch",void 0),wa(this,"apiRoot",void 0),wa(this,"mediaFolder",void 0),wa(this,"previewContext",void 0),wa(this,"token",void 0),wa(this,"tokenKeyword",void 0),wa(this,"squashMerges",void 0),wa(this,"cmsLabelPrefix",void 0),wa(this,"useGraphql",void 0),wa(this,"baseUrl",void 0),wa(this,"bypassWriteAccessCheckForAppTokens",!1),wa(this,"_currentUserPromise",void 0),wa(this,"_userIsOriginMaintainerPromises",void 0),wa(this,"_mediaDisplayURLSem",void 0),wa(this,"getCursorAndFiles",((e,t)=>{const r=e.length,n=Math.ceil(e.length/20),i=[];return t>1&&(i.push("prev"),i.push("first")),t<n&&(i.push("next"),i.push("last")),{cursor:k.Cursor.create({actions:i,meta:{page:t,count:r,pageSize:20,pageCount:n},data:{files:e}}),files:e.slice(20*(t-1),20*t)}})),this.options=ba({proxied:!1,API:null,initialWorkflowStatus:""},t),!this.options.proxied&&(null===e.backend.repo||void 0===e.backend.repo))throw new Error('The GitHub backend needs a "repo" in the backend configuration.');if(this.api=this.options.API||null,this.isBranchConfigured=!!e.backend.branch,this.openAuthoringEnabled=e.backend.open_authoring||!1,this.openAuthoringEnabled){if(!this.options.useWorkflow)throw new Error("backend.open_authoring is true but publish_mode is not set to editorial_workflow.");this.originRepo=e.backend.repo||""}else this.repo=this.originRepo=e.backend.repo||"";this.alwaysForkEnabled=e.backend.always_fork||!1,this.branch=(null===(r=e.backend.branch)||void 0===r?void 0:r.trim())||"master",this.apiRoot=e.backend.api_root||"https://api.github.com",this.token="",this.tokenKeyword="token",this.baseUrl=e.backend.base_url,this.squashMerges=e.backend.squash_merges||!1,this.cmsLabelPrefix=e.backend.cms_label_prefix||"",this.useGraphql=e.backend.use_graphql||!1,this.mediaFolder=e.media_folder,this.previewContext=e.backend.preview_context||"",this.lock=(0,k.asyncLock)()}isGitBackend(){return!0}async status(){const e=await Ra(Oa).then((e=>e.json())).then((e=>e.components.filter((e=>ka.includes(e.name))).every((e=>"operational"===e.status)))).catch((e=>(console.warn("Failed getting GitHub status",e),!0)));let t=!1;var r,n;return e&&(t=await(null===(r=this.api)||void 0===r?void 0:r.getUser({token:null!==(n=this.token)&&void 0!==n?n:""}).then((e=>!!e)).catch((e=>(console.warn("Failed getting GitHub user",e),!1))))||!1),{auth:{status:t},api:{status:e,statusPage:Ea}}}authComponent(){const e=e=>(0,P.jsx)(ie,va({},e,{backend:this}));return e.displayName="AuthenticationPage",e}restoreUser(e){return this.openAuthoringEnabled?this.authenticateWithFork({userData:e,getPermissionToFork:()=>!0}).then((()=>this.authenticate(e))):this.authenticate(e)}async pollUntilForkExists({repo:e,token:t}){let r=!1;for(;!r;)r=await Ra(`${this.apiRoot}/repos/${e}`,{headers:{Authorization:`${this.tokenKeyword} ${t}`}}).then((()=>!0)).catch((e=>e&&404===e.status?(console.log("This 404 was expected and handled appropriately."),!1):Promise.reject(e))),r||await new Promise((e=>setTimeout(e,250)));return Promise.resolve()}async currentUser({token:e}){return this._currentUserPromise||(this._currentUserPromise=Ra(`${this.apiRoot}/user`,{headers:{Authorization:`${this.tokenKeyword} ${e}`}}).then((e=>e.json()))),this._currentUserPromise}async userIsOriginMaintainer({username:e,token:t}){const r=e||(await this.currentUser({token:t})).login;return this._userIsOriginMaintainerPromises=this._userIsOriginMaintainerPromises||{},this._userIsOriginMaintainerPromises[r]||(this._userIsOriginMaintainerPromises[r]=Ra(`${this.apiRoot}/repos/${this.originRepo}/collaborators/${r}/permission`,{headers:{Authorization:`${this.tokenKeyword} ${t}`}}).then((e=>e.json())).then((({permission:e})=>"admin"===e||"write"===e))),this._userIsOriginMaintainerPromises[r]}async forkExists({token:e}){try{const t=await this.currentUser({token:e}),r=this.originRepo.split("/")[1],n=await Ra(`${this.apiRoot}/repos/${t.login}/${r}`,{method:"GET",headers:{Authorization:`${this.tokenKeyword} ${e}`}}).then((e=>e.json()));return!0===n.fork&&n.parent&&n.parent.full_name.toLowerCase()===this.originRepo.toLowerCase()}catch{return!1}}async authenticateWithFork({userData:e,getPermissionToFork:t}){if(!this.openAuthoringEnabled)throw new Error("Cannot authenticate with fork; Open Authoring is turned off.");const r=e.token;if(!this.alwaysForkEnabled&&await this.userIsOriginMaintainer({token:r}))return this.repo=this.originRepo,this.useOpenAuthoring=!1,Promise.resolve();const n=await this.currentUser({token:r}),i=this.originRepo.split("/")[1];if(this.repo=`${n.login}/${i}`,this.useOpenAuthoring=!0,await this.forkExists({token:r}))return Ra(`${this.apiRoot}/repos/${this.repo}/merge-upstream`,{method:"POST",headers:{Authorization:`${this.tokenKeyword} ${r}`},body:JSON.stringify({branch:this.branch})});{await t();const e=await Ra(`${this.apiRoot}/repos/${this.originRepo}/forks`,{method:"POST",headers:{Authorization:`${this.tokenKeyword} ${r}`}}).then((e=>e.json()));return this.pollUntilForkExists({repo:e.full_name,token:r})}}async authenticate(e){if(this.token=e.token,!this.isBranchConfigured){const e=await Ra(`${this.apiRoot}/repos/${this.originRepo}`,{headers:{Authorization:`token ${this.token}`}}).then((e=>e.json())).catch((()=>null));e&&e.default_branch&&(this.branch=e.default_branch)}const t=this.useGraphql?ya:ht;this.api=new t({token:this.token,tokenKeyword:this.tokenKeyword,branch:this.branch,repo:this.repo,originRepo:this.originRepo,apiRoot:this.apiRoot,squashMerges:this.squashMerges,cmsLabelPrefix:this.cmsLabelPrefix,useOpenAuthoring:this.useOpenAuthoring,initialWorkflowStatus:this.options.initialWorkflowStatus,baseUrl:this.baseUrl,getUser:this.currentUser});const r=await this.api.user();if(!await this.api.hasWriteAccess().catch((e=>{throw e.message=O`
|
|
Repo "${this.repo}" not found.
|
|
|
|
Please ensure the repo information is spelled correctly.
|
|
|
|
If the repo is private, make sure you're logged into a GitHub account with access.
|
|
|
|
If your repo is under an organization, ensure the organization has granted access to Decap CMS.
|
|
`,e}))&&!this.bypassWriteAccessCheckForAppTokens)throw new Error("Your GitHub user account does not have access to this repo.");return ba(ba({},r),{},{token:e.token,useOpenAuthoring:this.useOpenAuthoring})}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}async entriesByFolder(e,t,r){const n=this.api.originRepoURL;let i;const o=await(0,k.entriesByFolder)((()=>this.api.listFiles(e,{repoURL:n,depth:r}).then((e=>{const r=e.filter((e=>(0,k.filterByExtension)(e,t))),n=this.getCursorAndFiles(r,1);return i=n.cursor,n.files}))),((e,t)=>this.api.readFile(e,t,{repoURL:n})),this.api.readFileMetadata.bind(this.api),it);return o[k.CURSOR_COMPATIBILITY_SYMBOL]=i,o}async allEntriesByFolder(e,t,r,n){const i=this.api.originRepoURL;return await(0,k.entriesByFolder)((()=>this.api.listFiles(e,{repoURL:i,depth:r}).then((e=>e.filter((e=>(!n||n.test(e.path))&&(0,k.filterByExtension)(e,t)))))),((e,t)=>this.api.readFile(e,t,{repoURL:i})),this.api.readFileMetadata.bind(this.api),it)}entriesByFiles(e){const t=this.useOpenAuthoring?this.api.originRepoURL:this.api.repoURL;return(0,k.entriesByFiles)(e,((e,r)=>this.api.readFile(e,r,{repoURL:t}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),it)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then((t=>({file:{path:e,id:null},data:t}))).catch((()=>({file:{path:e,id:null},data:""})))}getMedia(e=this.mediaFolder){return this.api.listFiles(e).then((e=>e.map((({id:e,name:t,size:r,path:n})=>({id:e,name:t,size:r,displayURL:{id:e,path:n},path:n})))))}async getMediaFile(e){const t=await(0,k.getMediaAsBlob)(e,null,this.api.readFile.bind(this.api)),r=(0,k.basename)(e),n=(0,k.blobToFileObj)(r,t),i=URL.createObjectURL(n);return{id:await(0,k.getBlobSHA)(t),displayURL:i,path:e,name:r,size:n.size,file:n,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||o()(10),(0,k.getMediaDisplayURL)(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return(0,k.runWithLock)(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:r,path:n,fileObj:i}=e,o=i?URL.createObjectURL(i):"";return{id:r,name:i.name,size:i.size,displayURL:o,path:s()(n,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){const r=e.meta,n=e.data.get("files").toJS();let i;switch(t){case"first":default:i=this.getCursorAndFiles(n,1);break;case"last":i=this.getCursorAndFiles(n,r.get("pageCount"));break;case"next":i=this.getCursorAndFiles(n,r.get("page")+1);break;case"prev":i=this.getCursorAndFiles(n,r.get("page")-1)}return{entries:await(0,k.entriesByFiles)(i.files,((e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),it),cursor:i.cursor}}async loadMediaFile(e,t){const r=await(0,k.getMediaAsBlob)(t.path,t.id,((t,r,{parseText:n})=>this.api.readFile(t,r,{branch:e,parseText:n}))),n=(0,k.basename)(t.path),i=(0,k.blobToFileObj)(n,r);return{id:t.id,displayURL:URL.createObjectURL(i),path:t.path,name:n,size:i.size,file:i}}async unpublishedEntries(){const e=await(0,k.unpublishedEntries)((()=>this.api.listUnpublishedBranches().then((e=>e.map((e=>(0,k.contentKeyFromBranch)(e)))))));return e}async unpublishedEntry({id:e,collection:t,slug:r}){if(e)return await this.api.retrieveUnpublishedEntryData(e);if(t&&r){const e=this.api.generateContentKey(t,r);return await this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}getBranch(e,t){const r=this.api.generateContentKey(e,t);return(0,k.branchFromContentKey)(r)}async unpublishedEntryDataFile(e,t,r,n){const i=this.getBranch(e,t);return await this.api.readFile(r,n,{branch:i})}async unpublishedEntryMediaFile(e,t,r,n){const i=this.getBranch(e,t);return await this.loadMediaFile(i,{path:r,id:n})}async getDeployPreview(e,t){try{const r=await this.api.getStatuses(e,t),n=(0,k.getPreviewStatus)(r,this.previewContext);if(n){const{target_url:e,state:t}=n;return{url:e,status:t}}return null}catch(e){return null}}updateUnpublishedEntryStatus(e,t,r){return(0,k.runWithLock)(this.lock,(()=>this.api.updateUnpublishedEntryStatus(e,t,r)),"Failed to acquire update entry status lock")}deleteUnpublishedEntry(e,t){return(0,k.runWithLock)(this.lock,(()=>this.api.deleteUnpublishedEntry(e,t)),"Failed to acquire delete entry lock")}publishUnpublishedEntry(e,t){return(0,k.runWithLock)(this.lock,(()=>this.api.publishUnpublishedEntry(e,t)),"Failed to acquire publish entry lock")}},API:ht,AuthenticationPage:ie}})(),c.DecapCmsBackendGithub})()));
|
|
//# sourceMappingURL=decap-cms-backend-github.js.map
|