diff --git a/.azure-pipelines-steps.yml b/.azure-pipelines-steps.yml index c4e9f857d422..573a5f650397 100644 --- a/.azure-pipelines-steps.yml +++ b/.azure-pipelines-steps.yml @@ -18,19 +18,21 @@ steps: versionSpec: '2.7' displayName: 'Use Python 2.7' - # Run yarn to install dependencies and build - - script: node scripts/remove-postinstall - displayName: 'Remove postinstall script' + - bash: echo "##vso[task.setvariable variable=folder;isOutput=true]$(yarn config get cacheFolder)" + name: yarnCache - - task: CacheBeta@0 + - task: Cache@2 inputs: key: yarn | $(Agent.OS) | yarn.lock - path: $(YARN_CACHE_FOLDER) + path: $(yarnCache.folder) displayName: Cache Yarn packages - - script: yarn install-no-ts-build + - script: yarn install displayName: 'Install dependencies' + - script: yarn build:js + displayName: 'Transpile TypeScript' + # Run test-ci-partial - script: yarn run test-ci-partial displayName: 'Run tests' diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 141c9cffea6c..849fe34d2194 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -34,5 +34,3 @@ variables: # Ensures the handful of tests that should be skipped during CI are CI: true - - YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn diff --git a/.circleci/config.yml b/.circleci/config.yml index bd9be807475f..6df4345cca52 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,20 +1,19 @@ aliases: - &restore-cache keys: - - v2-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }} + - v3-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }} # Fallback in case checksum fails - - v2-dependencies-{{ .Branch }}- + - v3-dependencies-{{ .Branch }}- - &save-cache paths: - - node_modules - - website/node_modules - key: v2-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }} + - ~/.cache/yarn + key: v3-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }} - &filter-ignore-gh-pages branches: ignore: gh-pages - - &install yarn install-no-ts-build + - &install yarn install && yarn build:js version: 2 jobs: diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000000..253bcb76bad2 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 2fef34f1beff..3613b9b1917b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -25,22 +25,20 @@ jobs: - uses: actions/checkout@v2 - name: Get yarn cache id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v1 + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - uses: actions/cache@v2 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ubuntu-latest-node-12.x-yarn- - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2.1.1 with: node-version: 12.x - name: install - run: yarn install-no-ts-build + run: yarn - name: build - run: node scripts/build.js - - name: run tsc - run: yarn build:ts + run: yarn build - name: verify TypeScript@3.8 compatibility run: yarn verify-old-ts - name: run eslint @@ -68,19 +66,21 @@ jobs: - uses: actions/checkout@v2 - name: Get yarn cache id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v1 + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - uses: actions/cache@v2 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-node-${{ matrix.node-version }}-yarn- - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v2.1.1 with: node-version: ${{ matrix.node-version }} - name: install - run: yarn install-no-ts-build + run: yarn + - name: build + run: yarn build:js - name: run tests run: yarn test-ci-partial env: diff --git a/.gitignore b/.gitignore index c6b727d6dfa1..915f2491dfb1 100644 --- a/.gitignore +++ b/.gitignore @@ -39,7 +39,10 @@ junit.xml *.tsbuildinfo -.pnp.js -.yarn/unplugged/ -.yarn/build-state.yml -e2e/async-regenerator/.yarn/ +# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored but nested for e2e directories +**/.yarn/* +!**/.yarn/releases +!**/.yarn/plugins +!**/.yarn/sdks +!**/.yarn/versions +**/.pnp.* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 443ed6f7b78e..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: node_js - -node_js: - - 'lts/*' - -branches: - only: - - master - -before_install: - - curl -o- -L https://yarnpkg.com/install.sh | bash - - export PATH="$HOME/.yarn/bin:$PATH" - -install: yarn install-no-ts-build - -cache: - yarn: true - directories: - - '.eslintcache' - - 'node_modules' - -script: - - yarn run test-ci-partial diff --git a/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs b/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs new file mode 100644 index 000000000000..08fd6e74e603 --- /dev/null +++ b/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs @@ -0,0 +1,39 @@ +module.exports={name:"@yarnpkg/plugin-interactive-tools",factory:function(require){var plugin=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=117)}([function(e,t,n){"use strict";e.exports=n(42)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"render",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"Box",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"Color",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"AppContext",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"StdinContext",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"StdoutContext",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"Static",{enumerable:!0,get:function(){return c.default}});var r=f(n(46)),i=f(n(90)),u=f(n(91)),o=f(n(96)),a=f(n(30)),l=f(n(31)),s=f(n(32)),c=f(n(98));function f(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";function r(e,t,n){const r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:()=>e===f.WithinHeaders?r:{},queryParameters:()=>e===f.WithinQueryParameters?r:{}}}function i(e){let t=0;const n=()=>(t++,new Promise(r=>{setTimeout(()=>{r(e(n))},Math.min(100*t,1e3))}));return e(n)}function u(e,t=((e,t)=>Promise.resolve())){return Object.assign(e,{wait:n=>u(e.then(e=>Promise.all([t(e,n),e])).then(e=>e[1]))})}function o(e){let t=e.length-1;for(;t>0;t--){const n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function a(e,t){return Object.keys(void 0!==t?t:{}).forEach(n=>{e[n]=t[n](e)}),e}function l(e,...t){let n=0;return e.replace(/%s/g,()=>encodeURIComponent(t[n++]))}n.r(t),n.d(t,"AuthMode",(function(){return f})),n.d(t,"addMethods",(function(){return a})),n.d(t,"createAuth",(function(){return r})),n.d(t,"createRetryablePromise",(function(){return i})),n.d(t,"createWaitablePromise",(function(){return u})),n.d(t,"destroy",(function(){return c})),n.d(t,"encode",(function(){return l})),n.d(t,"shuffle",(function(){return o})),n.d(t,"version",(function(){return s}));const s="4.2.0",c=e=>()=>e.transporter.requester.destroy(),f={WithinQueryParameters:0,WithinHeaders:1}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r={Delete:"DELETE",Get:"GET",Post:"POST",Put:"PUT"}},function(e,t,n){"use strict";n.r(t),n.d(t,"CallEnum",(function(){return u})),n.d(t,"HostStatusEnum",(function(){return o})),n.d(t,"createApiError",(function(){return T})),n.d(t,"createDeserializationError",(function(){return C})),n.d(t,"createMappedRequestOptions",(function(){return i})),n.d(t,"createRetryError",(function(){return k})),n.d(t,"createStatefulHost",(function(){return l})),n.d(t,"createStatelessHost",(function(){return f})),n.d(t,"createTransporter",(function(){return h})),n.d(t,"createUserAgent",(function(){return m})),n.d(t,"deserializeFailure",(function(){return b})),n.d(t,"deserializeSuccess",(function(){return v})),n.d(t,"isStatefulHostTimeouted",(function(){return c})),n.d(t,"isStatefulHostUp",(function(){return s})),n.d(t,"serializeData",(function(){return _})),n.d(t,"serializeHeaders",(function(){return D})),n.d(t,"serializeQueryParameters",(function(){return y})),n.d(t,"serializeUrl",(function(){return g})),n.d(t,"stackFrameWithoutCredentials",(function(){return E})),n.d(t,"stackTraceWithoutCredentials",(function(){return w}));var r=n(3);function i(e,t){const n=e||{},r=n.data||{};return Object.keys(n).forEach(e=>{-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(r[e]=n[e])}),{data:Object.entries(r).length>0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}const u={Read:1,Write:2,Any:3},o={Up:1,Down:2,Timeouted:3},a=12e4;function l(e,t=o.Up){return{...e,status:t,lastUpdate:Date.now()}}function s(e){return e.status===o.Up||Date.now()-e.lastUpdate>a}function c(e){return e.status===o.Timeouted&&Date.now()-e.lastUpdate<=a}function f(e){return{protocol:e.protocol||"https",url:e.url,accept:e.accept||u.Any}}const d=(e,t)=>(e=>{const t=e.status;return e.isTimedOut||(({isTimedOut:e,status:t})=>!e&&0==~~t)(e)||2!=~~(t/100)&&4!=~~(t/100)})(e)?t.onRetry(e):(({status:e})=>2==~~(e/100))(e)?t.onSucess(e):t.onFail(e);function p(e,t,n,i){const u=[],a=_(n,i),p=D(e,i),h=n.method,m=n.method!==r.a.Get?{}:{...n.data,...i.data},y={"x-algolia-agent":e.userAgent.value,...e.queryParameters,...m,...i.queryParameters};let T=0;const C=(t,r)=>{const s=t.pop();if(void 0===s)throw k(w(u));const c={data:a,headers:p,method:h,url:g(s,n.path,y),connectTimeout:r(T,e.timeouts.connect),responseTimeout:r(T,i.timeout)},f=e=>{const n={request:c,response:e,host:s,triesLeft:t.length};return u.push(n),n},m={onSucess:e=>v(e),onRetry(n){const i=f(n);return n.isTimedOut&&T++,Promise.all([e.logger.info("Retryable failure",E(i)),e.hostsCache.set(s,l(s,n.isTimedOut?o.Timeouted:o.Down))]).then(()=>C(t,r))},onFail(e){throw f(e),b(e,w(u))}};return e.requester.send(c).then(e=>d(e,m))};return function(e,t){return Promise.all(t.map(t=>e.get(t,()=>Promise.resolve(l(t))))).then(e=>{const n=e.filter(e=>s(e)),r=e.filter(e=>c(e)),i=[...n,...r];return{getTimeout:(e,t)=>(0===r.length&&0===e?1:r.length+3+e)*t,statelessHosts:i.length>0?i.map(e=>f(e)):t}})}(e.hostsCache,t).then(e=>C([...e.statelessHosts].reverse(),e.getTimeout))}function h(e){const{hostsCache:t,logger:n,requester:r,requestsCache:o,responsesCache:a,timeouts:l,userAgent:s,hosts:c,queryParameters:d,headers:h}=e,m={hostsCache:t,logger:n,requester:r,requestsCache:o,responsesCache:a,timeouts:l,userAgent:s,headers:h,queryParameters:d,hosts:c.map(e=>f(e)),read(e,t){const n=i(t,m.timeouts.read),r=()=>p(m,m.hosts.filter(e=>0!=(e.accept&u.Read)),e,n);if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();const o={request:e,mappedRequestOptions:n,transporter:{queryParameters:m.queryParameters,headers:m.headers}};return m.responsesCache.get(o,()=>m.requestsCache.get(o,()=>m.requestsCache.set(o,r()).then(e=>Promise.all([m.requestsCache.delete(o),e]),e=>Promise.all([m.requestsCache.delete(o),Promise.reject(e)])).then(([e,t])=>t)),{miss:e=>m.responsesCache.set(o,e)})},write:(e,t)=>p(m,m.hosts.filter(e=>0!=(e.accept&u.Write)),e,i(t,m.timeouts.write))};return m}function m(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const n=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(n)&&(t.value=`${t.value}${n}`),t}};return t}function v(e){try{return JSON.parse(e.content)}catch(t){throw C(t.message,e)}}function b({content:e,status:t},n){let r=e;try{r=JSON.parse(e).message}catch(e){}return T(r,t,n)}function g(e,t,n){const r=y(n);let i=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return r.length&&(i+=`?${r}`),i}function y(e){return Object.keys(e).map(t=>(function(e,...t){let n=0;return e.replace(/%s/g,()=>encodeURIComponent(t[n++]))})("%s=%s",t,(e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e))(e[t])?JSON.stringify(e[t]):e[t])).join("&")}function _(e,t){if(e.method===r.a.Get||void 0===e.data&&void 0===t.data)return;const n=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(n)}function D(e,t){const n={...e.headers,...t.headers},r={};return Object.keys(n).forEach(e=>{const t=n[e];r[e.toLowerCase()]=t}),r}function w(e){return e.map(e=>E(e))}function E(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function T(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}function C(e,t){return{name:"DeserializationError",message:e,response:t}}function k(e){return{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:e}}},function(e,t){e.exports=require("@yarnpkg/core")},function(e,t){e.exports=require("clipanion")},function(e,t,n){e.exports=n(88)()},function(e,t){e.exports=require("@yarnpkg/cli")},function(e,t){e.exports=require("http")},function(e,t){e.exports=require("https")},function(e,t,n){"use strict";e.exports=e=>!Number.isNaN(e)&&(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTextNode=t.setAttribute=t.removeChildNode=t.insertBeforeNode=t.appendStaticNode=t.appendChildNode=t.createNode=void 0;t.createNode=e=>({nodeName:e.toUpperCase(),style:{},attributes:{},childNodes:[],parentNode:null});t.appendChildNode=(e,t)=>{t.parentNode&&r(t.parentNode,t),t.parentNode=e,e.childNodes.push(t)};t.appendStaticNode=(e,t)=>{e.childNodes.push(t)};t.insertBeforeNode=(e,t,n)=>{t.parentNode&&r(t.parentNode,t),t.parentNode=e;const i=e.childNodes.indexOf(n);i>=0?e.childNodes.splice(i,0,t):e.childNodes.push(t)};const r=(e,t)=>{t.parentNode=null;const n=e.childNodes.indexOf(t);n>=0&&e.childNodes.splice(n,1)};t.removeChildNode=r;t.setAttribute=(e,t,n)=>{e.attributes[t]=n};t.createTextNode=e=>({nodeName:"#text",nodeValue:e})},function(e,t,n){"use strict";var r=n(75),i=n(77),u=!1,o=null;if(i({},(function(e,t){if(!u){if(u=!0,e)throw e;o=t}})),!u)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");e.exports=r(o.bind,o.lib)},function(e,t,n){"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,l=o(e),s=1;s{const t=e||process.stderr;t.isTTY&&(i=!1,t.write("[?25h"))},t.hide=e=>{const t=e||process.stderr;t.isTTY&&(r(),i=!0,t.write("[?25l"))},t.toggle=(e,n)=>{void 0!==e&&(i=e),i?t.show(n):t.hide(n)}},function(e,t,n){var r,i=n(55),u=n(56),o=n(57);function a(){c&&(c=!1,u.forEach((function(e){try{process.removeListener(e,s[e])}catch(e){}})),process.emit=h,process.reallyExit=d,r.count-=1)}function l(e,t,n){r.emitted[e]||(r.emitted[e]=!0,r.emit(e,t,n))}"function"!=typeof o&&(o=o.EventEmitter),process.__signal_exit_emitter__?r=process.__signal_exit_emitter__:((r=process.__signal_exit_emitter__=new o).count=0,r.emitted={}),r.infinite||(r.setMaxListeners(1/0),r.infinite=!0),e.exports=function(e,t){i.equal(typeof e,"function","a callback must be provided for exit handler"),!1===c&&f();var n="exit";t&&t.alwaysLast&&(n="afterexit");return r.on(n,e),function(){r.removeListener(n,e),0===r.listeners("exit").length&&0===r.listeners("afterexit").length&&a()}},e.exports.unload=a;var s={};u.forEach((function(e){s[e]=function(){process.listeners(e).length===r.count&&(a(),l("exit",null,e),l("afterexit",null,e),process.kill(process.pid,e))}})),e.exports.signals=function(){return u},e.exports.load=f;var c=!1;function f(){c||(c=!0,r.count+=1,u=u.filter((function(e){try{return process.on(e,s[e]),!0}catch(e){return!1}})),process.emit=m,process.reallyExit=p)}var d=process.reallyExit;function p(e){process.exitCode=e||0,l("exit",process.exitCode,null),l("afterexit",process.exitCode,null),d.call(process,process.exitCode)}var h=process.emit;function m(e,t){if("exit"===e){void 0!==t&&(process.exitCode=t);var n=h.apply(this,arguments);return l("exit",process.exitCode,null),l("afterexit",process.exitCode,null),n}return h.apply(this,arguments)}},function(e,t,n){"use strict";const r=n(58),i=n(18),u=n(19),o=new Set(["","›"]),a=e=>`${o.values().next().value}[${e}m`,l=(e,t,n)=>{const u=[...t];let a=!1,l=r(i(e[e.length-1]));for(const[t,i]of u.entries()){const s=r(i);if(l+s<=n?e[e.length-1]+=i:(e.push(i),l=0),o.has(i))a=!0;else if(a&&"m"===i){a=!1;continue}a||(l+=s)===n&&t0&&e.length>1&&(e[e.length-2]+=e.pop())},s=e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(r(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},c=(e,t,n={})=>{if(!1!==n.trim&&""===e.trim())return"";let i,c="",f="";const d=(e=>e.split(" ").map(e=>r(e)))(e);let p=[""];for(const[i,u]of e.split(" ").entries()){!1!==n.trim&&(p[p.length-1]=p[p.length-1].trimLeft());let e=r(p[p.length-1]);if(0!==i&&(e>=t&&(!1===n.wordWrap||!1===n.trim)&&(p.push(""),e=0),(e>0||!1===n.trim)&&(p[p.length-1]+=" ",e++)),n.hard&&d[i]>t){const n=t-e,r=1+Math.floor((d[i]-n-1)/t);Math.floor((d[i]-1)/t)t&&e>0&&d[i]>0){if(!1===n.wordWrap&&et&&!1===n.wordWrap?l(p,u,t):p[p.length-1]+=u}}!1!==n.trim&&(p=p.map(s)),c=p.join("\n");for(const[e,t]of[...c].entries()){if(f+=t,o.has(t)){const t=parseFloat(/\d[^m]*/.exec(c.slice(e,e+4)));i=39===t?null:t}const n=u.codes.get(Number(i));i&&n&&("\n"===c[e+1]?f+=a(n):"\n"===t&&(f+=a(i)))}return f};e.exports=(e,t,n)=>String(e).normalize().split("\n").map(e=>c(e,t,n)).join("\n")},function(e,t,n){"use strict";const r=n(59);e.exports=e=>"string"==typeof e?e.replace(r(),""):e},function(e,t,n){"use strict";(function(e){const t=n(61),r=(e,n)=>(function(){const r=e.apply(t,arguments);return`[${r+n}m`}),i=(e,n)=>(function(){const r=e.apply(t,arguments);return`[${38+n};5;${r}m`}),u=(e,n)=>(function(){const r=e.apply(t,arguments);return`[${38+n};2;${r[0]};${r[1]};${r[2]}m`});Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,n={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};n.color.grey=n.color.gray;for(const t of Object.keys(n)){const r=n[t];for(const t of Object.keys(r)){const i=r[t];n[t]={open:`[${i[0]}m`,close:`[${i[1]}m`},r[t]=n[t],e.set(i[0],i[1])}Object.defineProperty(n,t,{value:r,enumerable:!1}),Object.defineProperty(n,"codes",{value:e,enumerable:!1})}const o=e=>e,a=(e,t,n)=>[e,t,n];n.color.close="",n.bgColor.close="",n.color.ansi={ansi:r(o,0)},n.color.ansi256={ansi256:i(o,0)},n.color.ansi16m={rgb:u(a,0)},n.bgColor.ansi={ansi:r(o,10)},n.bgColor.ansi256={ansi256:i(o,10)},n.bgColor.ansi16m={rgb:u(a,10)};for(let e of Object.keys(t)){if("object"!=typeof t[e])continue;const o=t[e];"ansi16"===e&&(e="ansi"),"ansi16"in o&&(n.color.ansi[e]=r(o.ansi16,0),n.bgColor.ansi[e]=r(o.ansi16,10)),"ansi256"in o&&(n.color.ansi256[e]=i(o.ansi256,0),n.bgColor.ansi256[e]=i(o.ansi256,10)),"rgb"in o&&(n.color.ansi16m[e]=u(o.rgb,0),n.bgColor.ansi16m[e]=u(o.rgb,10))}return n}})}).call(this,n(20)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(62),i={};for(var u in r)r.hasOwnProperty(u)&&(i[r[u]]=u);var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in o)if(o.hasOwnProperty(a)){if(!("channels"in o[a]))throw new Error("missing channels property: "+a);if(!("labels"in o[a]))throw new Error("missing channel labels property: "+a);if(o[a].labels.length!==o[a].channels)throw new Error("channel and label counts mismatch: "+a);var l=o[a].channels,s=o[a].labels;delete o[a].channels,delete o[a].labels,Object.defineProperty(o[a],"channels",{value:l}),Object.defineProperty(o[a],"labels",{value:s})}o.rgb.hsl=function(e){var t,n,r=e[0]/255,i=e[1]/255,u=e[2]/255,o=Math.min(r,i,u),a=Math.max(r,i,u),l=a-o;return a===o?t=0:r===a?t=(i-u)/l:i===a?t=2+(u-r)/l:u===a&&(t=4+(r-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),n=(o+a)/2,[t,100*(a===o?0:n<=.5?l/(a+o):l/(2-a-o)),100*n]},o.rgb.hsv=function(e){var t,n,r,i,u,o=e[0]/255,a=e[1]/255,l=e[2]/255,s=Math.max(o,a,l),c=s-Math.min(o,a,l),f=function(e){return(s-e)/6/c+.5};return 0===c?i=u=0:(u=c/s,t=f(o),n=f(a),r=f(l),o===s?i=r-n:a===s?i=1/3+t-r:l===s&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*u,100*s]},o.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[o.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(n,r))),100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},o.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-i)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-i-t)/(1-t)||0),100*t]},o.rgb.keyword=function(e){var t=i[e];if(t)return t;var n,u,o,a=1/0;for(var l in r)if(r.hasOwnProperty(l)){var s=r[l],c=(u=e,o=s,Math.pow(u[0]-o[0],2)+Math.pow(u[1]-o[1],2)+Math.pow(u[2]-o[2],2));c.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},o.rgb.lab=function(e){var t=o.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},o.hsl.rgb=function(e){var t,n,r,i,u,o=e[0]/360,a=e[1]/100,l=e[2]/100;if(0===a)return[u=255*l,u,u];t=2*l-(n=l<.5?l*(1+a):l+a-l*a),i=[0,0,0];for(var s=0;s<3;s++)(r=o+1/3*-(s-1))<0&&r++,r>1&&r--,u=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[s]=255*u;return i},o.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,i=n,u=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=u<=1?u:2-u,[t,100*(0===r?2*i/(u+i):2*n/(r+n)),100*((r+n)/2)]},o.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,u=t-Math.floor(t),o=255*r*(1-n),a=255*r*(1-n*u),l=255*r*(1-n*(1-u));switch(r*=255,i){case 0:return[r,l,o];case 1:return[a,r,o];case 2:return[o,r,l];case 3:return[o,a,r];case 4:return[l,o,r];case 5:return[r,o,a]}},o.hsv.hsl=function(e){var t,n,r,i=e[0],u=e[1]/100,o=e[2]/100,a=Math.max(o,.01);return r=(2-u)*o,n=u*a,[i,100*(n=(n/=(t=(2-u)*a)<=1?t:2-t)||0),100*(r/=2)]},o.hwb.rgb=function(e){var t,n,r,i,u,o,a,l=e[0]/360,s=e[1]/100,c=e[2]/100,f=s+c;switch(f>1&&(s/=f,c/=f),r=6*l-(t=Math.floor(6*l)),0!=(1&t)&&(r=1-r),i=s+r*((n=1-c)-s),t){default:case 6:case 0:u=n,o=i,a=s;break;case 1:u=i,o=n,a=s;break;case 2:u=s,o=n,a=i;break;case 3:u=s,o=i,a=n;break;case 4:u=i,o=s,a=n;break;case 5:u=n,o=s,a=i}return[255*u,255*o,255*a]},o.cmyk.rgb=function(e){var t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},o.xyz.rgb=function(e){var t,n,r,i=e[0]/100,u=e[1]/100,o=e[2]/100;return n=-.9689*i+1.8758*u+.0415*o,r=.0557*i+-.204*u+1.057*o,t=(t=3.2406*i+-1.5372*u+-.4986*o)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},o.xyz.lab=function(e){var t=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},o.lab.xyz=function(e){var t,n,r,i=e[0];t=e[1]/500+(n=(i+16)/116),r=n-e[2]/200;var u=Math.pow(n,3),o=Math.pow(t,3),a=Math.pow(r,3);return n=u>.008856?u:(n-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},o.lab.lch=function(e){var t,n=e[0],r=e[1],i=e[2];return(t=360*Math.atan2(i,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+i*i),t]},o.lch.lab=function(e){var t,n=e[0],r=e[1];return t=e[2]/360*2*Math.PI,[n,r*Math.cos(t),r*Math.sin(t)]},o.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];if(0===(i=Math.round(i/50)))return 30;var u=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(u+=60),u},o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])},o.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},o.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},o.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},o.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},o.rgb.hcg=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255,u=Math.max(Math.max(n,r),i),o=Math.min(Math.min(n,r),i),a=u-o;return t=a<=0?0:u===n?(r-i)/a%6:u===r?2+(i-n)/a:4+(n-r)/a+4,t/=6,[360*(t%=1),100*a,100*(a<1?o/(1-a):0)]},o.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,i=0;return(r=n<.5?2*t*n:2*t*(1-n))<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},o.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var i,u=[0,0,0],o=t%1*6,a=o%1,l=1-a;switch(Math.floor(o)){case 0:u[0]=1,u[1]=a,u[2]=0;break;case 1:u[0]=l,u[1]=1,u[2]=0;break;case 2:u[0]=0,u[1]=1,u[2]=a;break;case 3:u[0]=0,u[1]=l,u[2]=1;break;case 4:u[0]=a,u[1]=0,u[2]=1;break;default:u[0]=1,u[1]=0,u[2]=l}return i=(1-n)*r,[255*(n*u[0]+i),255*(n*u[1]+i),255*(n*u[2]+i)]},o.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},o.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},o.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},o.hwb.hcg=function(e){var t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]},o.gray.hwb=function(e){return[0,100,e[0]]},o.gray.cmyk=function(e){return[0,0,0,e[0]]},o.gray.lab=function(e){return[e[0],0,0]},o.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},o.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},function(e,t,n){"use strict";const r=n(80);e.exports=e=>"string"==typeof e?e.replace(r(),""):e},function(e,t,n){"use strict";const r=n(11),i=["","›"],u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,o=new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[90,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49]]),a=e=>`${i[0]}[${e}m`;e.exports=(e,t,n)=>{const l=Array.from(e.normalize());n="number"==typeof n?n:l.length;let s,c=!1,f=0,d="";for(const p of l.entries()){const l=p[0],h=p[1];let m=!1;if(-1!==i.indexOf(h)){c=!0;const t=/\d[^m]*/.exec(e.slice(l,l+4));s=39===t?null:t}else c&&"m"===h&&(c=!1,m=!0);if(c||m||++f,!u.test(h)&&r(h.codePointAt())&&++f,f>t&&f<=n)d+=h;else if(f!==t||c||void 0===s||39===s){if(f>=n){void 0!==s&&(d+=a(o.get(parseInt(s,10))||39));break}}else d+=a(s)}return d}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(25))&&r.__esModule?r:{default:r};t.default=e=>{return{width:(0,i.default)(e),height:e.split("\n").length}}},function(e,t,n){"use strict";const r=n(26);e.exports=e=>{let t=0;for(const n of e.split("\n"))t=Math.max(t,r(n));return t}},function(e,t,n){"use strict";const r=n(22),i=n(11);e.exports=e=>{if("string"!=typeof e||0===e.length)return 0;e=r(e);let t=0;for(let n=0;n=127&&r<=159||(r>=768&&r<=879||(r>65535&&n++,t+=i(r)?2:1))}return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(17)),i=u(n(85));function u(e){return e&&e.__esModule?e:{default:e}}t.default=(e,t,{textWrap:n}={})=>{if("wrap"===n)return(0,r.default)(e,t,{trim:!1,hard:!0});if(String(n).startsWith("truncate")){let r;return"truncate"!==n&&"truncate-end"!==n||(r="end"),"truncate-middle"===n&&(r="middle"),"truncate-start"===n&&(r="start"),(0,i.default)(e,t,{position:r})}return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=e=>e.getComputedWidth()-2*e.getComputedPadding()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=new WeakMap;t.default=r},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=((r=n(0))&&r.__esModule?r:{default:r}).default.createContext({exit(){}});t.default=i},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=((r=n(0))&&r.__esModule?r:{default:r}).default.createContext({stdin:void 0,setRawMode:void 0});t.default=i},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=((r=n(0))&&r.__esModule?r:{default:r}).default.createContext({stdout:void 0});t.default=i},function(e,t,n){"use strict";const r=n(92),i=n(19),u=n(93).stdout,o=n(95),a="win32"===process.platform&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),l=["ansi","ansi","ansi256","ansi16m"],s=new Set(["gray"]),c=Object.create(null);function f(e,t){t=t||{};const n=u?u.level:0;e.level=void 0===t.level?n:t.level,e.enabled="enabled"in t?t.enabled:e.level>0}function d(e){if(!this||!(this instanceof d)||this.template){const t={};return f(t,e),t.template=function(){const e=[].slice.call(arguments);return v.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,d.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=d,t.template}f(this,e)}a&&(i.blue.open="");for(const e of Object.keys(i))i[e].closeRe=new RegExp(r(i[e].close),"g"),c[e]={get(){const t=i[e];return h.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}};c.visible={get(){return h.call(this,this._styles||[],!0,"visible")}},i.color.closeRe=new RegExp(r(i.color.close),"g");for(const e of Object.keys(i.color.ansi))s.has(e)||(c[e]={get(){const t=this.level;return function(){const n=i.color[l[t]][e].apply(null,arguments),r={open:n,close:i.color.close,closeRe:i.color.closeRe};return h.call(this,this._styles?this._styles.concat(r):[r],this._empty,e)}}});i.bgColor.closeRe=new RegExp(r(i.bgColor.close),"g");for(const e of Object.keys(i.bgColor.ansi)){if(s.has(e))continue;c["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const t=this.level;return function(){const n=i.bgColor[l[t]][e].apply(null,arguments),r={open:n,close:i.bgColor.close,closeRe:i.bgColor.closeRe};return h.call(this,this._styles?this._styles.concat(r):[r],this._empty,e)}}}}const p=Object.defineProperties(()=>{},c);function h(e,t,n){const r=function(){return m.apply(r,arguments)};r._styles=e,r._empty=t;const i=this;return Object.defineProperty(r,"level",{enumerable:!0,get:()=>i.level,set(e){i.level=e}}),Object.defineProperty(r,"enabled",{enumerable:!0,get:()=>i.enabled,set(e){i.enabled=e}}),r.hasGrey=this.hasGrey||"gray"===n||"grey"===n,r.__proto__=p,r}function m(){const e=arguments,t=e.length;let n=String(arguments[0]);if(0===t)return"";if(t>1)for(let r=1;r1&&(i-=1)),[360*i,100*u,100*s]},u.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];return[u.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(n,r))),100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},u.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},u.rgb.keyword=function(e){const t=i[e];if(t)return t;let n,u=1/0;for(const t of Object.keys(r)){const i=r[t],l=(a=i,((o=e)[0]-a[0])**2+(o[1]-a[1])**2+(o[2]-a[2])**2);l.04045?((t+.055)/1.055)**2.4:t/12.92)+.3576*(n=n>.04045?((n+.055)/1.055)**2.4:n/12.92)+.1805*(r=r>.04045?((r+.055)/1.055)**2.4:r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},u.rgb.lab=function(e){const t=u.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];return[116*(r=(r/=100)>.008856?r**(1/3):7.787*r+16/116)-16,500*((n=(n/=95.047)>.008856?n**(1/3):7.787*n+16/116)-r),200*(r-(i=(i/=108.883)>.008856?i**(1/3):7.787*i+16/116))]},u.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,u,o;if(0===n)return[o=255*r,o,o];const a=2*r-(i=r<.5?r*(1+n):r+n-r*n),l=[0,0,0];for(let e=0;e<3;e++)(u=t+1/3*-(e-1))<0&&u++,u>1&&u--,o=6*u<1?a+6*(i-a)*u:2*u<1?i:3*u<2?a+(i-a)*(2/3-u)*6:a,l[e]=255*o;return l},u.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const u=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=u<=1?u:2-u,[t,100*(0===r?2*i/(u+i):2*n/(r+n)),100*((r+n)/2)]},u.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,u=t-Math.floor(t),o=255*r*(1-n),a=255*r*(1-n*u),l=255*r*(1-n*(1-u));switch(r*=255,i){case 0:return[r,l,o];case 1:return[a,r,o];case 2:return[o,r,l];case 3:return[o,a,r];case 4:return[l,o,r];case 5:return[r,o,a]}},u.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let u,o;o=(2-n)*r;const a=(2-n)*i;return u=n*i,[t,100*(u=(u/=a<=1?a:2-a)||0),100*(o/=2)]},u.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let u;i>1&&(n/=i,r/=i);const o=Math.floor(6*t),a=1-r;u=6*t-o,0!=(1&o)&&(u=1-u);const l=n+u*(a-n);let s,c,f;switch(o){default:case 6:case 0:s=a,c=l,f=n;break;case 1:s=l,c=a,f=n;break;case 2:s=n,c=a,f=l;break;case 3:s=n,c=l,f=a;break;case 4:s=l,c=n,f=a;break;case 5:s=a,c=n,f=l}return[255*s,255*c,255*f]},u.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},u.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,u,o;return i=(i=3.2406*t+-1.5372*n+-.4986*r)>.0031308?1.055*i**(1/2.4)-.055:12.92*i,u=(u=-.9689*t+1.8758*n+.0415*r)>.0031308?1.055*u**(1/2.4)-.055:12.92*u,o=(o=.0557*t+-.204*n+1.057*r)>.0031308?1.055*o**(1/2.4)-.055:12.92*o,[255*(i=Math.min(Math.max(0,i),1)),255*(u=Math.min(Math.max(0,u),1)),255*(o=Math.min(Math.max(0,o),1))]},u.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return[116*(n=(n/=100)>.008856?n**(1/3):7.787*n+16/116)-16,500*((t=(t/=95.047)>.008856?t**(1/3):7.787*t+16/116)-n),200*(n-(r=(r/=108.883)>.008856?r**(1/3):7.787*r+16/116))]},u.lab.xyz=function(e){let t,n,r;const i=(n=(e[0]+16)/116)**3,u=(t=e[1]/500+n)**3,o=(r=n-e[2]/200)**3;return n=i>.008856?i:(n-16/116)/7.787,t=u>.008856?u:(t-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},u.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;return(i=360*Math.atan2(r,n)/2/Math.PI)<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},u.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},u.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let o=null===t?u.rgb.hsv(e)[2]:t;if(0===(o=Math.round(o/50)))return 30;let a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===o&&(a+=60),a},u.hsv.ansi16=function(e){return u.rgb.ansi16(u.hsv.rgb(e),e[2])},u.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},u.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},u.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},u.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},u.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},u.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),u=Math.min(Math.min(t,n),r),o=i-u;let a,l;return l=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,l/=6,[360*(l%=1),100*o,100*(a=o<1?u/(1-o):0)]},u.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},u.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},u.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const i=[0,0,0],u=t%1*6,o=u%1,a=1-o;let l=0;switch(Math.floor(u)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},u.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},u.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},u.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},u.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},u.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},u.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},u.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},u.gray.hsl=function(e){return[0,0,e[0]]},u.gray.hsv=u.gray.hsl,u.gray.hwb=function(e){return[0,100,e[0]]},u.gray.cmyk=function(e){return[0,0,0,e[0]]},u.gray.lab=function(e){return[e[0],0,0]},u.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},u.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UncontrolledTextInput=t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var u=r?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=e[i]}n.default=e,t&&t.set(e,n);return n}(n(0)),i=a(n(43)),u=n(1),o=a(n(99));function a(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function s(){return(s=Object.assign||function(e){for(var t=1;t{const{value:t,focus:n,showCursor:r,mask:i,onChange:u,onSubmit:o}=this.props,{cursorOffset:a}=this.state;if(!1===n||!1===this.isMounted)return;const l=String(e);if(l===f||l===d||l===v)return;if(l===m)return void(o&&o(t));let s=a,c=t,y=0;l===p?r&&!i&&s--:l===h?r&&!i&&s++:l===b||l===g?(c=c.slice(0,s-1)+c.slice(s,c.length),s--):(c=c.slice(0,s)+l+c.slice(s,c.length),s+=l.length,l.length>1&&(y=l.length)),s<0&&(s=0),s>c.length&&(s=c.length),this.setState({cursorOffset:s,cursorWidth:y}),c!==t&&u(c)})}render(){const{value:e,placeholder:t,showCursor:n,focus:i,mask:a,highlightPastedText:l}=this.props,{cursorOffset:s,cursorWidth:c}=this.state,f=e.length>0;let d=e;const p=l?c:0;if(n&&!a&&i){d=e.length>0?"":o.default.inverse(" ");let t=0;for(const n of e)d+=t>=s-p&&t<=s?o.default.inverse(n):n,t++;e.length>0&&s===e.length&&(d+=o.default.inverse(" "))}return a&&(d=a.repeat(d.length)),r.default.createElement(u.Color,{dim:!f&&t},t?f?d:t:d)}componentDidMount(){const{stdin:e,setRawMode:t}=this.props;this.isMounted=!0,t(!0),e.on("data",this.handleInput)}componentWillUnmount(){const{stdin:e,setRawMode:t}=this.props;this.isMounted=!1,e.removeListener("data",this.handleInput),t(!1)}}c(y,"propTypes",{value:i.default.string.isRequired,placeholder:i.default.string,focus:i.default.bool,mask:i.default.string,highlightPastedText:i.default.bool,showCursor:i.default.bool,stdin:i.default.object.isRequired,setRawMode:i.default.func.isRequired,onChange:i.default.func.isRequired,onSubmit:i.default.func}),c(y,"defaultProps",{placeholder:"",showCursor:!0,focus:!0,mask:void 0,highlightPastedText:!1,onSubmit:void 0});class _ extends r.PureComponent{render(){return r.default.createElement(u.StdinContext.Consumer,null,({stdin:e,setRawMode:t})=>r.default.createElement(y,s({},this.props,{stdin:e,setRawMode:t})))}}t.default=_;class D extends r.PureComponent{constructor(...e){super(...e),c(this,"state",{value:""}),c(this,"setValue",this.setValue.bind(this))}setValue(e){this.setState({value:e})}render(){return r.default.createElement(_,s({},this.props,{value:this.state.value,onChange:this.setValue}))}}t.UncontrolledTextInput=D},function(e,t,n){const r=n(109);e.exports=r,e.exports.default=r},function(e,t){e.exports=require("crypto")},function(e,t){e.exports=require("url")},function(e,t){e.exports=require("@yarnpkg/plugin-essentials")},function(e,t){e.exports=require("semver")},function(e,t,n){"use strict"; +/** @license React v16.13.1 + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var r=n(14),i="function"==typeof Symbol&&Symbol.for,u=i?Symbol.for("react.element"):60103,o=i?Symbol.for("react.portal"):60106,a=i?Symbol.for("react.fragment"):60107,l=i?Symbol.for("react.strict_mode"):60108,s=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,f=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,h=i?Symbol.for("react.memo"):60115,m=i?Symbol.for("react.lazy"):60116,v="function"==typeof Symbol&&Symbol.iterator;function b(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nO.length&&O.push(e)}function R(e,t,n){return null==e?0:function e(t,n,r,i){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var l=!1;if(null===t)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case u:case o:l=!0}}if(l)return r(i,t,""===n?"."+I(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var s=0;s{let n;return"function"==typeof t.write&&(t={stdout:t,stdin:process.stdin}),t=function(e){for(var t=1;tn.unmount(),waitUntilExit:n.waitUntilExit,cleanup:()=>i.default.delete(t.stdout)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=h(n(0)),i=h(n(48)),u=h(n(49)),o=h(n(50)),a=h(n(64)),l=h(n(16)),s=h(n(67)),c=h(n(74)),f=n(12),d=h(n(29)),p=h(n(86));function h(e){return e&&e.__esModule?e:{default:e}}t.default=class{constructor(e){(0,u.default)(this),this.options=e,this.rootNode=(0,f.createNode)("root"),this.rootNode.onRender=this.onRender,this.renderer=(0,c.default)({terminalWidth:e.stdout.columns}),this.log=o.default.create(e.stdout),this.throttledLog=e.debug?this.log:(0,i.default)(this.log,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=s.default.createContainer(this.rootNode,!1,!1),this.exitPromise=new Promise((e,t)=>{this.resolveExitPromise=e,this.rejectExitPromise=t}),this.unsubscribeExit=(0,l.default)(this.unmount,{alwaysLast:!1})}onRender(){if(this.isUnmounted)return;const{output:e,staticOutput:t}=this.renderer(this.rootNode),n=t&&"\n"!==t;if(this.options.debug)return n&&(this.fullStaticOutput+=t),void this.options.stdout.write(this.fullStaticOutput+e);n&&(a.default||this.log.clear(),this.options.stdout.write(t),a.default||this.log(e)),e!==this.lastOutput&&(a.default||this.throttledLog(e),this.lastOutput=e)}render(e){const t=r.default.createElement(p.default,{stdin:this.options.stdin,stdout:this.options.stdout,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},e);s.default.updateContainer(t,this.container)}unmount(e){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),a.default?this.options.stdout.write(this.lastOutput+"\n"):this.options.debug||this.log.done(),this.isUnmounted=!0,s.default.updateContainer(null,this.container),d.default.delete(this.options.stdout),e instanceof Error?this.rejectExitPromise(e):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise}}},function(e,t){var n="Expected a function",r=NaN,i="[object Symbol]",u=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof global&&global&&global.Object===Object&&global,f="object"==typeof self&&self&&self.Object===Object&&self,d=c||f||Function("return this")(),p=Object.prototype.toString,h=Math.max,m=Math.min,v=function(){return d.Date.now()};function b(e,t,r){var i,u,o,a,l,s,c=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError(n);function b(t){var n=i,r=u;return i=u=void 0,c=t,a=e.apply(r,n)}function _(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-c>=o}function D(){var e=v();if(_(e))return w(e);l=setTimeout(D,function(e){var n=t-(e-s);return d?m(n,o-(e-c)):n}(e))}function w(e){return l=void 0,p&&i?b(e):(i=u=void 0,a)}function E(){var e=v(),n=_(e);if(i=arguments,u=this,s=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(D,t),f?b(e):a}(s);if(d)return l=setTimeout(D,t),b(s)}return void 0===l&&(l=setTimeout(D,t)),a}return t=y(t)||0,g(r)&&(f=!!r.leading,o=(d="maxWait"in r)?h(y(r.maxWait)||0,t):o,p="trailing"in r?!!r.trailing:p),E.cancel=function(){void 0!==l&&clearTimeout(l),c=0,i=s=u=l=void 0},E.flush=function(){return void 0===l?a:w(v())},E}function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&p.call(e)==i}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(u,"");var n=a.test(e);return n||l.test(e)?s(e.slice(2),n?2:8):o.test(e)?r:+e}e.exports=function(e,t,r){var i=!0,u=!0;if("function"!=typeof e)throw new TypeError(n);return g(r)&&(i="leading"in r?!!r.leading:i,u="trailing"in r?!!r.trailing:u),b(e,t,{leading:i,maxWait:t,trailing:u})}},function(e,t,n){"use strict";e.exports=(e,t)=>{t=Object.assign({},t);const n=e=>{const n=t=>"string"==typeof t?e===t:t.test(e);return t.include?t.include.some(n):!t.exclude||!t.exclude.some(n)};for(const[t,r]of(e=>{const t=new Set;do{for(const n of Reflect.ownKeys(e))t.add([e,n])}while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t})(e.constructor.prototype)){if("constructor"===r||!n(r))continue;const i=Reflect.getOwnPropertyDescriptor(t,r);i&&"function"==typeof i.value&&(e[r]=e[r].bind(e))}return e};const r=["componentWillMount","UNSAFE_componentWillMount","render","getSnapshotBeforeUpdate","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","componentDidUpdate","componentWillUnmount","componentDidCatch","setState","forceUpdate"];e.exports.react=(t,n)=>((n=Object.assign({},n)).exclude=(n.exclude||[]).concat(r),e.exports(t,n))},function(e,t,n){"use strict";const r=n(51),i=n(15),u=n(17),o=(e,t)=>{t=Object.assign({showCursor:!1},t);let n=0;const o=(...o)=>{t.showCursor||i.hide();let a=o.join(" ")+"\n";a=u(a,(e=>{const{columns:t}=e;return t?"win32"===process.platform?t-1:t:80})(e),{trim:!1,hard:!0,wordWrap:!1}),e.write(r.eraseLines(n)+a),n=a.split("\n").length};return o.clear=()=>{e.write(r.eraseLines(n)),n=0},o.done=()=>{n=0,t.showCursor||i.show()},o};e.exports=o(process.stdout),e.exports.default=e.exports,e.exports.stderr=o(process.stderr),e.exports.create=o},function(e,t,n){"use strict";const r=e.exports,i="[",u="]",o="",a=";",l="Apple_Terminal"===process.env.TERM_PROGRAM;r.cursorTo=(e,t)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");return"number"!=typeof t?i+(e+1)+"G":i+(t+1)+";"+(e+1)+"H"},r.cursorMove=(e,t)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");let n="";return e<0?n+=i+-e+"D":e>0&&(n+=i+e+"C"),t<0?n+=i+-t+"A":t>0&&(n+=i+t+"B"),n},r.cursorUp=e=>i+("number"==typeof e?e:1)+"A",r.cursorDown=e=>i+("number"==typeof e?e:1)+"B",r.cursorForward=e=>i+("number"==typeof e?e:1)+"C",r.cursorBackward=e=>i+("number"==typeof e?e:1)+"D",r.cursorLeft="",r.cursorSavePosition=i+(l?"7":"s"),r.cursorRestorePosition=i+(l?"8":"u"),r.cursorGetPosition="",r.cursorNextLine="",r.cursorPrevLine="",r.cursorHide="[?25l",r.cursorShow="[?25h",r.eraseLines=e=>{let t="";for(let n=0;n[u,"8",a,a,t,o,e,u,"8",a,a,o].join(""),r.image=(e,t)=>{let n=u+"1337;File=inline=1";return(t=t||{}).width&&(n+=`;width=${t.width}`),t.height&&(n+=`;height=${t.height}`),!1===t.preserveAspectRatio&&(n+=";preserveAspectRatio=0"),n+":"+e.toString("base64")+o},r.iTerm={},r.iTerm.setCwd=e=>u+"50;CurrentDir="+(e||process.cwd())+o},function(e,t,n){"use strict";const r=n(53),i=n(16);e.exports=r(()=>{i(()=>{process.stderr.write("[?25h")},{alwaysLast:!0})})},function(e,t,n){"use strict";const r=n(54);e.exports=(e,t)=>{if(!0===t)throw new TypeError("The second argument is now an options object");if("function"!=typeof e)throw new TypeError("Expected a function");let n;t=t||{};let i=!1;const u=e.displayName||e.name||"",o=function(){if(i){if(!0===t.throw)throw new Error(`Function \`${u}\` can only be called once`);return n}return i=!0,n=e.apply(this,arguments),e=null,n};return r(o,e),o}},function(e,t,n){"use strict";e.exports=(e,t)=>{for(const n of Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e}},function(e,t){e.exports=require("assert")},function(e,t){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},function(e,t){e.exports=require("events")},function(e,t,n){"use strict";const r=n(18),i=n(11),u=n(60)();e.exports=e=>{if("string"!=typeof(e=e.replace(u," "))||0===e.length)return 0;e=r(e);let t=0;for(let n=0;n=127&&r<=159||(r>=768&&r<=879||(r>65535&&n++,t+=i(r)?2:1))}return t}},function(e,t,n){"use strict";e.exports=e=>{e=Object.assign({onlyFirst:!1},e);const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e.onlyFirst?void 0:"g")}},function(e,t,n){"use strict";e.exports=function(){return/\uD83C\uDFF4(?:\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74)\uDB40\uDC7F|\u200D\u2620\uFE0F)|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|\uD83D\uDC69\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83D\uDC69\u200D[\u2695\u2696\u2708])\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC68(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g}},function(e,t,n){var r=n(21),i=n(63),u={};Object.keys(r).forEach((function(e){u[e]={},Object.defineProperty(u[e],"channels",{value:r[e].channels}),Object.defineProperty(u[e],"labels",{value:r[e].labels});var t=i(e);Object.keys(t).forEach((function(n){var r=t[n];u[e][n]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var r=n.length,i=0;i1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)}))})),e.exports=u},function(e,t,n){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(e,t,n){var r=n(21);function i(e){var t=function(){for(var e={},t=Object.keys(r),n=t.length,i=0;i!0,prepareForCommit:()=>{},resetAfterCommit:e=>{e.onRender()},getChildHostContext:()=>!0,shouldSetTextContent:(e,t)=>"string"==typeof t.children||"number"==typeof t.children,createInstance:(e,t)=>{const n=(0,o.createNode)(e);for(const[r,i]of Object.entries(t))if("children"===r){if("string"==typeof i||"number"==typeof i){if("div"===e){const e=(0,o.createNode)("div");e.textContent=String(i),(0,o.appendChildNode)(n,e)}"span"===e&&(n.textContent=String(i))}}else"style"===r?Object.assign(n.style,i):"unstable__transformChildren"===r?n.unstable__transformChildren=i:"unstable__static"===r?n.unstable__static=!0:(0,o.setAttribute)(n,r,i);return n},createTextInstance:o.createTextNode,resetTextContent:e=>{if(e.textContent&&(e.textContent=""),e.childNodes.length>0)for(const t of e.childNodes)t.yogaNode.free(),(0,o.removeChildNode)(e,t)},getPublicInstance:e=>e,appendInitialChild:o.appendChildNode,appendChild:o.appendChildNode,insertBefore:o.insertBeforeNode,finalizeInitialChildren:()=>{},supportsMutation:!0,appendChildToContainer:o.appendChildNode,insertInContainerBefore:o.insertBeforeNode,removeChildFromContainer:o.removeChildNode,prepareUpdate:()=>!0,commitUpdate:(e,t,n,r,i)=>{for(const[t,r]of Object.entries(i))if("children"===t){if("string"==typeof r||"number"==typeof r){if("div"===n)if(0===e.childNodes.length){const t=(0,o.createNode)("div");t.textContent=String(r),(0,o.appendChildNode)(e,t)}else e.childNodes[0].textContent=String(r);"span"===n&&(e.textContent=String(r))}}else"style"===t?Object.assign(e.style,r):"unstable__transformChildren"===t?e.unstable__transformChildren=r:"unstable__static"===t?e.unstable__static=!0:(0,o.setAttribute)(e,t,r)},commitTextUpdate:(e,t,n)=>{"#text"===e.nodeName?e.nodeValue=n:e.textContent=n},removeChild:o.removeChildNode};var l=(0,u.default)(a);t.default=l},function(e,t,n){"use strict";e.exports=n(69)},function(e,t,n){"use strict"; +/** @license React v0.13.4 + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */Object.defineProperty(t,"__esModule",{value:!0});var r=null,i=!1,u=3,o=-1,a=-1,l=!1,s=!1;function c(){if(!l){var e=r.expirationTime;s?T():s=!0,E(p,e)}}function f(){var e=r,t=r.next;if(r===t)r=null;else{var n=r.previous;r=n.next=t,t.previous=n}e.next=e.previous=null,n=e.callback,t=e.expirationTime,e=e.priorityLevel;var i=u,o=a;u=e,a=t;try{var l=n()}finally{u=i,a=o}if("function"==typeof l)if(l={callback:l,priorityLevel:e,expirationTime:t,next:null,previous:null},null===r)r=l.next=l.previous=l;else{n=null,e=r;do{if(e.expirationTime>=t){n=e;break}e=e.next}while(e!==r);null===n?n=r:n===r&&(r=l,c()),(t=n.previous).next=n.previous=l,l.next=n,l.previous=t}}function d(){if(-1===o&&null!==r&&1===r.priorityLevel){l=!0;try{do{f()}while(null!==r&&1===r.priorityLevel)}finally{l=!1,null!==r?c():s=!1}}}function p(e){l=!0;var n=i;i=e;try{if(e)for(;null!==r;){var u=t.unstable_now();if(!(r.expirationTime<=u))break;do{f()}while(null!==r&&r.expirationTime<=u)}else if(null!==r)do{f()}while(null!==r&&!C())}finally{l=!1,i=n,null!==r?c():s=!1,d()}}var h,m,v=Date,b="function"==typeof setTimeout?setTimeout:void 0,g="function"==typeof clearTimeout?clearTimeout:void 0,y="function"==typeof requestAnimationFrame?requestAnimationFrame:void 0,_="function"==typeof cancelAnimationFrame?cancelAnimationFrame:void 0;function D(e){h=y((function(t){g(m),e(t)})),m=b((function(){_(h),e(t.unstable_now())}),100)}if("object"==typeof performance&&"function"==typeof performance.now){var w=performance;t.unstable_now=function(){return w.now()}}else t.unstable_now=function(){return v.now()};var E,T,C,k=null;if("undefined"!=typeof window?k=window:"undefined"!=typeof global&&(k=global),k&&k._schedMock){var M=k._schedMock;E=M[0],T=M[1],C=M[2],t.unstable_now=M[3]}else if("undefined"==typeof window||"function"!=typeof MessageChannel){var S=null,x=function(e){if(null!==S)try{S(e)}finally{S=null}};E=function(e){null!==S?setTimeout(E,0,e):(S=e,setTimeout(x,0,!1))},T=function(){S=null},C=function(){return!1}}else{"undefined"!=typeof console&&("function"!=typeof y&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof _&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var O=null,A=!1,P=-1,R=!1,I=!1,N=0,F=33,L=33;C=function(){return N<=t.unstable_now()};var B=new MessageChannel,j=B.port2;B.port1.onmessage=function(){A=!1;var e=O,n=P;O=null,P=-1;var r=t.unstable_now(),i=!1;if(0>=N-r){if(!(-1!==n&&n<=r))return R||(R=!0,D(U)),O=e,void(P=n);i=!0}if(null!==e){I=!0;try{e(i)}finally{I=!1}}};var U=function(e){if(null!==O){D(U);var t=e-N+L;tt&&(t=8),L=tt?j.postMessage(void 0):R||(R=!0,D(U))},T=function(){O=null,A=!1,P=-1}}t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=u,i=o;u=e,o=t.unstable_now();try{return n()}finally{u=r,o=i,d()}},t.unstable_next=function(e){switch(u){case 1:case 2:case 3:var n=3;break;default:n=u}var r=u,i=o;u=n,o=t.unstable_now();try{return e()}finally{u=r,o=i,d()}},t.unstable_scheduleCallback=function(e,n){var i=-1!==o?o:t.unstable_now();if("object"==typeof n&&null!==n&&"number"==typeof n.timeout)n=i+n.timeout;else switch(u){case 1:n=i+-1;break;case 2:n=i+250;break;case 5:n=i+1073741823;break;case 4:n=i+1e4;break;default:n=i+5e3}if(e={callback:e,priorityLevel:u,expirationTime:n,next:null,previous:null},null===r)r=e.next=e.previous=e,c();else{i=null;var a=r;do{if(a.expirationTime>n){i=a;break}a=a.next}while(a!==r);null===i?i=r:i===r&&(r=e,c()),(n=i.previous).next=i.previous=e,e.next=i,e.previous=n}return e},t.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)r=null;else{e===r&&(r=t);var n=e.previous;n.next=t,t.previous=n}e.next=e.previous=null}},t.unstable_wrapCallback=function(e){var n=u;return function(){var r=u,i=o;u=n,o=t.unstable_now();try{return e.apply(this,arguments)}finally{u=r,o=i,d()}}},t.unstable_getCurrentPriorityLevel=function(){return u},t.unstable_shouldYield=function(){return!i&&(null!==r&&r.expirationTimeAe||(e.current=Oe[Ae],Oe[Ae]=null,Ae--)}function Re(e,t){Oe[++Ae]=e.current,e.current=t}var Ie={},Ne={current:Ie},Fe={current:!1},Le=Ie;function Be(e,t){var n=e.type.contextTypes;if(!n)return Ie;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,u={};for(i in n)u[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=u),u}function je(e){return null!=(e=e.childContextTypes)}function Ue(e){Pe(Fe),Pe(Ne)}function We(e){Pe(Fe),Pe(Ne)}function ze(e,t,n){Ne.current!==Ie&&a("168"),Re(Ne,t),Re(Fe,n)}function qe(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var u in r=r.getChildContext())u in e||a("108",T(t)||"Unknown",u);return i({},n,r)}function He(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Ie,Le=Ne.current,Re(Ne,t),Re(Fe,Fe.current),!0}function Ge(e,t,n){var r=e.stateNode;r||a("169"),n?(t=qe(e,t,Le),r.__reactInternalMemoizedMergedChildContext=t,Pe(Fe),Pe(Ne),Re(Ne,t)):Pe(Fe),Re(Fe,n)}var Ve=null,Ye=null;function $e(e){return function(t){try{return e(t)}catch(e){}}}function Ke(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.contextDependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Xe(e,t,n,r){return new Ke(e,t,n,r)}function Je(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Qe(e,t){var n=e.alternate;return null===n?((n=Xe(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,n.contextDependencies=e.contextDependencies,n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ze(e,t,n,r,i,u){var o=2;if(r=e,"function"==typeof e)Je(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case d:return et(n.children,i,u,t);case b:return tt(n,3|i,u,t);case p:return tt(n,2|i,u,t);case h:return(e=Xe(12,n,t,4|i)).elementType=h,e.type=h,e.expirationTime=u,e;case y:return(e=Xe(13,n,t,i)).elementType=y,e.type=y,e.expirationTime=u,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case m:o=10;break e;case v:o=9;break e;case g:o=11;break e;case _:o=14;break e;case D:o=16,r=null;break e}a("130",null==e?e:typeof e,"")}return(t=Xe(o,n,t,i)).elementType=e,t.type=r,t.expirationTime=u,t}function et(e,t,n,r){return(e=Xe(7,e,r,t)).expirationTime=n,e}function tt(e,t,n,r){return e=Xe(8,e,r,t),t=0==(1&t)?p:b,e.elementType=t,e.type=t,e.expirationTime=n,e}function nt(e,t,n){return(e=Xe(6,e,null,t)).expirationTime=n,e}function rt(e,t,n){return(t=Xe(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function it(e,t){e.didError=!1;var n=e.earliestPendingTime;0===n?e.earliestPendingTime=e.latestPendingTime=t:nt&&(e.latestPendingTime=t),at(t,e)}function ut(e,t){e.didError=!1,e.latestPingedTime>=t&&(e.latestPingedTime=0);var n=e.earliestPendingTime,r=e.latestPendingTime;n===t?e.earliestPendingTime=r===t?e.latestPendingTime=0:r:r===t&&(e.latestPendingTime=n),n=e.earliestSuspendedTime,r=e.latestSuspendedTime,0===n?e.earliestSuspendedTime=e.latestSuspendedTime=t:nt&&(e.latestSuspendedTime=t),at(t,e)}function ot(e,t){var n=e.earliestPendingTime;return n>t&&(t=n),(e=e.earliestSuspendedTime)>t&&(t=e),t}function at(e,t){var n=t.earliestSuspendedTime,r=t.latestSuspendedTime,i=t.earliestPendingTime,u=t.latestPingedTime;0===(i=0!==i?i:u)&&(0===e||re&&(e=n),t.nextExpirationTimeToWorkOn=i,t.expirationTime=e}function lt(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}var st=Object.prototype.hasOwnProperty;function ct(e,t){if(lt(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;rd?(p=f,f=null):p=f.sibling;var h=v(i,f,a[d],l);if(null===h){null===f&&(f=p);break}e&&f&&null===h.alternate&&t(i,f),o=u(h,o,d),null===c?s=h:c.sibling=h,c=h,f=p}if(d===a.length)return n(i,f),s;if(null===f){for(;dp?(h=d,d=null):h=d.sibling;var y=v(i,d,g.value,s);if(null===y){d||(d=h);break}e&&d&&null===y.alternate&&t(i,d),o=u(y,o,p),null===f?c=y:f.sibling=y,f=y,d=h}if(g.done)return n(i,d),c;if(null===d){for(;!g.done;p++,g=l.next())null!==(g=m(i,g.value,s))&&(o=u(g,o,p),null===f?c=g:f.sibling=g,f=g);return c}for(d=r(i,d);!g.done;p++,g=l.next())null!==(g=b(d,i,p,g.value,s))&&(e&&null!==g.alternate&&d.delete(null===g.key?p:g.key),o=u(g,o,p),null===f?c=g:f.sibling=g,f=g);return e&&d.forEach((function(e){return t(i,e)})),c}return function(e,r,u,l){var s="object"==typeof u&&null!==u&&u.type===d&&null===u.key;s&&(u=u.props.children);var p="object"==typeof u&&null!==u;if(p)switch(u.$$typeof){case c:e:{for(p=u.key,s=r;null!==s;){if(s.key===p){if(7===s.tag?u.type===d:s.elementType===u.type){n(e,s.sibling),(r=i(s,u.type===d?u.props.children:u.props)).ref=_t(e,s,u),r.return=e,e=r;break e}n(e,s);break}t(e,s),s=s.sibling}u.type===d?((r=et(u.props.children,e.mode,l,u.key)).return=e,e=r):((l=Ze(u.type,u.key,u.props,null,e.mode,l)).ref=_t(e,r,u),l.return=e,e=l)}return o(e);case f:e:{for(s=u.key;null!==r;){if(r.key===s){if(4===r.tag&&r.stateNode.containerInfo===u.containerInfo&&r.stateNode.implementation===u.implementation){n(e,r.sibling),(r=i(r,u.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=rt(u,e.mode,l)).return=e,e=r}return o(e)}if("string"==typeof u||"number"==typeof u)return u=""+u,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,u)).return=e,e=r):(n(e,r),(r=nt(u,e.mode,l)).return=e,e=r),o(e);if(yt(u))return g(e,r,u,l);if(E(u))return y(e,r,u,l);if(p&&Dt(e,u),void 0===u&&!s)switch(e.tag){case 1:case 0:a("152",(l=e.type).displayName||l.name||"Component")}return n(e,r)}}var Et=wt(!0),Tt=wt(!1),Ct={},kt={current:Ct},Mt={current:Ct},St={current:Ct};function xt(e){return e===Ct&&a("174"),e}function Ot(e,t){Re(St,t),Re(Mt,e),Re(kt,Ct),t=O(t),Pe(kt),Re(kt,t)}function At(e){Pe(kt),Pe(Mt),Pe(St)}function Pt(){return xt(kt.current)}function Rt(e){var t=xt(St.current),n=xt(kt.current);n!==(t=A(n,e.type,t))&&(Re(Mt,e),Re(kt,t))}function It(e){Mt.current===e&&(Pe(kt),Pe(Mt))}var Nt=0,Ft=2,Lt=4,Bt=8,jt=16,Ut=32,Wt=64,zt=128,qt=l.ReactCurrentDispatcher,Ht=0,Gt=null,Vt=null,Yt=null,$t=null,Kt=null,Xt=null,Jt=0,Qt=null,Zt=0,en=!1,tn=null,nn=0;function rn(){a("321")}function un(e,t){if(null===t)return!1;for(var n=0;nJt&&(Jt=f)):u=s.eagerReducer===e?s.eagerState:e(u,s.action),o=s,s=s.next}while(null!==s&&s!==r);c||(l=o,i=u),lt(u,t.memoizedState)||(An=!0),t.memoizedState=u,t.baseUpdate=l,t.baseState=i,n.lastRenderedState=u}return[t.memoizedState,n.dispatch]}function dn(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===Qt?(Qt={lastEffect:null}).lastEffect=e.next=e:null===(t=Qt.lastEffect)?Qt.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,Qt.lastEffect=e),e}function pn(e,t,n,r){var i=ln();Zt|=e,i.memoizedState=dn(t,n,void 0,void 0===r?null:r)}function hn(e,t,n,r){var i=sn();r=void 0===r?null:r;var u=void 0;if(null!==Vt){var o=Vt.memoizedState;if(u=o.destroy,null!==r&&un(r,o.deps))return void dn(Nt,n,u,r)}Zt|=e,i.memoizedState=dn(t,n,u,r)}function mn(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function vn(){}function bn(e,t,n){25>nn||a("301");var r=e.alternate;if(e===Gt||null!==r&&r===Gt)if(en=!0,e={expirationTime:Ht,action:n,eagerReducer:null,eagerState:null,next:null},null===tn&&(tn=new Map),void 0===(n=tn.get(t)))tn.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}else{ti();var i=Fi(),u={expirationTime:i=ai(i,e),action:n,eagerReducer:null,eagerState:null,next:null},o=t.last;if(null===o)u.next=u;else{var l=o.next;null!==l&&(u.next=l),o.next=u}if(t.last=u,0===e.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=t.lastRenderedReducer))try{var s=t.lastRenderedState,c=r(s,n);if(u.eagerReducer=r,u.eagerState=c,lt(c,s))return}catch(e){}fi(e,i)}}var gn={readContext:Jn,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useLayoutEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn},yn={readContext:Jn,useCallback:function(e,t){return ln().memoizedState=[e,void 0===t?null:t],e},useContext:Jn,useEffect:function(e,t){return pn(516,zt|Wt,e,t)},useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,pn(4,Lt|Ut,mn.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pn(4,Lt|Ut,e,t)},useMemo:function(e,t){var n=ln();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ln();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=bn.bind(null,Gt,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},ln().memoizedState=e},useState:function(e){var t=ln();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:cn,lastRenderedState:e}).dispatch=bn.bind(null,Gt,e),[t.memoizedState,e]},useDebugValue:vn},_n={readContext:Jn,useCallback:function(e,t){var n=sn();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&un(t,r[1])?r[0]:(n.memoizedState=[e,t],e)},useContext:Jn,useEffect:function(e,t){return hn(516,zt|Wt,e,t)},useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,hn(4,Lt|Ut,mn.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hn(4,Lt|Ut,e,t)},useMemo:function(e,t){var n=sn();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&un(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)},useReducer:fn,useRef:function(){return sn().memoizedState},useState:function(e){return fn(cn)},useDebugValue:vn},Dn=null,wn=null,En=!1;function Tn(e,t){var n=Xe(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Cn(e,t){switch(e.tag){case 5:return null!==(t=we(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=Ee(t,e.pendingProps))&&(e.stateNode=t,!0);case 13:default:return!1}}function kn(e){if(En){var t=wn;if(t){var n=t;if(!Cn(e,t)){if(!(t=Te(n))||!Cn(e,t))return e.effectTag|=2,En=!1,void(Dn=e);Tn(Dn,n)}Dn=e,wn=Ce(t)}else e.effectTag|=2,En=!1,Dn=e}}function Mn(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&18!==e.tag;)e=e.return;Dn=e}function Sn(e){if(!Z||e!==Dn)return!1;if(!En)return Mn(e),En=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!B(t,e.memoizedProps))for(t=wn;t;)Tn(e,t),t=Te(t);return Mn(e),wn=Dn?Te(e.stateNode):null,!0}function xn(){Z&&(wn=Dn=null,En=!1)}var On=l.ReactCurrentOwner,An=!1;function Pn(e,t,n,r){t.child=null===e?Tt(t,null,n,r):Et(t,e.child,n,r)}function Rn(e,t,n,r,i){n=n.render;var u=t.ref;return Xn(t,i),r=on(e,t,n,r,u,i),null===e||An?(t.effectTag|=1,Pn(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),zn(e,t,i))}function In(e,t,n,r,i,u){if(null===e){var o=n.type;return"function"!=typeof o||Je(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ze(n.type,null,r,null,t.mode,u)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Nn(e,t,o,r,i,u))}return o=e.child,i=n?Wn(e,t,n):null!==(t=zn(e,t,n))?t.sibling:null}return zn(e,t,n)}}else An=!1;switch(t.expirationTime=0,t.tag){case 2:r=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps;var i=Be(t,Ne.current);if(Xn(t,n),i=on(null,t,r,e,i,n),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,an(),je(r)){var u=!0;He(t)}else u=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var o=r.getDerivedStateFromProps;"function"==typeof o&&pt(t,r,o,e),i.updater=ht,t.stateNode=i,i._reactInternalFiber=t,gt(t,r,e,n),t=jn(null,t,r,!0,u,n)}else t.tag=0,Pn(null,t,i,n),t=t.child;return t;case 16:switch(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),u=t.pendingProps,e=function(e){var t=e._result;switch(e._status){case 1:return t;case 2:case 0:throw t;default:switch(e._status=0,(t=(t=e._ctor)()).then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)})),e._status){case 1:return e._result;case 2:throw e._result}throw e._result=t,t}}(i),t.type=e,i=t.tag=function(e){if("function"==typeof e)return Je(e)?1:0;if(null!=e){if((e=e.$$typeof)===g)return 11;if(e===_)return 14}return 2}(e),u=ft(e,u),o=void 0,i){case 0:o=Ln(null,t,e,u,n);break;case 1:o=Bn(null,t,e,u,n);break;case 11:o=Rn(null,t,e,u,n);break;case 14:o=In(null,t,e,ft(e.type,u),r,n);break;default:a("306",e,"")}return o;case 0:return r=t.type,i=t.pendingProps,Ln(e,t,r,i=t.elementType===r?i:ft(r,i),n);case 1:return r=t.type,i=t.pendingProps,Bn(e,t,r,i=t.elementType===r?i:ft(r,i),n);case 3:return Un(t),null===(r=t.updateQueue)&&a("282"),i=null!==(i=t.memoizedState)?i.element:null,fr(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===i?(xn(),t=zn(e,t,n)):(i=t.stateNode,(i=(null===e||null===e.child)&&i.hydrate)&&(Z?(wn=Ce(t.stateNode.containerInfo),Dn=t,i=En=!0):i=!1),i?(t.effectTag|=2,t.child=Tt(t,null,r,n)):(Pn(e,t,r,n),xn()),t=t.child),t;case 5:return Rt(t),null===e&&kn(t),r=t.type,i=t.pendingProps,u=null!==e?e.memoizedProps:null,o=i.children,B(r,i)?o=null:null!==u&&B(r,u)&&(t.effectTag|=16),Fn(e,t),1!==n&&1&t.mode&&j(r,i)?(t.expirationTime=t.childExpirationTime=1,t=null):(Pn(e,t,o,n),t=t.child),t;case 6:return null===e&&kn(t),null;case 13:return Wn(e,t,n);case 4:return Ot(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Et(t,null,r,n):Pn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Rn(e,t,r,i=t.elementType===r?i:ft(r,i),n);case 7:return Pn(e,t,t.pendingProps,n),t.child;case 8:case 12:return Pn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,$n(t,u=i.value),null!==o){var l=o.value;if(0===(u=lt(l,u)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,u):1073741823))){if(o.children===i.children&&!Fe.current){t=zn(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var s=l.contextDependencies;if(null!==s){o=l.child;for(var c=s.first;null!==c;){if(c.context===r&&0!=(c.observedBits&u)){1===l.tag&&((c=ur(n)).tag=er,ar(l,c)),l.expirationTime=t&&(An=!0),e.contextDependencies=null}function Jn(e,t){return Yn!==e&&!1!==t&&0!==t&&("number"==typeof t&&1073741823!==t||(Yn=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Vn?(null===Gn&&a("308"),Vn=t,Gn.contextDependencies={first:t,expirationTime:0}):Vn=Vn.next=t),X?e._currentValue:e._currentValue2}var Qn=0,Zn=1,er=2,tr=3,nr=!1;function rr(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function ir(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function ur(e){return{expirationTime:e,tag:Qn,payload:null,callback:null,next:null,nextEffect:null}}function or(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function ar(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,i=null;null===r&&(r=e.updateQueue=rr(e.memoizedState))}else r=e.updateQueue,i=n.updateQueue,null===r?null===i?(r=e.updateQueue=rr(e.memoizedState),i=n.updateQueue=rr(n.memoizedState)):r=e.updateQueue=ir(i):null===i&&(i=n.updateQueue=ir(r));null===i||r===i?or(r,t):null===r.lastUpdate||null===i.lastUpdate?(or(r,t),or(i,t)):(or(r,t),i.lastUpdate=t)}function lr(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=rr(e.memoizedState):sr(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function sr(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=ir(t)),t}function cr(e,t,n,r,u,o){switch(n.tag){case Zn:return"function"==typeof(e=n.payload)?e.call(o,r,u):e;case tr:e.effectTag=-2049&e.effectTag|64;case Qn:if(null==(u="function"==typeof(e=n.payload)?e.call(o,r,u):e))break;return i({},r,u);case er:nr=!0}return r}function fr(e,t,n,r,i){nr=!1;for(var u=(t=sr(e,t)).baseState,o=null,a=0,l=t.firstUpdate,s=u;null!==l;){var c=l.expirationTime;ct?e.earliestPendingTime=e.latestPendingTime=0:e.earliestPendingTime>t&&(e.earliestPendingTime=e.latestPendingTime)),0===(n=e.earliestSuspendedTime)?it(e,t):tn&&it(e,t)}at(0,e)}(e,i>r?i:r),Fr.current=null,r=void 0,1n?t:n)&&(Kr=null),function(e,t){e.expirationTime=t,e.finishedWork=null}(e,t)}function ri(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0==(1024&e.effectTag)){jr=e;e:{var i=t,u=Wr,o=(t=e).pendingProps;switch(t.tag){case 2:case 16:break;case 15:case 0:break;case 1:je(t.type)&&Ue();break;case 3:At(),We(),(o=t.stateNode).pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null!==i&&null!==i.child||(Sn(t),t.effectTag&=-3),br(t);break;case 5:It(t),u=xt(St.current);var l=t.type;if(null!==i&&null!=t.stateNode)gr(i,t,l,o,u),i.ref!==t.ref&&(t.effectTag|=128);else if(o){if(i=Pt(),Sn(t))o=t,Z||a("175"),i=ke(o.stateNode,o.type,o.memoizedProps,u,i,o),o.updateQueue=i,(i=null!==i)&&mr(t);else{var s=I(l,o,u,i,t);vr(s,t,!1,!1),F(s,l,o,u,i)&&mr(t),t.stateNode=s}null!==t.ref&&(t.effectTag|=128)}else null===t.stateNode&&a("166");break;case 6:i&&null!=t.stateNode?yr(i,t,i.memoizedProps,o):("string"!=typeof o&&(null===t.stateNode&&a("166")),i=xt(St.current),u=Pt(),Sn(t)?(i=t,Z||a("176"),(i=Me(i.stateNode,i.memoizedProps,i))&&mr(t)):t.stateNode=U(o,i,u,t));break;case 11:break;case 13:if(o=t.memoizedState,0!=(64&t.effectTag)){t.expirationTime=u,jr=t;break e}o=null!==o,u=null!==i&&null!==i.memoizedState,null!==i&&!o&&u&&(null!==(i=i.child.sibling)&&(null!==(l=t.firstEffect)?(t.firstEffect=i,i.nextEffect=l):(t.firstEffect=t.lastEffect=i,i.nextEffect=null),i.effectTag=8)),(o||u)&&(t.effectTag|=4);break;case 7:case 8:case 12:break;case 4:At(),br(t);break;case 10:Kn(t);break;case 9:case 14:break;case 17:je(t.type)&&Ue();break;case 18:break;default:a("156")}jr=null}if(t=e,1===Wr||1!==t.childExpirationTime){for(i=0,o=t.child;null!==o;)(u=o.expirationTime)>i&&(i=u),(l=o.childExpirationTime)>i&&(i=l),o=o.sibling;t.childExpirationTime=i}if(null!==jr)return jr;null!==n&&0==(1024&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1=m?p=0:(-1===p||m component higher in the tree to provide a loading indicator or placeholder to display."+xe(c))}qr=!0,f=hr(f,c),l=s;do{switch(l.tag){case 3:l.effectTag|=2048,l.expirationTime=o,lr(l,o=Pr(l,f,o));break e;case 1:if(p=f,h=l.type,c=l.stateNode,0==(64&l.effectTag)&&("function"==typeof h.getDerivedStateFromError||null!==c&&"function"==typeof c.componentDidCatch&&(null===Kr||!Kr.has(c)))){l.effectTag|=2048,l.expirationTime=o,lr(l,o=Rr(l,p,o));break e}}l=l.return}while(null!==l)}jr=ri(u);continue}i=!0,Vi(t)}}break}if(Br=!1,Nr.current=n,Yn=Vn=Gn=null,an(),i)Ur=null,e.finishedWork=null;else if(null!==jr)e.finishedWork=null;else{if(null===(n=e.current.alternate)&&a("281"),Ur=null,qr){if(i=e.latestPendingTime,u=e.latestSuspendedTime,o=e.latestPingedTime,0!==i&&it?0:t)):(e.pendingCommitExpirationTime=r,e.finishedWork=n)}}function oi(e,t){for(var n=e.return;null!==n;){switch(n.tag){case 1:var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Kr||!Kr.has(r)))return ar(n,e=Rr(n,e=hr(t,e),1073741823)),void fi(n,1073741823);break;case 3:return ar(n,e=Pr(n,e=hr(t,e),1073741823)),void fi(n,1073741823)}n=n.return}3===e.tag&&(ar(e,n=Pr(e,n=hr(t,e),1073741823)),fi(e,1073741823))}function ai(e,t){var n=o.unstable_getCurrentPriorityLevel(),r=void 0;if(0==(1&t.mode))r=1073741823;else if(Br&&!Gr)r=Wr;else{switch(n){case o.unstable_ImmediatePriority:r=1073741823;break;case o.unstable_UserBlockingPriority:r=1073741822-10*(1+((1073741822-e+15)/10|0));break;case o.unstable_NormalPriority:r=1073741822-25*(1+((1073741822-e+500)/25|0));break;case o.unstable_LowPriority:case o.unstable_IdlePriority:r=1;break;default:a("313")}null!==Ur&&r===Wr&&--r}return n===o.unstable_UserBlockingPriority&&(0===_i||r<_i)&&(_i=r),r}function li(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),null!==Ur&&Wr===n?Ur=null:(t=e.earliestSuspendedTime,r=e.latestSuspendedTime,0!==t&&n<=t&&n>=r&&(e.didError=!1,(0===(t=e.latestPingedTime)||t>n)&&(e.latestPingedTime=n),at(n,e),0!==(n=e.expirationTime)&&Li(e,n)))}function si(e,t){var n=e.stateNode;null!==n&&n.delete(t),null!==(e=ci(e,t=ai(t=Fi(),e)))&&(it(e,t),0!==(t=e.expirationTime)&&Li(e,t))}function ci(e,t){e.expirationTimeWr&&Xr(),it(e,t),Br&&!Gr&&Ur===e||Li(e,e.expirationTime),Oi>xi&&(Oi=0,a("185")))}function di(e,t,n,r,i){return o.unstable_runWithPriority(o.unstable_ImmediatePriority,(function(){return e(t,n,r,i)}))}var pi=null,hi=null,mi=0,vi=void 0,bi=!1,gi=null,yi=0,_i=0,Di=!1,wi=null,Ei=!1,Ti=!1,Ci=null,ki=K(),Mi=1073741822-(ki/10|0),Si=Mi,xi=50,Oi=0,Ai=null;function Pi(){Mi=1073741822-((K()-ki)/10|0)}function Ri(e,t){if(0!==mi){if(te.expirationTime&&(e.expirationTime=t),bi||(Ei?Ti&&(gi=e,yi=1073741823,Hi(e,1073741823,!1)):1073741823===t?zi(1073741823,!1):Ri(e,t))}function Bi(){var e=0,t=null;if(null!==hi)for(var n=hi,r=pi;null!==r;){var i=r.expirationTime;if(0===i){if((null===n||null===hi)&&a("244"),r===r.nextScheduledRoot){pi=hi=r.nextScheduledRoot=null;break}if(r===pi)pi=i=r.nextScheduledRoot,hi.nextScheduledRoot=i,r.nextScheduledRoot=null;else{if(r===hi){(hi=n).nextScheduledRoot=pi,r.nextScheduledRoot=null;break}n.nextScheduledRoot=r.nextScheduledRoot,r.nextScheduledRoot=null}r=n.nextScheduledRoot}else{if(i>e&&(e=i,t=r),r===hi)break;if(1073741823===e)break;n=r,r=r.nextScheduledRoot}}gi=t,yi=e}var ji=!1;function Ui(){return!!ji||!!q()&&(ji=!0)}function Wi(){try{if(!Ui()&&null!==pi){Pi();var e=pi;do{var t=e.expirationTime;0!==t&&Mi<=t&&(e.nextExpirationTimeToWorkOn=Mi),e=e.nextScheduledRoot}while(e!==pi)}zi(0,!0)}finally{ji=!1}}function zi(e,t){if(Bi(),t)for(Pi(),Si=Mi;null!==gi&&0!==yi&&e<=yi&&!(ji&&Mi>yi);)Hi(gi,yi,Mi>yi),Bi(),Pi(),Si=Mi;else for(;null!==gi&&0!==yi&&e<=yi;)Hi(gi,yi,!1),Bi();if(t&&(mi=0,vi=null),0!==yi&&Ri(gi,yi),Oi=0,Ai=null,null!==Ci)for(e=Ci,Ci=null,t=0;t=n&&(null===Ci?Ci=[r]:Ci.push(r),r._defer))return e.finishedWork=t,void(e.expirationTime=0);e.finishedWork=null,e===Ai?Oi++:(Ai=e,Oi=0),o.unstable_runWithPriority(o.unstable_ImmediatePriority,(function(){ni(e,t)}))}function Vi(e){null===gi&&a("246"),gi.expirationTime=0,Di||(Di=!0,wi=e)}function Yi(e,t,n,r,i){var u=t.current;e:if(n){t:{2===C(n=n._reactInternalFiber)&&1===n.tag||a("170");var o=n;do{switch(o.tag){case 3:o=o.stateNode.context;break t;case 1:if(je(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break t}}o=o.return}while(null!==o);a("171"),o=void 0}if(1===n.tag){var l=n.type;if(je(l)){n=qe(n,l,o);break e}}n=o}else n=Ie;return null===t.context?t.context=n:t.pendingContext=n,t=i,(i=ur(r)).payload={element:e},null!==(t=void 0===t?null:t)&&(i.callback=t),ti(),ar(u,i),fi(u,r),r}function $i(e){var t=e._reactInternalFiber;return void 0===t&&("function"==typeof e.render?a("188"):a("268",Object.keys(e))),null===(e=S(t))?null:e.stateNode}var Ki={updateContainerAtExpirationTime:Yi,createContainer:function(e,t,n){return e={current:t=Xe(3,null,null,t?3:0),containerInfo:e,pendingChildren:null,pingCache:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:V,context:null,pendingContext:null,hydrate:n,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null},t.stateNode=e},updateContainer:function(e,t,n,r){var i=t.current;return Yi(e,t,n,i=ai(Fi(),i),r)},flushRoot:qi,requestWork:Li,computeUniqueAsyncExpiration:function(){var e=1073741822-25*(1+((1073741822-Fi()+500)/25|0));return e>=Lr&&(e=Lr-1),Lr=e},batchedUpdates:function(e,t){var n=Ei;Ei=!0;try{return e(t)}finally{(Ei=n)||bi||zi(1073741823,!1)}},unbatchedUpdates:function(e,t){if(Ei&&!Ti){Ti=!0;try{return e(t)}finally{Ti=!1}}return e(t)},deferredUpdates:o.unstable_next,syncUpdates:di,interactiveUpdates:function(e,t,n){Ei||bi||0===_i||(zi(_i,!1),_i=0);var r=Ei;Ei=!0;try{return o.unstable_runWithPriority(o.unstable_UserBlockingPriority,(function(){return e(t,n)}))}finally{(Ei=r)||bi||zi(1073741823,!1)}},flushInteractiveUpdates:function(){bi||0===_i||(zi(_i,!1),_i=0)},flushControlled:function(e){var t=Ei;Ei=!0;try{di(e)}finally{(Ei=t)||bi||zi(1073741823,!1)}},flushSync:function(e,t){bi&&a("187");var n=Ei;Ei=!0;try{return di(e,t)}finally{Ei=n,zi(1073741823,!1)}},getPublicRootInstance:function(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:return x(e.child.stateNode);default:return e.child.stateNode}},findHostInstance:$i,findHostInstanceWithWarning:function(e){return $i(e)},findHostInstanceWithNoPortals:function(e){return null===(e=function(e){if(!(e=M(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child&&4!==t.tag)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}(e))?null:e.stateNode},injectIntoDevTools:function(e){var t=e.findFiberByHostInstance;return function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Ve=$e((function(e){return t.onCommitFiberRoot(n,e)})),Ye=$e((function(e){return t.onCommitFiberUnmount(n,e)}))}catch(e){}return!0}(i({},e,{overrideProps:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=S(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null}}))}};e.exports=Ki.default||Ki;var Xi=e.exports;return e.exports=t,Xi}},function(e,t,n){"use strict";e.exports=n(73)},function(e,t,n){"use strict"; +/** @license React v0.13.6 + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */Object.defineProperty(t,"__esModule",{value:!0});var r=null,i=!1,u=3,o=-1,a=-1,l=!1,s=!1;function c(){if(!l){var e=r.expirationTime;s?T():s=!0,E(p,e)}}function f(){var e=r,t=r.next;if(r===t)r=null;else{var n=r.previous;r=n.next=t,t.previous=n}e.next=e.previous=null,n=e.callback,t=e.expirationTime,e=e.priorityLevel;var i=u,o=a;u=e,a=t;try{var l=n()}finally{u=i,a=o}if("function"==typeof l)if(l={callback:l,priorityLevel:e,expirationTime:t,next:null,previous:null},null===r)r=l.next=l.previous=l;else{n=null,e=r;do{if(e.expirationTime>=t){n=e;break}e=e.next}while(e!==r);null===n?n=r:n===r&&(r=l,c()),(t=n.previous).next=n.previous=l,l.next=n,l.previous=t}}function d(){if(-1===o&&null!==r&&1===r.priorityLevel){l=!0;try{do{f()}while(null!==r&&1===r.priorityLevel)}finally{l=!1,null!==r?c():s=!1}}}function p(e){l=!0;var n=i;i=e;try{if(e)for(;null!==r;){var u=t.unstable_now();if(!(r.expirationTime<=u))break;do{f()}while(null!==r&&r.expirationTime<=u)}else if(null!==r)do{f()}while(null!==r&&!C())}finally{l=!1,i=n,null!==r?c():s=!1,d()}}var h,m,v=Date,b="function"==typeof setTimeout?setTimeout:void 0,g="function"==typeof clearTimeout?clearTimeout:void 0,y="function"==typeof requestAnimationFrame?requestAnimationFrame:void 0,_="function"==typeof cancelAnimationFrame?cancelAnimationFrame:void 0;function D(e){h=y((function(t){g(m),e(t)})),m=b((function(){_(h),e(t.unstable_now())}),100)}if("object"==typeof performance&&"function"==typeof performance.now){var w=performance;t.unstable_now=function(){return w.now()}}else t.unstable_now=function(){return v.now()};var E,T,C,k=null;if("undefined"!=typeof window?k=window:"undefined"!=typeof global&&(k=global),k&&k._schedMock){var M=k._schedMock;E=M[0],T=M[1],C=M[2],t.unstable_now=M[3]}else if("undefined"==typeof window||"function"!=typeof MessageChannel){var S=null,x=function(e){if(null!==S)try{S(e)}finally{S=null}};E=function(e){null!==S?setTimeout(E,0,e):(S=e,setTimeout(x,0,!1))},T=function(){S=null},C=function(){return!1}}else{"undefined"!=typeof console&&("function"!=typeof y&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof _&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var O=null,A=!1,P=-1,R=!1,I=!1,N=0,F=33,L=33;C=function(){return N<=t.unstable_now()};var B=new MessageChannel,j=B.port2;B.port1.onmessage=function(){A=!1;var e=O,n=P;O=null,P=-1;var r=t.unstable_now(),i=!1;if(0>=N-r){if(!(-1!==n&&n<=r))return R||(R=!0,D(U)),O=e,void(P=n);i=!0}if(null!==e){I=!0;try{e(i)}finally{I=!1}}};var U=function(e){if(null!==O){D(U);var t=e-N+L;tt&&(t=8),L=tt?j.postMessage(void 0):R||(R=!0,D(U))},T=function(){O=null,A=!1,P=-1}}t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=u,i=o;u=e,o=t.unstable_now();try{return n()}finally{u=r,o=i,d()}},t.unstable_next=function(e){switch(u){case 1:case 2:case 3:var n=3;break;default:n=u}var r=u,i=o;u=n,o=t.unstable_now();try{return e()}finally{u=r,o=i,d()}},t.unstable_scheduleCallback=function(e,n){var i=-1!==o?o:t.unstable_now();if("object"==typeof n&&null!==n&&"number"==typeof n.timeout)n=i+n.timeout;else switch(u){case 1:n=i+-1;break;case 2:n=i+250;break;case 5:n=i+1073741823;break;case 4:n=i+1e4;break;default:n=i+5e3}if(e={callback:e,priorityLevel:u,expirationTime:n,next:null,previous:null},null===r)r=e.next=e.previous=e,c();else{i=null;var a=r;do{if(a.expirationTime>n){i=a;break}a=a.next}while(a!==r);null===i?i=r:i===r&&(r=e,c()),(n=i.previous).next=i.previous=e,e.next=i,e.previous=n}return e},t.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)r=null;else{e===r&&(r=t);var n=e.previous;n.next=t,t.previous=n}e.next=e.previous=null}},t.unstable_wrapCallback=function(e){var n=u;return function(){var r=u,i=o;u=n,o=t.unstable_now();try{return e.apply(this,arguments)}finally{u=r,o=i,d()}}},t.unstable_getCurrentPriorityLevel=function(){return u},t.unstable_shouldYield=function(){return!i&&(null!==r&&r.expirationTime{if(e.textContent&&"string"==typeof e.parentNode.style.textWrap){const{yogaNode:t}=e,n=e.parentNode.yogaNode,r=(0,c.default)(n);if(t.getComputedWidth()>r){const{textWrap:n}=e.parentNode.style,i=(0,s.default)(e.textContent,r,{textWrap:n}),{width:u,height:o}=(0,l.default)(i);t.setWidth(u),t.setHeight(o)}}else if(Array.isArray(e.childNodes)&&e.childNodes.length>0)for(const t of e.childNodes)d(t)},p=e=>{const t=[];for(const n of e.childNodes)n.unstable__static&&t.push(n),Array.isArray(n.childNodes)&&n.childNodes.length>0&&t.push(...p(n));return t};t.default=({terminalWidth:e})=>{const t=r.default.Config.create();let n,l;return s=>{n&&n.freeRecursive(),l&&l.freeRecursive();const c=p(s);let f;if(c.length,1===c.length){const n=(0,u.createNode)("root");(0,u.appendStaticNode)(n,c[0]);const{yogaNode:s}=(0,o.default)(n,{config:t,terminalWidth:e,skipStaticElements:!1});s.calculateLayout(r.default.UNDEFINED,r.default.UNDEFINED,r.default.DIRECTION_LTR),d(n),s.calculateLayout(r.default.UNDEFINED,r.default.UNDEFINED,r.default.DIRECTION_LTR),l=s,f=new i.default({width:s.getComputedWidth(),height:s.getComputedHeight()}),(0,a.default)(n,f,{skipStaticElements:!1})}const{yogaNode:h}=(0,o.default)(s,{config:t,terminalWidth:e,skipStaticElements:!0});h.calculateLayout(r.default.UNDEFINED,r.default.UNDEFINED,r.default.DIRECTION_LTR),d(s),h.calculateLayout(r.default.UNDEFINED,r.default.UNDEFINED,r.default.DIRECTION_LTR),n=h;const m=new i.default({width:h.getComputedWidth(),height:h.getComputedHeight()});return(0,a.default)(s,m,{skipStaticElements:!0}),{output:m.get(),staticOutput:f?`${f.get()}\n`:void 0}}}},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t"}}]),e}(),s=function(){function e(t,n){o(this,e),this.width=t,this.height=n}return i(e,null,[{key:"fromJS",value:function(t){return new e(t.width,t.height)}}]),i(e,[{key:"fromJS",value:function(e){e(this.width,this.height)}},{key:"toString",value:function(){return""}}]),e}(),c=function(){function e(t,n){o(this,e),this.unit=t,this.value=n}return i(e,[{key:"fromJS",value:function(e){e(this.unit,this.value)}},{key:"toString",value:function(){switch(this.unit){case a.UNIT_POINT:return String(this.value);case a.UNIT_PERCENT:return this.value+"%";case a.UNIT_AUTO:return"auto";default:return this.value+"?"}}},{key:"valueOf",value:function(){return this.value}}]),e}();e.exports=function(e,t){function n(e,t,n){var r=e[t];e[t]=function(){for(var e=arguments.length,t=Array(e),i=0;i1?t-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:NaN,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.DIRECTION_LTR;return e.call(this,t,n,r)})),r({Config:t.Config,Node:t.Node,Layout:e("Layout",l),Size:e("Size",s),Value:e("Value",c),getInstanceCount:function(){return t.getInstanceCount.apply(t,arguments)}},a)}},function(e,t,n){"use strict";e.exports={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:1,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:6,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_COUNT:6,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_COUNT:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2}},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,wrapper;wrapper=function(Module,cb){var Module;"function"==typeof Module&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(e,t){return function(){e&&e.apply(this,arguments);try{Module.ccall("nbind_init")}catch(e){return void t(e)}t(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb),Module||(Module=(void 0!==Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1,nodeFS,nodePath;if(Module.ENVIRONMENT)if("WEB"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if("WORKER"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if("NODE"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if("SHELL"!==Module.ENVIRONMENT)throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE)Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn),Module.read=function(e,t){nodeFS||(nodeFS={}("")),nodePath||(nodePath={}("")),e=nodePath.normalize(e);var n=nodeFS.readFileSync(e);return t?n:n.toString()},Module.readBinary=function(e){var t=Module.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),module.exports=Module,process.on("uncaughtException",(function(e){if(!(e instanceof ExitStatus))throw e})),Module.inspect=function(){return"[Emscripten Module object]"};else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var t=read(e,"binary");return assert("object"==typeof t),t},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),"function"==typeof quit&&(Module.quit=function(e,t){quit(e)});else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Module.readAsync=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}function globalEval(e){eval.call(null,e)}for(var key in!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.quit||(Module.quit=function(e,t){throw t}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(e){return tempRet0=e,e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8==0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},getAlignSize:function(e,t,n){return n||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},dynCall:function(e,t,n){return n&&n.length?Module["dynCall_"+e].apply(null,[t].concat(n)):Module["dynCall_"+e].call(null,t)},functionPointers:[],addFunction:function(e){for(var t=0;t>2],n=-16&(t+e+15|0);return HEAP32[DYNAMICTOP_PTR>>2]=n,n>=TOTAL_MEMORY&&!enlargeMemory()?(HEAP32[DYNAMICTOP_PTR>>2]=t,0):t},alignMemory:function(e,t){return e=Math.ceil(e/(t||16))*(t||16)},makeBigInt:function(e,t,n){return n?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0,cwrap,ccall;function assert(e,t){e||abort("Assertion failed: "+t)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,t,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":HEAP8[e>>0]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+n)}}function getValue(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+t)}return null}!function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var t=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,t),t},stringToC:function(e){var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);stringToUTF8(e,t=Runtime.stackAlloc(n),n)}return t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,t,n,r,i){var u=getCFunc(e),o=[],a=0;if(r)for(var l=0;l>2]=0;for(l=o+u;r>0]=0;return o}if("i8"===a)return e.subarray||e.slice?HEAPU8.set(e,o):HEAPU8.set(new Uint8Array(e),o),o;for(var s,c,f,d=0;d>0],(0!=n||t)&&(i++,!t||i!=t););t||(t=i);var u="";if(r<128){for(var o;t>0;)o=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(t,1024))),u=u?u+o:o,e+=1024,t-=1024;return u}return Module.UTF8ToString(e)}function AsciiToString(e){for(var t="";;){var n=HEAP8[e++>>0];if(!n)return t;t+=String.fromCharCode(n)}}function stringToAscii(e,t){return writeAsciiToMemory(e,t,!1)}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,t){for(var n=t;e[n];)++n;if(n-t>16&&e.subarray&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,n));for(var r,i,u,o,a,l="";;){if(!(r=e[t++]))return l;if(128&r)if(i=63&e[t++],192!=(224&r))if(u=63&e[t++],224==(240&r)?r=(15&r)<<12|i<<6|u:(o=63&e[t++],240==(248&r)?r=(7&r)<<18|i<<12|u<<6|o:(a=63&e[t++],r=248==(252&r)?(3&r)<<24|i<<18|u<<12|o<<6|a:(1&r)<<30|i<<24|u<<18|o<<12|a<<6|63&e[t++])),r<65536)l+=String.fromCharCode(r);else{var s=r-65536;l+=String.fromCharCode(55296|s>>10,56320|1023&s)}else l+=String.fromCharCode((31&r)<<6|i);else l+=String.fromCharCode(r)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,t,n,r){if(!(r>0))return 0;for(var i=n,u=n+r-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(n>=u)break;t[n++]=a}else if(a<=2047){if(n+1>=u)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=u)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else if(a<=2097151){if(n+3>=u)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}else if(a<=67108863){if(n+4>=u)break;t[n++]=248|a>>24,t[n++]=128|a>>18&63,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+5>=u)break;t[n++]=252|a>>30,t[n++]=128|a>>24&63,t[n++]=128|a>>18&63,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-i}function stringToUTF8(e,t,n){return stringToUTF8Array(e,HEAPU8,t,n)}function lengthBytesUTF8(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:r<=2097151?4:r<=67108863?5:6}return t}Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;function demangle(e){var t=Module.___cxa_demangle||Module.__cxa_demangle;if(t){try{var n=e.substr(1),r=lengthBytesUTF8(n)+1,i=_malloc(r);stringToUTF8(n,i,r);var u=_malloc(4),o=t(i,0,0,u);if(0===getValue(u,"i32")&&o)return Pointer_stringify(o)}catch(e){}finally{i&&_free(i),u&&_free(u),o&&_free(o)}return e}return Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,(function(e){var t=demangle(e);return e===t?e:e+" ["+t+"]"}))}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),demangleAll(e)}function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}Module.stackTrace=stackTrace,STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;function getTotalMemory(){return TOTAL_MEMORY}if(TOTAL_MEMORY0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?Module.dynCall_v(n):Module.dynCall_vi(n,t.arg):n(void 0===t.arg?null:t.arg)}else t()}}Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,t,n){var r=n>0?n:lengthBytesUTF8(e)+1,i=new Array(r),u=stringToUTF8Array(e,i,0,i.length);return t&&(i.length=u),i}function intArrayToString(e){for(var t=[],n=0;n255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}function writeStringToMemory(e,t,n){var r,i;Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!"),n&&(i=t+lengthBytesUTF8(e),r=HEAP8[i]),stringToUTF8(e,t,1/0),n&&(HEAP8[i]=r)}function writeArrayToMemory(e,t){HEAP8.set(e,t)}function writeAsciiToMemory(e,t,n){for(var r=0;r>0]=e.charCodeAt(r);n||(HEAP8[t>>0]=0)}if(Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(e){return froundBuffer[0]=e,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(e,t,n,r,i,u,o,a){return _nbind.callbackSignatureList[e].apply(this,arguments)}];function _emscripten_asm_const_iiiiiiii(e,t,n,r,i,u,o,a){return ASM_CONSTS[e](t,n,r,i,u,o,a)}function _emscripten_asm_const_iiiii(e,t,n,r,i){return ASM_CONSTS[e](t,n,r,i)}function _emscripten_asm_const_iiidddddd(e,t,n,r,i,u,o,a,l){return ASM_CONSTS[e](t,n,r,i,u,o,a,l)}function _emscripten_asm_const_iiididi(e,t,n,r,i,u,o){return ASM_CONSTS[e](t,n,r,i,u,o)}function _emscripten_asm_const_iiii(e,t,n,r){return ASM_CONSTS[e](t,n,r)}function _emscripten_asm_const_iiiid(e,t,n,r,i){return ASM_CONSTS[e](t,n,r,i)}function _emscripten_asm_const_iiiiii(e,t,n,r,i,u){return ASM_CONSTS[e](t,n,r,i,u)}STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+12800,__ATINIT__.push({func:function(){__GLOBAL__sub_I_Yoga_cpp()}},{func:function(){__GLOBAL__sub_I_nbind_cc()}},{func:function(){__GLOBAL__sub_I_common_cc()}},{func:function(){__GLOBAL__sub_I_Binding_cc()}}),allocate([0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,192,127,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,128,191,0,0,128,191,0,0,192,127,0,0,0,0,0,0,0,0,0,0,128,63,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,190,12,0,0,200,12,0,0,208,12,0,0,216,12,0,0,230,12,0,0,242,12,0,0,1,0,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,192,127,3,0,0,0,180,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,182,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,1,0,0,0,4,0,0,0,183,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,184,45,0,0,185,45,0,0,181,45,0,0,181,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,148,4,0,0,3,0,0,0,187,45,0,0,164,4,0,0,188,45,0,0,2,0,0,0,189,45,0,0,164,4,0,0,188,45,0,0,185,45,0,0,164,4,0,0,185,45,0,0,164,4,0,0,188,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,7,0,0,0,183,45,0,0,182,45,0,0,181,45,0,0,190,45,0,0,190,45,0,0,182,45,0,0,182,45,0,0,185,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,185,45,0,0,48,5,0,0,3,0,0,0,56,5,0,0,1,0,0,0,189,45,0,0,185,45,0,0,164,4,0,0,76,5,0,0,2,0,0,0,191,45,0,0,186,45,0,0,182,45,0,0,185,45,0,0,192,45,0,0,185,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,76,5,0,0,76,5,0,0,136,5,0,0,182,45,0,0,181,45,0,0,2,0,0,0,190,45,0,0,136,5,0,0,56,19,0,0,156,5,0,0,2,0,0,0,184,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,9,0,0,0,1,0,0,0,10,0,0,0,204,5,0,0,181,45,0,0,181,45,0,0,2,0,0,0,180,45,0,0,204,5,0,0,2,0,0,0,195,45,0,0,236,5,0,0,97,19,0,0,198,45,0,0,211,45,0,0,212,45,0,0,213,45,0,0,214,45,0,0,215,45,0,0,188,45,0,0,182,45,0,0,216,45,0,0,217,45,0,0,218,45,0,0,219,45,0,0,192,45,0,0,181,45,0,0,0,0,0,0,185,45,0,0,110,19,0,0,186,45,0,0,115,19,0,0,221,45,0,0,120,19,0,0,148,4,0,0,132,19,0,0,96,6,0,0,145,19,0,0,222,45,0,0,164,19,0,0,223,45,0,0,173,19,0,0,0,0,0,0,3,0,0,0,104,6,0,0,1,0,0,0,187,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,12,0,0,0,1,0,0,0,13,0,0,0,185,45,0,0,224,45,0,0,164,6,0,0,188,45,0,0,172,6,0,0,180,6,0,0,2,0,0,0,188,6,0,0,7,0,0,0,224,45,0,0,7,0,0,0,164,6,0,0,1,0,0,0,213,45,0,0,185,45,0,0,224,45,0,0,172,6,0,0,185,45,0,0,224,45,0,0,164,6,0,0,185,45,0,0,224,45,0,0,211,45,0,0,211,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,172,6,0,0,222,45,0,0,211,45,0,0,224,45,0,0,188,45,0,0,222,45,0,0,211,45,0,0,40,7,0,0,188,45,0,0,2,0,0,0,224,45,0,0,185,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,222,45,0,0,224,45,0,0,148,4,0,0,185,45,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,185,45,0,0,164,6,0,0,148,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,14,0,0,0,15,0,0,0,1,0,0,0,16,0,0,0,148,7,0,0,2,0,0,0,225,45,0,0,183,45,0,0,188,45,0,0,168,7,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,234,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,9,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,242,45,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,110,111,100,101,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,119,104,105,99,104,32,115,116,105,108,108,32,104,97,115,32,99,104,105,108,100,114,101,110,32,97,116,116,97,99,104,101,100,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,115,116,105,108,108,32,97,116,116,97,99,104,101,100,32,116,111,32,97,32,112,97,114,101,110,116,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,99,111,110,102,105,103,0,67,97,110,110,111,116,32,115,101,116,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,67,104,105,108,100,32,97,108,114,101,97,100,121,32,104,97,115,32,97,32,112,97,114,101,110,116,44,32,105,116,32,109,117,115,116,32,98,101,32,114,101,109,111,118,101,100,32,102,105,114,115,116,46,0,67,97,110,110,111,116,32,97,100,100,32,99,104,105,108,100,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,79,110,108,121,32,108,101,97,102,32,110,111,100,101,115,32,119,105,116,104,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,115,104,111,117,108,100,32,109,97,110,117,97,108,108,121,32,109,97,114,107,32,116,104,101,109,115,101,108,118,101,115,32,97,115,32,100,105,114,116,121,0,67,97,110,110,111,116,32,103,101,116,32,108,97,121,111,117,116,32,112,114,111,112,101,114,116,105,101,115,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,37,115,37,100,46,123,91,115,107,105,112,112,101,100,93,32,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,61,62,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,37,115,37,100,46,123,37,115,0,42,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,37,115,10,0,37,115,37,100,46,125,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,79,117,116,32,111,102,32,99,97,99,104,101,32,101,110,116,114,105,101,115,33,10,0,83,99,97,108,101,32,102,97,99,116,111,114,32,115,104,111,117,108,100,32,110,111,116,32,98,101,32,108,101,115,115,32,116,104,97,110,32,122,101,114,111,0,105,110,105,116,105,97,108,0,37,115,10,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,85,78,68,69,70,73,78,69,68,0,69,88,65,67,84,76,89,0,65,84,95,77,79,83,84,0,76,65,89,95,85,78,68,69,70,73,78,69,68,0,76,65,89,95,69,88,65,67,84,76,89,0,76,65,89,95,65,84,95,77,79,83,84,0,97,118,97,105,108,97,98,108,101,87,105,100,116,104,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,119,105,100,116,104,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,97,118,97,105,108,97,98,108,101,72,101,105,103,104,116,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,104,101,105,103,104,116,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,102,108,101,120,0,115,116,114,101,116,99,104,0,109,117,108,116,105,108,105,110,101,45,115,116,114,101,116,99,104,0,69,120,112,101,99,116,101,100,32,110,111,100,101,32,116,111,32,104,97,118,101,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,0,109,101,97,115,117,114,101,0,69,120,112,101,99,116,32,99,117,115,116,111,109,32,98,97,115,101,108,105,110,101,32,102,117,110,99,116,105,111,110,32,116,111,32,110,111,116,32,114,101,116,117,114,110,32,78,97,78,0,97,98,115,45,109,101,97,115,117,114,101,0,97,98,115,45,108,97,121,111,117,116,0,78,111,100,101,0,99,114,101,97,116,101,68,101,102,97,117,108,116,0,99,114,101,97,116,101,87,105,116,104,67,111,110,102,105,103,0,100,101,115,116,114,111,121,0,114,101,115,101,116,0,99,111,112,121,83,116,121,108,101,0,115,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,115,101,116,80,111,115,105,116,105,111,110,0,115,101,116,80,111,115,105,116,105,111,110,80,101,114,99,101,110,116,0,115,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,115,101,116,65,108,105,103,110,73,116,101,109,115,0,115,101,116,65,108,105,103,110,83,101,108,102,0,115,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,115,101,116,70,108,101,120,87,114,97,112,0,115,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,115,101,116,77,97,114,103,105,110,0,115,101,116,77,97,114,103,105,110,80,101,114,99,101,110,116,0,115,101,116,77,97,114,103,105,110,65,117,116,111,0,115,101,116,79,118,101,114,102,108,111,119,0,115,101,116,68,105,115,112,108,97,121,0,115,101,116,70,108,101,120,0,115,101,116,70,108,101,120,66,97,115,105,115,0,115,101,116,70,108,101,120,66,97,115,105,115,80,101,114,99,101,110,116,0,115,101,116,70,108,101,120,71,114,111,119,0,115,101,116,70,108,101,120,83,104,114,105,110,107,0,115,101,116,87,105,100,116,104,0,115,101,116,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,87,105,100,116,104,65,117,116,111,0,115,101,116,72,101,105,103,104,116,0,115,101,116,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,72,101,105,103,104,116,65,117,116,111,0,115,101,116,77,105,110,87,105,100,116,104,0,115,101,116,77,105,110,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,105,110,72,101,105,103,104,116,0,115,101,116,77,105,110,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,77,97,120,87,105,100,116,104,0,115,101,116,77,97,120,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,97,120,72,101,105,103,104,116,0,115,101,116,77,97,120,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,65,115,112,101,99,116,82,97,116,105,111,0,115,101,116,66,111,114,100,101,114,0,115,101,116,80,97,100,100,105,110,103,0,115,101,116,80,97,100,100,105,110,103,80,101,114,99,101,110,116,0,103,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,103,101,116,80,111,115,105,116,105,111,110,0,103,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,103,101,116,65,108,105,103,110,73,116,101,109,115,0,103,101,116,65,108,105,103,110,83,101,108,102,0,103,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,103,101,116,70,108,101,120,87,114,97,112,0,103,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,103,101,116,77,97,114,103,105,110,0,103,101,116,70,108,101,120,66,97,115,105,115,0,103,101,116,70,108,101,120,71,114,111,119,0,103,101,116,70,108,101,120,83,104,114,105,110,107,0,103,101,116,87,105,100,116,104,0,103,101,116,72,101,105,103,104,116,0,103,101,116,77,105,110,87,105,100,116,104,0,103,101,116,77,105,110,72,101,105,103,104,116,0,103,101,116,77,97,120,87,105,100,116,104,0,103,101,116,77,97,120,72,101,105,103,104,116,0,103,101,116,65,115,112,101,99,116,82,97,116,105,111,0,103,101,116,66,111,114,100,101,114,0,103,101,116,79,118,101,114,102,108,111,119,0,103,101,116,68,105,115,112,108,97,121,0,103,101,116,80,97,100,100,105,110,103,0,105,110,115,101,114,116,67,104,105,108,100,0,114,101,109,111,118,101,67,104,105,108,100,0,103,101,116,67,104,105,108,100,67,111,117,110,116,0,103,101,116,80,97,114,101,110,116,0,103,101,116,67,104,105,108,100,0,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,117,110,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,109,97,114,107,68,105,114,116,121,0,105,115,68,105,114,116,121,0,99,97,108,99,117,108,97,116,101,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,76,101,102,116,0,103,101,116,67,111,109,112,117,116,101,100,82,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,84,111,112,0,103,101,116,67,111,109,112,117,116,101,100,66,111,116,116,111,109,0,103,101,116,67,111,109,112,117,116,101,100,87,105,100,116,104,0,103,101,116,67,111,109,112,117,116,101,100,72,101,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,77,97,114,103,105,110,0,103,101,116,67,111,109,112,117,116,101,100,66,111,114,100,101,114,0,103,101,116,67,111,109,112,117,116,101,100,80,97,100,100,105,110,103,0,67,111,110,102,105,103,0,99,114,101,97,116,101,0,115,101,116,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,115,101,116,80,111,105,110,116,83,99,97,108,101,70,97,99,116,111,114,0,105,115,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,86,97,108,117,101,0,76,97,121,111,117,116,0,83,105,122,101,0,103,101,116,73,110,115,116,97,110,99,101,67,111,117,110,116,0,73,110,116,54,52,0,1,1,1,2,2,4,4,4,4,8,8,4,8,118,111,105,100,0,98,111,111,108,0,115,116,100,58,58,115,116,114,105,110,103,0,99,98,70,117,110,99,116,105,111,110,32,38,0,99,111,110,115,116,32,99,98,70,117,110,99,116,105,111,110,32,38,0,69,120,116,101,114,110,97,108,0,66,117,102,102,101,114,0,78,66,105,110,100,73,68,0,78,66,105,110,100,0,98,105,110,100,95,118,97,108,117,101,0,114,101,102,108,101,99,116,0,113,117,101,114,121,84,121,112,101,0,108,97,108,108,111,99,0,108,114,101,115,101,116,0,123,114,101,116,117,114,110,40,95,110,98,105,110,100,46,99,97,108,108,98,97,99,107,83,105,103,110,97,116,117,114,101,76,105,115,116,91,36,48,93,46,97,112,112,108,121,40,116,104,105,115,44,97,114,103,117,109,101,110,116,115,41,41,59,125,0,95,110,98,105,110,100,95,110,101,119,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;function _atexit(e,t){__ATEXIT__.unshift({func:e,arg:t})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function _abort(){Module.abort()}function __ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj(){Module.printErr("missing function: _ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj"),abort(-1)}function __decorate(e,t,n,r){var i,u=arguments.length,o=u<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(u<3?i(o):u>3?i(t,n,o):i(t,n))||o);return u>3&&o&&Object.defineProperty(t,n,o),o}function _defineHidden(e){return function(t,n){Object.defineProperty(t,n,{configurable:!1,enumerable:!1,value:e,writable:!0})}}STATICTOP+=16;var _nbind={};function __nbind_free_external(e){_nbind.externalList[e].dereference(e)}function __nbind_reference_external(e){_nbind.externalList[e].reference()}function _llvm_stackrestore(e){var t=_llvm_stacksave,n=t.LLVM_SAVEDSTACKS[e];t.LLVM_SAVEDSTACKS.splice(e,1),Runtime.stackRestore(n)}function __nbind_register_pool(e,t,n,r){_nbind.Pool.pageSize=e,_nbind.Pool.usedPtr=t/4,_nbind.Pool.rootPtr=n,_nbind.Pool.pagePtr=r/4,HEAP32[t/4]=16909060,1==HEAP8[t]&&(_nbind.bigEndian=!0),HEAP32[t/4]=0,_nbind.makeTypeKindTbl=((i={})[1024]=_nbind.PrimitiveType,i[64]=_nbind.Int64Type,i[2048]=_nbind.BindClass,i[3072]=_nbind.BindClassPtr,i[4096]=_nbind.SharedClassPtr,i[5120]=_nbind.ArrayType,i[6144]=_nbind.ArrayType,i[7168]=_nbind.CStringType,i[9216]=_nbind.CallbackType,i[10240]=_nbind.BindType,i),_nbind.makeTypeNameTbl={Buffer:_nbind.BufferType,External:_nbind.ExternalType,Int64:_nbind.Int64Type,_nbind_new:_nbind.CreateValueType,bool:_nbind.BooleanType,"cbFunction &":_nbind.CallbackType,"const cbFunction &":_nbind.CallbackType,"const std::string &":_nbind.StringType,"std::string":_nbind.StringType},Module.toggleLightGC=_nbind.toggleLightGC,_nbind.callUpcast=Module.dynCall_ii;var i,u=_nbind.makeType(_nbind.constructType,{flags:2048,id:0,name:""});u.proto=Module,_nbind.BindClass.list.push(u)}function _emscripten_set_main_loop_timing(e,t){if(Browser.mainLoop.timingMode=e,Browser.mainLoop.timingValue=t,!Browser.mainLoop.func)return 1;if(0==e)Browser.mainLoop.scheduler=function(){var e=0|Math.max(0,Browser.mainLoop.tickStartTime+t-_emscripten_get_now());setTimeout(Browser.mainLoop.runner,e)},Browser.mainLoop.method="timeout";else if(1==e)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(2==e){if(!window.setImmediate){var n=[],r="setimmediate";window.addEventListener("message",(function(e){e.source===window&&e.data===r&&(e.stopPropagation(),n.shift()())}),!0),window.setImmediate=function(e){n.push(e),ENVIRONMENT_IS_WORKER?(void 0===Module.setImmediates&&(Module.setImmediates=[]),Module.setImmediates.push(e),window.postMessage({target:r})):window.postMessage(r,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_get_now(){abort()}function _emscripten_set_main_loop(e,t,n,r,i){var u;Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=e,Browser.mainLoop.arg=r,u=void 0!==r?function(){Module.dynCall_vi(e,r)}:function(){Module.dynCall_v(e)};var o=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT)if(Browser.mainLoop.queue.length>0){var e=Date.now(),t=Browser.mainLoop.queue.shift();if(t.func(t.arg),Browser.mainLoop.remainingBlockers){var n=Browser.mainLoop.remainingBlockers,r=n%1==0?n-1:Math.floor(n);t.counted?Browser.mainLoop.remainingBlockers=r:(r+=.5,Browser.mainLoop.remainingBlockers=(8*n+r)/9)}if(console.log('main loop blocker "'+t.name+'" took '+(Date.now()-e)+" ms"),Browser.mainLoop.updateStatus(),o1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0?Browser.mainLoop.scheduler():(0==Browser.mainLoop.timingMode&&(Browser.mainLoop.tickStartTime=_emscripten_get_now()),"timeout"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(u),o0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),n)throw"SimulateInfiniteLoop"}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var e=Browser.mainLoop.timingMode,t=Browser.mainLoop.timingValue,n=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(n,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=Browser.mainLoop.remainingBlockers,n=Browser.mainLoop.expectedBlockers;t?t=6;){var o=r>>i-6&63;i-=6,n+=t[o]}return 2==i?(n+=t[(3&r)<<4],n+="=="):4==i&&(n+=t[(15&r)<<2],n+="="),n}(e),u(s))},s.src=l,Browser.safeSetTimeout((function(){u(s)}),1e4)}};Module.preloadPlugins.push(t);var n=Module.canvas;n&&(n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock||n.msRequestPointerLock||function(){},n.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},n.exitPointerLock=n.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",r,!1),document.addEventListener("mozpointerlockchange",r,!1),document.addEventListener("webkitpointerlockchange",r,!1),document.addEventListener("mspointerlockchange",r,!1),Module.elementPointerLock&&n.addEventListener("click",(function(e){!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),e.preventDefault())}),!1))}function r(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}},createContext:function(e,t,n,r){if(t&&Module.ctx&&e==Module.canvas)return Module.ctx;var i,u;if(t){var o={antialias:!1,alpha:!1};if(r)for(var a in r)o[a]=r[a];(u=GL.createContext(e,o))&&(i=GL.getContext(u).GLctx)}else i=e.getContext("2d");return i?(n&&(t||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=i,t&&GL.makeContextCurrent(u),Module.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach((function(e){e()})),Browser.init()),i):null},destroyContext:function(e,t,n){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t,n){Browser.lockPointer=e,Browser.resizeCanvas=t,Browser.vrDevice=n,void 0===Browser.lockPointer&&(Browser.lockPointer=!0),void 0===Browser.resizeCanvas&&(Browser.resizeCanvas=!1),void 0===Browser.vrDevice&&(Browser.vrDevice=null);var r=Module.canvas;function i(){Browser.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){},r.exitFullscreen=r.exitFullscreen.bind(document),Browser.lockPointer&&r.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas&&Browser.setFullscreenCanvasSize()):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullscreen),Module.onFullscreen&&Module.onFullscreen(Browser.isFullscreen),Browser.updateCanvasDimensions(r)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("MSFullscreenChange",i,!1));var u=document.createElement("div");r.parentNode.insertBefore(u,r),u.appendChild(r),u.requestFullscreen=u.requestFullscreen||u.mozRequestFullScreen||u.msRequestFullscreen||(u.webkitRequestFullscreen?function(){u.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(u.webkitRequestFullScreen?function(){u.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),n?u.requestFullscreen({vrDisplay:n}):u.requestFullscreen()},requestFullScreen:function(e,t,n){return Module.printErr("Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead."),Browser.requestFullScreen=function(e,t,n){return Browser.requestFullscreen(e,t,n)},Browser.requestFullscreen(e,t,n)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=t+1e3/60;else for(;t+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var n=Math.max(Browser.nextRAF-t,0);setTimeout(e,n)},requestAnimationFrame:function(e){"undefined"==typeof window?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var e=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],e.forEach((function(e){e()}))}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame((function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))}))},safeSetTimeout:function(e,t){return Module.noExitRuntime=!0,setTimeout((function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))}),t)},safeSetInterval:function(e,t){return Module.noExitRuntime=!0,setInterval((function(){ABORT||Browser.allowAsyncCallbacks&&e()}),t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail;break;case"mousewheel":t=e.wheelDelta;break;case"wheel":t=e.deltaY;break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var t=Module.canvas.getBoundingClientRect(),n=Module.canvas.width,r=Module.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,u=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var o=e.touch;if(void 0===o)return;var a=o.pageX-(i+t.left),l=o.pageY-(u+t.top),s={x:a*=n/t.width,y:l*=r/t.height};if("touchstart"===e.type)Browser.lastTouches[o.identifier]=s,Browser.touches[o.identifier]=s;else if("touchend"===e.type||"touchmove"===e.type){var c=Browser.touches[o.identifier];c||(c=s),Browser.lastTouches[o.identifier]=c,Browser.touches[o.identifier]=s}return}var f=e.pageX-(i+t.left),d=e.pageY-(u+t.top);f*=n/t.width,d*=r/t.height,Browser.mouseMovementX=f-Browser.mouseX,Browser.mouseMovementY=d-Browser.mouseY,Browser.mouseX=f,Browser.mouseY=d}},asyncLoad:function(e,t,n,r){var i=r?"":getUniqueRunDependency("al "+e);Module.readAsync(e,(function(n){assert(n,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(n)),i&&removeRunDependency(i)}),(function(t){if(!n)throw'Loading data file "'+e+'" failed.';n()})),i&&addRunDependency(i)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach((function(t){t(e.width,e.height)}))},setCanvasSize:function(e,t,n){var r=Module.canvas;Browser.updateCanvasDimensions(r,e,t),n||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},updateCanvasDimensions:function(e,t,n){t&&n?(e.widthNative=t,e.heightNative=n):(t=e.widthNative,n=e.heightNative);var r=t,i=n;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(r/i>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},get64:function(){var e=SYSCALLS.get(),t=SYSCALLS.get();return assert(e>=0?0===t:-1===t),e},getZero:function(){assert(0===SYSCALLS.get())}};function ___syscall6(e,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.getStreamFromFD();return FS.close(n),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,t){SYSCALLS.varargs=t;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _typeModule(e){var t=[[0,1,"X"],[1,1,"const X"],[128,1,"X *"],[256,1,"X &"],[384,1,"X &&"],[512,1,"std::shared_ptr"],[640,1,"std::unique_ptr"],[5120,1,"std::vector"],[6144,2,"std::array"],[9216,-1,"std::function"]];function n(e,t,n,r,i,u){if(1==t){var o=896&r;128!=o&&256!=o&&384!=o||(e="X const")}return(u?n.replace("X",e).replace("Y",i):e.replace("X",n).replace("Y",i)).replace(/([*&]) (?=[*&])/g,"$1")}function r(e,t){var n=t.flags,r=896&n,i=15360&n;return t.name||1024!=i||(1==t.ptrSize?t.name=(16&n?"":(8&n?"un":"")+"signed ")+"char":t.name=(8&n?"u":"")+(32&n?"float":"int")+8*t.ptrSize+"_t"),8!=t.ptrSize||32&n||(i=64),2048==i&&(512==r||640==r?i=4096:r&&(i=3072)),e(i,t)}var i={Type:function(){function e(e){this.id=e.id,this.name=e.name,this.flags=e.flags,this.spec=e}return e.prototype.toString=function(){return this.name},e}(),getComplexType:function e(i,u,o,a,l,s,c,f){void 0===s&&(s="X"),void 0===f&&(f=1);var d=o(i);if(d)return d;var p,h=a(i),m=h.placeholderFlag,v=t[m];c&&v&&(s=n(c[2],c[0],s,v[0],"?",!0)),0==m&&(p="Unbound"),m>=10&&(p="Corrupt"),f>20&&(p="Deeply nested"),p&&function(e,t,n,r,i){throw new Error(e+" type "+n.replace("X",t+"?")+(r?" with flag "+r:"")+" in "+i)}(p,i,s,m,l||"?");var b,g=e(h.paramList[0],u,o,a,l,s,v,f+1),y={flags:v[0],id:i,name:"",paramList:[g]},_=[],D="?";switch(h.placeholderFlag){case 1:b=g.spec;break;case 2:if(1024==(15360&g.flags)&&1==g.spec.ptrSize){y.flags=7168;break}case 3:case 6:case 5:b=g.spec,g.flags;break;case 8:D=""+h.paramList[1],y.paramList.push(h.paramList[1]);break;case 9:for(var w=0,E=h.paramList[1];w>2]=e),e}function _llvm_stacksave(){var e=_llvm_stacksave;return e.LLVM_SAVEDSTACKS||(e.LLVM_SAVEDSTACKS=[]),e.LLVM_SAVEDSTACKS.push(Runtime.stackSave()),e.LLVM_SAVEDSTACKS.length-1}function ___syscall140(e,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.getStreamFromFD(),r=(SYSCALLS.get(),SYSCALLS.get()),i=SYSCALLS.get(),u=SYSCALLS.get(),o=r;return FS.llseek(n,o,u),HEAP32[i>>2]=n.position,n.getdents&&0===o&&0===u&&(n.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.get(),r=SYSCALLS.get(),i=SYSCALLS.get(),u=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(e,t){var n=___syscall146.buffers[e];assert(n),0===t||10===t?((1===e?Module.print:Module.printErr)(UTF8ArrayToString(n,0)),n.length=0):n.push(t)});for(var o=0;o>2],l=HEAP32[r+(8*o+4)>>2],s=0;se.pageSize/2||t>e.pageSize-n?_nbind.typeNameTbl.NBind.proto.lalloc(t):(HEAPU32[e.usedPtr]=n+t,e.rootPtr+n)},e.lreset=function(t,n){HEAPU32[e.pagePtr]?_nbind.typeNameTbl.NBind.proto.lreset(t,n):HEAPU32[e.usedPtr]=t},e}();function constructType(e,t){var n=new(10240==e?_nbind.makeTypeNameTbl[t.name]||_nbind.BindType:_nbind.makeTypeKindTbl[e])(t);return typeIdTbl[t.id]=n,_nbind.typeNameTbl[t.name]=n,n}function getType(e){return typeIdTbl[e]}function queryType(e){var t=HEAPU8[e],n=_nbind.structureList[t][1];e/=4,n<0&&(n=HEAPU32[++e]+1);var r=Array.prototype.slice.call(HEAPU32.subarray(e+1,e+1+n));return 9==t&&(r=[r[0],r.slice(1)]),{paramList:r,placeholderFlag:t}}function getTypes(e,t){return e.map((function(e){return"number"==typeof e?_nbind.getComplexType(e,constructType,getType,queryType,t):_nbind.typeNameTbl[e]}))}function readTypeIdList(e,t){return Array.prototype.slice.call(HEAPU32,e/4,e/4+t)}function readAsciiString(e){for(var t=e;HEAPU8[t++];);return String.fromCharCode.apply("",HEAPU8.subarray(e,t-1))}function readPolicyList(e){var t={};if(e)for(;;){var n=HEAPU32[e/4];if(!n)break;t[readAsciiString(n)]=!0,e+=4}return t}function getDynCall(e,t){var n={float32_t:"d",float64_t:"d",int64_t:"d",uint64_t:"d",void:"v"},r=e.map((function(e){return n[e.name]||"i"})).join(""),i=Module["dynCall_"+r];if(!i)throw new Error("dynCall_"+r+" not found for "+t+"("+e.map((function(e){return e.name})).join(", ")+")");return i}function addMethod(e,t,n,r){var i=e[t];e.hasOwnProperty(t)&&i?((i.arity||0===i.arity)&&(i=_nbind.makeOverloader(i,i.arity),e[t]=i),i.addMethod(n,r)):(n.arity=r,e[t]=n)}function throwError(e){throw new Error(e)}_nbind.Pool=Pool,_nbind.constructType=constructType,_nbind.getType=getType,_nbind.queryType=queryType,_nbind.getTypes=getTypes,_nbind.readTypeIdList=readTypeIdList,_nbind.readAsciiString=readAsciiString,_nbind.readPolicyList=readPolicyList,_nbind.getDynCall=getDynCall,_nbind.addMethod=addMethod,_nbind.throwError=throwError,_nbind.bigEndian=!1,_a=_typeModule(_typeModule),_nbind.Type=_a.Type,_nbind.makeType=_a.makeType,_nbind.getComplexType=_a.getComplexType,_nbind.structureList=_a.structureList;var BindType=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.heap=HEAPU32,t.ptrSize=4,t}return __extends(t,e),t.prototype.needsWireRead=function(e){return!!this.wireRead||!!this.makeWireRead},t.prototype.needsWireWrite=function(e){return!!this.wireWrite||!!this.makeWireWrite},t}(_nbind.Type);_nbind.BindType=BindType;var PrimitiveType=function(e){function t(t){var n=e.call(this,t)||this,r=32&t.flags?{32:HEAPF32,64:HEAPF64}:8&t.flags?{8:HEAPU8,16:HEAPU16,32:HEAPU32}:{8:HEAP8,16:HEAP16,32:HEAP32};return n.heap=r[8*t.ptrSize],n.ptrSize=t.ptrSize,n}return __extends(t,e),t.prototype.needsWireWrite=function(e){return!!e&&!!e.Strict},t.prototype.makeWireWrite=function(e,t){return t&&t.Strict&&function(e){if("number"==typeof e)return e;throw new Error("Type mismatch")}},t}(BindType);function pushCString(e,t){if(null==e){if(t&&t.Nullable)return 0;throw new Error("Type mismatch")}if(t&&t.Strict){if("string"!=typeof e)throw new Error("Type mismatch")}else e=e.toString();var n=Module.lengthBytesUTF8(e)+1,r=_nbind.Pool.lalloc(n);return Module.stringToUTF8Array(e,HEAPU8,r,n),r}function popCString(e){return 0===e?null:Module.Pointer_stringify(e)}_nbind.PrimitiveType=PrimitiveType,_nbind.pushCString=pushCString,_nbind.popCString=popCString;var CStringType=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.wireRead=popCString,t.wireWrite=pushCString,t.readResources=[_nbind.resources.pool],t.writeResources=[_nbind.resources.pool],t}return __extends(t,e),t.prototype.makeWireWrite=function(e,t){return function(e){return pushCString(e,t)}},t}(BindType);_nbind.CStringType=CStringType;var BooleanType=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.wireRead=function(e){return!!e},t}return __extends(t,e),t.prototype.needsWireWrite=function(e){return!!e&&!!e.Strict},t.prototype.makeWireRead=function(e){return"!!("+e+")"},t.prototype.makeWireWrite=function(e,t){return t&&t.Strict&&function(e){if("boolean"==typeof e)return e;throw new Error("Type mismatch")}||e},t}(BindType);_nbind.BooleanType=BooleanType;var Wrapper=function(){function e(){}return e.prototype.persist=function(){this.__nbindState|=1},e}();function makeBound(e,t){var n=function(e){function n(t,r,i,u){var o=e.call(this)||this;if(!(o instanceof n))return new(Function.prototype.bind.apply(n,Array.prototype.concat.apply([null],arguments)));var a=r,l=i,s=u;if(t!==_nbind.ptrMarker){var c=o.__nbindConstructor.apply(o,arguments);a=4608,s=HEAPU32[c/4],l=HEAPU32[c/4+1]}var f={configurable:!0,enumerable:!1,value:null,writable:!1},d={__nbindFlags:a,__nbindPtr:l};s&&(d.__nbindShared=s,_nbind.mark(o));for(var p=0,h=Object.keys(d);p>=1;var n=_nbind.valueList[e];return _nbind.valueList[e]=firstFreeValue,firstFreeValue=e,n}if(t)return _nbind.popShared(e,t);throw new Error("Invalid value slot "+e)}_nbind.pushValue=pushValue,_nbind.popValue=popValue;var valueBase=0x10000000000000000;function push64(e){return"number"==typeof e?e:4096*pushValue(e)+valueBase}function pop64(e){return e=3?Buffer.from(u):new Buffer(u)).copy(r):getBuffer(r).set(u)}}_nbind.BufferType=BufferType,_nbind.commitBuffer=commitBuffer;var dirtyList=[],gcTimer=0;function sweep(){for(var e=0,t=dirtyList;e>2]=DYNAMIC_BASE,staticSealed=!0,Module.asmGlobalArg={Math,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Float32Array,Float64Array,NaN:NaN,Infinity:1/0},Module.asmLibraryArg={abort,assert,enlargeMemory,getTotalMemory,abortOnCannotGrowMemory,invoke_viiiii,invoke_vif,invoke_vid,invoke_fiff,invoke_vi,invoke_vii,invoke_ii,invoke_viddi,invoke_vidd,invoke_iiii,invoke_diii,invoke_di,invoke_iid,invoke_iii,invoke_viiddi,invoke_viiiiii,invoke_dii,invoke_i,invoke_iiiiii,invoke_viiid,invoke_viififi,invoke_viii,invoke_v,invoke_viid,invoke_idd,invoke_viiii,_emscripten_asm_const_iiiii,_emscripten_asm_const_iiidddddd,_emscripten_asm_const_iiiid,__nbind_reference_external,_emscripten_asm_const_iiiiiiii,_removeAccessorPrefix,_typeModule,__nbind_register_pool,__decorate,_llvm_stackrestore,___cxa_atexit,__extends,__nbind_get_value_object,__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,_emscripten_set_main_loop_timing,__nbind_register_primitive,__nbind_register_type,_emscripten_memcpy_big,__nbind_register_function,___setErrNo,__nbind_register_class,__nbind_finish,_abort,_nbind_value,_llvm_stacksave,___syscall54,_defineHidden,_emscripten_set_main_loop,_emscripten_get_now,__nbind_register_callback_signature,_emscripten_asm_const_iiiiii,__nbind_free_external,_emscripten_asm_const_iiii,_emscripten_asm_const_iiididi,___syscall6,_atexit,___syscall140,___syscall146,DYNAMICTOP_PTR,tempDoublePtr,ABORT,STACKTOP,STACK_MAX,cttz_i8,___dso_handle};var asm=function(e,t,n){"use asm";var r=new e.Int8Array(n);var i=new e.Int16Array(n);var u=new e.Int32Array(n);var o=new e.Uint8Array(n);var a=new e.Uint16Array(n);var l=new e.Uint32Array(n);var s=new e.Float32Array(n);var c=new e.Float64Array(n);var f=t.DYNAMICTOP_PTR|0;var d=t.tempDoublePtr|0;var p=t.ABORT|0;var h=t.STACKTOP|0;var m=t.STACK_MAX|0;var v=t.cttz_i8|0;var b=t.___dso_handle|0;var g=0;var y=0;var _=0;var D=0;var w=e.NaN,E=e.Infinity;var T=0,C=0,k=0,M=0,S=0.0;var x=0;var O=e.Math.floor;var A=e.Math.abs;var P=e.Math.sqrt;var R=e.Math.pow;var I=e.Math.cos;var N=e.Math.sin;var F=e.Math.tan;var L=e.Math.acos;var B=e.Math.asin;var j=e.Math.atan;var U=e.Math.atan2;var W=e.Math.exp;var z=e.Math.log;var q=e.Math.ceil;var H=e.Math.imul;var G=e.Math.min;var V=e.Math.max;var Y=e.Math.clz32;var $=e.Math.fround;var K=t.abort;var X=t.assert;var J=t.enlargeMemory;var Q=t.getTotalMemory;var Z=t.abortOnCannotGrowMemory;var ee=t.invoke_viiiii;var te=t.invoke_vif;var ne=t.invoke_vid;var re=t.invoke_fiff;var ie=t.invoke_vi;var ue=t.invoke_vii;var oe=t.invoke_ii;var ae=t.invoke_viddi;var le=t.invoke_vidd;var se=t.invoke_iiii;var ce=t.invoke_diii;var fe=t.invoke_di;var de=t.invoke_iid;var pe=t.invoke_iii;var he=t.invoke_viiddi;var me=t.invoke_viiiiii;var ve=t.invoke_dii;var be=t.invoke_i;var ge=t.invoke_iiiiii;var ye=t.invoke_viiid;var _e=t.invoke_viififi;var De=t.invoke_viii;var we=t.invoke_v;var Ee=t.invoke_viid;var Te=t.invoke_idd;var Ce=t.invoke_viiii;var ke=t._emscripten_asm_const_iiiii;var Me=t._emscripten_asm_const_iiidddddd;var Se=t._emscripten_asm_const_iiiid;var xe=t.__nbind_reference_external;var Oe=t._emscripten_asm_const_iiiiiiii;var Ae=t._removeAccessorPrefix;var Pe=t._typeModule;var Re=t.__nbind_register_pool;var Ie=t.__decorate;var Ne=t._llvm_stackrestore;var Fe=t.___cxa_atexit;var Le=t.__extends;var Be=t.__nbind_get_value_object;var je=t.__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj;var Ue=t._emscripten_set_main_loop_timing;var We=t.__nbind_register_primitive;var ze=t.__nbind_register_type;var qe=t._emscripten_memcpy_big;var He=t.__nbind_register_function;var Ge=t.___setErrNo;var Ve=t.__nbind_register_class;var Ye=t.__nbind_finish;var $e=t._abort;var Ke=t._nbind_value;var Xe=t._llvm_stacksave;var Je=t.___syscall54;var Qe=t._defineHidden;var Ze=t._emscripten_set_main_loop;var et=t._emscripten_get_now;var tt=t.__nbind_register_callback_signature;var nt=t._emscripten_asm_const_iiiiii;var rt=t.__nbind_free_external;var it=t._emscripten_asm_const_iiii;var ut=t._emscripten_asm_const_iiididi;var ot=t.___syscall6;var at=t._atexit;var lt=t.___syscall140;var st=t.___syscall146;var ct=$(0);const ft=$(0);function dt(e){e=e|0;var t=0;t=h;h=h+e|0;h=h+15&-16;return t|0}function pt(){return h|0}function ht(e){e=e|0;h=e}function mt(e,t){e=e|0;t=t|0;h=e;m=t}function vt(e,t){e=e|0;t=t|0;if(!g){g=e;y=t}}function bt(e){e=e|0;x=e}function gt(){return x|0}function yt(){var e=0,t=0;iS(8104,8,400)|0;iS(8504,408,540)|0;e=9044;t=e+44|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));r[9088]=0;r[9089]=1;u[2273]=0;u[2274]=948;u[2275]=948;Fe(17,8104,b|0)|0;return}function _t(e){e=e|0;Gt(e+948|0);return}function Dt(e){e=$(e);return((Pi(e)|0)&2147483647)>>>0>2139095040|0}function wt(e,t,n){e=e|0;t=t|0;n=n|0;e:do{if(!(u[e+(t<<3)+4>>2]|0)){if((t|2|0)==3?u[e+60>>2]|0:0){e=e+56|0;break}switch(t|0){case 0:case 2:case 4:case 5:{if(u[e+52>>2]|0){e=e+48|0;break e}break}default:{}}if(!(u[e+68>>2]|0)){e=(t|1|0)==5?948:n;break}else{e=e+64|0;break}}else e=e+(t<<3)|0}while(0);return e|0}function Et(e){e=e|0;var t=0;t=Gk(1e3)|0;Tt(e,(t|0)!=0,2456);u[2276]=(u[2276]|0)+1;iS(t|0,8104,1e3)|0;if(r[e+2>>0]|0){u[t+4>>2]=2;u[t+12>>2]=4}u[t+976>>2]=e;return t|0}function Tt(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;i=h;h=h+16|0;r=i;if(!t){u[r>>2]=n;Lr(e,5,3197,r)}h=i;return}function Ct(){return Et(956)|0}function kt(e){e=e|0;var t=0;t=YM(1e3)|0;Mt(t,e);Tt(u[e+976>>2]|0,1,2456);u[2276]=(u[2276]|0)+1;u[t+944>>2]=0;return t|0}function Mt(e,t){e=e|0;t=t|0;var n=0;iS(e|0,t|0,948)|0;Ur(e+948|0,t+948|0);n=e+960|0;e=t+960|0;t=n+40|0;do{u[n>>2]=u[e>>2];n=n+4|0;e=e+4|0}while((n|0)<(t|0));return}function St(e){e=e|0;var t=0,n=0,r=0,i=0;t=e+944|0;n=u[t>>2]|0;if(n|0){xt(n+948|0,e)|0;u[t>>2]=0}n=Ot(e)|0;if(n|0){t=0;do{u[(At(e,t)|0)+944>>2]=0;t=t+1|0}while((t|0)!=(n|0))}n=e+948|0;r=u[n>>2]|0;i=e+952|0;t=u[i>>2]|0;if((t|0)!=(r|0))u[i>>2]=t+(~((t+-4-r|0)>>>2)<<2);Pt(n);Vk(e);u[2276]=(u[2276]|0)+-1;return}function xt(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0;r=u[e>>2]|0;l=e+4|0;n=u[l>>2]|0;o=n;e:do{if((r|0)==(n|0)){i=r;a=4}else{e=r;while(1){if((u[e>>2]|0)==(t|0)){i=e;a=4;break e}e=e+4|0;if((e|0)==(n|0)){e=0;break}}}}while(0);if((a|0)==4)if((i|0)!=(n|0)){r=i+4|0;e=o-r|0;t=e>>2;if(t){sS(i|0,r|0,e|0)|0;n=u[l>>2]|0}e=i+(t<<2)|0;if((n|0)==(e|0))e=1;else{u[l>>2]=n+(~((n+-4-e|0)>>>2)<<2);e=1}}else e=0;return e|0}function Ot(e){e=e|0;return(u[e+952>>2]|0)-(u[e+948>>2]|0)>>2|0}function At(e,t){e=e|0;t=t|0;var n=0;n=u[e+948>>2]|0;if((u[e+952>>2]|0)-n>>2>>>0>t>>>0)e=u[n+(t<<2)>>2]|0;else e=0;return e|0}function Pt(e){e=e|0;var t=0,n=0,r=0,i=0;r=h;h=h+32|0;t=r;i=u[e>>2]|0;n=(u[e+4>>2]|0)-i|0;if(((u[e+8>>2]|0)-i|0)>>>0>n>>>0){i=n>>2;Ri(t,i,i,e+8|0);Ii(e,t);Ni(t)}h=r;return}function Rt(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0;c=Ot(e)|0;do{if(c|0){if((u[(At(e,0)|0)+944>>2]|0)==(e|0)){if(!(xt(e+948|0,t)|0))break;iS(t+400|0,8504,540)|0;u[t+944>>2]=0;Ht(e);break}a=u[(u[e+976>>2]|0)+12>>2]|0;l=e+948|0;s=(a|0)==0;n=0;o=0;do{r=u[(u[l>>2]|0)+(o<<2)>>2]|0;if((r|0)==(t|0))Ht(e);else{i=kt(r)|0;u[(u[l>>2]|0)+(n<<2)>>2]=i;u[i+944>>2]=e;if(!s)Nx[a&15](r,i,e,n);n=n+1|0}o=o+1|0}while((o|0)!=(c|0));if(n>>>0>>0){s=e+948|0;l=e+952|0;a=n;n=u[l>>2]|0;do{o=(u[s>>2]|0)+(a<<2)|0;r=o+4|0;i=n-r|0;t=i>>2;if(!t)i=n;else{sS(o|0,r|0,i|0)|0;n=u[l>>2]|0;i=n}r=o+(t<<2)|0;if((i|0)!=(r|0)){n=i+(~((i+-4-r|0)>>>2)<<2)|0;u[l>>2]=n}a=a+1|0}while((a|0)!=(c|0))}}}while(0);return}function It(e){e=e|0;var t=0,n=0,i=0,o=0;Nt(e,(Ot(e)|0)==0,2491);Nt(e,(u[e+944>>2]|0)==0,2545);t=e+948|0;n=u[t>>2]|0;i=e+952|0;o=u[i>>2]|0;if((o|0)!=(n|0))u[i>>2]=o+(~((o+-4-n|0)>>>2)<<2);Pt(t);t=e+976|0;n=u[t>>2]|0;iS(e|0,8104,1e3)|0;if(r[n+2>>0]|0){u[e+4>>2]=2;u[e+12>>2]=4}u[t>>2]=n;return}function Nt(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;i=h;h=h+16|0;r=i;if(!t){u[r>>2]=n;Cr(e,5,3197,r)}h=i;return}function Ft(){return u[2276]|0}function Lt(){var e=0;e=Gk(20)|0;Bt((e|0)!=0,2592);u[2277]=(u[2277]|0)+1;u[e>>2]=u[239];u[e+4>>2]=u[240];u[e+8>>2]=u[241];u[e+12>>2]=u[242];u[e+16>>2]=u[243];return e|0}function Bt(e,t){e=e|0;t=t|0;var n=0,r=0;r=h;h=h+16|0;n=r;if(!e){u[n>>2]=t;Cr(0,5,3197,n)}h=r;return}function jt(e){e=e|0;Vk(e);u[2277]=(u[2277]|0)+-1;return}function Ut(e,t){e=e|0;t=t|0;var n=0;if(!t){n=0;t=0}else{Nt(e,(Ot(e)|0)==0,2629);n=1}u[e+964>>2]=t;u[e+988>>2]=n;return}function Wt(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;o=r+8|0;i=r+4|0;a=r;u[i>>2]=t;Nt(e,(u[t+944>>2]|0)==0,2709);Nt(e,(u[e+964>>2]|0)==0,2763);zt(e);t=e+948|0;u[a>>2]=(u[t>>2]|0)+(n<<2);u[o>>2]=u[a>>2];qt(t,o,i)|0;u[(u[i>>2]|0)+944>>2]=e;Ht(e);h=r;return}function zt(e){e=e|0;var t=0,n=0,r=0,i=0,o=0,a=0,l=0;n=Ot(e)|0;if(n|0?(u[(At(e,0)|0)+944>>2]|0)!=(e|0):0){r=u[(u[e+976>>2]|0)+12>>2]|0;i=e+948|0;o=(r|0)==0;t=0;do{a=u[(u[i>>2]|0)+(t<<2)>>2]|0;l=kt(a)|0;u[(u[i>>2]|0)+(t<<2)>>2]=l;u[l+944>>2]=e;if(!o)Nx[r&15](a,l,e,t);t=t+1|0}while((t|0)!=(n|0))}return}function qt(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0;g=h;h=h+64|0;d=g+52|0;l=g+48|0;p=g+28|0;m=g+24|0;v=g+20|0;b=g;r=u[e>>2]|0;o=r;t=r+((u[t>>2]|0)-o>>2<<2)|0;r=e+4|0;i=u[r>>2]|0;a=e+8|0;do{if(i>>>0<(u[a>>2]|0)>>>0){if((t|0)==(i|0)){u[t>>2]=u[n>>2];u[r>>2]=(u[r>>2]|0)+4;break}Fi(e,t,i,t+4|0);if(t>>>0<=n>>>0)n=(u[r>>2]|0)>>>0>n>>>0?n+4|0:n;u[t>>2]=u[n>>2]}else{r=(i-o>>2)+1|0;i=qr(e)|0;if(i>>>0>>0)UM(e);f=u[e>>2]|0;c=(u[a>>2]|0)-f|0;o=c>>1;Ri(b,c>>2>>>0>>1>>>0?o>>>0>>0?r:o:i,t-f>>2,e+8|0);f=b+8|0;r=u[f>>2]|0;o=b+12|0;c=u[o>>2]|0;a=c;s=r;do{if((r|0)==(c|0)){c=b+4|0;r=u[c>>2]|0;y=u[b>>2]|0;i=y;if(r>>>0<=y>>>0){r=a-i>>1;r=(r|0)==0?1:r;Ri(p,r,r>>>2,u[b+16>>2]|0);u[m>>2]=u[c>>2];u[v>>2]=u[f>>2];u[l>>2]=u[m>>2];u[d>>2]=u[v>>2];Bi(p,l,d);r=u[b>>2]|0;u[b>>2]=u[p>>2];u[p>>2]=r;r=p+4|0;y=u[c>>2]|0;u[c>>2]=u[r>>2];u[r>>2]=y;r=p+8|0;y=u[f>>2]|0;u[f>>2]=u[r>>2];u[r>>2]=y;r=p+12|0;y=u[o>>2]|0;u[o>>2]=u[r>>2];u[r>>2]=y;Ni(p);r=u[f>>2]|0;break}o=r;a=((o-i>>2)+1|0)/-2|0;l=r+(a<<2)|0;i=s-o|0;o=i>>2;if(o){sS(l|0,r|0,i|0)|0;r=u[c>>2]|0}y=l+(o<<2)|0;u[f>>2]=y;u[c>>2]=r+(a<<2);r=y}}while(0);u[r>>2]=u[n>>2];u[f>>2]=(u[f>>2]|0)+4;t=Li(e,b,t)|0;Ni(b)}}while(0);h=g;return t|0}function Ht(e){e=e|0;var t=0;do{t=e+984|0;if(r[t>>0]|0)break;r[t>>0]=1;s[e+504>>2]=$(w);e=u[e+944>>2]|0}while((e|0)!=0);return}function Gt(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-4-r|0)>>>2)<<2);KM(n)}return}function Vt(e){e=e|0;return u[e+944>>2]|0}function Yt(e){e=e|0;Nt(e,(u[e+964>>2]|0)!=0,2832);Ht(e);return}function $t(e){e=e|0;return(r[e+984>>0]|0)!=0|0}function Kt(e,t){e=e|0;t=t|0;if(iM(e,t,400)|0){iS(e|0,t|0,400)|0;Ht(e)}return}function Xt(e){e=e|0;var t=ft;t=$(s[e+44>>2]);e=Dt(t)|0;return $(e?$(0.0):t)}function Jt(e){e=e|0;var t=ft;t=$(s[e+48>>2]);if(Dt(t)|0)t=r[(u[e+976>>2]|0)+2>>0]|0?$(1.0):$(0.0);return $(t)}function Qt(e,t){e=e|0;t=t|0;u[e+980>>2]=t;return}function Zt(e){e=e|0;return u[e+980>>2]|0}function en(e,t){e=e|0;t=t|0;var n=0;n=e+4|0;if((u[n>>2]|0)!=(t|0)){u[n>>2]=t;Ht(e)}return}function tn(e){e=e|0;return u[e+4>>2]|0}function nn(e,t){e=e|0;t=t|0;var n=0;n=e+8|0;if((u[n>>2]|0)!=(t|0)){u[n>>2]=t;Ht(e)}return}function rn(e){e=e|0;return u[e+8>>2]|0}function un(e,t){e=e|0;t=t|0;var n=0;n=e+12|0;if((u[n>>2]|0)!=(t|0)){u[n>>2]=t;Ht(e)}return}function on(e){e=e|0;return u[e+12>>2]|0}function an(e,t){e=e|0;t=t|0;var n=0;n=e+16|0;if((u[n>>2]|0)!=(t|0)){u[n>>2]=t;Ht(e)}return}function ln(e){e=e|0;return u[e+16>>2]|0}function sn(e,t){e=e|0;t=t|0;var n=0;n=e+20|0;if((u[n>>2]|0)!=(t|0)){u[n>>2]=t;Ht(e)}return}function cn(e){e=e|0;return u[e+20>>2]|0}function fn(e,t){e=e|0;t=t|0;var n=0;n=e+24|0;if((u[n>>2]|0)!=(t|0)){u[n>>2]=t;Ht(e)}return}function dn(e){e=e|0;return u[e+24>>2]|0}function pn(e,t){e=e|0;t=t|0;var n=0;n=e+28|0;if((u[n>>2]|0)!=(t|0)){u[n>>2]=t;Ht(e)}return}function hn(e){e=e|0;return u[e+28>>2]|0}function mn(e,t){e=e|0;t=t|0;var n=0;n=e+32|0;if((u[n>>2]|0)!=(t|0)){u[n>>2]=t;Ht(e)}return}function vn(e){e=e|0;return u[e+32>>2]|0}function bn(e,t){e=e|0;t=t|0;var n=0;n=e+36|0;if((u[n>>2]|0)!=(t|0)){u[n>>2]=t;Ht(e)}return}function gn(e){e=e|0;return u[e+36>>2]|0}function yn(e,t){e=e|0;t=$(t);var n=0;n=e+40|0;if($(s[n>>2])!=t){s[n>>2]=t;Ht(e)}return}function _n(e,t){e=e|0;t=$(t);var n=0;n=e+44|0;if($(s[n>>2])!=t){s[n>>2]=t;Ht(e)}return}function Dn(e,t){e=e|0;t=$(t);var n=0;n=e+48|0;if($(s[n>>2])!=t){s[n>>2]=t;Ht(e)}return}function wn(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=(o^1)&1;r=e+52|0;i=e+56|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function En(e,t){e=e|0;t=$(t);var n=0,r=0;r=e+52|0;n=e+56|0;if(!(!($(s[r>>2])!=t)?(u[n>>2]|0)==2:0)){s[r>>2]=t;r=Dt(t)|0;u[n>>2]=r?3:2;Ht(e)}return}function Tn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+52|0;n=u[r+4>>2]|0;t=e;u[t>>2]=u[r>>2];u[t+4>>2]=n;return}function Cn(e,t,n){e=e|0;t=t|0;n=$(n);var r=0,i=0,o=0;o=Dt(n)|0;r=(o^1)&1;i=e+132+(t<<3)|0;t=e+132+(t<<3)+4|0;if(!(o|$(s[i>>2])==n?(u[t>>2]|0)==(r|0):0)){s[i>>2]=n;u[t>>2]=r;Ht(e)}return}function kn(e,t,n){e=e|0;t=t|0;n=$(n);var r=0,i=0,o=0;o=Dt(n)|0;r=o?0:2;i=e+132+(t<<3)|0;t=e+132+(t<<3)+4|0;if(!(o|$(s[i>>2])==n?(u[t>>2]|0)==(r|0):0)){s[i>>2]=n;u[t>>2]=r;Ht(e)}return}function Mn(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=t+132+(n<<3)|0;t=u[r+4>>2]|0;n=e;u[n>>2]=u[r>>2];u[n+4>>2]=t;return}function Sn(e,t,n){e=e|0;t=t|0;n=$(n);var r=0,i=0,o=0;o=Dt(n)|0;r=(o^1)&1;i=e+60+(t<<3)|0;t=e+60+(t<<3)+4|0;if(!(o|$(s[i>>2])==n?(u[t>>2]|0)==(r|0):0)){s[i>>2]=n;u[t>>2]=r;Ht(e)}return}function xn(e,t,n){e=e|0;t=t|0;n=$(n);var r=0,i=0,o=0;o=Dt(n)|0;r=o?0:2;i=e+60+(t<<3)|0;t=e+60+(t<<3)+4|0;if(!(o|$(s[i>>2])==n?(u[t>>2]|0)==(r|0):0)){s[i>>2]=n;u[t>>2]=r;Ht(e)}return}function On(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=t+60+(n<<3)|0;t=u[r+4>>2]|0;n=e;u[n>>2]=u[r>>2];u[n+4>>2]=t;return}function An(e,t){e=e|0;t=t|0;var n=0;n=e+60+(t<<3)+4|0;if((u[n>>2]|0)!=3){s[e+60+(t<<3)>>2]=$(w);u[n>>2]=3;Ht(e)}return}function Pn(e,t,n){e=e|0;t=t|0;n=$(n);var r=0,i=0,o=0;o=Dt(n)|0;r=(o^1)&1;i=e+204+(t<<3)|0;t=e+204+(t<<3)+4|0;if(!(o|$(s[i>>2])==n?(u[t>>2]|0)==(r|0):0)){s[i>>2]=n;u[t>>2]=r;Ht(e)}return}function Rn(e,t,n){e=e|0;t=t|0;n=$(n);var r=0,i=0,o=0;o=Dt(n)|0;r=o?0:2;i=e+204+(t<<3)|0;t=e+204+(t<<3)+4|0;if(!(o|$(s[i>>2])==n?(u[t>>2]|0)==(r|0):0)){s[i>>2]=n;u[t>>2]=r;Ht(e)}return}function In(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=t+204+(n<<3)|0;t=u[r+4>>2]|0;n=e;u[n>>2]=u[r>>2];u[n+4>>2]=t;return}function Nn(e,t,n){e=e|0;t=t|0;n=$(n);var r=0,i=0,o=0;o=Dt(n)|0;r=(o^1)&1;i=e+276+(t<<3)|0;t=e+276+(t<<3)+4|0;if(!(o|$(s[i>>2])==n?(u[t>>2]|0)==(r|0):0)){s[i>>2]=n;u[t>>2]=r;Ht(e)}return}function Fn(e,t){e=e|0;t=t|0;return $(s[e+276+(t<<3)>>2])}function Ln(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=(o^1)&1;r=e+348|0;i=e+352|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function Bn(e,t){e=e|0;t=$(t);var n=0,r=0;r=e+348|0;n=e+352|0;if(!(!($(s[r>>2])!=t)?(u[n>>2]|0)==2:0)){s[r>>2]=t;r=Dt(t)|0;u[n>>2]=r?3:2;Ht(e)}return}function jn(e){e=e|0;var t=0;t=e+352|0;if((u[t>>2]|0)!=3){s[e+348>>2]=$(w);u[t>>2]=3;Ht(e)}return}function Un(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+348|0;n=u[r+4>>2]|0;t=e;u[t>>2]=u[r>>2];u[t+4>>2]=n;return}function Wn(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=(o^1)&1;r=e+356|0;i=e+360|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function zn(e,t){e=e|0;t=$(t);var n=0,r=0;r=e+356|0;n=e+360|0;if(!(!($(s[r>>2])!=t)?(u[n>>2]|0)==2:0)){s[r>>2]=t;r=Dt(t)|0;u[n>>2]=r?3:2;Ht(e)}return}function qn(e){e=e|0;var t=0;t=e+360|0;if((u[t>>2]|0)!=3){s[e+356>>2]=$(w);u[t>>2]=3;Ht(e)}return}function Hn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+356|0;n=u[r+4>>2]|0;t=e;u[t>>2]=u[r>>2];u[t+4>>2]=n;return}function Gn(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=(o^1)&1;r=e+364|0;i=e+368|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function Vn(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=o?0:2;r=e+364|0;i=e+368|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function Yn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+364|0;n=u[r+4>>2]|0;t=e;u[t>>2]=u[r>>2];u[t+4>>2]=n;return}function $n(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=(o^1)&1;r=e+372|0;i=e+376|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function Kn(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=o?0:2;r=e+372|0;i=e+376|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function Xn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+372|0;n=u[r+4>>2]|0;t=e;u[t>>2]=u[r>>2];u[t+4>>2]=n;return}function Jn(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=(o^1)&1;r=e+380|0;i=e+384|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function Qn(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=o?0:2;r=e+380|0;i=e+384|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function Zn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+380|0;n=u[r+4>>2]|0;t=e;u[t>>2]=u[r>>2];u[t+4>>2]=n;return}function er(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=(o^1)&1;r=e+388|0;i=e+392|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function tr(e,t){e=e|0;t=$(t);var n=0,r=0,i=0,o=0;o=Dt(t)|0;n=o?0:2;r=e+388|0;i=e+392|0;if(!(o|$(s[r>>2])==t?(u[i>>2]|0)==(n|0):0)){s[r>>2]=t;u[i>>2]=n;Ht(e)}return}function nr(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+388|0;n=u[r+4>>2]|0;t=e;u[t>>2]=u[r>>2];u[t+4>>2]=n;return}function rr(e,t){e=e|0;t=$(t);var n=0;n=e+396|0;if($(s[n>>2])!=t){s[n>>2]=t;Ht(e)}return}function ir(e){e=e|0;return $(s[e+396>>2])}function ur(e){e=e|0;return $(s[e+400>>2])}function or(e){e=e|0;return $(s[e+404>>2])}function ar(e){e=e|0;return $(s[e+408>>2])}function lr(e){e=e|0;return $(s[e+412>>2])}function sr(e){e=e|0;return $(s[e+416>>2])}function cr(e){e=e|0;return $(s[e+420>>2])}function fr(e,t){e=e|0;t=t|0;Nt(e,(t|0)<6,2918);switch(t|0){case 0:{t=(u[e+496>>2]|0)==2?5:4;break}case 2:{t=(u[e+496>>2]|0)==2?4:5;break}default:{}}return $(s[e+424+(t<<2)>>2])}function dr(e,t){e=e|0;t=t|0;Nt(e,(t|0)<6,2918);switch(t|0){case 0:{t=(u[e+496>>2]|0)==2?5:4;break}case 2:{t=(u[e+496>>2]|0)==2?4:5;break}default:{}}return $(s[e+448+(t<<2)>>2])}function pr(e,t){e=e|0;t=t|0;Nt(e,(t|0)<6,2918);switch(t|0){case 0:{t=(u[e+496>>2]|0)==2?5:4;break}case 2:{t=(u[e+496>>2]|0)==2?4:5;break}default:{}}return $(s[e+472+(t<<2)>>2])}function hr(e,t){e=e|0;t=t|0;var n=0,r=ft;n=u[e+4>>2]|0;if((n|0)==(u[t+4>>2]|0)){if(!n)e=1;else{r=$(s[e>>2]);e=$(A($(r-$(s[t>>2]))))<$(.0000999999974)}}else e=0;return e|0}function mr(e,t){e=$(e);t=$(t);var n=0;if(Dt(e)|0)n=Dt(t)|0;else n=$(A($(e-t)))<$(.0000999999974);return n|0}function vr(e,t){e=e|0;t=t|0;br(e,t);return}function br(e,t){e=e|0;t=t|0;var n=0,i=0;n=h;h=h+16|0;i=n+4|0;u[i>>2]=0;u[i+4>>2]=0;u[i+8>>2]=0;je(i|0,e|0,t|0,0);Cr(e,3,(r[i+11>>0]|0)<0?u[i>>2]|0:i,n);XM(i);h=n;return}function gr(e,t,n,r){e=$(e);t=$(t);n=n|0;r=r|0;var i=ft;e=$(e*t);i=$(LM(e,$(1.0)));do{if(!(mr(i,$(0.0))|0)){e=$(e-i);if(mr(i,$(1.0))|0){e=$(e+$(1.0));break}if(n){e=$(e+$(1.0));break}if(!r){if(i>$(.5))i=$(1.0);else{r=mr(i,$(.5))|0;i=r?$(1.0):$(0.0)}e=$(e+i)}}else e=$(e-i)}while(0);return $(e/t)}function yr(e,t,n,r,i,u,o,a,l,c,f,d,p){e=e|0;t=$(t);n=n|0;r=$(r);i=i|0;u=$(u);o=o|0;a=$(a);l=$(l);c=$(c);f=$(f);d=$(d);p=p|0;var h=0,m=ft,v=ft,b=ft,g=ft,y=ft,_=ft;if(l<$(0.0)|c<$(0.0))p=0;else{if((p|0)!=0?(m=$(s[p+4>>2]),m!=$(0.0)):0){b=$(gr(t,m,0,0));g=$(gr(r,m,0,0));v=$(gr(u,m,0,0));m=$(gr(a,m,0,0))}else{v=u;b=t;m=a;g=r}if((i|0)==(e|0))h=mr(v,b)|0;else h=0;if((o|0)==(n|0))p=mr(m,g)|0;else p=0;if((!h?(y=$(t-f),!(_r(e,y,l)|0)):0)?!(Dr(e,y,i,l)|0):0)h=wr(e,y,i,u,l)|0;else h=1;if((!p?(_=$(r-d),!(_r(n,_,c)|0)):0)?!(Dr(n,_,o,c)|0):0)p=wr(n,_,o,a,c)|0;else p=1;p=h&p}return p|0}function _r(e,t,n){e=e|0;t=$(t);n=$(n);if((e|0)==1)e=mr(t,n)|0;else e=0;return e|0}function Dr(e,t,n,r){e=e|0;t=$(t);n=n|0;r=$(r);if((e|0)==2&(n|0)==0){if(!(t>=r))e=mr(t,r)|0;else e=1}else e=0;return e|0}function wr(e,t,n,r,i){e=e|0;t=$(t);n=n|0;r=$(r);i=$(i);if((e|0)==2&(n|0)==2&r>t){if(!(i<=t))e=mr(t,i)|0;else e=1}else e=0;return e|0}function Er(e,t,n,i,o,a,l,f,d,p,m){e=e|0;t=$(t);n=$(n);i=i|0;o=o|0;a=a|0;l=$(l);f=$(f);d=d|0;p=p|0;m=m|0;var v=0,b=0,g=0,y=0,_=ft,D=ft,w=0,E=0,T=0,C=0,k=0,M=0,S=0,x=0,O=0,A=0,P=0,R=ft,I=ft,N=ft,F=0.0,L=0.0;P=h;h=h+160|0;x=P+152|0;S=P+120|0;M=P+104|0;T=P+72|0;y=P+56|0;k=P+8|0;E=P;C=(u[2279]|0)+1|0;u[2279]=C;O=e+984|0;if((r[O>>0]|0)!=0?(u[e+512>>2]|0)!=(u[2278]|0):0)w=4;else if((u[e+516>>2]|0)==(i|0))A=0;else w=4;if((w|0)==4){u[e+520>>2]=0;u[e+924>>2]=-1;u[e+928>>2]=-1;s[e+932>>2]=$(-1.0);s[e+936>>2]=$(-1.0);A=1}e:do{if(!(u[e+964>>2]|0)){if(d){v=e+916|0;if(!(mr($(s[v>>2]),t)|0)){w=21;break}if(!(mr($(s[e+920>>2]),n)|0)){w=21;break}if((u[e+924>>2]|0)!=(o|0)){w=21;break}v=(u[e+928>>2]|0)==(a|0)?v:0;w=22;break}g=u[e+520>>2]|0;if(!g)w=21;else{b=0;while(1){v=e+524+(b*24|0)|0;if(((mr($(s[v>>2]),t)|0?mr($(s[e+524+(b*24|0)+4>>2]),n)|0:0)?(u[e+524+(b*24|0)+8>>2]|0)==(o|0):0)?(u[e+524+(b*24|0)+12>>2]|0)==(a|0):0){w=22;break e}b=b+1|0;if(b>>>0>=g>>>0){w=21;break}}}}else{_=$(Tr(e,2,l));D=$(Tr(e,0,l));v=e+916|0;N=$(s[v>>2]);I=$(s[e+920>>2]);R=$(s[e+932>>2]);if(!(yr(o,t,a,n,u[e+924>>2]|0,N,u[e+928>>2]|0,I,R,$(s[e+936>>2]),_,D,m)|0)){g=u[e+520>>2]|0;if(!g)w=21;else{b=0;while(1){v=e+524+(b*24|0)|0;R=$(s[v>>2]);I=$(s[e+524+(b*24|0)+4>>2]);N=$(s[e+524+(b*24|0)+16>>2]);if(yr(o,t,a,n,u[e+524+(b*24|0)+8>>2]|0,R,u[e+524+(b*24|0)+12>>2]|0,I,N,$(s[e+524+(b*24|0)+20>>2]),_,D,m)|0){w=22;break e}b=b+1|0;if(b>>>0>=g>>>0){w=21;break}}}}else w=22}}while(0);do{if((w|0)==21){if(!(r[11697]|0)){v=0;w=31}else{v=0;w=28}}else if((w|0)==22){b=(r[11697]|0)!=0;if(!((v|0)!=0&(A^1)))if(b){w=28;break}else{w=31;break}y=v+16|0;u[e+908>>2]=u[y>>2];g=v+20|0;u[e+912>>2]=u[g>>2];if(!((r[11698]|0)==0|b^1)){u[E>>2]=kr(C)|0;u[E+4>>2]=C;Cr(e,4,2972,E);b=u[e+972>>2]|0;if(b|0)hx[b&127](e);o=Mr(o,d)|0;a=Mr(a,d)|0;L=+$(s[y>>2]);F=+$(s[g>>2]);u[k>>2]=o;u[k+4>>2]=a;c[k+8>>3]=+t;c[k+16>>3]=+n;c[k+24>>3]=L;c[k+32>>3]=F;u[k+40>>2]=p;Cr(e,4,2989,k)}}}while(0);if((w|0)==28){b=kr(C)|0;u[y>>2]=b;u[y+4>>2]=C;u[y+8>>2]=A?3047:11699;Cr(e,4,3038,y);b=u[e+972>>2]|0;if(b|0)hx[b&127](e);k=Mr(o,d)|0;w=Mr(a,d)|0;u[T>>2]=k;u[T+4>>2]=w;c[T+8>>3]=+t;c[T+16>>3]=+n;u[T+24>>2]=p;Cr(e,4,3049,T);w=31}if((w|0)==31){Sr(e,t,n,i,o,a,l,f,d,m);if(r[11697]|0){b=u[2279]|0;k=kr(b)|0;u[M>>2]=k;u[M+4>>2]=b;u[M+8>>2]=A?3047:11699;Cr(e,4,3083,M);b=u[e+972>>2]|0;if(b|0)hx[b&127](e);k=Mr(o,d)|0;M=Mr(a,d)|0;F=+$(s[e+908>>2]);L=+$(s[e+912>>2]);u[S>>2]=k;u[S+4>>2]=M;c[S+8>>3]=F;c[S+16>>3]=L;u[S+24>>2]=p;Cr(e,4,3092,S)}u[e+516>>2]=i;if(!v){b=e+520|0;v=u[b>>2]|0;if((v|0)==16){if(r[11697]|0)Cr(e,4,3124,x);u[b>>2]=0;v=0}if(d)v=e+916|0;else{u[b>>2]=v+1;v=e+524+(v*24|0)|0}s[v>>2]=t;s[v+4>>2]=n;u[v+8>>2]=o;u[v+12>>2]=a;u[v+16>>2]=u[e+908>>2];u[v+20>>2]=u[e+912>>2];v=0}}if(d){u[e+416>>2]=u[e+908>>2];u[e+420>>2]=u[e+912>>2];r[e+985>>0]=1;r[O>>0]=0}u[2279]=(u[2279]|0)+-1;u[e+512>>2]=u[2278];h=P;return A|(v|0)==0|0}function Tr(e,t,n){e=e|0;t=t|0;n=$(n);var r=ft;r=$(Hr(e,t,n));return $(r+$(Gr(e,t,n)))}function Cr(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=h;h=h+16|0;i=o;u[i>>2]=r;if(!e)r=0;else r=u[e+976>>2]|0;Br(r,e,t,n,i);h=o;return}function kr(e){e=e|0;return(e>>>0>60?3201:3201+(60-e)|0)|0}function Mr(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+32|0;n=i+12|0;r=i;u[n>>2]=u[254];u[n+4>>2]=u[255];u[n+8>>2]=u[256];u[r>>2]=u[257];u[r+4>>2]=u[258];u[r+8>>2]=u[259];if((e|0)>2)e=11699;else e=u[(t?r:n)+(e<<2)>>2]|0;h=i;return e|0}function Sr(e,t,n,i,a,l,c,f,p,m){e=e|0;t=$(t);n=$(n);i=i|0;a=a|0;l=l|0;c=$(c);f=$(f);p=p|0;m=m|0;var v=0,b=0,g=0,y=0,_=ft,D=ft,w=ft,E=ft,T=ft,C=ft,k=ft,M=0,S=0,x=0,O=ft,A=ft,P=0,R=ft,I=0,N=0,F=0,L=0,B=0,j=0,U=0,W=0,z=0,q=0,H=0,G=0,V=0,Y=0,K=0,X=0,J=0,Q=0,Z=ft,ee=ft,te=ft,ne=ft,re=ft,ie=0,ue=0,oe=0,ae=0,le=0,se=ft,ce=ft,fe=ft,de=ft,pe=ft,he=ft,me=0,ve=ft,be=ft,ge=ft,ye=ft,_e=ft,De=ft,we=0,Ee=0,Te=ft,Ce=ft,ke=0,Me=0,Se=0,xe=0,Oe=ft,Ae=0,Pe=0,Re=0,Ie=0,Ne=0,Fe=0,Le=0,Be=ft,je=0,Ue=0;Le=h;h=h+16|0;ie=Le+12|0;ue=Le+8|0;oe=Le+4|0;ae=Le;Nt(e,(a|0)==0|(Dt(t)|0)^1,3326);Nt(e,(l|0)==0|(Dt(n)|0)^1,3406);Pe=$r(e,i)|0;u[e+496>>2]=Pe;Ne=Kr(2,Pe)|0;Fe=Kr(0,Pe)|0;s[e+440>>2]=$(Hr(e,Ne,c));s[e+444>>2]=$(Gr(e,Ne,c));s[e+428>>2]=$(Hr(e,Fe,c));s[e+436>>2]=$(Gr(e,Fe,c));s[e+464>>2]=$(Xr(e,Ne));s[e+468>>2]=$(Jr(e,Ne));s[e+452>>2]=$(Xr(e,Fe));s[e+460>>2]=$(Jr(e,Fe));s[e+488>>2]=$(Qr(e,Ne,c));s[e+492>>2]=$(Zr(e,Ne,c));s[e+476>>2]=$(Qr(e,Fe,c));s[e+484>>2]=$(Zr(e,Fe,c));do{if(!(u[e+964>>2]|0)){Re=e+948|0;Ie=(u[e+952>>2]|0)-(u[Re>>2]|0)>>2;if(!Ie){ti(e,t,n,a,l,c,f);break}if(!p?ni(e,t,n,a,l,c,f)|0:0)break;zt(e);X=e+508|0;r[X>>0]=0;Ne=Kr(u[e+4>>2]|0,Pe)|0;Fe=ri(Ne,Pe)|0;Ae=Vr(Ne)|0;J=u[e+8>>2]|0;Me=e+28|0;Q=(u[Me>>2]|0)!=0;_e=Ae?c:f;Te=Ae?f:c;Z=$(ii(e,Ne,c));ee=$(ui(e,Ne,c));_=$(ii(e,Fe,c));De=$(oi(e,Ne,c));Ce=$(oi(e,Fe,c));x=Ae?a:l;ke=Ae?l:a;Oe=Ae?De:Ce;T=Ae?Ce:De;ye=$(Tr(e,2,c));E=$(Tr(e,0,c));D=$($(Rr(e+364|0,c))-Oe);w=$($(Rr(e+380|0,c))-Oe);C=$($(Rr(e+372|0,f))-T);k=$($(Rr(e+388|0,f))-T);te=Ae?D:C;ne=Ae?w:k;ye=$(t-ye);t=$(ye-Oe);if(Dt(t)|0)Oe=t;else Oe=$(RM($(NM(t,w)),D));be=$(n-E);t=$(be-T);if(Dt(t)|0)ge=t;else ge=$(RM($(NM(t,k)),C));D=Ae?Oe:ge;ve=Ae?ge:Oe;e:do{if((x|0)==1){i=0;b=0;while(1){v=At(e,b)|0;if(!i){if($(li(v))>$(0.0)?$(si(v))>$(0.0):0)i=v;else i=0}else if(ai(v)|0){y=0;break e}b=b+1|0;if(b>>>0>=Ie>>>0){y=i;break}}}else y=0}while(0);M=y+500|0;S=y+504|0;i=0;v=0;t=$(0.0);g=0;do{b=u[(u[Re>>2]|0)+(g<<2)>>2]|0;if((u[b+36>>2]|0)==1){ci(b);r[b+985>>0]=1;r[b+984>>0]=0}else{Ar(b);if(p)Ir(b,$r(b,Pe)|0,D,ve,Oe);do{if((u[b+24>>2]|0)!=1){if((b|0)==(y|0)){u[M>>2]=u[2278];s[S>>2]=$(0.0);break}else{fi(e,b,Oe,a,ge,Oe,ge,l,Pe,m);break}}else{if(v|0)u[v+960>>2]=b;u[b+960>>2]=0;v=b;i=(i|0)==0?b:i}}while(0);he=$(s[b+504>>2]);t=$(t+$(he+$(Tr(b,Ne,Oe))))}g=g+1|0}while((g|0)!=(Ie|0));F=t>D;me=Q&((x|0)==2&F)?1:x;I=(ke|0)==1;B=I&(p^1);j=(me|0)==1;U=(me|0)==2;W=976+(Ne<<2)|0;z=(ke|2|0)==2;Y=I&(Q^1);q=1040+(Fe<<2)|0;H=1040+(Ne<<2)|0;G=976+(Fe<<2)|0;V=(ke|0)!=1;F=Q&((x|0)!=0&F);N=e+976|0;I=I^1;t=D;P=0;L=0;he=$(0.0);re=$(0.0);while(1){e:do{if(P>>>0>>0){S=u[Re>>2]|0;g=0;k=$(0.0);C=$(0.0);w=$(0.0);D=$(0.0);b=0;v=0;y=P;while(1){M=u[S+(y<<2)>>2]|0;if((u[M+36>>2]|0)!=1?(u[M+940>>2]=L,(u[M+24>>2]|0)!=1):0){E=$(Tr(M,Ne,Oe));K=u[W>>2]|0;n=$(Rr(M+380+(K<<3)|0,_e));T=$(s[M+504>>2]);n=$(NM(n,T));n=$(RM($(Rr(M+364+(K<<3)|0,_e)),n));if(Q&(g|0)!=0&$(E+$(C+n))>t){l=g;E=k;x=y;break e}E=$(E+n);n=$(C+E);E=$(k+E);if(ai(M)|0){w=$(w+$(li(M)));D=$(D-$(T*$(si(M))))}if(v|0)u[v+960>>2]=M;u[M+960>>2]=0;g=g+1|0;v=M;b=(b|0)==0?M:b}else{E=k;n=C}y=y+1|0;if(y>>>0>>0){k=E;C=n}else{l=g;x=y;break}}}else{l=0;E=$(0.0);w=$(0.0);D=$(0.0);b=0;x=P}}while(0);K=w>$(0.0)&w<$(1.0);O=K?$(1.0):w;K=D>$(0.0)&D<$(1.0);k=K?$(1.0):D;do{if(!j){if(!(Ene&((Dt(ne)|0)^1))){if(!(r[(u[N>>2]|0)+3>>0]|0)){if(!(O==$(0.0))?!($(li(e))==$(0.0)):0){K=53;break}t=E;K=53}else K=51}else{t=ne;K=51}}else{t=te;K=51}}else K=51}while(0);if((K|0)==51){K=0;if(Dt(t)|0)K=53;else{A=$(t-E);R=t}}if((K|0)==53){K=0;if(E<$(0.0)){A=$(-E);R=t}else{A=$(0.0);R=t}}if(!B?(le=(b|0)==0,!le):0){g=u[W>>2]|0;y=A<$(0.0);T=$(A/k);M=A>$(0.0);C=$(A/O);w=$(0.0);E=$(0.0);t=$(0.0);v=b;do{n=$(Rr(v+380+(g<<3)|0,_e));D=$(Rr(v+364+(g<<3)|0,_e));D=$(NM(n,$(RM(D,$(s[v+504>>2])))));if(y){n=$(D*$(si(v)));if(n!=$(-0.0)?(Be=$(D-$(T*n)),se=$(di(v,Ne,Be,R,Oe)),Be!=se):0){w=$(w-$(se-D));t=$(t+n)}}else if((M?(ce=$(li(v)),ce!=$(0.0)):0)?(Be=$(D+$(C*ce)),fe=$(di(v,Ne,Be,R,Oe)),Be!=fe):0){w=$(w-$(fe-D));E=$(E-ce)}v=u[v+960>>2]|0}while((v|0)!=0);t=$(k+t);D=$(A+w);if(!le){T=$(O+E);y=u[W>>2]|0;M=D<$(0.0);S=t==$(0.0);C=$(D/t);g=D>$(0.0);T=$(D/T);t=$(0.0);do{Be=$(Rr(b+380+(y<<3)|0,_e));w=$(Rr(b+364+(y<<3)|0,_e));w=$(NM(Be,$(RM(w,$(s[b+504>>2])))));if(M){Be=$(w*$(si(b)));D=$(-Be);if(Be!=$(-0.0)){Be=$(C*D);D=$(di(b,Ne,$(w+(S?D:Be)),R,Oe))}else D=w}else if(g?(de=$(li(b)),de!=$(0.0)):0)D=$(di(b,Ne,$(w+$(T*de)),R,Oe));else D=w;t=$(t-$(D-w));E=$(Tr(b,Ne,Oe));n=$(Tr(b,Fe,Oe));D=$(D+E);s[ue>>2]=D;u[ae>>2]=1;w=$(s[b+396>>2]);e:do{if(Dt(w)|0){v=Dt(ve)|0;do{if(!v){if(F|(Pr(b,Fe,ve)|0|I))break;if((pi(e,b)|0)!=4)break;if((u[(hi(b,Fe)|0)+4>>2]|0)==3)break;if((u[(mi(b,Fe)|0)+4>>2]|0)==3)break;s[ie>>2]=ve;u[oe>>2]=1;break e}}while(0);if(Pr(b,Fe,ve)|0){v=u[b+992+(u[G>>2]<<2)>>2]|0;Be=$(n+$(Rr(v,ve)));s[ie>>2]=Be;v=V&(u[v+4>>2]|0)==2;u[oe>>2]=((Dt(Be)|0|v)^1)&1;break}else{s[ie>>2]=ve;u[oe>>2]=v?0:2;break}}else{Be=$(D-E);O=$(Be/w);Be=$(w*Be);u[oe>>2]=1;s[ie>>2]=$(n+(Ae?O:Be))}}while(0);vi(b,Ne,R,Oe,ae,ue);vi(b,Fe,ve,Oe,oe,ie);do{if(!(Pr(b,Fe,ve)|0)?(pi(e,b)|0)==4:0){if((u[(hi(b,Fe)|0)+4>>2]|0)==3){v=0;break}v=(u[(mi(b,Fe)|0)+4>>2]|0)!=3}else v=0}while(0);Be=$(s[ue>>2]);O=$(s[ie>>2]);je=u[ae>>2]|0;Ue=u[oe>>2]|0;Er(b,Ae?Be:O,Ae?O:Be,Pe,Ae?je:Ue,Ae?Ue:je,Oe,ge,p&(v^1),3488,m)|0;r[X>>0]=r[X>>0]|r[b+508>>0];b=u[b+960>>2]|0}while((b|0)!=0)}else t=$(0.0)}else t=$(0.0);t=$(A+t);Ue=t<$(0.0)&1;r[X>>0]=Ue|o[X>>0];if(U&t>$(0.0)){v=u[W>>2]|0;if((u[e+364+(v<<3)+4>>2]|0)!=0?(pe=$(Rr(e+364+(v<<3)|0,_e)),pe>=$(0.0)):0)D=$(RM($(0.0),$(pe-$(R-t))));else D=$(0.0)}else D=t;M=P>>>0>>0;if(M){y=u[Re>>2]|0;g=P;v=0;do{b=u[y+(g<<2)>>2]|0;if(!(u[b+24>>2]|0)){v=((u[(hi(b,Ne)|0)+4>>2]|0)==3&1)+v|0;v=v+((u[(mi(b,Ne)|0)+4>>2]|0)==3&1)|0}g=g+1|0}while((g|0)!=(x|0));if(v){E=$(0.0);n=$(0.0)}else K=101}else K=101;e:do{if((K|0)==101){K=0;switch(J|0){case 1:{v=0;E=$(D*$(.5));n=$(0.0);break e}case 2:{v=0;E=D;n=$(0.0);break e}case 3:{if(l>>>0<=1){v=0;E=$(0.0);n=$(0.0);break e}n=$((l+-1|0)>>>0);v=0;E=$(0.0);n=$($(RM(D,$(0.0)))/n);break e}case 5:{n=$(D/$((l+1|0)>>>0));v=0;E=n;break e}case 4:{n=$(D/$(l>>>0));v=0;E=$(n*$(.5));break e}default:{v=0;E=$(0.0);n=$(0.0);break e}}}}while(0);t=$(Z+E);if(M){w=$(D/$(v|0));g=u[Re>>2]|0;b=P;D=$(0.0);do{v=u[g+(b<<2)>>2]|0;e:do{if((u[v+36>>2]|0)!=1){switch(u[v+24>>2]|0){case 1:{if(bi(v,Ne)|0){if(!p)break e;Be=$(gi(v,Ne,R));Be=$(Be+$(Xr(e,Ne)));Be=$(Be+$(Hr(v,Ne,Oe)));s[v+400+(u[H>>2]<<2)>>2]=Be;break e}break}case 0:{Ue=(u[(hi(v,Ne)|0)+4>>2]|0)==3;Be=$(w+t);t=Ue?Be:t;if(p){Ue=v+400+(u[H>>2]<<2)|0;s[Ue>>2]=$(t+$(s[Ue>>2]))}Ue=(u[(mi(v,Ne)|0)+4>>2]|0)==3;Be=$(w+t);t=Ue?Be:t;if(B){Be=$(n+$(Tr(v,Ne,Oe)));D=ve;t=$(t+$(Be+$(s[v+504>>2])));break e}else{t=$(t+$(n+$(yi(v,Ne,Oe))));D=$(RM(D,$(yi(v,Fe,Oe))));break e}}default:{}}if(p){Be=$(E+$(Xr(e,Ne)));Ue=v+400+(u[H>>2]<<2)|0;s[Ue>>2]=$(Be+$(s[Ue>>2]))}}}while(0);b=b+1|0}while((b|0)!=(x|0))}else D=$(0.0);n=$(ee+t);if(z)E=$($(di(e,Fe,$(Ce+D),Te,c))-Ce);else E=ve;w=$($(di(e,Fe,$(Ce+(Y?ve:D)),Te,c))-Ce);if(M&p){b=P;do{g=u[(u[Re>>2]|0)+(b<<2)>>2]|0;do{if((u[g+36>>2]|0)!=1){if((u[g+24>>2]|0)==1){if(bi(g,Fe)|0){Be=$(gi(g,Fe,ve));Be=$(Be+$(Xr(e,Fe)));Be=$(Be+$(Hr(g,Fe,Oe)));v=u[q>>2]|0;s[g+400+(v<<2)>>2]=Be;if(!(Dt(Be)|0))break}else v=u[q>>2]|0;Be=$(Xr(e,Fe));s[g+400+(v<<2)>>2]=$(Be+$(Hr(g,Fe,Oe)));break}v=pi(e,g)|0;do{if((v|0)==4){if((u[(hi(g,Fe)|0)+4>>2]|0)==3){K=139;break}if((u[(mi(g,Fe)|0)+4>>2]|0)==3){K=139;break}if(Pr(g,Fe,ve)|0){t=_;break}je=u[g+908+(u[W>>2]<<2)>>2]|0;u[ie>>2]=je;t=$(s[g+396>>2]);Ue=Dt(t)|0;D=(u[d>>2]=je,$(s[d>>2]));if(Ue)t=w;else{A=$(Tr(g,Fe,Oe));Be=$(D/t);t=$(t*D);t=$(A+(Ae?Be:t))}s[ue>>2]=t;s[ie>>2]=$($(Tr(g,Ne,Oe))+D);u[oe>>2]=1;u[ae>>2]=1;vi(g,Ne,R,Oe,oe,ie);vi(g,Fe,ve,Oe,ae,ue);t=$(s[ie>>2]);A=$(s[ue>>2]);Be=Ae?t:A;t=Ae?A:t;Ue=((Dt(Be)|0)^1)&1;Er(g,Be,t,Pe,Ue,((Dt(t)|0)^1)&1,Oe,ge,1,3493,m)|0;t=_}else K=139}while(0);e:do{if((K|0)==139){K=0;t=$(E-$(yi(g,Fe,Oe)));do{if((u[(hi(g,Fe)|0)+4>>2]|0)==3){if((u[(mi(g,Fe)|0)+4>>2]|0)!=3)break;t=$(_+$(RM($(0.0),$(t*$(.5)))));break e}}while(0);if((u[(mi(g,Fe)|0)+4>>2]|0)==3){t=_;break}if((u[(hi(g,Fe)|0)+4>>2]|0)==3){t=$(_+$(RM($(0.0),t)));break}switch(v|0){case 1:{t=_;break e}case 2:{t=$(_+$(t*$(.5)));break e}default:{t=$(_+t);break e}}}}while(0);Be=$(he+t);Ue=g+400+(u[q>>2]<<2)|0;s[Ue>>2]=$(Be+$(s[Ue>>2]))}}while(0);b=b+1|0}while((b|0)!=(x|0))}he=$(he+w);re=$(RM(re,n));l=L+1|0;if(x>>>0>=Ie>>>0)break;else{t=R;P=x;L=l}}do{if(p){v=l>>>0>1;if(!v?!(_i(e)|0):0)break;if(!(Dt(ve)|0)){t=$(ve-he);e:do{switch(u[e+12>>2]|0){case 3:{_=$(_+t);C=$(0.0);break}case 2:{_=$(_+$(t*$(.5)));C=$(0.0);break}case 4:{if(ve>he)C=$(t/$(l>>>0));else C=$(0.0);break}case 7:if(ve>he){_=$(_+$(t/$(l<<1>>>0)));C=$(t/$(l>>>0));C=v?C:$(0.0);break e}else{_=$(_+$(t*$(.5)));C=$(0.0);break e}case 6:{C=$(t/$(L>>>0));C=ve>he&v?C:$(0.0);break}default:C=$(0.0)}}while(0);if(l|0){M=1040+(Fe<<2)|0;S=976+(Fe<<2)|0;y=0;b=0;while(1){e:do{if(b>>>0>>0){D=$(0.0);w=$(0.0);t=$(0.0);g=b;while(1){v=u[(u[Re>>2]|0)+(g<<2)>>2]|0;do{if((u[v+36>>2]|0)!=1?(u[v+24>>2]|0)==0:0){if((u[v+940>>2]|0)!=(y|0))break e;if(Di(v,Fe)|0){Be=$(s[v+908+(u[S>>2]<<2)>>2]);t=$(RM(t,$(Be+$(Tr(v,Fe,Oe)))))}if((pi(e,v)|0)!=5)break;pe=$(wi(v));pe=$(pe+$(Hr(v,0,Oe)));Be=$(s[v+912>>2]);Be=$($(Be+$(Tr(v,0,Oe)))-pe);pe=$(RM(w,pe));Be=$(RM(D,Be));D=Be;w=pe;t=$(RM(t,$(pe+Be)))}}while(0);v=g+1|0;if(v>>>0>>0)g=v;else{g=v;break}}}else{w=$(0.0);t=$(0.0);g=b}}while(0);T=$(C+t);n=_;_=$(_+T);if(b>>>0>>0){E=$(n+w);v=b;do{b=u[(u[Re>>2]|0)+(v<<2)>>2]|0;e:do{if((u[b+36>>2]|0)!=1?(u[b+24>>2]|0)==0:0)switch(pi(e,b)|0){case 1:{Be=$(n+$(Hr(b,Fe,Oe)));s[b+400+(u[M>>2]<<2)>>2]=Be;break e}case 3:{Be=$($(_-$(Gr(b,Fe,Oe)))-$(s[b+908+(u[S>>2]<<2)>>2]));s[b+400+(u[M>>2]<<2)>>2]=Be;break e}case 2:{Be=$(n+$($(T-$(s[b+908+(u[S>>2]<<2)>>2]))*$(.5)));s[b+400+(u[M>>2]<<2)>>2]=Be;break e}case 4:{Be=$(n+$(Hr(b,Fe,Oe)));s[b+400+(u[M>>2]<<2)>>2]=Be;if(Pr(b,Fe,ve)|0)break e;if(Ae){D=$(s[b+908>>2]);t=$(D+$(Tr(b,Ne,Oe)));w=T}else{w=$(s[b+912>>2]);w=$(w+$(Tr(b,Fe,Oe)));t=T;D=$(s[b+908>>2])}if(mr(t,D)|0?mr(w,$(s[b+912>>2]))|0:0)break e;Er(b,t,w,Pe,1,1,Oe,ge,1,3501,m)|0;break e}case 5:{s[b+404>>2]=$($(E-$(wi(b)))+$(gi(b,0,ve)));break e}default:break e}}while(0);v=v+1|0}while((v|0)!=(g|0))}y=y+1|0;if((y|0)==(l|0))break;else b=g}}}}}while(0);s[e+908>>2]=$(di(e,2,ye,c,c));s[e+912>>2]=$(di(e,0,be,f,c));if((me|0)!=0?(we=u[e+32>>2]|0,Ee=(me|0)==2,!(Ee&(we|0)!=2)):0){if(Ee&(we|0)==2){t=$(De+R);t=$(RM($(NM(t,$(Ei(e,Ne,re,_e)))),De));K=198}}else{t=$(di(e,Ne,re,_e,c));K=198}if((K|0)==198)s[e+908+(u[976+(Ne<<2)>>2]<<2)>>2]=t;if((ke|0)!=0?(Se=u[e+32>>2]|0,xe=(ke|0)==2,!(xe&(Se|0)!=2)):0){if(xe&(Se|0)==2){t=$(Ce+ve);t=$(RM($(NM(t,$(Ei(e,Fe,$(Ce+he),Te)))),Ce));K=204}}else{t=$(di(e,Fe,$(Ce+he),Te,c));K=204}if((K|0)==204)s[e+908+(u[976+(Fe<<2)>>2]<<2)>>2]=t;if(p){if((u[Me>>2]|0)==2){b=976+(Fe<<2)|0;g=1040+(Fe<<2)|0;v=0;do{y=At(e,v)|0;if(!(u[y+24>>2]|0)){je=u[b>>2]|0;Be=$(s[e+908+(je<<2)>>2]);Ue=y+400+(u[g>>2]<<2)|0;Be=$(Be-$(s[Ue>>2]));s[Ue>>2]=$(Be-$(s[y+908+(je<<2)>>2]))}v=v+1|0}while((v|0)!=(Ie|0))}if(i|0){v=Ae?me:a;do{Ti(e,i,Oe,v,ge,Pe,m);i=u[i+960>>2]|0}while((i|0)!=0)}v=(Ne|2|0)==3;b=(Fe|2|0)==3;if(v|b){i=0;do{g=u[(u[Re>>2]|0)+(i<<2)>>2]|0;if((u[g+36>>2]|0)!=1){if(v)Ci(e,g,Ne);if(b)Ci(e,g,Fe)}i=i+1|0}while((i|0)!=(Ie|0))}}}else ei(e,t,n,a,l,c,f)}while(0);h=Le;return}function xr(e,t){e=e|0;t=$(t);var n=0;Tt(e,t>=$(0.0),3147);n=t==$(0.0);s[e+4>>2]=n?$(0.0):t;return}function Or(e,t,n,i){e=e|0;t=$(t);n=$(n);i=i|0;var o=ft,a=ft,l=0,c=0,f=0;u[2278]=(u[2278]|0)+1;Ar(e);if(!(Pr(e,2,t)|0)){o=$(Rr(e+380|0,t));if(!(o>=$(0.0))){f=((Dt(t)|0)^1)&1;o=t}else f=2}else{o=$(Rr(u[e+992>>2]|0,t));f=1;o=$(o+$(Tr(e,2,t)))}if(!(Pr(e,0,n)|0)){a=$(Rr(e+388|0,n));if(!(a>=$(0.0))){c=((Dt(n)|0)^1)&1;a=n}else c=2}else{a=$(Rr(u[e+996>>2]|0,n));c=1;a=$(a+$(Tr(e,0,t)))}l=e+976|0;if(Er(e,o,a,i,f,c,t,n,1,3189,u[l>>2]|0)|0?(Ir(e,u[e+496>>2]|0,t,n,t),Nr(e,$(s[(u[l>>2]|0)+4>>2]),$(0.0),$(0.0)),r[11696]|0):0)vr(e,7);return}function Ar(e){e=e|0;var t=0,n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;a=l+24|0;o=l+16|0;r=l+8|0;i=l;n=0;do{t=e+380+(n<<3)|0;if(!((u[e+380+(n<<3)+4>>2]|0)!=0?(s=t,c=u[s+4>>2]|0,f=r,u[f>>2]=u[s>>2],u[f+4>>2]=c,f=e+364+(n<<3)|0,c=u[f+4>>2]|0,s=i,u[s>>2]=u[f>>2],u[s+4>>2]=c,u[o>>2]=u[r>>2],u[o+4>>2]=u[r+4>>2],u[a>>2]=u[i>>2],u[a+4>>2]=u[i+4>>2],hr(o,a)|0):0))t=e+348+(n<<3)|0;u[e+992+(n<<2)>>2]=t;n=n+1|0}while((n|0)!=2);h=l;return}function Pr(e,t,n){e=e|0;t=t|0;n=$(n);var r=0;e=u[e+992+(u[976+(t<<2)>>2]<<2)>>2]|0;switch(u[e+4>>2]|0){case 0:case 3:{e=0;break}case 1:{if($(s[e>>2])<$(0.0))e=0;else r=5;break}case 2:{if($(s[e>>2])<$(0.0))e=0;else e=(Dt(n)|0)^1;break}default:r=5}if((r|0)==5)e=1;return e|0}function Rr(e,t){e=e|0;t=$(t);switch(u[e+4>>2]|0){case 2:{t=$($($(s[e>>2])*t)/$(100.0));break}case 1:{t=$(s[e>>2]);break}default:t=$(w)}return $(t)}function Ir(e,t,n,r,i){e=e|0;t=t|0;n=$(n);r=$(r);i=$(i);var o=0,a=ft;t=u[e+944>>2]|0?t:1;o=Kr(u[e+4>>2]|0,t)|0;t=ri(o,t)|0;n=$(Ai(e,o,n));r=$(Ai(e,t,r));a=$(n+$(Hr(e,o,i)));s[e+400+(u[1040+(o<<2)>>2]<<2)>>2]=a;n=$(n+$(Gr(e,o,i)));s[e+400+(u[1e3+(o<<2)>>2]<<2)>>2]=n;n=$(r+$(Hr(e,t,i)));s[e+400+(u[1040+(t<<2)>>2]<<2)>>2]=n;i=$(r+$(Gr(e,t,i)));s[e+400+(u[1e3+(t<<2)>>2]<<2)>>2]=i;return}function Nr(e,t,n,r){e=e|0;t=$(t);n=$(n);r=$(r);var i=0,o=0,a=ft,l=ft,c=0,f=0,d=ft,p=0,h=ft,m=ft,v=ft,b=ft;if(!(t==$(0.0))){i=e+400|0;b=$(s[i>>2]);o=e+404|0;v=$(s[o>>2]);p=e+416|0;m=$(s[p>>2]);f=e+420|0;a=$(s[f>>2]);h=$(b+n);d=$(v+r);r=$(h+m);l=$(d+a);c=(u[e+988>>2]|0)==1;s[i>>2]=$(gr(b,t,0,c));s[o>>2]=$(gr(v,t,0,c));n=$(LM($(m*t),$(1.0)));if(mr(n,$(0.0))|0)o=0;else o=(mr(n,$(1.0))|0)^1;n=$(LM($(a*t),$(1.0)));if(mr(n,$(0.0))|0)i=0;else i=(mr(n,$(1.0))|0)^1;b=$(gr(r,t,c&o,c&(o^1)));s[p>>2]=$(b-$(gr(h,t,0,c)));b=$(gr(l,t,c&i,c&(i^1)));s[f>>2]=$(b-$(gr(d,t,0,c)));o=(u[e+952>>2]|0)-(u[e+948>>2]|0)>>2;if(o|0){i=0;do{Nr(At(e,i)|0,t,h,d);i=i+1|0}while((i|0)!=(o|0))}}return}function Fr(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;switch(n|0){case 5:case 0:{e=uM(u[489]|0,r,i)|0;break}default:e=jM(r,i)|0}return e|0}function Lr(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;i=h;h=h+16|0;o=i;u[o>>2]=r;Br(e,0,t,n,o);h=i;return}function Br(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;e=e|0?e:956;Sx[u[e+8>>2]&1](e,t,n,r,i)|0;if((n|0)==5)$e();else return}function jr(e,t,n){e=e|0;t=t|0;n=n|0;r[e+t>>0]=n&1;return}function Ur(e,t){e=e|0;t=t|0;var n=0,r=0;u[e>>2]=0;u[e+4>>2]=0;u[e+8>>2]=0;n=t+4|0;r=(u[n>>2]|0)-(u[t>>2]|0)>>2;if(r|0){Wr(e,r);zr(e,u[t>>2]|0,u[n>>2]|0,r)}return}function Wr(e,t){e=e|0;t=t|0;var n=0;if((qr(e)|0)>>>0>>0)UM(e);if(t>>>0>1073741823)$e();else{n=YM(t<<2)|0;u[e+4>>2]=n;u[e>>2]=n;u[e+8>>2]=n+(t<<2);return}}function zr(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=e+4|0;e=n-t|0;if((e|0)>0){iS(u[r>>2]|0,t|0,e|0)|0;u[r>>2]=(u[r>>2]|0)+(e>>>2<<2)}return}function qr(e){e=e|0;return 1073741823}function Hr(e,t,n){e=e|0;t=t|0;n=$(n);if(Vr(t)|0?(u[e+96>>2]|0)!=0:0)e=e+92|0;else e=wt(e+60|0,u[1040+(t<<2)>>2]|0,992)|0;return $(Yr(e,n))}function Gr(e,t,n){e=e|0;t=t|0;n=$(n);if(Vr(t)|0?(u[e+104>>2]|0)!=0:0)e=e+100|0;else e=wt(e+60|0,u[1e3+(t<<2)>>2]|0,992)|0;return $(Yr(e,n))}function Vr(e){e=e|0;return(e|1|0)==3|0}function Yr(e,t){e=e|0;t=$(t);if((u[e+4>>2]|0)==3)t=$(0.0);else t=$(Rr(e,t));return $(t)}function $r(e,t){e=e|0;t=t|0;e=u[e>>2]|0;return((e|0)==0?(t|0)>1?t:1:e)|0}function Kr(e,t){e=e|0;t=t|0;var n=0;e:do{if((t|0)==2){switch(e|0){case 2:{e=3;break e}case 3:break;default:{n=4;break e}}e=2}else n=4}while(0);return e|0}function Xr(e,t){e=e|0;t=t|0;var n=ft;if(!((Vr(t)|0?(u[e+312>>2]|0)!=0:0)?(n=$(s[e+308>>2]),n>=$(0.0)):0))n=$(RM($(s[(wt(e+276|0,u[1040+(t<<2)>>2]|0,992)|0)>>2]),$(0.0)));return $(n)}function Jr(e,t){e=e|0;t=t|0;var n=ft;if(!((Vr(t)|0?(u[e+320>>2]|0)!=0:0)?(n=$(s[e+316>>2]),n>=$(0.0)):0))n=$(RM($(s[(wt(e+276|0,u[1e3+(t<<2)>>2]|0,992)|0)>>2]),$(0.0)));return $(n)}function Qr(e,t,n){e=e|0;t=t|0;n=$(n);var r=ft;if(!((Vr(t)|0?(u[e+240>>2]|0)!=0:0)?(r=$(Rr(e+236|0,n)),r>=$(0.0)):0))r=$(RM($(Rr(wt(e+204|0,u[1040+(t<<2)>>2]|0,992)|0,n)),$(0.0)));return $(r)}function Zr(e,t,n){e=e|0;t=t|0;n=$(n);var r=ft;if(!((Vr(t)|0?(u[e+248>>2]|0)!=0:0)?(r=$(Rr(e+244|0,n)),r>=$(0.0)):0))r=$(RM($(Rr(wt(e+204|0,u[1e3+(t<<2)>>2]|0,992)|0,n)),$(0.0)));return $(r)}function ei(e,t,n,r,i,o,a){e=e|0;t=$(t);n=$(n);r=r|0;i=i|0;o=$(o);a=$(a);var l=ft,c=ft,f=ft,d=ft,p=ft,m=ft,v=0,b=0,g=0;g=h;h=h+16|0;v=g;b=e+964|0;Nt(e,(u[b>>2]|0)!=0,3519);l=$(oi(e,2,t));c=$(oi(e,0,t));f=$(Tr(e,2,t));d=$(Tr(e,0,t));if(Dt(t)|0)p=t;else p=$(RM($(0.0),$($(t-f)-l)));if(Dt(n)|0)m=n;else m=$(RM($(0.0),$($(n-d)-c)));if((r|0)==1&(i|0)==1){s[e+908>>2]=$(di(e,2,$(t-f),o,o));t=$(di(e,0,$(n-d),a,o))}else{Ox[u[b>>2]&1](v,e,p,r,m,i);p=$(l+$(s[v>>2]));m=$(t-f);s[e+908>>2]=$(di(e,2,(r|2|0)==2?p:m,o,o));m=$(c+$(s[v+4>>2]));t=$(n-d);t=$(di(e,0,(i|2|0)==2?m:t,a,o))}s[e+912>>2]=t;h=g;return}function ti(e,t,n,r,i,u,o){e=e|0;t=$(t);n=$(n);r=r|0;i=i|0;u=$(u);o=$(o);var a=ft,l=ft,c=ft,f=ft;c=$(oi(e,2,u));a=$(oi(e,0,u));f=$(Tr(e,2,u));l=$(Tr(e,0,u));t=$(t-f);s[e+908>>2]=$(di(e,2,(r|2|0)==2?c:t,u,u));n=$(n-l);s[e+912>>2]=$(di(e,0,(i|2|0)==2?a:n,o,u));return}function ni(e,t,n,r,i,u,o){e=e|0;t=$(t);n=$(n);r=r|0;i=i|0;u=$(u);o=$(o);var a=0,l=ft,c=ft;a=(r|0)==2;if((!(t<=$(0.0)&a)?!(n<=$(0.0)&(i|0)==2):0)?!((r|0)==1&(i|0)==1):0)e=0;else{l=$(Tr(e,0,u));c=$(Tr(e,2,u));a=t<$(0.0)&a|(Dt(t)|0);t=$(t-c);s[e+908>>2]=$(di(e,2,a?$(0.0):t,u,u));t=$(n-l);a=n<$(0.0)&(i|0)==2|(Dt(n)|0);s[e+912>>2]=$(di(e,0,a?$(0.0):t,o,u));e=1}return e|0}function ri(e,t){e=e|0;t=t|0;if(ki(e)|0)e=Kr(2,t)|0;else e=0;return e|0}function ii(e,t,n){e=e|0;t=t|0;n=$(n);n=$(Qr(e,t,n));return $(n+$(Xr(e,t)))}function ui(e,t,n){e=e|0;t=t|0;n=$(n);n=$(Zr(e,t,n));return $(n+$(Jr(e,t)))}function oi(e,t,n){e=e|0;t=t|0;n=$(n);var r=ft;r=$(ii(e,t,n));return $(r+$(ui(e,t,n)))}function ai(e){e=e|0;if(!(u[e+24>>2]|0)){if($(li(e))!=$(0.0))e=1;else e=$(si(e))!=$(0.0)}else e=0;return e|0}function li(e){e=e|0;var t=ft;if(u[e+944>>2]|0){t=$(s[e+44>>2]);if(Dt(t)|0){t=$(s[e+40>>2]);e=t>$(0.0)&((Dt(t)|0)^1);return $(e?t:$(0.0))}}else t=$(0.0);return $(t)}function si(e){e=e|0;var t=ft,n=0,i=ft;do{if(u[e+944>>2]|0){t=$(s[e+48>>2]);if(Dt(t)|0){n=r[(u[e+976>>2]|0)+2>>0]|0;if(n<<24>>24==0?(i=$(s[e+40>>2]),i<$(0.0)&((Dt(i)|0)^1)):0){t=$(-i);break}t=n<<24>>24?$(1.0):$(0.0)}}else t=$(0.0)}while(0);return $(t)}function ci(e){e=e|0;var t=0,n=0;tS(e+400|0,0,540)|0;r[e+985>>0]=1;zt(e);n=Ot(e)|0;if(n|0){t=e+948|0;e=0;do{ci(u[(u[t>>2]|0)+(e<<2)>>2]|0);e=e+1|0}while((e|0)!=(n|0))}return}function fi(e,t,n,r,i,o,a,l,c,f){e=e|0;t=t|0;n=$(n);r=r|0;i=$(i);o=$(o);a=$(a);l=l|0;c=c|0;f=f|0;var d=0,p=ft,m=0,v=0,b=ft,g=ft,y=0,_=ft,D=0,E=ft,T=0,C=0,k=0,M=0,S=0,x=0,O=0,A=0,P=0,R=0;P=h;h=h+16|0;k=P+12|0;M=P+8|0;S=P+4|0;x=P;A=Kr(u[e+4>>2]|0,c)|0;T=Vr(A)|0;p=$(Rr(Mi(t)|0,T?o:a));C=Pr(t,2,o)|0;O=Pr(t,0,a)|0;do{if(!(Dt(p)|0)?!(Dt(T?n:i)|0):0){d=t+504|0;if(!(Dt($(s[d>>2]))|0)){if(!(Si(u[t+976>>2]|0,0)|0))break;if((u[t+500>>2]|0)==(u[2278]|0))break}s[d>>2]=$(RM(p,$(oi(t,A,o))))}else m=7}while(0);do{if((m|0)==7){D=T^1;if(!(D|C^1)){a=$(Rr(u[t+992>>2]|0,o));s[t+504>>2]=$(RM(a,$(oi(t,2,o))));break}if(!(T|O^1)){a=$(Rr(u[t+996>>2]|0,a));s[t+504>>2]=$(RM(a,$(oi(t,0,o))));break}s[k>>2]=$(w);s[M>>2]=$(w);u[S>>2]=0;u[x>>2]=0;_=$(Tr(t,2,o));E=$(Tr(t,0,o));if(C){b=$(_+$(Rr(u[t+992>>2]|0,o)));s[k>>2]=b;u[S>>2]=1;v=1}else{v=0;b=$(w)}if(O){p=$(E+$(Rr(u[t+996>>2]|0,a)));s[M>>2]=p;u[x>>2]=1;d=1}else{d=0;p=$(w)}m=u[e+32>>2]|0;if(!(T&(m|0)==2)){if(Dt(b)|0?!(Dt(n)|0):0){s[k>>2]=n;u[S>>2]=2;v=2;b=n}}else m=2;if((!((m|0)==2&D)?Dt(p)|0:0)?!(Dt(i)|0):0){s[M>>2]=i;u[x>>2]=2;d=2;p=i}g=$(s[t+396>>2]);y=Dt(g)|0;do{if(!y){if((v|0)==1&D){s[M>>2]=$($(b-_)/g);u[x>>2]=1;d=1;m=1;break}if(T&(d|0)==1){s[k>>2]=$(g*$(p-E));u[S>>2]=1;d=1;m=1}else m=v}else m=v}while(0);R=Dt(n)|0;v=(pi(e,t)|0)!=4;if(!(T|C|((r|0)!=1|R)|(v|(m|0)==1))?(s[k>>2]=n,u[S>>2]=1,!y):0){s[M>>2]=$($(n-_)/g);u[x>>2]=1;d=1}if(!(O|D|((l|0)!=1|(Dt(i)|0))|(v|(d|0)==1))?(s[M>>2]=i,u[x>>2]=1,!y):0){s[k>>2]=$(g*$(i-E));u[S>>2]=1}vi(t,2,o,o,S,k);vi(t,0,a,o,x,M);n=$(s[k>>2]);i=$(s[M>>2]);Er(t,n,i,c,u[S>>2]|0,u[x>>2]|0,o,a,0,3565,f)|0;a=$(s[t+908+(u[976+(A<<2)>>2]<<2)>>2]);s[t+504>>2]=$(RM(a,$(oi(t,A,o))))}}while(0);u[t+500>>2]=u[2278];h=P;return}function di(e,t,n,r,i){e=e|0;t=t|0;n=$(n);r=$(r);i=$(i);r=$(Ei(e,t,n,r));return $(RM(r,$(oi(e,t,i))))}function pi(e,t){e=e|0;t=t|0;t=t+20|0;t=u[((u[t>>2]|0)==0?e+16|0:t)>>2]|0;if((t|0)==5?ki(u[e+4>>2]|0)|0:0)t=1;return t|0}function hi(e,t){e=e|0;t=t|0;if(Vr(t)|0?(u[e+96>>2]|0)!=0:0)t=4;else t=u[1040+(t<<2)>>2]|0;return e+60+(t<<3)|0}function mi(e,t){e=e|0;t=t|0;if(Vr(t)|0?(u[e+104>>2]|0)!=0:0)t=5;else t=u[1e3+(t<<2)>>2]|0;return e+60+(t<<3)|0}function vi(e,t,n,r,i,o){e=e|0;t=t|0;n=$(n);r=$(r);i=i|0;o=o|0;n=$(Rr(e+380+(u[976+(t<<2)>>2]<<3)|0,n));n=$(n+$(Tr(e,t,r)));switch(u[i>>2]|0){case 2:case 1:{i=Dt(n)|0;r=$(s[o>>2]);s[o>>2]=i|r>2]=2;s[o>>2]=n}break}default:{}}return}function bi(e,t){e=e|0;t=t|0;e=e+132|0;if(Vr(t)|0?(u[(wt(e,4,948)|0)+4>>2]|0)!=0:0)e=1;else e=(u[(wt(e,u[1040+(t<<2)>>2]|0,948)|0)+4>>2]|0)!=0;return e|0}function gi(e,t,n){e=e|0;t=t|0;n=$(n);var r=0,i=0;e=e+132|0;if(Vr(t)|0?(r=wt(e,4,948)|0,(u[r+4>>2]|0)!=0):0)i=4;else{r=wt(e,u[1040+(t<<2)>>2]|0,948)|0;if(!(u[r+4>>2]|0))n=$(0.0);else i=4}if((i|0)==4)n=$(Rr(r,n));return $(n)}function yi(e,t,n){e=e|0;t=t|0;n=$(n);var r=ft;r=$(s[e+908+(u[976+(t<<2)>>2]<<2)>>2]);r=$(r+$(Hr(e,t,n)));return $(r+$(Gr(e,t,n)))}function _i(e){e=e|0;var t=0,n=0,r=0;e:do{if(!(ki(u[e+4>>2]|0)|0)){if((u[e+16>>2]|0)!=5){n=Ot(e)|0;if(!n)t=0;else{t=0;while(1){r=At(e,t)|0;if((u[r+24>>2]|0)==0?(u[r+20>>2]|0)==5:0){t=1;break e}t=t+1|0;if(t>>>0>=n>>>0){t=0;break}}}}else t=1}else t=0}while(0);return t|0}function Di(e,t){e=e|0;t=t|0;var n=ft;n=$(s[e+908+(u[976+(t<<2)>>2]<<2)>>2]);return n>=$(0.0)&((Dt(n)|0)^1)|0}function wi(e){e=e|0;var t=ft,n=0,r=0,i=0,o=0,a=0,l=0,c=ft;n=u[e+968>>2]|0;if(!n){o=Ot(e)|0;do{if(o|0){n=0;i=0;while(1){r=At(e,i)|0;if(u[r+940>>2]|0){a=8;break}if((u[r+24>>2]|0)!=1){l=(pi(e,r)|0)==5;if(l){n=r;break}else n=(n|0)==0?r:n}i=i+1|0;if(i>>>0>=o>>>0){a=8;break}}if((a|0)==8)if(!n)break;t=$(wi(n));return $(t+$(s[n+404>>2]))}}while(0);t=$(s[e+912>>2])}else{c=$(s[e+908>>2]);t=$(s[e+912>>2]);t=$(px[n&0](e,c,t));Nt(e,(Dt(t)|0)^1,3573)}return $(t)}function Ei(e,t,n,r){e=e|0;t=t|0;n=$(n);r=$(r);var i=ft,u=0;if(!(ki(t)|0)){if(Vr(t)|0){t=0;u=3}else{r=$(w);i=$(w)}}else{t=1;u=3}if((u|0)==3){i=$(Rr(e+364+(t<<3)|0,r));r=$(Rr(e+380+(t<<3)|0,r))}u=r=$(0.0)&((Dt(r)|0)^1));n=u?r:n;u=i>=$(0.0)&((Dt(i)|0)^1)&n>2]|0,o)|0;v=ri(g,o)|0;b=Vr(g)|0;p=$(Tr(t,2,n));h=$(Tr(t,0,n));if(!(Pr(t,2,n)|0)){if(bi(t,2)|0?xi(t,2)|0:0){l=$(s[e+908>>2]);c=$(Xr(e,2));c=$(l-$(c+$(Jr(e,2))));l=$(gi(t,2,n));l=$(di(t,2,$(c-$(l+$(Oi(t,2,n)))),n,n))}else l=$(w)}else l=$(p+$(Rr(u[t+992>>2]|0,n)));if(!(Pr(t,0,i)|0)){if(bi(t,0)|0?xi(t,0)|0:0){c=$(s[e+912>>2]);_=$(Xr(e,0));_=$(c-$(_+$(Jr(e,0))));c=$(gi(t,0,i));c=$(di(t,0,$(_-$(c+$(Oi(t,0,i)))),i,n))}else c=$(w)}else c=$(h+$(Rr(u[t+996>>2]|0,i)));f=Dt(l)|0;d=Dt(c)|0;do{if(f^d?(m=$(s[t+396>>2]),!(Dt(m)|0)):0)if(f){l=$(p+$($(c-h)*m));break}else{_=$(h+$($(l-p)/m));c=d?_:c;break}}while(0);d=Dt(l)|0;f=Dt(c)|0;if(d|f){D=(d^1)&1;r=n>$(0.0)&((r|0)!=0&d);l=b?l:r?n:l;Er(t,l,c,o,b?D:r?2:D,d&(f^1)&1,l,c,0,3623,a)|0;l=$(s[t+908>>2]);l=$(l+$(Tr(t,2,n)));c=$(s[t+912>>2]);c=$(c+$(Tr(t,0,n)))}Er(t,l,c,o,1,1,l,c,1,3635,a)|0;if(xi(t,g)|0?!(bi(t,g)|0):0){D=u[976+(g<<2)>>2]|0;_=$(s[e+908+(D<<2)>>2]);_=$(_-$(s[t+908+(D<<2)>>2]));_=$(_-$(Jr(e,g)));_=$(_-$(Gr(t,g,n)));_=$(_-$(Oi(t,g,b?n:i)));s[t+400+(u[1040+(g<<2)>>2]<<2)>>2]=_}else y=21;do{if((y|0)==21){if(!(bi(t,g)|0)?(u[e+8>>2]|0)==1:0){D=u[976+(g<<2)>>2]|0;_=$(s[e+908+(D<<2)>>2]);_=$($(_-$(s[t+908+(D<<2)>>2]))*$(.5));s[t+400+(u[1040+(g<<2)>>2]<<2)>>2]=_;break}if(!(bi(t,g)|0)?(u[e+8>>2]|0)==2:0){D=u[976+(g<<2)>>2]|0;_=$(s[e+908+(D<<2)>>2]);_=$(_-$(s[t+908+(D<<2)>>2]));s[t+400+(u[1040+(g<<2)>>2]<<2)>>2]=_}}}while(0);if(xi(t,v)|0?!(bi(t,v)|0):0){D=u[976+(v<<2)>>2]|0;_=$(s[e+908+(D<<2)>>2]);_=$(_-$(s[t+908+(D<<2)>>2]));_=$(_-$(Jr(e,v)));_=$(_-$(Gr(t,v,n)));_=$(_-$(Oi(t,v,b?i:n)));s[t+400+(u[1040+(v<<2)>>2]<<2)>>2]=_}else y=30;do{if((y|0)==30?!(bi(t,v)|0):0){if((pi(e,t)|0)==2){D=u[976+(v<<2)>>2]|0;_=$(s[e+908+(D<<2)>>2]);_=$($(_-$(s[t+908+(D<<2)>>2]))*$(.5));s[t+400+(u[1040+(v<<2)>>2]<<2)>>2]=_;break}D=(pi(e,t)|0)==3;if(D^(u[e+28>>2]|0)==2){D=u[976+(v<<2)>>2]|0;_=$(s[e+908+(D<<2)>>2]);_=$(_-$(s[t+908+(D<<2)>>2]));s[t+400+(u[1040+(v<<2)>>2]<<2)>>2]=_}}}while(0);return}function Ci(e,t,n){e=e|0;t=t|0;n=n|0;var r=ft,i=0;i=u[976+(n<<2)>>2]|0;r=$(s[t+908+(i<<2)>>2]);r=$($(s[e+908+(i<<2)>>2])-r);r=$(r-$(s[t+400+(u[1040+(n<<2)>>2]<<2)>>2]));s[t+400+(u[1e3+(n<<2)>>2]<<2)>>2]=r;return}function ki(e){e=e|0;return(e|1|0)==1|0}function Mi(e){e=e|0;var t=ft;switch(u[e+56>>2]|0){case 0:case 3:{t=$(s[e+40>>2]);if(t>$(0.0)&((Dt(t)|0)^1))e=r[(u[e+976>>2]|0)+2>>0]|0?1056:992;else e=1056;break}default:e=e+52|0}return e|0}function Si(e,t){e=e|0;t=t|0;return(r[e+t>>0]|0)!=0|0}function xi(e,t){e=e|0;t=t|0;e=e+132|0;if(Vr(t)|0?(u[(wt(e,5,948)|0)+4>>2]|0)!=0:0)e=1;else e=(u[(wt(e,u[1e3+(t<<2)>>2]|0,948)|0)+4>>2]|0)!=0;return e|0}function Oi(e,t,n){e=e|0;t=t|0;n=$(n);var r=0,i=0;e=e+132|0;if(Vr(t)|0?(r=wt(e,5,948)|0,(u[r+4>>2]|0)!=0):0)i=4;else{r=wt(e,u[1e3+(t<<2)>>2]|0,948)|0;if(!(u[r+4>>2]|0))n=$(0.0);else i=4}if((i|0)==4)n=$(Rr(r,n));return $(n)}function Ai(e,t,n){e=e|0;t=t|0;n=$(n);if(bi(e,t)|0)n=$(gi(e,t,n));else n=$(-$(Oi(e,t,n)));return $(n)}function Pi(e){e=$(e);return(s[d>>2]=e,u[d>>2]|0)|0}function Ri(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>1073741823)$e();else{i=YM(t<<2)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<2)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<2);return}function Ii(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Ni(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-4-t|0)>>>2)<<2);e=u[e>>2]|0;if(e|0)KM(e);return}function Fi(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0;a=e+4|0;l=u[a>>2]|0;i=l-r|0;o=i>>2;e=t+(o<<2)|0;if(e>>>0>>0){r=l;do{u[r>>2]=u[e>>2];e=e+4|0;r=(u[a>>2]|0)+4|0;u[a>>2]=r}while(e>>>0>>0)}if(o|0)sS(l+(0-o<<2)|0,t|0,i|0)|0;return}function Li(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0;l=t+4|0;s=u[l>>2]|0;i=u[e>>2]|0;a=n;o=a-i|0;r=s+(0-(o>>2)<<2)|0;u[l>>2]=r;if((o|0)>0)iS(r|0,i|0,o|0)|0;i=e+4|0;o=t+8|0;r=(u[i>>2]|0)-a|0;if((r|0)>0){iS(u[o>>2]|0,n|0,r|0)|0;u[o>>2]=(u[o>>2]|0)+(r>>>2<<2)}a=u[e>>2]|0;u[e>>2]=u[l>>2];u[l>>2]=a;a=u[i>>2]|0;u[i>>2]=u[o>>2];u[o>>2]=a;a=e+8|0;n=t+12|0;e=u[a>>2]|0;u[a>>2]=u[n>>2];u[n>>2]=e;u[t>>2]=u[l>>2];return s|0}function Bi(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;a=u[t>>2]|0;o=u[n>>2]|0;if((a|0)!=(o|0)){i=e+8|0;n=((o+-4-a|0)>>>2)+1|0;e=a;r=u[i>>2]|0;do{u[r>>2]=u[e>>2];r=(u[i>>2]|0)+4|0;u[i>>2]=r;e=e+4|0}while((e|0)!=(o|0));u[t>>2]=a+(n<<2)}return}function ji(){yt();return}function Ui(){var e=0;e=YM(4)|0;Wi(e);return e|0}function Wi(e){e=e|0;u[e>>2]=Lt()|0;return}function zi(e){e=e|0;if(e|0){qi(e);KM(e)}return}function qi(e){e=e|0;jt(u[e>>2]|0);return}function Hi(e,t,n){e=e|0;t=t|0;n=n|0;jr(u[e>>2]|0,t,n);return}function Gi(e,t){e=e|0;t=$(t);xr(u[e>>2]|0,t);return}function Vi(e,t){e=e|0;t=t|0;return Si(u[e>>2]|0,t)|0}function Yi(){var e=0;e=YM(8)|0;$i(e,0);return e|0}function $i(e,t){e=e|0;t=t|0;if(!t)t=Ct()|0;else t=Et(u[t>>2]|0)|0;u[e>>2]=t;u[e+4>>2]=0;Qt(t,e);return}function Ki(e){e=e|0;var t=0;t=YM(8)|0;$i(t,e);return t|0}function Xi(e){e=e|0;if(e|0){Ji(e);KM(e)}return}function Ji(e){e=e|0;var t=0;St(u[e>>2]|0);t=e+4|0;e=u[t>>2]|0;u[t>>2]=0;if(e|0){Qi(e);KM(e)}return}function Qi(e){e=e|0;Zi(e);return}function Zi(e){e=e|0;e=u[e>>2]|0;if(e|0)rt(e|0);return}function eu(e){e=e|0;return Zt(e)|0}function tu(e){e=e|0;var t=0,n=0;n=e+4|0;t=u[n>>2]|0;u[n>>2]=0;if(t|0){Qi(t);KM(t)}It(u[e>>2]|0);return}function nu(e,t){e=e|0;t=t|0;Kt(u[e>>2]|0,u[t>>2]|0);return}function ru(e,t){e=e|0;t=t|0;fn(u[e>>2]|0,t);return}function iu(e,t,n){e=e|0;t=t|0;n=+n;Cn(u[e>>2]|0,t,$(n));return}function uu(e,t,n){e=e|0;t=t|0;n=+n;kn(u[e>>2]|0,t,$(n));return}function ou(e,t){e=e|0;t=t|0;un(u[e>>2]|0,t);return}function au(e,t){e=e|0;t=t|0;an(u[e>>2]|0,t);return}function lu(e,t){e=e|0;t=t|0;sn(u[e>>2]|0,t);return}function su(e,t){e=e|0;t=t|0;en(u[e>>2]|0,t);return}function cu(e,t){e=e|0;t=t|0;pn(u[e>>2]|0,t);return}function fu(e,t){e=e|0;t=t|0;nn(u[e>>2]|0,t);return}function du(e,t,n){e=e|0;t=t|0;n=+n;Sn(u[e>>2]|0,t,$(n));return}function pu(e,t,n){e=e|0;t=t|0;n=+n;xn(u[e>>2]|0,t,$(n));return}function hu(e,t){e=e|0;t=t|0;An(u[e>>2]|0,t);return}function mu(e,t){e=e|0;t=t|0;mn(u[e>>2]|0,t);return}function vu(e,t){e=e|0;t=t|0;bn(u[e>>2]|0,t);return}function bu(e,t){e=e|0;t=+t;yn(u[e>>2]|0,$(t));return}function gu(e,t){e=e|0;t=+t;wn(u[e>>2]|0,$(t));return}function yu(e,t){e=e|0;t=+t;En(u[e>>2]|0,$(t));return}function _u(e,t){e=e|0;t=+t;_n(u[e>>2]|0,$(t));return}function Du(e,t){e=e|0;t=+t;Dn(u[e>>2]|0,$(t));return}function wu(e,t){e=e|0;t=+t;Ln(u[e>>2]|0,$(t));return}function Eu(e,t){e=e|0;t=+t;Bn(u[e>>2]|0,$(t));return}function Tu(e){e=e|0;jn(u[e>>2]|0);return}function Cu(e,t){e=e|0;t=+t;Wn(u[e>>2]|0,$(t));return}function ku(e,t){e=e|0;t=+t;zn(u[e>>2]|0,$(t));return}function Mu(e){e=e|0;qn(u[e>>2]|0);return}function Su(e,t){e=e|0;t=+t;Gn(u[e>>2]|0,$(t));return}function xu(e,t){e=e|0;t=+t;Vn(u[e>>2]|0,$(t));return}function Ou(e,t){e=e|0;t=+t;$n(u[e>>2]|0,$(t));return}function Au(e,t){e=e|0;t=+t;Kn(u[e>>2]|0,$(t));return}function Pu(e,t){e=e|0;t=+t;Jn(u[e>>2]|0,$(t));return}function Ru(e,t){e=e|0;t=+t;Qn(u[e>>2]|0,$(t));return}function Iu(e,t){e=e|0;t=+t;er(u[e>>2]|0,$(t));return}function Nu(e,t){e=e|0;t=+t;tr(u[e>>2]|0,$(t));return}function Fu(e,t){e=e|0;t=+t;rr(u[e>>2]|0,$(t));return}function Lu(e,t,n){e=e|0;t=t|0;n=+n;Nn(u[e>>2]|0,t,$(n));return}function Bu(e,t,n){e=e|0;t=t|0;n=+n;Pn(u[e>>2]|0,t,$(n));return}function ju(e,t,n){e=e|0;t=t|0;n=+n;Rn(u[e>>2]|0,t,$(n));return}function Uu(e){e=e|0;return dn(u[e>>2]|0)|0}function Wu(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;Mn(i,u[t>>2]|0,n);zu(e,i);h=r;return}function zu(e,t){e=e|0;t=t|0;qu(e,u[t+4>>2]|0,+$(s[t>>2]));return}function qu(e,t,n){e=e|0;t=t|0;n=+n;u[e>>2]=t;c[e+8>>3]=n;return}function Hu(e){e=e|0;return on(u[e>>2]|0)|0}function Gu(e){e=e|0;return ln(u[e>>2]|0)|0}function Vu(e){e=e|0;return cn(u[e>>2]|0)|0}function Yu(e){e=e|0;return tn(u[e>>2]|0)|0}function $u(e){e=e|0;return hn(u[e>>2]|0)|0}function Ku(e){e=e|0;return rn(u[e>>2]|0)|0}function Xu(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;On(i,u[t>>2]|0,n);zu(e,i);h=r;return}function Ju(e){e=e|0;return vn(u[e>>2]|0)|0}function Qu(e){e=e|0;return gn(u[e>>2]|0)|0}function Zu(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Tn(r,u[t>>2]|0);zu(e,r);h=n;return}function eo(e){e=e|0;return+ +$(Xt(u[e>>2]|0))}function to(e){e=e|0;return+ +$(Jt(u[e>>2]|0))}function no(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Un(r,u[t>>2]|0);zu(e,r);h=n;return}function ro(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Hn(r,u[t>>2]|0);zu(e,r);h=n;return}function io(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Yn(r,u[t>>2]|0);zu(e,r);h=n;return}function uo(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Xn(r,u[t>>2]|0);zu(e,r);h=n;return}function oo(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Zn(r,u[t>>2]|0);zu(e,r);h=n;return}function ao(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;nr(r,u[t>>2]|0);zu(e,r);h=n;return}function lo(e){e=e|0;return+ +$(ir(u[e>>2]|0))}function so(e,t){e=e|0;t=t|0;return+ +$(Fn(u[e>>2]|0,t))}function co(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;In(i,u[t>>2]|0,n);zu(e,i);h=r;return}function fo(e,t,n){e=e|0;t=t|0;n=n|0;Wt(u[e>>2]|0,u[t>>2]|0,n);return}function po(e,t){e=e|0;t=t|0;Rt(u[e>>2]|0,u[t>>2]|0);return}function ho(e){e=e|0;return Ot(u[e>>2]|0)|0}function mo(e){e=e|0;e=Vt(u[e>>2]|0)|0;if(!e)e=0;else e=eu(e)|0;return e|0}function vo(e,t){e=e|0;t=t|0;e=At(u[e>>2]|0,t)|0;if(!e)e=0;else e=eu(e)|0;return e|0}function bo(e,t){e=e|0;t=t|0;var n=0,r=0;r=YM(4)|0;go(r,t);n=e+4|0;t=u[n>>2]|0;u[n>>2]=r;if(t|0){Qi(t);KM(t)}Ut(u[e>>2]|0,1);return}function go(e,t){e=e|0;t=t|0;Bo(e,t);return}function yo(e,t,n,r,i,u){e=e|0;t=t|0;n=$(n);r=r|0;i=$(i);u=u|0;var o=0,a=0;o=h;h=h+16|0;a=o;_o(a,Zt(t)|0,+n,r,+i,u);s[e>>2]=$(+c[a>>3]);s[e+4>>2]=$(+c[a+8>>3]);h=o;return}function _o(e,t,n,r,i,o){e=e|0;t=t|0;n=+n;r=r|0;i=+i;o=o|0;var a=0,l=0,s=0,f=0,d=0;a=h;h=h+32|0;d=a+8|0;f=a+20|0;s=a;l=a+16|0;c[d>>3]=n;u[f>>2]=r;c[s>>3]=i;u[l>>2]=o;Do(e,u[t+4>>2]|0,d,f,s,l);h=a;return}function Do(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;var a=0,l=0;a=h;h=h+16|0;l=a;Ek(l);t=wo(t)|0;Eo(e,t,+c[n>>3],u[r>>2]|0,+c[i>>3],u[o>>2]|0);Ck(l);h=a;return}function wo(e){e=e|0;return u[e>>2]|0}function Eo(e,t,n,r,i,u){e=e|0;t=t|0;n=+n;r=r|0;i=+i;u=u|0;var o=0;o=Co(To()|0)|0;n=+ko(n);r=Mo(r)|0;i=+ko(i);So(e,ut(0,o|0,t|0,+n,r|0,+i,Mo(u)|0)|0);return}function To(){var e=0;if(!(r[7608]|0)){No(9120);e=7608;u[e>>2]=1;u[e+4>>2]=0}return 9120}function Co(e){e=e|0;return u[e+8>>2]|0}function ko(e){e=+e;return+ +Io(e)}function Mo(e){e=e|0;return Ro(e)|0}function So(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+32|0;n=i;r=t;if(!(r&1)){u[e>>2]=u[t>>2];u[e+4>>2]=u[t+4>>2];u[e+8>>2]=u[t+8>>2];u[e+12>>2]=u[t+12>>2]}else{xo(n,0);Be(r|0,n|0)|0;Oo(e,n);Ao(n)}h=i;return}function xo(e,t){e=e|0;t=t|0;Po(e,t);u[e+8>>2]=0;r[e+24>>0]=0;return}function Oo(e,t){e=e|0;t=t|0;t=t+8|0;u[e>>2]=u[t>>2];u[e+4>>2]=u[t+4>>2];u[e+8>>2]=u[t+8>>2];u[e+12>>2]=u[t+12>>2];return}function Ao(e){e=e|0;r[e+24>>0]=0;return}function Po(e,t){e=e|0;t=t|0;u[e>>2]=t;return}function Ro(e){e=e|0;return e|0}function Io(e){e=+e;return+e}function No(e){e=e|0;Lo(e,Fo()|0,4);return}function Fo(){return 1064}function Lo(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;u[e+8>>2]=tt(t|0,n+1|0)|0;return}function Bo(e,t){e=e|0;t=t|0;t=u[t>>2]|0;u[e>>2]=t;xe(t|0);return}function jo(e){e=e|0;var t=0,n=0;n=e+4|0;t=u[n>>2]|0;u[n>>2]=0;if(t|0){Qi(t);KM(t)}Ut(u[e>>2]|0,0);return}function Uo(e){e=e|0;Yt(u[e>>2]|0);return}function Wo(e){e=e|0;return $t(u[e>>2]|0)|0}function zo(e,t,n,r){e=e|0;t=+t;n=+n;r=r|0;Or(u[e>>2]|0,$(t),$(n),r);return}function qo(e){e=e|0;return+ +$(ur(u[e>>2]|0))}function Ho(e){e=e|0;return+ +$(ar(u[e>>2]|0))}function Go(e){e=e|0;return+ +$(or(u[e>>2]|0))}function Vo(e){e=e|0;return+ +$(lr(u[e>>2]|0))}function Yo(e){e=e|0;return+ +$(sr(u[e>>2]|0))}function $o(e){e=e|0;return+ +$(cr(u[e>>2]|0))}function Ko(e,t){e=e|0;t=t|0;c[e>>3]=+$(ur(u[t>>2]|0));c[e+8>>3]=+$(ar(u[t>>2]|0));c[e+16>>3]=+$(or(u[t>>2]|0));c[e+24>>3]=+$(lr(u[t>>2]|0));c[e+32>>3]=+$(sr(u[t>>2]|0));c[e+40>>3]=+$(cr(u[t>>2]|0));return}function Xo(e,t){e=e|0;t=t|0;return+ +$(fr(u[e>>2]|0,t))}function Jo(e,t){e=e|0;t=t|0;return+ +$(dr(u[e>>2]|0,t))}function Qo(e,t){e=e|0;t=t|0;return+ +$(pr(u[e>>2]|0,t))}function Zo(){return Ft()|0}function ea(){ta();na();ra();ia();ua();oa();return}function ta(){W_(11713,4938,1);return}function na(){t_(10448);return}function ra(){Ny(10408);return}function ia(){Qg(10324);return}function ua(){Gv(10096);return}function oa(){aa(9132);return}function aa(e){e=e|0;var t=0,n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,D=0,w=0,E=0,T=0,C=0,k=0,M=0,S=0,x=0,O=0,A=0,P=0,R=0,I=0,N=0,F=0,L=0,B=0,j=0,U=0,W=0,z=0,q=0,H=0,G=0,V=0,Y=0,$=0,K=0,X=0,J=0,Q=0,Z=0,ee=0,te=0,ne=0,re=0,ie=0,ue=0,oe=0,ae=0,le=0,se=0,ce=0,fe=0,de=0,pe=0,he=0,me=0,ve=0,be=0,ge=0,ye=0,_e=0,De=0,we=0,Ee=0,Te=0,Ce=0,ke=0,Me=0,Se=0,xe=0,Oe=0,Ae=0,Pe=0;t=h;h=h+672|0;n=t+656|0;Pe=t+648|0;Ae=t+640|0;Oe=t+632|0;xe=t+624|0;Se=t+616|0;Me=t+608|0;ke=t+600|0;Ce=t+592|0;Te=t+584|0;Ee=t+576|0;we=t+568|0;De=t+560|0;_e=t+552|0;ye=t+544|0;ge=t+536|0;be=t+528|0;ve=t+520|0;me=t+512|0;he=t+504|0;pe=t+496|0;de=t+488|0;fe=t+480|0;ce=t+472|0;se=t+464|0;le=t+456|0;ae=t+448|0;oe=t+440|0;ue=t+432|0;ie=t+424|0;re=t+416|0;ne=t+408|0;te=t+400|0;ee=t+392|0;Z=t+384|0;Q=t+376|0;J=t+368|0;X=t+360|0;K=t+352|0;$=t+344|0;Y=t+336|0;V=t+328|0;G=t+320|0;H=t+312|0;q=t+304|0;z=t+296|0;W=t+288|0;U=t+280|0;j=t+272|0;B=t+264|0;L=t+256|0;F=t+248|0;N=t+240|0;I=t+232|0;R=t+224|0;P=t+216|0;A=t+208|0;O=t+200|0;x=t+192|0;S=t+184|0;M=t+176|0;k=t+168|0;C=t+160|0;T=t+152|0;E=t+144|0;w=t+136|0;D=t+128|0;_=t+120|0;y=t+112|0;g=t+104|0;b=t+96|0;v=t+88|0;m=t+80|0;p=t+72|0;d=t+64|0;f=t+56|0;c=t+48|0;s=t+40|0;l=t+32|0;a=t+24|0;o=t+16|0;i=t+8|0;r=t;la(e,3646);sa(e,3651,2)|0;ca(e,3665,2)|0;fa(e,3682,18)|0;u[Pe>>2]=19;u[Pe+4>>2]=0;u[n>>2]=u[Pe>>2];u[n+4>>2]=u[Pe+4>>2];da(e,3690,n)|0;u[Ae>>2]=1;u[Ae+4>>2]=0;u[n>>2]=u[Ae>>2];u[n+4>>2]=u[Ae+4>>2];pa(e,3696,n)|0;u[Oe>>2]=2;u[Oe+4>>2]=0;u[n>>2]=u[Oe>>2];u[n+4>>2]=u[Oe+4>>2];ha(e,3706,n)|0;u[xe>>2]=1;u[xe+4>>2]=0;u[n>>2]=u[xe>>2];u[n+4>>2]=u[xe+4>>2];ma(e,3722,n)|0;u[Se>>2]=2;u[Se+4>>2]=0;u[n>>2]=u[Se>>2];u[n+4>>2]=u[Se+4>>2];ma(e,3734,n)|0;u[Me>>2]=3;u[Me+4>>2]=0;u[n>>2]=u[Me>>2];u[n+4>>2]=u[Me+4>>2];ha(e,3753,n)|0;u[ke>>2]=4;u[ke+4>>2]=0;u[n>>2]=u[ke>>2];u[n+4>>2]=u[ke+4>>2];ha(e,3769,n)|0;u[Ce>>2]=5;u[Ce+4>>2]=0;u[n>>2]=u[Ce>>2];u[n+4>>2]=u[Ce+4>>2];ha(e,3783,n)|0;u[Te>>2]=6;u[Te+4>>2]=0;u[n>>2]=u[Te>>2];u[n+4>>2]=u[Te+4>>2];ha(e,3796,n)|0;u[Ee>>2]=7;u[Ee+4>>2]=0;u[n>>2]=u[Ee>>2];u[n+4>>2]=u[Ee+4>>2];ha(e,3813,n)|0;u[we>>2]=8;u[we+4>>2]=0;u[n>>2]=u[we>>2];u[n+4>>2]=u[we+4>>2];ha(e,3825,n)|0;u[De>>2]=3;u[De+4>>2]=0;u[n>>2]=u[De>>2];u[n+4>>2]=u[De+4>>2];ma(e,3843,n)|0;u[_e>>2]=4;u[_e+4>>2]=0;u[n>>2]=u[_e>>2];u[n+4>>2]=u[_e+4>>2];ma(e,3853,n)|0;u[ye>>2]=9;u[ye+4>>2]=0;u[n>>2]=u[ye>>2];u[n+4>>2]=u[ye+4>>2];ha(e,3870,n)|0;u[ge>>2]=10;u[ge+4>>2]=0;u[n>>2]=u[ge>>2];u[n+4>>2]=u[ge+4>>2];ha(e,3884,n)|0;u[be>>2]=11;u[be+4>>2]=0;u[n>>2]=u[be>>2];u[n+4>>2]=u[be+4>>2];ha(e,3896,n)|0;u[ve>>2]=1;u[ve+4>>2]=0;u[n>>2]=u[ve>>2];u[n+4>>2]=u[ve+4>>2];va(e,3907,n)|0;u[me>>2]=2;u[me+4>>2]=0;u[n>>2]=u[me>>2];u[n+4>>2]=u[me+4>>2];va(e,3915,n)|0;u[he>>2]=3;u[he+4>>2]=0;u[n>>2]=u[he>>2];u[n+4>>2]=u[he+4>>2];va(e,3928,n)|0;u[pe>>2]=4;u[pe+4>>2]=0;u[n>>2]=u[pe>>2];u[n+4>>2]=u[pe+4>>2];va(e,3948,n)|0;u[de>>2]=5;u[de+4>>2]=0;u[n>>2]=u[de>>2];u[n+4>>2]=u[de+4>>2];va(e,3960,n)|0;u[fe>>2]=6;u[fe+4>>2]=0;u[n>>2]=u[fe>>2];u[n+4>>2]=u[fe+4>>2];va(e,3974,n)|0;u[ce>>2]=7;u[ce+4>>2]=0;u[n>>2]=u[ce>>2];u[n+4>>2]=u[ce+4>>2];va(e,3983,n)|0;u[se>>2]=20;u[se+4>>2]=0;u[n>>2]=u[se>>2];u[n+4>>2]=u[se+4>>2];da(e,3999,n)|0;u[le>>2]=8;u[le+4>>2]=0;u[n>>2]=u[le>>2];u[n+4>>2]=u[le+4>>2];va(e,4012,n)|0;u[ae>>2]=9;u[ae+4>>2]=0;u[n>>2]=u[ae>>2];u[n+4>>2]=u[ae+4>>2];va(e,4022,n)|0;u[oe>>2]=21;u[oe+4>>2]=0;u[n>>2]=u[oe>>2];u[n+4>>2]=u[oe+4>>2];da(e,4039,n)|0;u[ue>>2]=10;u[ue+4>>2]=0;u[n>>2]=u[ue>>2];u[n+4>>2]=u[ue+4>>2];va(e,4053,n)|0;u[ie>>2]=11;u[ie+4>>2]=0;u[n>>2]=u[ie>>2];u[n+4>>2]=u[ie+4>>2];va(e,4065,n)|0;u[re>>2]=12;u[re+4>>2]=0;u[n>>2]=u[re>>2];u[n+4>>2]=u[re+4>>2];va(e,4084,n)|0;u[ne>>2]=13;u[ne+4>>2]=0;u[n>>2]=u[ne>>2];u[n+4>>2]=u[ne+4>>2];va(e,4097,n)|0;u[te>>2]=14;u[te+4>>2]=0;u[n>>2]=u[te>>2];u[n+4>>2]=u[te+4>>2];va(e,4117,n)|0;u[ee>>2]=15;u[ee+4>>2]=0;u[n>>2]=u[ee>>2];u[n+4>>2]=u[ee+4>>2];va(e,4129,n)|0;u[Z>>2]=16;u[Z+4>>2]=0;u[n>>2]=u[Z>>2];u[n+4>>2]=u[Z+4>>2];va(e,4148,n)|0;u[Q>>2]=17;u[Q+4>>2]=0;u[n>>2]=u[Q>>2];u[n+4>>2]=u[Q+4>>2];va(e,4161,n)|0;u[J>>2]=18;u[J+4>>2]=0;u[n>>2]=u[J>>2];u[n+4>>2]=u[J+4>>2];va(e,4181,n)|0;u[X>>2]=5;u[X+4>>2]=0;u[n>>2]=u[X>>2];u[n+4>>2]=u[X+4>>2];ma(e,4196,n)|0;u[K>>2]=6;u[K+4>>2]=0;u[n>>2]=u[K>>2];u[n+4>>2]=u[K+4>>2];ma(e,4206,n)|0;u[$>>2]=7;u[$+4>>2]=0;u[n>>2]=u[$>>2];u[n+4>>2]=u[$+4>>2];ma(e,4217,n)|0;u[Y>>2]=3;u[Y+4>>2]=0;u[n>>2]=u[Y>>2];u[n+4>>2]=u[Y+4>>2];ba(e,4235,n)|0;u[V>>2]=1;u[V+4>>2]=0;u[n>>2]=u[V>>2];u[n+4>>2]=u[V+4>>2];ga(e,4251,n)|0;u[G>>2]=4;u[G+4>>2]=0;u[n>>2]=u[G>>2];u[n+4>>2]=u[G+4>>2];ba(e,4263,n)|0;u[H>>2]=5;u[H+4>>2]=0;u[n>>2]=u[H>>2];u[n+4>>2]=u[H+4>>2];ba(e,4279,n)|0;u[q>>2]=6;u[q+4>>2]=0;u[n>>2]=u[q>>2];u[n+4>>2]=u[q+4>>2];ba(e,4293,n)|0;u[z>>2]=7;u[z+4>>2]=0;u[n>>2]=u[z>>2];u[n+4>>2]=u[z+4>>2];ba(e,4306,n)|0;u[W>>2]=8;u[W+4>>2]=0;u[n>>2]=u[W>>2];u[n+4>>2]=u[W+4>>2];ba(e,4323,n)|0;u[U>>2]=9;u[U+4>>2]=0;u[n>>2]=u[U>>2];u[n+4>>2]=u[U+4>>2];ba(e,4335,n)|0;u[j>>2]=2;u[j+4>>2]=0;u[n>>2]=u[j>>2];u[n+4>>2]=u[j+4>>2];ga(e,4353,n)|0;u[B>>2]=12;u[B+4>>2]=0;u[n>>2]=u[B>>2];u[n+4>>2]=u[B+4>>2];ya(e,4363,n)|0;u[L>>2]=1;u[L+4>>2]=0;u[n>>2]=u[L>>2];u[n+4>>2]=u[L+4>>2];_a(e,4376,n)|0;u[F>>2]=2;u[F+4>>2]=0;u[n>>2]=u[F>>2];u[n+4>>2]=u[F+4>>2];_a(e,4388,n)|0;u[N>>2]=13;u[N+4>>2]=0;u[n>>2]=u[N>>2];u[n+4>>2]=u[N+4>>2];ya(e,4402,n)|0;u[I>>2]=14;u[I+4>>2]=0;u[n>>2]=u[I>>2];u[n+4>>2]=u[I+4>>2];ya(e,4411,n)|0;u[R>>2]=15;u[R+4>>2]=0;u[n>>2]=u[R>>2];u[n+4>>2]=u[R+4>>2];ya(e,4421,n)|0;u[P>>2]=16;u[P+4>>2]=0;u[n>>2]=u[P>>2];u[n+4>>2]=u[P+4>>2];ya(e,4433,n)|0;u[A>>2]=17;u[A+4>>2]=0;u[n>>2]=u[A>>2];u[n+4>>2]=u[A+4>>2];ya(e,4446,n)|0;u[O>>2]=18;u[O+4>>2]=0;u[n>>2]=u[O>>2];u[n+4>>2]=u[O+4>>2];ya(e,4458,n)|0;u[x>>2]=3;u[x+4>>2]=0;u[n>>2]=u[x>>2];u[n+4>>2]=u[x+4>>2];_a(e,4471,n)|0;u[S>>2]=1;u[S+4>>2]=0;u[n>>2]=u[S>>2];u[n+4>>2]=u[S+4>>2];Da(e,4486,n)|0;u[M>>2]=10;u[M+4>>2]=0;u[n>>2]=u[M>>2];u[n+4>>2]=u[M+4>>2];ba(e,4496,n)|0;u[k>>2]=11;u[k+4>>2]=0;u[n>>2]=u[k>>2];u[n+4>>2]=u[k+4>>2];ba(e,4508,n)|0;u[C>>2]=3;u[C+4>>2]=0;u[n>>2]=u[C>>2];u[n+4>>2]=u[C+4>>2];ga(e,4519,n)|0;u[T>>2]=4;u[T+4>>2]=0;u[n>>2]=u[T>>2];u[n+4>>2]=u[T+4>>2];wa(e,4530,n)|0;u[E>>2]=19;u[E+4>>2]=0;u[n>>2]=u[E>>2];u[n+4>>2]=u[E+4>>2];Ea(e,4542,n)|0;u[w>>2]=12;u[w+4>>2]=0;u[n>>2]=u[w>>2];u[n+4>>2]=u[w+4>>2];Ta(e,4554,n)|0;u[D>>2]=13;u[D+4>>2]=0;u[n>>2]=u[D>>2];u[n+4>>2]=u[D+4>>2];Ca(e,4568,n)|0;u[_>>2]=2;u[_+4>>2]=0;u[n>>2]=u[_>>2];u[n+4>>2]=u[_+4>>2];ka(e,4578,n)|0;u[y>>2]=20;u[y+4>>2]=0;u[n>>2]=u[y>>2];u[n+4>>2]=u[y+4>>2];Ma(e,4587,n)|0;u[g>>2]=22;u[g+4>>2]=0;u[n>>2]=u[g>>2];u[n+4>>2]=u[g+4>>2];da(e,4602,n)|0;u[b>>2]=23;u[b+4>>2]=0;u[n>>2]=u[b>>2];u[n+4>>2]=u[b+4>>2];da(e,4619,n)|0;u[v>>2]=14;u[v+4>>2]=0;u[n>>2]=u[v>>2];u[n+4>>2]=u[v+4>>2];Sa(e,4629,n)|0;u[m>>2]=1;u[m+4>>2]=0;u[n>>2]=u[m>>2];u[n+4>>2]=u[m+4>>2];xa(e,4637,n)|0;u[p>>2]=4;u[p+4>>2]=0;u[n>>2]=u[p>>2];u[n+4>>2]=u[p+4>>2];_a(e,4653,n)|0;u[d>>2]=5;u[d+4>>2]=0;u[n>>2]=u[d>>2];u[n+4>>2]=u[d+4>>2];_a(e,4669,n)|0;u[f>>2]=6;u[f+4>>2]=0;u[n>>2]=u[f>>2];u[n+4>>2]=u[f+4>>2];_a(e,4686,n)|0;u[c>>2]=7;u[c+4>>2]=0;u[n>>2]=u[c>>2];u[n+4>>2]=u[c+4>>2];_a(e,4701,n)|0;u[s>>2]=8;u[s+4>>2]=0;u[n>>2]=u[s>>2];u[n+4>>2]=u[s+4>>2];_a(e,4719,n)|0;u[l>>2]=9;u[l+4>>2]=0;u[n>>2]=u[l>>2];u[n+4>>2]=u[l+4>>2];_a(e,4736,n)|0;u[a>>2]=21;u[a+4>>2]=0;u[n>>2]=u[a>>2];u[n+4>>2]=u[a+4>>2];Oa(e,4754,n)|0;u[o>>2]=2;u[o+4>>2]=0;u[n>>2]=u[o>>2];u[n+4>>2]=u[o+4>>2];Da(e,4772,n)|0;u[i>>2]=3;u[i+4>>2]=0;u[n>>2]=u[i>>2];u[n+4>>2]=u[i+4>>2];Da(e,4790,n)|0;u[r>>2]=4;u[r+4>>2]=0;u[n>>2]=u[r>>2];u[n+4>>2]=u[r+4>>2];Da(e,4808,n)|0;h=t;return}function la(e,t){e=e|0;t=t|0;var n=0;n=Iv()|0;u[e>>2]=n;Nv(n,t);cD(u[e>>2]|0);return}function sa(e,t,n){e=e|0;t=t|0;n=n|0;bv(e,Pa(t)|0,n,0);return e|0}function ca(e,t,n){e=e|0;t=t|0;n=n|0;Xm(e,Pa(t)|0,n,0);return e|0}function fa(e,t,n){e=e|0;t=t|0;n=n|0;Rm(e,Pa(t)|0,n,0);return e|0}function da(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];hm(e,t,i);h=r;return e|0}function pa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Vh(e,t,i);h=r;return e|0}function ha(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Mh(e,t,i);h=r;return e|0}function ma(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];lh(e,t,i);h=r;return e|0}function va(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];qp(e,t,i);h=r;return e|0}function ba(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Tp(e,t,i);h=r;return e|0}function ga(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];up(e,t,i);h=r;return e|0}function ya(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Cd(e,t,i);h=r;return e|0}function _a(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];od(e,t,i);h=r;return e|0}function Da(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Wf(e,t,i);h=r;return e|0}function wa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];wf(e,t,i);h=r;return e|0}function Ea(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Zc(e,t,i);h=r;return e|0}function Ta(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Rc(e,t,i);h=r;return e|0}function Ca(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];hc(e,t,i);h=r;return e|0}function ka(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Gs(e,t,i);h=r;return e|0}function Ma(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ds(e,t,i);h=r;return e|0}function Sa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ts(e,t,i);h=r;return e|0}function xa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ol(e,t,i);h=r;return e|0}function Oa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Aa(e,t,i);h=r;return e|0}function Aa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ra(e,n,i,1);h=r;return}function Pa(e){e=e|0;return e|0}function Ra(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=Ia()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Na(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Fa(o,r)|0,r);h=i;return}function Ia(){var e=0,t=0;if(!(r[7616]|0)){$a(9136);Fe(24,9136,b|0)|0;t=7616;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9136)|0)){e=9136;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));$a(9136)}return 9136}function Na(e){e=e|0;return 0}function Fa(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=Ia()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];za(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{qa(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function La(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;var a=0,l=0,s=0,c=0,f=0,d=0,p=0,m=0;a=h;h=h+32|0;p=a+24|0;d=a+20|0;s=a+16|0;f=a+12|0;c=a+8|0;l=a+4|0;m=a;u[d>>2]=t;u[s>>2]=n;u[f>>2]=r;u[c>>2]=i;u[l>>2]=o;o=e+28|0;u[m>>2]=u[o>>2];u[p>>2]=u[m>>2];Ba(e+24|0,p,d,f,c,s,l)|0;u[o>>2]=u[u[o>>2]>>2];h=a;return}function Ba(e,t,n,r,i,o,a){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;a=a|0;e=ja(t)|0;t=YM(24)|0;Ua(t+4|0,u[n>>2]|0,u[r>>2]|0,u[i>>2]|0,u[o>>2]|0,u[a>>2]|0);u[t>>2]=u[e>>2];u[e>>2]=t;return t|0}function ja(e){e=e|0;return u[e>>2]|0}function Ua(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;u[e>>2]=t;u[e+4>>2]=n;u[e+8>>2]=r;u[e+12>>2]=i;u[e+16>>2]=o;return}function Wa(e,t){e=e|0;t=t|0;return t|e|0}function za(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function qa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Ha(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Ga(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];za(o,r,n);u[s>>2]=(u[s>>2]|0)+12;Va(e,l);Ya(l);h=c;return}}function Ha(e){e=e|0;return 357913941}function Ga(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function Va(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Ya(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function $a(e){e=e|0;Qa(e);return}function Ka(e){e=e|0;Ja(e+24|0);return}function Xa(e){e=e|0;return u[e>>2]|0}function Ja(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Qa(e){e=e|0;var t=0;t=Za()|0;nl(e,2,3,t,el()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Za(){return 9228}function el(){return 1140}function tl(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0;n=h;h=h+16|0;r=n+8|0;i=n;o=rl(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];t=il(t,r)|0;h=n;return t|0}function nl(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;u[e>>2]=t;u[e+4>>2]=n;u[e+8>>2]=r;u[e+12>>2]=i;u[e+16>>2]=o;return}function rl(e){e=e|0;return(u[(Ia()|0)+24>>2]|0)+(e*12|0)|0}function il(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+48|0;r=i;n=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=u[(u[e>>2]|0)+n>>2]|0;mx[n&31](r,e);r=ul(r)|0;h=i;return r|0}function ul(e){e=e|0;var t=0,n=0,r=0,i=0;i=h;h=h+32|0;t=i+12|0;n=i;r=al(ol()|0)|0;if(!r)e=dl(e)|0;else{ll(t,r);sl(n,t);cl(e,n);e=fl(t)|0}h=i;return e|0}function ol(){var e=0;if(!(r[7632]|0)){El(9184);Fe(25,9184,b|0)|0;e=7632;u[e>>2]=1;u[e+4>>2]=0}return 9184}function al(e){e=e|0;return u[e+36>>2]|0}function ll(e,t){e=e|0;t=t|0;u[e>>2]=t;u[e+4>>2]=e;u[e+8>>2]=0;return}function sl(e,t){e=e|0;t=t|0;u[e>>2]=u[t>>2];u[e+4>>2]=u[t+4>>2];u[e+8>>2]=0;return}function cl(e,t){e=e|0;t=t|0;bl(t,e,e+8|0,e+16|0,e+24|0,e+32|0,e+40|0)|0;return}function fl(e){e=e|0;return u[(u[e+4>>2]|0)+8>>2]|0}function dl(e){e=e|0;var t=0,n=0,r=0,i=0,o=0,a=0,l=0,s=0;s=h;h=h+16|0;n=s+4|0;r=s;i=UE(8)|0;o=i;a=YM(48)|0;l=a;t=l+48|0;do{u[l>>2]=u[e>>2];l=l+4|0;e=e+4|0}while((l|0)<(t|0));t=o+4|0;u[t>>2]=a;l=YM(8)|0;a=u[t>>2]|0;u[r>>2]=0;u[n>>2]=u[r>>2];pl(l,a,n);u[i>>2]=l;h=s;return o|0}function pl(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;n=YM(16)|0;u[n+4>>2]=0;u[n+8>>2]=0;u[n>>2]=1092;u[n+12>>2]=t;u[e+4>>2]=n;return}function hl(e){e=e|0;WM(e);KM(e);return}function ml(e){e=e|0;e=u[e+12>>2]|0;if(e|0)KM(e);return}function vl(e){e=e|0;KM(e);return}function bl(e,t,n,r,i,o,a){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;a=a|0;o=gl(u[e>>2]|0,t,n,r,i,o,a)|0;a=e+4|0;u[(u[a>>2]|0)+8>>2]=o;return u[(u[a>>2]|0)+8>>2]|0}function gl(e,t,n,r,i,u,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;o=o|0;var a=0,l=0;a=h;h=h+16|0;l=a;Ek(l);e=wo(e)|0;o=yl(e,+c[t>>3],+c[n>>3],+c[r>>3],+c[i>>3],+c[u>>3],+c[o>>3])|0;Ck(l);h=a;return o|0}function yl(e,t,n,r,i,u,o){e=e|0;t=+t;n=+n;r=+r;i=+i;u=+u;o=+o;var a=0;a=Co(_l()|0)|0;t=+ko(t);n=+ko(n);r=+ko(r);i=+ko(i);u=+ko(u);return Me(0,a|0,e|0,+t,+n,+r,+i,+u,+ +ko(o))|0}function _l(){var e=0;if(!(r[7624]|0)){Dl(9172);e=7624;u[e>>2]=1;u[e+4>>2]=0}return 9172}function Dl(e){e=e|0;Lo(e,wl()|0,6);return}function wl(){return 1112}function El(e){e=e|0;xl(e);return}function Tl(e){e=e|0;Cl(e+24|0);kl(e+16|0);return}function Cl(e){e=e|0;Sl(e);return}function kl(e){e=e|0;Ml(e);return}function Ml(e){e=e|0;var t=0,n=0;t=u[e>>2]|0;if(t|0)do{n=t;t=u[t>>2]|0;KM(n)}while((t|0)!=0);u[e>>2]=0;return}function Sl(e){e=e|0;var t=0,n=0;t=u[e>>2]|0;if(t|0)do{n=t;t=u[t>>2]|0;KM(n)}while((t|0)!=0);u[e>>2]=0;return}function xl(e){e=e|0;var t=0;u[e+16>>2]=0;u[e+20>>2]=0;t=e+24|0;u[t>>2]=0;u[e+28>>2]=t;u[e+36>>2]=0;r[e+40>>0]=0;r[e+41>>0]=0;return}function Ol(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Al(e,n,i,0);h=r;return}function Al(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=Pl()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Rl(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Il(o,r)|0,r);h=i;return}function Pl(){var e=0,t=0;if(!(r[7640]|0)){Wl(9232);Fe(26,9232,b|0)|0;t=7640;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9232)|0)){e=9232;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Wl(9232)}return 9232}function Rl(e){e=e|0;return 0}function Il(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=Pl()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Nl(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Fl(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function Nl(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Fl(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Ll(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Bl(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Nl(o,r,n);u[s>>2]=(u[s>>2]|0)+12;jl(e,l);Ul(l);h=c;return}}function Ll(e){e=e|0;return 357913941}function Bl(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function jl(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Ul(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Wl(e){e=e|0;Hl(e);return}function zl(e){e=e|0;ql(e+24|0);return}function ql(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Hl(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,Gl()|0,3);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Gl(){return 1144}function Vl(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;var o=0,a=0,l=0,s=0;o=h;h=h+16|0;a=o+8|0;l=o;s=Yl(e)|0;e=u[s+4>>2]|0;u[l>>2]=u[s>>2];u[l+4>>2]=e;u[a>>2]=u[l>>2];u[a+4>>2]=u[l+4>>2];$l(t,a,n,r,i);h=o;return}function Yl(e){e=e|0;return(u[(Pl()|0)+24>>2]|0)+(e*12|0)|0}function $l(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;var o=0,a=0,l=0,s=0,c=0;c=h;h=h+16|0;a=c+2|0;l=c+1|0;s=c;o=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)o=u[(u[e>>2]|0)+o>>2]|0;Kl(a,n);n=+Xl(a,n);Kl(l,r);r=+Xl(l,r);Jl(s,i);s=Ql(s,i)|0;bx[o&1](e,n,r,s);h=c;return}function Kl(e,t){e=e|0;t=+t;return}function Xl(e,t){e=e|0;t=+t;return+ +es(t)}function Jl(e,t){e=e|0;t=t|0;return}function Ql(e,t){e=e|0;t=t|0;return Zl(t)|0}function Zl(e){e=e|0;return e|0}function es(e){e=+e;return+e}function ts(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ns(e,n,i,1);h=r;return}function ns(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=rs()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=is(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,us(o,r)|0,r);h=i;return}function rs(){var e=0,t=0;if(!(r[7648]|0)){ds(9268);Fe(27,9268,b|0)|0;t=7648;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9268)|0)){e=9268;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));ds(9268)}return 9268}function is(e){e=e|0;return 0}function us(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=rs()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];os(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{as(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function os(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function as(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=ls(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;ss(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];os(o,r,n);u[s>>2]=(u[s>>2]|0)+12;cs(e,l);fs(l);h=c;return}}function ls(e){e=e|0;return 357913941}function ss(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function cs(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function fs(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function ds(e){e=e|0;ms(e);return}function ps(e){e=e|0;hs(e+24|0);return}function hs(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function ms(e){e=e|0;var t=0;t=Za()|0;nl(e,2,4,t,vs()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function vs(){return 1160}function bs(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0;n=h;h=h+16|0;r=n+8|0;i=n;o=gs(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];t=ys(t,r)|0;h=n;return t|0}function gs(e){e=e|0;return(u[(rs()|0)+24>>2]|0)+(e*12|0)|0}function ys(e,t){e=e|0;t=t|0;var n=0;n=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=u[(u[e>>2]|0)+n>>2]|0;return _s(vx[n&31](e)|0)|0}function _s(e){e=e|0;return e&1|0}function Ds(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ws(e,n,i,0);h=r;return}function ws(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=Es()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Ts(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Cs(o,r)|0,r);h=i;return}function Es(){var e=0,t=0;if(!(r[7656]|0)){Ps(9304);Fe(28,9304,b|0)|0;t=7656;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9304)|0)){e=9304;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Ps(9304)}return 9304}function Ts(e){e=e|0;return 0}function Cs(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=Es()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];ks(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Ms(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function ks(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Ms(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Ss(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;xs(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];ks(o,r,n);u[s>>2]=(u[s>>2]|0)+12;Os(e,l);As(l);h=c;return}}function Ss(e){e=e|0;return 357913941}function xs(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function Os(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function As(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Ps(e){e=e|0;Ns(e);return}function Rs(e){e=e|0;Is(e+24|0);return}function Is(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Ns(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,Fs()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Fs(){return 1164}function Ls(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=Bs(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];js(t,i,n);h=r;return}function Bs(e){e=e|0;return(u[(Es()|0)+24>>2]|0)+(e*12|0)|0}function js(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;o=h;h=h+16|0;i=o;r=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=u[(u[e>>2]|0)+r>>2]|0;Us(i,n);n=Ws(i,n)|0;mx[r&31](e,n);zs(i);h=o;return}function Us(e,t){e=e|0;t=t|0;qs(e,t);return}function Ws(e,t){e=e|0;t=t|0;return e|0}function zs(e){e=e|0;Qi(e);return}function qs(e,t){e=e|0;t=t|0;Hs(e,t);return}function Hs(e,t){e=e|0;t=t|0;u[e>>2]=t;return}function Gs(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Vs(e,n,i,0);h=r;return}function Vs(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=Ys()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=$s(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Ks(o,r)|0,r);h=i;return}function Ys(){var e=0,t=0;if(!(r[7664]|0)){nc(9340);Fe(29,9340,b|0)|0;t=7664;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9340)|0)){e=9340;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));nc(9340)}return 9340}function $s(e){e=e|0;return 0}function Ks(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=Ys()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Xs(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Js(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function Xs(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Js(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Qs(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Zs(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Xs(o,r,n);u[s>>2]=(u[s>>2]|0)+12;ec(e,l);tc(l);h=c;return}}function Qs(e){e=e|0;return 357913941}function Zs(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function ec(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function tc(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function nc(e){e=e|0;uc(e);return}function rc(e){e=e|0;ic(e+24|0);return}function ic(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function uc(e){e=e|0;var t=0;t=Za()|0;nl(e,2,4,t,oc()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function oc(){return 1180}function ac(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=lc(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];n=sc(t,i,n)|0;h=r;return n|0}function lc(e){e=e|0;return(u[(Ys()|0)+24>>2]|0)+(e*12|0)|0}function sc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;o=h;h=h+16|0;i=o;r=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=u[(u[e>>2]|0)+r>>2]|0;cc(i,n);i=fc(i,n)|0;i=dc(Ex[r&15](e,i)|0)|0;h=o;return i|0}function cc(e,t){e=e|0;t=t|0;return}function fc(e,t){e=e|0;t=t|0;return pc(t)|0}function dc(e){e=e|0;return e|0}function pc(e){e=e|0;return e|0}function hc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];mc(e,n,i,0);h=r;return}function mc(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=vc()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=bc(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,gc(o,r)|0,r);h=i;return}function vc(){var e=0,t=0;if(!(r[7672]|0)){Cc(9376);Fe(30,9376,b|0)|0;t=7672;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9376)|0)){e=9376;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Cc(9376)}return 9376}function bc(e){e=e|0;return 0}function gc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=vc()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];yc(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{_c(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function yc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function _c(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Dc(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;wc(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];yc(o,r,n);u[s>>2]=(u[s>>2]|0)+12;Ec(e,l);Tc(l);h=c;return}}function Dc(e){e=e|0;return 357913941}function wc(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function Ec(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Tc(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Cc(e){e=e|0;Sc(e);return}function kc(e){e=e|0;Mc(e+24|0);return}function Mc(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Sc(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,xc()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function xc(){return 1196}function Oc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0;n=h;h=h+16|0;r=n+8|0;i=n;o=Ac(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];t=Pc(t,r)|0;h=n;return t|0}function Ac(e){e=e|0;return(u[(vc()|0)+24>>2]|0)+(e*12|0)|0}function Pc(e,t){e=e|0;t=t|0;var n=0;n=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=u[(u[e>>2]|0)+n>>2]|0;return dc(vx[n&31](e)|0)|0}function Rc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ic(e,n,i,1);h=r;return}function Ic(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=Nc()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Fc(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Lc(o,r)|0,r);h=i;return}function Nc(){var e=0,t=0;if(!(r[7680]|0)){Hc(9412);Fe(31,9412,b|0)|0;t=7680;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9412)|0)){e=9412;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Hc(9412)}return 9412}function Fc(e){e=e|0;return 0}function Lc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=Nc()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Bc(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{jc(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function Bc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function jc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Uc(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Wc(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Bc(o,r,n);u[s>>2]=(u[s>>2]|0)+12;zc(e,l);qc(l);h=c;return}}function Uc(e){e=e|0;return 357913941}function Wc(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function zc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function qc(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Hc(e){e=e|0;Yc(e);return}function Gc(e){e=e|0;Vc(e+24|0);return}function Vc(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Yc(e){e=e|0;var t=0;t=Za()|0;nl(e,2,6,t,$c()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function $c(){return 1200}function Kc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0;n=h;h=h+16|0;r=n+8|0;i=n;o=Xc(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];t=Jc(t,r)|0;h=n;return t|0}function Xc(e){e=e|0;return(u[(Nc()|0)+24>>2]|0)+(e*12|0)|0}function Jc(e,t){e=e|0;t=t|0;var n=0;n=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=u[(u[e>>2]|0)+n>>2]|0;return Qc(vx[n&31](e)|0)|0}function Qc(e){e=e|0;return e|0}function Zc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ef(e,n,i,0);h=r;return}function ef(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=tf()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=nf(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,rf(o,r)|0,r);h=i;return}function tf(){var e=0,t=0;if(!(r[7688]|0)){ff(9448);Fe(32,9448,b|0)|0;t=7688;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9448)|0)){e=9448;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));ff(9448)}return 9448}function nf(e){e=e|0;return 0}function rf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=tf()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];uf(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{of(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function uf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function of(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=af(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;lf(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];uf(o,r,n);u[s>>2]=(u[s>>2]|0)+12;sf(e,l);cf(l);h=c;return}}function af(e){e=e|0;return 357913941}function lf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function sf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function cf(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function ff(e){e=e|0;hf(e);return}function df(e){e=e|0;pf(e+24|0);return}function pf(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function hf(e){e=e|0;var t=0;t=Za()|0;nl(e,2,6,t,mf()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function mf(){return 1204}function vf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=bf(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];gf(t,i,n);h=r;return}function bf(e){e=e|0;return(u[(tf()|0)+24>>2]|0)+(e*12|0)|0}function gf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;o=h;h=h+16|0;i=o;r=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=u[(u[e>>2]|0)+r>>2]|0;yf(i,n);i=_f(i,n)|0;mx[r&31](e,i);h=o;return}function yf(e,t){e=e|0;t=t|0;return}function _f(e,t){e=e|0;t=t|0;return Df(t)|0}function Df(e){e=e|0;return e|0}function wf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ef(e,n,i,0);h=r;return}function Ef(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=Tf()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Cf(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,kf(o,r)|0,r);h=i;return}function Tf(){var e=0,t=0;if(!(r[7696]|0)){Rf(9484);Fe(33,9484,b|0)|0;t=7696;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9484)|0)){e=9484;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Rf(9484)}return 9484}function Cf(e){e=e|0;return 0}function kf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=Tf()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Mf(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Sf(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function Mf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Sf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=xf(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Of(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Mf(o,r,n);u[s>>2]=(u[s>>2]|0)+12;Af(e,l);Pf(l);h=c;return}}function xf(e){e=e|0;return 357913941}function Of(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function Af(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Pf(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Rf(e){e=e|0;Ff(e);return}function If(e){e=e|0;Nf(e+24|0);return}function Nf(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Ff(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,Lf()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Lf(){return 1212}function Bf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0;i=h;h=h+16|0;o=i+8|0;a=i;l=jf(e)|0;e=u[l+4>>2]|0;u[a>>2]=u[l>>2];u[a+4>>2]=e;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];Uf(t,o,n,r);h=i;return}function jf(e){e=e|0;return(u[(Tf()|0)+24>>2]|0)+(e*12|0)|0}function Uf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0;l=h;h=h+16|0;o=l+1|0;a=l;i=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)i=u[(u[e>>2]|0)+i>>2]|0;yf(o,n);o=_f(o,n)|0;cc(a,r);a=fc(a,r)|0;Ax[i&15](e,o,a);h=l;return}function Wf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];zf(e,n,i,1);h=r;return}function zf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=qf()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Hf(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Gf(o,r)|0,r);h=i;return}function qf(){var e=0,t=0;if(!(r[7704]|0)){Qf(9520);Fe(34,9520,b|0)|0;t=7704;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9520)|0)){e=9520;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Qf(9520)}return 9520}function Hf(e){e=e|0;return 0}function Gf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=qf()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Vf(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Yf(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function Vf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Yf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=$f(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Kf(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Vf(o,r,n);u[s>>2]=(u[s>>2]|0)+12;Xf(e,l);Jf(l);h=c;return}}function $f(e){e=e|0;return 357913941}function Kf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function Xf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Jf(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Qf(e){e=e|0;td(e);return}function Zf(e){e=e|0;ed(e+24|0);return}function ed(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function td(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,nd()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function nd(){return 1224}function rd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0.0,i=0,o=0,a=0,l=0;i=h;h=h+16|0;o=i+8|0;a=i;l=id(e)|0;e=u[l+4>>2]|0;u[a>>2]=u[l>>2];u[a+4>>2]=e;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];r=+ud(t,o,n);h=i;return+r}function id(e){e=e|0;return(u[(qf()|0)+24>>2]|0)+(e*12|0)|0}function ud(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0.0;o=h;h=h+16|0;i=o;r=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=u[(u[e>>2]|0)+r>>2]|0;Jl(i,n);i=Ql(i,n)|0;a=+Io(+kx[r&7](e,i));h=o;return+a}function od(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ad(e,n,i,1);h=r;return}function ad(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=ld()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=sd(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,cd(o,r)|0,r);h=i;return}function ld(){var e=0,t=0;if(!(r[7712]|0)){bd(9556);Fe(35,9556,b|0)|0;t=7712;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9556)|0)){e=9556;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));bd(9556)}return 9556}function sd(e){e=e|0;return 0}function cd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=ld()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];fd(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{dd(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function fd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function dd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=pd(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;hd(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];fd(o,r,n);u[s>>2]=(u[s>>2]|0)+12;md(e,l);vd(l);h=c;return}}function pd(e){e=e|0;return 357913941}function hd(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function md(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function vd(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function bd(e){e=e|0;_d(e);return}function gd(e){e=e|0;yd(e+24|0);return}function yd(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function _d(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,Dd()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Dd(){return 1232}function wd(e,t){e=e|0;t=t|0;var n=0.0,r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=Ed(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];n=+Td(t,i);h=r;return+n}function Ed(e){e=e|0;return(u[(ld()|0)+24>>2]|0)+(e*12|0)|0}function Td(e,t){e=e|0;t=t|0;var n=0;n=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=u[(u[e>>2]|0)+n>>2]|0;return+ +Io(+Dx[n&15](e))}function Cd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];kd(e,n,i,1);h=r;return}function kd(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=Md()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Sd(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,xd(o,r)|0,r);h=i;return}function Md(){var e=0,t=0;if(!(r[7720]|0)){Fd(9592);Fe(36,9592,b|0)|0;t=7720;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9592)|0)){e=9592;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Fd(9592)}return 9592}function Sd(e){e=e|0;return 0}function xd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=Md()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Od(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Ad(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function Od(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Ad(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Pd(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Rd(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Od(o,r,n);u[s>>2]=(u[s>>2]|0)+12;Id(e,l);Nd(l);h=c;return}}function Pd(e){e=e|0;return 357913941}function Rd(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function Id(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Nd(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Fd(e){e=e|0;jd(e);return}function Ld(e){e=e|0;Bd(e+24|0);return}function Bd(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function jd(e){e=e|0;var t=0;t=Za()|0;nl(e,2,7,t,Ud()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Ud(){return 1276}function Wd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0;n=h;h=h+16|0;r=n+8|0;i=n;o=zd(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];t=qd(t,r)|0;h=n;return t|0}function zd(e){e=e|0;return(u[(Md()|0)+24>>2]|0)+(e*12|0)|0}function qd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+16|0;r=i;n=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=u[(u[e>>2]|0)+n>>2]|0;mx[n&31](r,e);r=Hd(r)|0;h=i;return r|0}function Hd(e){e=e|0;var t=0,n=0,r=0,i=0;i=h;h=h+32|0;t=i+12|0;n=i;r=al(Gd()|0)|0;if(!r)e=Yd(e)|0;else{ll(t,r);sl(n,t);Vd(e,n);e=fl(t)|0}h=i;return e|0}function Gd(){var e=0;if(!(r[7736]|0)){ip(9640);Fe(25,9640,b|0)|0;e=7736;u[e>>2]=1;u[e+4>>2]=0}return 9640}function Vd(e,t){e=e|0;t=t|0;Qd(t,e,e+8|0)|0;return}function Yd(e){e=e|0;var t=0,n=0,r=0,i=0,o=0,a=0,l=0;n=h;h=h+16|0;i=n+4|0;a=n;r=UE(8)|0;t=r;l=YM(16)|0;u[l>>2]=u[e>>2];u[l+4>>2]=u[e+4>>2];u[l+8>>2]=u[e+8>>2];u[l+12>>2]=u[e+12>>2];o=t+4|0;u[o>>2]=l;e=YM(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];$d(e,o,i);u[r>>2]=e;h=n;return t|0}function $d(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;n=YM(16)|0;u[n+4>>2]=0;u[n+8>>2]=0;u[n>>2]=1244;u[n+12>>2]=t;u[e+4>>2]=n;return}function Kd(e){e=e|0;WM(e);KM(e);return}function Xd(e){e=e|0;e=u[e+12>>2]|0;if(e|0)KM(e);return}function Jd(e){e=e|0;KM(e);return}function Qd(e,t,n){e=e|0;t=t|0;n=n|0;t=Zd(u[e>>2]|0,t,n)|0;n=e+4|0;u[(u[n>>2]|0)+8>>2]=t;return u[(u[n>>2]|0)+8>>2]|0}function Zd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;Ek(i);e=wo(e)|0;n=ep(e,u[t>>2]|0,+c[n>>3])|0;Ck(i);h=r;return n|0}function ep(e,t,n){e=e|0;t=t|0;n=+n;var r=0;r=Co(tp()|0)|0;t=Mo(t)|0;return Se(0,r|0,e|0,t|0,+ +ko(n))|0}function tp(){var e=0;if(!(r[7728]|0)){np(9628);e=7728;u[e>>2]=1;u[e+4>>2]=0}return 9628}function np(e){e=e|0;Lo(e,rp()|0,2);return}function rp(){return 1264}function ip(e){e=e|0;xl(e);return}function up(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];op(e,n,i,1);h=r;return}function op(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=ap()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=lp(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,sp(o,r)|0,r);h=i;return}function ap(){var e=0,t=0;if(!(r[7744]|0)){vp(9684);Fe(37,9684,b|0)|0;t=7744;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9684)|0)){e=9684;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));vp(9684)}return 9684}function lp(e){e=e|0;return 0}function sp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=ap()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];cp(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{fp(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function cp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function fp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=dp(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;pp(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];cp(o,r,n);u[s>>2]=(u[s>>2]|0)+12;hp(e,l);mp(l);h=c;return}}function dp(e){e=e|0;return 357913941}function pp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function hp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function mp(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function vp(e){e=e|0;yp(e);return}function bp(e){e=e|0;gp(e+24|0);return}function gp(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function yp(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,_p()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function _p(){return 1280}function Dp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=wp(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];n=Ep(t,i,n)|0;h=r;return n|0}function wp(e){e=e|0;return(u[(ap()|0)+24>>2]|0)+(e*12|0)|0}function Ep(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;a=h;h=h+32|0;i=a;o=a+16|0;r=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=u[(u[e>>2]|0)+r>>2]|0;Jl(o,n);o=Ql(o,n)|0;Ax[r&15](i,e,o);o=Hd(i)|0;h=a;return o|0}function Tp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Cp(e,n,i,1);h=r;return}function Cp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=kp()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Mp(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Sp(o,r)|0,r);h=i;return}function kp(){var e=0,t=0;if(!(r[7752]|0)){Np(9720);Fe(38,9720,b|0)|0;t=7752;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9720)|0)){e=9720;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Np(9720)}return 9720}function Mp(e){e=e|0;return 0}function Sp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=kp()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];xp(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Op(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function xp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Op(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Ap(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Pp(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];xp(o,r,n);u[s>>2]=(u[s>>2]|0)+12;Rp(e,l);Ip(l);h=c;return}}function Ap(e){e=e|0;return 357913941}function Pp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function Rp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Ip(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Np(e){e=e|0;Bp(e);return}function Fp(e){e=e|0;Lp(e+24|0);return}function Lp(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Bp(e){e=e|0;var t=0;t=Za()|0;nl(e,2,8,t,jp()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function jp(){return 1288}function Up(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0;n=h;h=h+16|0;r=n+8|0;i=n;o=Wp(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];t=zp(t,r)|0;h=n;return t|0}function Wp(e){e=e|0;return(u[(kp()|0)+24>>2]|0)+(e*12|0)|0}function zp(e,t){e=e|0;t=t|0;var n=0;n=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=u[(u[e>>2]|0)+n>>2]|0;return Ro(vx[n&31](e)|0)|0}function qp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Hp(e,n,i,0);h=r;return}function Hp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=Gp()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Vp(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Yp(o,r)|0,r);h=i;return}function Gp(){var e=0,t=0;if(!(r[7760]|0)){eh(9756);Fe(39,9756,b|0)|0;t=7760;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9756)|0)){e=9756;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));eh(9756)}return 9756}function Vp(e){e=e|0;return 0}function Yp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=Gp()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];$p(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Kp(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function $p(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Kp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Xp(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Jp(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];$p(o,r,n);u[s>>2]=(u[s>>2]|0)+12;Qp(e,l);Zp(l);h=c;return}}function Xp(e){e=e|0;return 357913941}function Jp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function Qp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Zp(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function eh(e){e=e|0;rh(e);return}function th(e){e=e|0;nh(e+24|0);return}function nh(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function rh(e){e=e|0;var t=0;t=Za()|0;nl(e,2,8,t,ih()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function ih(){return 1292}function uh(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=oh(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ah(t,i,n);h=r;return}function oh(e){e=e|0;return(u[(Gp()|0)+24>>2]|0)+(e*12|0)|0}function ah(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,o=0;o=h;h=h+16|0;i=o;r=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=u[(u[e>>2]|0)+r>>2]|0;Kl(i,n);n=+Xl(i,n);dx[r&31](e,n);h=o;return}function lh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];sh(e,n,i,0);h=r;return}function sh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=ch()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=fh(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,dh(o,r)|0,r);h=i;return}function ch(){var e=0,t=0;if(!(r[7768]|0)){yh(9792);Fe(40,9792,b|0)|0;t=7768;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9792)|0)){e=9792;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));yh(9792)}return 9792}function fh(e){e=e|0;return 0}function dh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=ch()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];ph(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{hh(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function ph(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function hh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=mh(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;vh(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];ph(o,r,n);u[s>>2]=(u[s>>2]|0)+12;bh(e,l);gh(l);h=c;return}}function mh(e){e=e|0;return 357913941}function vh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function bh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function gh(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function yh(e){e=e|0;wh(e);return}function _h(e){e=e|0;Dh(e+24|0);return}function Dh(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function wh(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,Eh()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Eh(){return 1300}function Th(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;var i=0,o=0,a=0,l=0;i=h;h=h+16|0;o=i+8|0;a=i;l=Ch(e)|0;e=u[l+4>>2]|0;u[a>>2]=u[l>>2];u[a+4>>2]=e;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];kh(t,o,n,r);h=i;return}function Ch(e){e=e|0;return(u[(ch()|0)+24>>2]|0)+(e*12|0)|0}function kh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;var i=0,o=0,a=0,l=0;l=h;h=h+16|0;o=l+1|0;a=l;i=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)i=u[(u[e>>2]|0)+i>>2]|0;Jl(o,n);o=Ql(o,n)|0;Kl(a,r);r=+Xl(a,r);Rx[i&15](e,o,r);h=l;return}function Mh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Sh(e,n,i,0);h=r;return}function Sh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=xh()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Oh(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Ah(o,r)|0,r);h=i;return}function xh(){var e=0,t=0;if(!(r[7776]|0)){Bh(9828);Fe(41,9828,b|0)|0;t=7776;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9828)|0)){e=9828;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Bh(9828)}return 9828}function Oh(e){e=e|0;return 0}function Ah(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=xh()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Ph(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Rh(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function Ph(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Rh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Ih(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Nh(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Ph(o,r,n);u[s>>2]=(u[s>>2]|0)+12;Fh(e,l);Lh(l);h=c;return}}function Ih(e){e=e|0;return 357913941}function Nh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function Fh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Lh(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Bh(e){e=e|0;Wh(e);return}function jh(e){e=e|0;Uh(e+24|0);return}function Uh(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Wh(e){e=e|0;var t=0;t=Za()|0;nl(e,2,7,t,zh()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function zh(){return 1312}function qh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=Hh(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Gh(t,i,n);h=r;return}function Hh(e){e=e|0;return(u[(xh()|0)+24>>2]|0)+(e*12|0)|0}function Gh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;o=h;h=h+16|0;i=o;r=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=u[(u[e>>2]|0)+r>>2]|0;Jl(i,n);i=Ql(i,n)|0;mx[r&31](e,i);h=o;return}function Vh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Yh(e,n,i,0);h=r;return}function Yh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=$h()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=Kh(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Xh(o,r)|0,r);h=i;return}function $h(){var e=0,t=0;if(!(r[7784]|0)){rm(9864);Fe(42,9864,b|0)|0;t=7784;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9864)|0)){e=9864;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));rm(9864)}return 9864}function Kh(e){e=e|0;return 0}function Xh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=$h()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Jh(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Qh(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function Jh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Qh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Zh(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;em(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Jh(o,r,n);u[s>>2]=(u[s>>2]|0)+12;tm(e,l);nm(l);h=c;return}}function Zh(e){e=e|0;return 357913941}function em(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function tm(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function nm(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function rm(e){e=e|0;om(e);return}function im(e){e=e|0;um(e+24|0);return}function um(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function om(e){e=e|0;var t=0;t=Za()|0;nl(e,2,8,t,am()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function am(){return 1320}function lm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=sm(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];cm(t,i,n);h=r;return}function sm(e){e=e|0;return(u[($h()|0)+24>>2]|0)+(e*12|0)|0}function cm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;o=h;h=h+16|0;i=o;r=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=u[(u[e>>2]|0)+r>>2]|0;fm(i,n);i=dm(i,n)|0;mx[r&31](e,i);h=o;return}function fm(e,t){e=e|0;t=t|0;return}function dm(e,t){e=e|0;t=t|0;return pm(t)|0}function pm(e){e=e|0;return e|0}function hm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];mm(e,n,i,0);h=r;return}function mm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=vm()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=bm(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,gm(o,r)|0,r);h=i;return}function vm(){var e=0,t=0;if(!(r[7792]|0)){Cm(9900);Fe(43,9900,b|0)|0;t=7792;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9900)|0)){e=9900;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Cm(9900)}return 9900}function bm(e){e=e|0;return 0}function gm(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=vm()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];ym(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{_m(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function ym(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function _m(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Dm(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;wm(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];ym(o,r,n);u[s>>2]=(u[s>>2]|0)+12;Em(e,l);Tm(l);h=c;return}}function Dm(e){e=e|0;return 357913941}function wm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function Em(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Tm(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Cm(e){e=e|0;Sm(e);return}function km(e){e=e|0;Mm(e+24|0);return}function Mm(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Sm(e){e=e|0;var t=0;t=Za()|0;nl(e,2,22,t,xm()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function xm(){return 1344}function Om(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0;n=h;h=h+16|0;r=n+8|0;i=n;o=Am(e)|0;e=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=e;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];Pm(t,r);h=n;return}function Am(e){e=e|0;return(u[(vm()|0)+24>>2]|0)+(e*12|0)|0}function Pm(e,t){e=e|0;t=t|0;var n=0;n=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=u[(u[e>>2]|0)+n>>2]|0;hx[n&127](e);return}function Rm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=u[e>>2]|0;i=Im()|0;e=Nm(n)|0;La(o,t,i,e,Fm(n,r)|0,r);return}function Im(){var e=0,t=0;if(!(r[7800]|0)){qm(9936);Fe(44,9936,b|0)|0;t=7800;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9936)|0)){e=9936;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));qm(9936)}return 9936}function Nm(e){e=e|0;return e|0}function Fm(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=Im()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){Lm(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{Bm(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function Lm(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function Bm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=jm(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;Um(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;Lm(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Wm(e,i);zm(i);h=l;return}}function jm(e){e=e|0;return 536870911}function Um(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function Wm(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function zm(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function qm(e){e=e|0;Vm(e);return}function Hm(e){e=e|0;Gm(e+24|0);return}function Gm(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function Vm(e){e=e|0;var t=0;t=Za()|0;nl(e,1,23,t,mf()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Ym(e,t){e=e|0;t=t|0;Km(u[($m(e)|0)>>2]|0,t);return}function $m(e){e=e|0;return(u[(Im()|0)+24>>2]|0)+(e<<3)|0}function Km(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;yf(r,t);t=_f(r,t)|0;hx[e&127](t);h=n;return}function Xm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=u[e>>2]|0;i=Jm()|0;e=Qm(n)|0;La(o,t,i,e,Zm(n,r)|0,r);return}function Jm(){var e=0,t=0;if(!(r[7808]|0)){ov(9972);Fe(45,9972,b|0)|0;t=7808;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(9972)|0)){e=9972;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));ov(9972)}return 9972}function Qm(e){e=e|0;return e|0}function Zm(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=Jm()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){ev(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{tv(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function ev(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function tv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=nv(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;rv(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;ev(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;iv(e,i);uv(i);h=l;return}}function nv(e){e=e|0;return 536870911}function rv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function iv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function uv(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function ov(e){e=e|0;sv(e);return}function av(e){e=e|0;lv(e+24|0);return}function lv(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function sv(e){e=e|0;var t=0;t=Za()|0;nl(e,1,9,t,cv()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function cv(){return 1348}function fv(e,t){e=e|0;t=t|0;return pv(u[(dv(e)|0)>>2]|0,t)|0}function dv(e){e=e|0;return(u[(Jm()|0)+24>>2]|0)+(e<<3)|0}function pv(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;hv(r,t);t=mv(r,t)|0;t=dc(vx[e&31](t)|0)|0;h=n;return t|0}function hv(e,t){e=e|0;t=t|0;return}function mv(e,t){e=e|0;t=t|0;return vv(t)|0}function vv(e){e=e|0;return e|0}function bv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=u[e>>2]|0;i=gv()|0;e=yv(n)|0;La(o,t,i,e,_v(n,r)|0,r);return}function gv(){var e=0,t=0;if(!(r[7816]|0)){Mv(10008);Fe(46,10008,b|0)|0;t=7816;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10008)|0)){e=10008;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Mv(10008)}return 10008}function yv(e){e=e|0;return e|0}function _v(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=gv()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){Dv(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{wv(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function Dv(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function wv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=Ev(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;Tv(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;Dv(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Cv(e,i);kv(i);h=l;return}}function Ev(e){e=e|0;return 536870911}function Tv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function Cv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function kv(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function Mv(e){e=e|0;Ov(e);return}function Sv(e){e=e|0;xv(e+24|0);return}function xv(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function Ov(e){e=e|0;var t=0;t=Za()|0;nl(e,1,15,t,xc()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Av(e){e=e|0;return Rv(u[(Pv(e)|0)>>2]|0)|0}function Pv(e){e=e|0;return(u[(gv()|0)+24>>2]|0)+(e<<3)|0}function Rv(e){e=e|0;return dc(Mx[e&7]()|0)|0}function Iv(){var e=0;if(!(r[7832]|0)){Hv(10052);Fe(25,10052,b|0)|0;e=7832;u[e>>2]=1;u[e+4>>2]=0}return 10052}function Nv(e,t){e=e|0;t=t|0;u[e>>2]=Fv()|0;u[e+4>>2]=Lv()|0;u[e+12>>2]=t;u[e+8>>2]=Bv()|0;u[e+32>>2]=2;return}function Fv(){return 11709}function Lv(){return 1188}function Bv(){return zv()|0}function jv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Uv(r,896)|0)==512){if(n|0){Wv(n);KM(n)}}else if(t|0){Ji(t);KM(t)}return}function Uv(e,t){e=e|0;t=t|0;return t&e|0}function Wv(e){e=e|0;e=u[e+4>>2]|0;if(e|0)GM(e);return}function zv(){var e=0;if(!(r[7824]|0)){u[2511]=qv()|0;u[2512]=0;e=7824;u[e>>2]=1;u[e+4>>2]=0}return 10044}function qv(){return 0}function Hv(e){e=e|0;xl(e);return}function Gv(e){e=e|0;var t=0,n=0,r=0,i=0,o=0;t=h;h=h+32|0;n=t+24|0;o=t+16|0;i=t+8|0;r=t;Vv(e,4827);Yv(e,4834,3)|0;$v(e,3682,47)|0;u[o>>2]=9;u[o+4>>2]=0;u[n>>2]=u[o>>2];u[n+4>>2]=u[o+4>>2];Kv(e,4841,n)|0;u[i>>2]=1;u[i+4>>2]=0;u[n>>2]=u[i>>2];u[n+4>>2]=u[i+4>>2];Xv(e,4871,n)|0;u[r>>2]=10;u[r+4>>2]=0;u[n>>2]=u[r>>2];u[n+4>>2]=u[r+4>>2];Jv(e,4891,n)|0;h=t;return}function Vv(e,t){e=e|0;t=t|0;var n=0;n=Hg()|0;u[e>>2]=n;Gg(n,t);cD(u[e>>2]|0);return}function Yv(e,t,n){e=e|0;t=t|0;n=n|0;Cg(e,Pa(t)|0,n,0);return e|0}function $v(e,t,n){e=e|0;t=t|0;n=n|0;ag(e,Pa(t)|0,n,0);return e|0}function Kv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];jb(e,t,i);h=r;return e|0}function Xv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];bb(e,t,i);h=r;return e|0}function Jv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=u[n+4>>2]|0;u[o>>2]=u[n>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Qv(e,t,i);h=r;return e|0}function Qv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Zv(e,n,i,1);h=r;return}function Zv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=eb()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=tb(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,nb(o,r)|0,r);h=i;return}function eb(){var e=0,t=0;if(!(r[7840]|0)){sb(10100);Fe(48,10100,b|0)|0;t=7840;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10100)|0)){e=10100;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));sb(10100)}return 10100}function tb(e){e=e|0;return 0}function nb(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=eb()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];rb(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{ib(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function rb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function ib(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=ub(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;ob(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];rb(o,r,n);u[s>>2]=(u[s>>2]|0)+12;ab(e,l);lb(l);h=c;return}}function ub(e){e=e|0;return 357913941}function ob(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function ab(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function lb(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function sb(e){e=e|0;db(e);return}function cb(e){e=e|0;fb(e+24|0);return}function fb(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function db(e){e=e|0;var t=0;t=Za()|0;nl(e,2,6,t,pb()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function pb(){return 1364}function hb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=mb(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];n=vb(t,i,n)|0;h=r;return n|0}function mb(e){e=e|0;return(u[(eb()|0)+24>>2]|0)+(e*12|0)|0}function vb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;o=h;h=h+16|0;i=o;r=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=u[(u[e>>2]|0)+r>>2]|0;Jl(i,n);i=Ql(i,n)|0;i=_s(Ex[r&15](e,i)|0)|0;h=o;return i|0}function bb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];gb(e,n,i,0);h=r;return}function gb(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=yb()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=_b(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,Db(o,r)|0,r);h=i;return}function yb(){var e=0,t=0;if(!(r[7848]|0)){Sb(10136);Fe(49,10136,b|0)|0;t=7848;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10136)|0)){e=10136;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Sb(10136)}return 10136}function _b(e){e=e|0;return 0}function Db(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=yb()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];wb(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Eb(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function wb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Eb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Tb(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Cb(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];wb(o,r,n);u[s>>2]=(u[s>>2]|0)+12;kb(e,l);Mb(l);h=c;return}}function Tb(e){e=e|0;return 357913941}function Cb(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function kb(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Mb(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Sb(e){e=e|0;Ab(e);return}function xb(e){e=e|0;Ob(e+24|0);return}function Ob(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Ab(e){e=e|0;var t=0;t=Za()|0;nl(e,2,9,t,Pb()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Pb(){return 1372}function Rb(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;i=r+8|0;o=r;a=Ib(e)|0;e=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=e;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Nb(t,i,n);h=r;return}function Ib(e){e=e|0;return(u[(yb()|0)+24>>2]|0)+(e*12|0)|0}function Nb(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,o=0,a=ft;o=h;h=h+16|0;i=o;r=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=u[(u[e>>2]|0)+r>>2]|0;Fb(i,n);a=$(Lb(i,n));fx[r&1](e,a);h=o;return}function Fb(e,t){e=e|0;t=+t;return}function Lb(e,t){e=e|0;t=+t;return $(Bb(t))}function Bb(e){e=+e;return $(e)}function jb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;o=r;l=u[n>>2]|0;a=u[n+4>>2]|0;n=Pa(t)|0;u[o>>2]=l;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ub(e,n,i,0);h=r;return}function Ub(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;o=i+16|0;f=i+8|0;l=i;c=u[n>>2]|0;s=u[n+4>>2]|0;a=u[e>>2]|0;e=Wb()|0;u[f>>2]=c;u[f+4>>2]=s;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];n=zb(o)|0;u[l>>2]=c;u[l+4>>2]=s;u[o>>2]=u[l>>2];u[o+4>>2]=u[l+4>>2];La(a,t,e,n,qb(o,r)|0,r);h=i;return}function Wb(){var e=0,t=0;if(!(r[7856]|0)){Xb(10172);Fe(50,10172,b|0)|0;t=7856;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10172)|0)){e=10172;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Xb(10172)}return 10172}function zb(e){e=e|0;return 0}function qb(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;o=u[e>>2]|0;r=u[e+4>>2]|0;u[l>>2]=o;u[l+4>>2]=r;d=Wb()|0;c=d+24|0;e=Wa(t,4)|0;u[s>>2]=e;t=d+28|0;n=u[t>>2]|0;if(n>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=r;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Hb(n,i,e);e=(u[t>>2]|0)+12|0;u[t>>2]=e}else{Gb(c,l,s);e=u[t>>2]|0}h=f;return((e-(u[c>>2]|0)|0)/12|0)+-1|0}function Hb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=u[t+4>>2]|0;u[e>>2]=u[t>>2];u[e+4>>2]=r;u[e+8>>2]=n;return}function Gb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((u[s>>2]|0)-(u[e>>2]|0)|0)/12|0)+1|0;o=Vb(e)|0;if(o>>>0>>0)UM(e);else{f=u[e>>2]|0;p=((u[e+8>>2]|0)-f|0)/12|0;d=p<<1;Yb(l,p>>>0>>1>>>0?d>>>0>>0?i:d:o,((u[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;o=u[s>>2]|0;i=u[t+4>>2]|0;n=u[n>>2]|0;u[a>>2]=u[t>>2];u[a+4>>2]=i;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Hb(o,r,n);u[s>>2]=(u[s>>2]|0)+12;$b(e,l);Kb(l);h=c;return}}function Vb(e){e=e|0;return 357913941}function Yb(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>357913941)$e();else{i=YM(t*12|0)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n*12|0)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t*12|0);return}function $b(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Kb(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=u[e>>2]|0;if(e|0)KM(e);return}function Xb(e){e=e|0;Zb(e);return}function Jb(e){e=e|0;Qb(e+24|0);return}function Qb(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KM(n)}return}function Zb(e){e=e|0;var t=0;t=Za()|0;nl(e,2,3,t,eg()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function eg(){return 1380}function tg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0;i=h;h=h+16|0;o=i+8|0;a=i;l=ng(e)|0;e=u[l+4>>2]|0;u[a>>2]=u[l>>2];u[a+4>>2]=e;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];rg(t,o,n,r);h=i;return}function ng(e){e=e|0;return(u[(Wb()|0)+24>>2]|0)+(e*12|0)|0}function rg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0;l=h;h=h+16|0;o=l+1|0;a=l;i=u[t>>2]|0;t=u[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)i=u[(u[e>>2]|0)+i>>2]|0;Jl(o,n);o=Ql(o,n)|0;ig(a,r);a=ug(a,r)|0;Ax[i&15](e,o,a);h=l;return}function ig(e,t){e=e|0;t=t|0;return}function ug(e,t){e=e|0;t=t|0;return og(t)|0}function og(e){e=e|0;return(e|0)!=0|0}function ag(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=u[e>>2]|0;i=lg()|0;e=sg(n)|0;La(o,t,i,e,cg(n,r)|0,r);return}function lg(){var e=0,t=0;if(!(r[7864]|0)){bg(10208);Fe(51,10208,b|0)|0;t=7864;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10208)|0)){e=10208;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));bg(10208)}return 10208}function sg(e){e=e|0;return e|0}function cg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=lg()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){fg(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{dg(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function fg(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function dg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=pg(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;hg(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;fg(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;mg(e,i);vg(i);h=l;return}}function pg(e){e=e|0;return 536870911}function hg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function mg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function vg(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function bg(e){e=e|0;_g(e);return}function gg(e){e=e|0;yg(e+24|0);return}function yg(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function _g(e){e=e|0;var t=0;t=Za()|0;nl(e,1,24,t,Dg()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function Dg(){return 1392}function wg(e,t){e=e|0;t=t|0;Tg(u[(Eg(e)|0)>>2]|0,t);return}function Eg(e){e=e|0;return(u[(lg()|0)+24>>2]|0)+(e<<3)|0}function Tg(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;hv(r,t);t=mv(r,t)|0;hx[e&127](t);h=n;return}function Cg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=u[e>>2]|0;i=kg()|0;e=Mg(n)|0;La(o,t,i,e,Sg(n,r)|0,r);return}function kg(){var e=0,t=0;if(!(r[7872]|0)){Ng(10244);Fe(52,10244,b|0)|0;t=7872;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10244)|0)){e=10244;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Ng(10244)}return 10244}function Mg(e){e=e|0;return e|0}function Sg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=kg()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){xg(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{Og(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function xg(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function Og(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=Ag(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;Pg(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;xg(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Rg(e,i);Ig(i);h=l;return}}function Ag(e){e=e|0;return 536870911}function Pg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function Rg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function Ig(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function Ng(e){e=e|0;Bg(e);return}function Fg(e){e=e|0;Lg(e+24|0);return}function Lg(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function Bg(e){e=e|0;var t=0;t=Za()|0;nl(e,1,16,t,jg()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function jg(){return 1400}function Ug(e){e=e|0;return zg(u[(Wg(e)|0)>>2]|0)|0}function Wg(e){e=e|0;return(u[(kg()|0)+24>>2]|0)+(e<<3)|0}function zg(e){e=e|0;return qg(Mx[e&7]()|0)|0}function qg(e){e=e|0;return e|0}function Hg(){var e=0;if(!(r[7880]|0)){Jg(10280);Fe(25,10280,b|0)|0;e=7880;u[e>>2]=1;u[e+4>>2]=0}return 10280}function Gg(e,t){e=e|0;t=t|0;u[e>>2]=Vg()|0;u[e+4>>2]=Yg()|0;u[e+12>>2]=t;u[e+8>>2]=$g()|0;u[e+32>>2]=4;return}function Vg(){return 11711}function Yg(){return 1356}function $g(){return zv()|0}function Kg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Uv(r,896)|0)==512){if(n|0){Xg(n);KM(n)}}else if(t|0){qi(t);KM(t)}return}function Xg(e){e=e|0;e=u[e+4>>2]|0;if(e|0)GM(e);return}function Jg(e){e=e|0;xl(e);return}function Qg(e){e=e|0;Zg(e,4920);ey(e)|0;ty(e)|0;return}function Zg(e,t){e=e|0;t=t|0;var n=0;n=Gd()|0;u[e>>2]=n;My(n,t);cD(u[e>>2]|0);return}function ey(e){e=e|0;var t=0;t=u[e>>2]|0;ry(t,my()|0);return e|0}function ty(e){e=e|0;var t=0;t=u[e>>2]|0;ry(t,ny()|0);return e|0}function ny(){var e=0;if(!(r[7888]|0)){iy(10328);Fe(53,10328,b|0)|0;e=7888;u[e>>2]=1;u[e+4>>2]=0}if(!(Xa(10328)|0))iy(10328);return 10328}function ry(e,t){e=e|0;t=t|0;La(e,0,t,0,0,0);return}function iy(e){e=e|0;ay(e);sy(e,10);return}function uy(e){e=e|0;oy(e+24|0);return}function oy(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function ay(e){e=e|0;var t=0;t=Za()|0;nl(e,5,1,t,dy()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function ly(e,t,n){e=e|0;t=t|0;n=+n;cy(e,t,n);return}function sy(e,t){e=e|0;t=t|0;u[e+20>>2]=t;return}function cy(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+16|0;o=r+8|0;l=r+13|0;i=r;a=r+12|0;Jl(l,t);u[o>>2]=Ql(l,t)|0;Kl(a,n);c[i>>3]=+Xl(a,n);fy(e,o,i);h=r;return}function fy(e,t,n){e=e|0;t=t|0;n=n|0;qu(e+8|0,u[t>>2]|0,+c[n>>3]);r[e+24>>0]=1;return}function dy(){return 1404}function py(e,t){e=e|0;t=+t;return hy(e,t)|0}function hy(e,t){e=e|0;t=+t;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;r=h;h=h+16|0;o=r+4|0;a=r+8|0;l=r;i=UE(8)|0;n=i;s=YM(16)|0;Jl(o,e);e=Ql(o,e)|0;Kl(a,t);qu(s,e,+Xl(a,t));a=n+4|0;u[a>>2]=s;e=YM(8)|0;a=u[a>>2]|0;u[l>>2]=0;u[o>>2]=u[l>>2];$d(e,a,o);u[i>>2]=e;h=r;return n|0}function my(){var e=0;if(!(r[7896]|0)){vy(10364);Fe(54,10364,b|0)|0;e=7896;u[e>>2]=1;u[e+4>>2]=0}if(!(Xa(10364)|0))vy(10364);return 10364}function vy(e){e=e|0;yy(e);sy(e,55);return}function by(e){e=e|0;gy(e+24|0);return}function gy(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function yy(e){e=e|0;var t=0;t=Za()|0;nl(e,5,4,t,Ty()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function _y(e){e=e|0;Dy(e);return}function Dy(e){e=e|0;wy(e);return}function wy(e){e=e|0;Ey(e+8|0);r[e+24>>0]=1;return}function Ey(e){e=e|0;u[e>>2]=0;c[e+8>>3]=0.0;return}function Ty(){return 1424}function Cy(){return ky()|0}function ky(){var e=0,t=0,n=0,r=0,i=0,o=0,a=0;t=h;h=h+16|0;i=t+4|0;a=t;n=UE(8)|0;e=n;r=YM(16)|0;Ey(r);o=e+4|0;u[o>>2]=r;r=YM(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];$d(r,o,i);u[n>>2]=r;h=t;return e|0}function My(e,t){e=e|0;t=t|0;u[e>>2]=Sy()|0;u[e+4>>2]=xy()|0;u[e+12>>2]=t;u[e+8>>2]=Oy()|0;u[e+32>>2]=5;return}function Sy(){return 11710}function xy(){return 1416}function Oy(){return Ry()|0}function Ay(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Uv(r,896)|0)==512){if(n|0){Py(n);KM(n)}}else if(t|0)KM(t);return}function Py(e){e=e|0;e=u[e+4>>2]|0;if(e|0)GM(e);return}function Ry(){var e=0;if(!(r[7904]|0)){u[2600]=Iy()|0;u[2601]=0;e=7904;u[e>>2]=1;u[e+4>>2]=0}return 10400}function Iy(){return u[357]|0}function Ny(e){e=e|0;Fy(e,4926);Ly(e)|0;return}function Fy(e,t){e=e|0;t=t|0;var n=0;n=ol()|0;u[e>>2]=n;Ky(n,t);cD(u[e>>2]|0);return}function Ly(e){e=e|0;var t=0;t=u[e>>2]|0;ry(t,By()|0);return e|0}function By(){var e=0;if(!(r[7912]|0)){jy(10412);Fe(56,10412,b|0)|0;e=7912;u[e>>2]=1;u[e+4>>2]=0}if(!(Xa(10412)|0))jy(10412);return 10412}function jy(e){e=e|0;zy(e);sy(e,57);return}function Uy(e){e=e|0;Wy(e+24|0);return}function Wy(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function zy(e){e=e|0;var t=0;t=Za()|0;nl(e,5,5,t,Vy()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function qy(e){e=e|0;Hy(e);return}function Hy(e){e=e|0;Gy(e);return}function Gy(e){e=e|0;var t=0,n=0;t=e+8|0;n=t+48|0;do{u[t>>2]=0;t=t+4|0}while((t|0)<(n|0));r[e+56>>0]=1;return}function Vy(){return 1432}function Yy(){return $y()|0}function $y(){var e=0,t=0,n=0,r=0,i=0,o=0,a=0,l=0;a=h;h=h+16|0;e=a+4|0;t=a;n=UE(8)|0;r=n;i=YM(48)|0;o=i;l=o+48|0;do{u[o>>2]=0;o=o+4|0}while((o|0)<(l|0));o=r+4|0;u[o>>2]=i;l=YM(8)|0;o=u[o>>2]|0;u[t>>2]=0;u[e>>2]=u[t>>2];pl(l,o,e);u[n>>2]=l;h=a;return r|0}function Ky(e,t){e=e|0;t=t|0;u[e>>2]=Xy()|0;u[e+4>>2]=Jy()|0;u[e+12>>2]=t;u[e+8>>2]=Qy()|0;u[e+32>>2]=6;return}function Xy(){return 11704}function Jy(){return 1436}function Qy(){return Ry()|0}function Zy(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Uv(r,896)|0)==512){if(n|0){e_(n);KM(n)}}else if(t|0)KM(t);return}function e_(e){e=e|0;e=u[e+4>>2]|0;if(e|0)GM(e);return}function t_(e){e=e|0;n_(e,4933);r_(e)|0;i_(e)|0;return}function n_(e,t){e=e|0;t=t|0;var n=0;n=R_()|0;u[e>>2]=n;I_(n,t);cD(u[e>>2]|0);return}function r_(e){e=e|0;var t=0;t=u[e>>2]|0;ry(t,D_()|0);return e|0}function i_(e){e=e|0;var t=0;t=u[e>>2]|0;ry(t,u_()|0);return e|0}function u_(){var e=0;if(!(r[7920]|0)){o_(10452);Fe(58,10452,b|0)|0;e=7920;u[e>>2]=1;u[e+4>>2]=0}if(!(Xa(10452)|0))o_(10452);return 10452}function o_(e){e=e|0;s_(e);sy(e,1);return}function a_(e){e=e|0;l_(e+24|0);return}function l_(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function s_(e){e=e|0;var t=0;t=Za()|0;nl(e,5,1,t,h_()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function c_(e,t,n){e=e|0;t=+t;n=+n;f_(e,t,n);return}function f_(e,t,n){e=e|0;t=+t;n=+n;var r=0,i=0,u=0,o=0,a=0;r=h;h=h+32|0;u=r+8|0;a=r+17|0;i=r;o=r+16|0;Kl(a,t);c[u>>3]=+Xl(a,t);Kl(o,n);c[i>>3]=+Xl(o,n);d_(e,u,i);h=r;return}function d_(e,t,n){e=e|0;t=t|0;n=n|0;p_(e+8|0,+c[t>>3],+c[n>>3]);r[e+24>>0]=1;return}function p_(e,t,n){e=e|0;t=+t;n=+n;c[e>>3]=t;c[e+8>>3]=n;return}function h_(){return 1472}function m_(e,t){e=+e;t=+t;return v_(e,t)|0}function v_(e,t){e=+e;t=+t;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;r=h;h=h+16|0;a=r+4|0;l=r+8|0;s=r;i=UE(8)|0;n=i;o=YM(16)|0;Kl(a,e);e=+Xl(a,e);Kl(l,t);p_(o,e,+Xl(l,t));l=n+4|0;u[l>>2]=o;o=YM(8)|0;l=u[l>>2]|0;u[s>>2]=0;u[a>>2]=u[s>>2];b_(o,l,a);u[i>>2]=o;h=r;return n|0}function b_(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;n=YM(16)|0;u[n+4>>2]=0;u[n+8>>2]=0;u[n>>2]=1452;u[n+12>>2]=t;u[e+4>>2]=n;return}function g_(e){e=e|0;WM(e);KM(e);return}function y_(e){e=e|0;e=u[e+12>>2]|0;if(e|0)KM(e);return}function __(e){e=e|0;KM(e);return}function D_(){var e=0;if(!(r[7928]|0)){w_(10488);Fe(59,10488,b|0)|0;e=7928;u[e>>2]=1;u[e+4>>2]=0}if(!(Xa(10488)|0))w_(10488);return 10488}function w_(e){e=e|0;C_(e);sy(e,60);return}function E_(e){e=e|0;T_(e+24|0);return}function T_(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function C_(e){e=e|0;var t=0;t=Za()|0;nl(e,5,6,t,O_()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function k_(e){e=e|0;M_(e);return}function M_(e){e=e|0;S_(e);return}function S_(e){e=e|0;x_(e+8|0);r[e+24>>0]=1;return}function x_(e){e=e|0;u[e>>2]=0;u[e+4>>2]=0;u[e+8>>2]=0;u[e+12>>2]=0;return}function O_(){return 1492}function A_(){return P_()|0}function P_(){var e=0,t=0,n=0,r=0,i=0,o=0,a=0;t=h;h=h+16|0;i=t+4|0;a=t;n=UE(8)|0;e=n;r=YM(16)|0;x_(r);o=e+4|0;u[o>>2]=r;r=YM(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];b_(r,o,i);u[n>>2]=r;h=t;return e|0}function R_(){var e=0;if(!(r[7936]|0)){U_(10524);Fe(25,10524,b|0)|0;e=7936;u[e>>2]=1;u[e+4>>2]=0}return 10524}function I_(e,t){e=e|0;t=t|0;u[e>>2]=N_()|0;u[e+4>>2]=F_()|0;u[e+12>>2]=t;u[e+8>>2]=L_()|0;u[e+32>>2]=7;return}function N_(){return 11700}function F_(){return 1484}function L_(){return Ry()|0}function B_(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Uv(r,896)|0)==512){if(n|0){j_(n);KM(n)}}else if(t|0)KM(t);return}function j_(e){e=e|0;e=u[e+4>>2]|0;if(e|0)GM(e);return}function U_(e){e=e|0;xl(e);return}function W_(e,t,n){e=e|0;t=t|0;n=n|0;e=Pa(t)|0;t=z_(n)|0;n=q_(n,0)|0;SD(e,t,n,H_()|0,0);return}function z_(e){e=e|0;return e|0}function q_(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=H_()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){Q_(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{Z_(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function H_(){var e=0,t=0;if(!(r[7944]|0)){G_(10568);Fe(61,10568,b|0)|0;t=7944;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10568)|0)){e=10568;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));G_(10568)}return 10568}function G_(e){e=e|0;$_(e);return}function V_(e){e=e|0;Y_(e+24|0);return}function Y_(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function $_(e){e=e|0;var t=0;t=Za()|0;nl(e,1,17,t,$c()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function K_(e){e=e|0;return J_(u[(X_(e)|0)>>2]|0)|0}function X_(e){e=e|0;return(u[(H_()|0)+24>>2]|0)+(e<<3)|0}function J_(e){e=e|0;return Qc(Mx[e&7]()|0)|0}function Q_(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function Z_(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=eD(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;tD(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;Q_(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;nD(e,i);rD(i);h=l;return}}function eD(e){e=e|0;return 536870911}function tD(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function nD(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function rD(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function iD(){uD();return}function uD(){oD(10604);return}function oD(e){e=e|0;aD(e,4955);return}function aD(e,t){e=e|0;t=t|0;var n=0;n=lD()|0;u[e>>2]=n;sD(n,t);cD(u[e>>2]|0);return}function lD(){var e=0;if(!(r[7952]|0)){_D(10612);Fe(25,10612,b|0)|0;e=7952;u[e>>2]=1;u[e+4>>2]=0}return 10612}function sD(e,t){e=e|0;t=t|0;u[e>>2]=mD()|0;u[e+4>>2]=vD()|0;u[e+12>>2]=t;u[e+8>>2]=bD()|0;u[e+32>>2]=8;return}function cD(e){e=e|0;var t=0,n=0;t=h;h=h+16|0;n=t;fD()|0;u[n>>2]=e;dD(10608,n);h=t;return}function fD(){if(!(r[11714]|0)){u[2652]=0;Fe(62,10608,b|0)|0;r[11714]=1}return 10608}function dD(e,t){e=e|0;t=t|0;var n=0;n=YM(8)|0;u[n+4>>2]=u[t>>2];u[n>>2]=u[e>>2];u[e>>2]=n;return}function pD(e){e=e|0;hD(e);return}function hD(e){e=e|0;var t=0,n=0;t=u[e>>2]|0;if(t|0)do{n=t;t=u[t>>2]|0;KM(n)}while((t|0)!=0);u[e>>2]=0;return}function mD(){return 11715}function vD(){return 1496}function bD(){return zv()|0}function gD(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Uv(r,896)|0)==512){if(n|0){yD(n);KM(n)}}else if(t|0)KM(t);return}function yD(e){e=e|0;e=u[e+4>>2]|0;if(e|0)GM(e);return}function _D(e){e=e|0;xl(e);return}function DD(e,t){e=e|0;t=t|0;var n=0,r=0;fD()|0;n=u[2652]|0;e:do{if(n|0){while(1){r=u[n+4>>2]|0;if(r|0?(rM(wD(r)|0,e)|0)==0:0)break;n=u[n>>2]|0;if(!n)break e}ED(r,t)}}while(0);return}function wD(e){e=e|0;return u[e+12>>2]|0}function ED(e,t){e=e|0;t=t|0;var n=0;e=e+36|0;n=u[e>>2]|0;if(n|0){Qi(n);KM(n)}n=YM(4)|0;go(n,t);u[e>>2]=n;return}function TD(){if(!(r[11716]|0)){u[2664]=0;Fe(63,10656,b|0)|0;r[11716]=1}return 10656}function CD(){var e=0;if(!(r[11717]|0)){kD();u[2665]=1504;r[11717]=1;e=1504}else e=u[2665]|0;return e|0}function kD(){if(!(r[11740]|0)){r[11718]=Wa(Wa(8,0)|0,0)|0;r[11719]=Wa(Wa(0,0)|0,0)|0;r[11720]=Wa(Wa(0,16)|0,0)|0;r[11721]=Wa(Wa(8,0)|0,0)|0;r[11722]=Wa(Wa(0,0)|0,0)|0;r[11723]=Wa(Wa(8,0)|0,0)|0;r[11724]=Wa(Wa(0,0)|0,0)|0;r[11725]=Wa(Wa(8,0)|0,0)|0;r[11726]=Wa(Wa(0,0)|0,0)|0;r[11727]=Wa(Wa(8,0)|0,0)|0;r[11728]=Wa(Wa(0,0)|0,0)|0;r[11729]=Wa(Wa(0,0)|0,32)|0;r[11730]=Wa(Wa(0,0)|0,32)|0;r[11740]=1}return}function MD(){return 1572}function SD(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var o=0,a=0,l=0,s=0,c=0,f=0;o=h;h=h+32|0;f=o+16|0;c=o+12|0;s=o+8|0;l=o+4|0;a=o;u[f>>2]=e;u[c>>2]=t;u[s>>2]=n;u[l>>2]=r;u[a>>2]=i;TD()|0;xD(10656,f,c,s,l,a);h=o;return}function xD(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;var a=0;a=YM(24)|0;Ua(a+4|0,u[t>>2]|0,u[n>>2]|0,u[r>>2]|0,u[i>>2]|0,u[o>>2]|0);u[a>>2]=u[e>>2];u[e>>2]=a;return}function OD(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0;_=h;h=h+32|0;v=_+20|0;b=_+8|0;g=_+4|0;y=_;t=u[t>>2]|0;if(t|0){m=v+4|0;s=v+8|0;c=b+4|0;f=b+8|0;d=b+8|0;p=v+8|0;do{a=t+4|0;l=AD(a)|0;if(l|0){i=PD(l)|0;u[v>>2]=0;u[m>>2]=0;u[s>>2]=0;r=(RD(l)|0)+1|0;ID(v,r);if(r|0)while(1){r=r+-1|0;bk(b,u[i>>2]|0);o=u[m>>2]|0;if(o>>>0<(u[p>>2]|0)>>>0){u[o>>2]=u[b>>2];u[m>>2]=(u[m>>2]|0)+4}else ND(v,b);if(!r)break;else i=i+4|0}r=FD(l)|0;u[b>>2]=0;u[c>>2]=0;u[f>>2]=0;e:do{if(u[r>>2]|0){i=0;o=0;while(1){if((i|0)==(o|0))LD(b,r);else{u[i>>2]=u[r>>2];u[c>>2]=(u[c>>2]|0)+4}r=r+4|0;if(!(u[r>>2]|0))break e;i=u[c>>2]|0;o=u[d>>2]|0}}}while(0);u[g>>2]=BD(a)|0;u[y>>2]=Xa(l)|0;jD(n,e,g,y,v,b);UD(b);WD(v)}t=u[t>>2]|0}while((t|0)!=0)}h=_;return}function AD(e){e=e|0;return u[e+12>>2]|0}function PD(e){e=e|0;return u[e+12>>2]|0}function RD(e){e=e|0;return u[e+16>>2]|0}function ID(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+32|0;n=i;r=u[e>>2]|0;if((u[e+8>>2]|0)-r>>2>>>0>>0){_w(n,t,(u[e+4>>2]|0)-r>>2,e+8|0);Dw(e,n);ww(n)}h=i;return}function ND(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0;a=h;h=h+32|0;n=a;r=e+4|0;i=((u[r>>2]|0)-(u[e>>2]|0)>>2)+1|0;o=vw(e)|0;if(o>>>0>>0)UM(e);else{l=u[e>>2]|0;c=(u[e+8>>2]|0)-l|0;s=c>>1;_w(n,c>>2>>>0>>1>>>0?s>>>0>>0?i:s:o,(u[r>>2]|0)-l>>2,e+8|0);o=n+8|0;u[u[o>>2]>>2]=u[t>>2];u[o>>2]=(u[o>>2]|0)+4;Dw(e,n);ww(n);h=a;return}}function FD(e){e=e|0;return u[e+8>>2]|0}function LD(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0;a=h;h=h+32|0;n=a;r=e+4|0;i=((u[r>>2]|0)-(u[e>>2]|0)>>2)+1|0;o=pw(e)|0;if(o>>>0>>0)UM(e);else{l=u[e>>2]|0;c=(u[e+8>>2]|0)-l|0;s=c>>1;bw(n,c>>2>>>0>>1>>>0?s>>>0>>0?i:s:o,(u[r>>2]|0)-l>>2,e+8|0);o=n+8|0;u[u[o>>2]>>2]=u[t>>2];u[o>>2]=(u[o>>2]|0)+4;gw(e,n);yw(n);h=a;return}}function BD(e){e=e|0;return u[e>>2]|0}function jD(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;zD(e,t,n,r,i,u);return}function UD(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-4-r|0)>>>2)<<2);KM(n)}return}function WD(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-4-r|0)>>>2)<<2);KM(n)}return}function zD(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;var a=0,l=0,s=0,c=0,f=0,d=0;a=h;h=h+48|0;f=a+40|0;l=a+32|0;d=a+24|0;s=a+12|0;c=a;Ek(l);e=wo(e)|0;u[d>>2]=u[t>>2];n=u[n>>2]|0;r=u[r>>2]|0;qD(s,i);HD(c,o);u[f>>2]=u[d>>2];GD(e,f,n,r,s,c);UD(c);WD(s);Ck(l);h=a;return}function qD(e,t){e=e|0;t=t|0;var n=0,r=0;u[e>>2]=0;u[e+4>>2]=0;u[e+8>>2]=0;n=t+4|0;r=(u[n>>2]|0)-(u[t>>2]|0)>>2;if(r|0){hw(e,r);mw(e,u[t>>2]|0,u[n>>2]|0,r)}return}function HD(e,t){e=e|0;t=t|0;var n=0,r=0;u[e>>2]=0;u[e+4>>2]=0;u[e+8>>2]=0;n=t+4|0;r=(u[n>>2]|0)-(u[t>>2]|0)>>2;if(r|0){fw(e,r);dw(e,u[t>>2]|0,u[n>>2]|0,r)}return}function GD(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;var a=0,l=0,s=0,c=0,f=0,d=0;a=h;h=h+32|0;f=a+28|0;d=a+24|0;l=a+12|0;s=a;c=Co(VD()|0)|0;u[d>>2]=u[t>>2];u[f>>2]=u[d>>2];t=YD(f)|0;n=$D(n)|0;r=KD(r)|0;u[l>>2]=u[i>>2];f=i+4|0;u[l+4>>2]=u[f>>2];d=i+8|0;u[l+8>>2]=u[d>>2];u[d>>2]=0;u[f>>2]=0;u[i>>2]=0;i=XD(l)|0;u[s>>2]=u[o>>2];f=o+4|0;u[s+4>>2]=u[f>>2];d=o+8|0;u[s+8>>2]=u[d>>2];u[d>>2]=0;u[f>>2]=0;u[o>>2]=0;Oe(0,c|0,e|0,t|0,n|0,r|0,i|0,JD(s)|0)|0;UD(s);WD(l);h=a;return}function VD(){var e=0;if(!(r[7968]|0)){sw(10708);e=7968;u[e>>2]=1;u[e+4>>2]=0}return 10708}function YD(e){e=e|0;return tw(e)|0}function $D(e){e=e|0;return ZD(e)|0}function KD(e){e=e|0;return Qc(e)|0}function XD(e){e=e|0;return ew(e)|0}function JD(e){e=e|0;return QD(e)|0}function QD(e){e=e|0;var t=0,n=0,r=0;r=(u[e+4>>2]|0)-(u[e>>2]|0)|0;n=r>>2;r=UE(r+4|0)|0;u[r>>2]=n;if(n|0){t=0;do{u[r+4+(t<<2)>>2]=ZD(u[(u[e>>2]|0)+(t<<2)>>2]|0)|0;t=t+1|0}while((t|0)!=(n|0))}return r|0}function ZD(e){e=e|0;return e|0}function ew(e){e=e|0;var t=0,n=0,r=0;r=(u[e+4>>2]|0)-(u[e>>2]|0)|0;n=r>>2;r=UE(r+4|0)|0;u[r>>2]=n;if(n|0){t=0;do{u[r+4+(t<<2)>>2]=tw((u[e>>2]|0)+(t<<2)|0)|0;t=t+1|0}while((t|0)!=(n|0))}return r|0}function tw(e){e=e|0;var t=0,n=0,r=0,i=0;i=h;h=h+32|0;t=i+12|0;n=i;r=al(nw()|0)|0;if(!r)e=rw(e)|0;else{ll(t,r);sl(n,t);_k(e,n);e=fl(t)|0}h=i;return e|0}function nw(){var e=0;if(!(r[7960]|0)){lw(10664);Fe(25,10664,b|0)|0;e=7960;u[e>>2]=1;u[e+4>>2]=0}return 10664}function rw(e){e=e|0;var t=0,n=0,r=0,i=0,o=0,a=0,l=0;n=h;h=h+16|0;i=n+4|0;a=n;r=UE(8)|0;t=r;l=YM(4)|0;u[l>>2]=u[e>>2];o=t+4|0;u[o>>2]=l;e=YM(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];iw(e,o,i);u[r>>2]=e;h=n;return t|0}function iw(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;n=YM(16)|0;u[n+4>>2]=0;u[n+8>>2]=0;u[n>>2]=1656;u[n+12>>2]=t;u[e+4>>2]=n;return}function uw(e){e=e|0;WM(e);KM(e);return}function ow(e){e=e|0;e=u[e+12>>2]|0;if(e|0)KM(e);return}function aw(e){e=e|0;KM(e);return}function lw(e){e=e|0;xl(e);return}function sw(e){e=e|0;Lo(e,cw()|0,5);return}function cw(){return 1676}function fw(e,t){e=e|0;t=t|0;var n=0;if((pw(e)|0)>>>0>>0)UM(e);if(t>>>0>1073741823)$e();else{n=YM(t<<2)|0;u[e+4>>2]=n;u[e>>2]=n;u[e+8>>2]=n+(t<<2);return}}function dw(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=e+4|0;e=n-t|0;if((e|0)>0){iS(u[r>>2]|0,t|0,e|0)|0;u[r>>2]=(u[r>>2]|0)+(e>>>2<<2)}return}function pw(e){e=e|0;return 1073741823}function hw(e,t){e=e|0;t=t|0;var n=0;if((vw(e)|0)>>>0>>0)UM(e);if(t>>>0>1073741823)$e();else{n=YM(t<<2)|0;u[e+4>>2]=n;u[e>>2]=n;u[e+8>>2]=n+(t<<2);return}}function mw(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=e+4|0;e=n-t|0;if((e|0)>0){iS(u[r>>2]|0,t|0,e|0)|0;u[r>>2]=(u[r>>2]|0)+(e>>>2<<2)}return}function vw(e){e=e|0;return 1073741823}function bw(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>1073741823)$e();else{i=YM(t<<2)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<2)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<2);return}function gw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function yw(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-4-t|0)>>>2)<<2);e=u[e>>2]|0;if(e|0)KM(e);return}function _w(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>1073741823)$e();else{i=YM(t<<2)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<2)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<2);return}function Dw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function ww(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-4-t|0)>>>2)<<2);e=u[e>>2]|0;if(e|0)KM(e);return}function Ew(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,m=0,v=0,b=0;b=h;h=h+32|0;f=b+20|0;d=b+12|0;c=b+16|0;p=b+4|0;m=b;v=b+8|0;l=CD()|0;o=u[l>>2]|0;a=u[o>>2]|0;if(a|0){s=u[l+8>>2]|0;l=u[l+4>>2]|0;while(1){bk(f,a);Tw(e,f,l,s);o=o+4|0;a=u[o>>2]|0;if(!a)break;else{s=s+1|0;l=l+1|0}}}o=MD()|0;a=u[o>>2]|0;if(a|0)do{bk(f,a);u[d>>2]=u[o+4>>2];Cw(t,f,d);o=o+8|0;a=u[o>>2]|0}while((a|0)!=0);o=u[(fD()|0)>>2]|0;if(o|0)do{t=u[o+4>>2]|0;bk(f,u[(kw(t)|0)>>2]|0);u[d>>2]=wD(t)|0;Mw(n,f,d);o=u[o>>2]|0}while((o|0)!=0);bk(c,0);o=TD()|0;u[f>>2]=u[c>>2];OD(f,o,i);o=u[(fD()|0)>>2]|0;if(o|0){e=f+4|0;t=f+8|0;n=f+8|0;do{s=u[o+4>>2]|0;bk(d,u[(kw(s)|0)>>2]|0);xw(p,Sw(s)|0);a=u[p>>2]|0;if(a|0){u[f>>2]=0;u[e>>2]=0;u[t>>2]=0;do{bk(m,u[(kw(u[a+4>>2]|0)|0)>>2]|0);l=u[e>>2]|0;if(l>>>0<(u[n>>2]|0)>>>0){u[l>>2]=u[m>>2];u[e>>2]=(u[e>>2]|0)+4}else ND(f,m);a=u[a>>2]|0}while((a|0)!=0);Ow(r,d,f);WD(f)}u[v>>2]=u[d>>2];c=Aw(s)|0;u[f>>2]=u[v>>2];OD(f,c,i);kl(p);o=u[o>>2]|0}while((o|0)!=0)}h=b;return}function Tw(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;Gw(e,t,n,r);return}function Cw(e,t,n){e=e|0;t=t|0;n=n|0;Hw(e,t,n);return}function kw(e){e=e|0;return e|0}function Mw(e,t,n){e=e|0;t=t|0;n=n|0;jw(e,t,n);return}function Sw(e){e=e|0;return e+16|0}function xw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;o=h;h=h+16|0;i=o+8|0;n=o;u[e>>2]=0;r=u[t>>2]|0;u[i>>2]=r;u[n>>2]=e;n=Lw(n)|0;if(r|0){r=YM(12)|0;a=(Bw(i)|0)+4|0;e=u[a+4>>2]|0;t=r+4|0;u[t>>2]=u[a>>2];u[t+4>>2]=e;t=u[u[i>>2]>>2]|0;u[i>>2]=t;if(!t)e=r;else{t=r;while(1){e=YM(12)|0;s=(Bw(i)|0)+4|0;l=u[s+4>>2]|0;a=e+4|0;u[a>>2]=u[s>>2];u[a+4>>2]=l;u[t>>2]=e;a=u[u[i>>2]>>2]|0;u[i>>2]=a;if(!a)break;else t=e}}u[e>>2]=u[n>>2];u[n>>2]=r}h=o;return}function Ow(e,t,n){e=e|0;t=t|0;n=n|0;Pw(e,t,n);return}function Aw(e){e=e|0;return e+24|0}function Pw(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+32|0;a=r+24|0;i=r+16|0;l=r+12|0;o=r;Ek(i);e=wo(e)|0;u[l>>2]=u[t>>2];qD(o,n);u[a>>2]=u[l>>2];Rw(e,a,o);WD(o);Ck(i);h=r;return}function Rw(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0;r=h;h=h+32|0;a=r+16|0;l=r+12|0;i=r;o=Co(Iw()|0)|0;u[l>>2]=u[t>>2];u[a>>2]=u[l>>2];t=YD(a)|0;u[i>>2]=u[n>>2];a=n+4|0;u[i+4>>2]=u[a>>2];l=n+8|0;u[i+8>>2]=u[l>>2];u[l>>2]=0;u[a>>2]=0;u[n>>2]=0;ke(0,o|0,e|0,t|0,XD(i)|0)|0;WD(i);h=r;return}function Iw(){var e=0;if(!(r[7976]|0)){Nw(10720);e=7976;u[e>>2]=1;u[e+4>>2]=0}return 10720}function Nw(e){e=e|0;Lo(e,Fw()|0,2);return}function Fw(){return 1732}function Lw(e){e=e|0;return u[e>>2]|0}function Bw(e){e=e|0;return u[e>>2]|0}function jw(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+32|0;o=r+16|0;i=r+8|0;a=r;Ek(i);e=wo(e)|0;u[a>>2]=u[t>>2];n=u[n>>2]|0;u[o>>2]=u[a>>2];Uw(e,o,n);Ck(i);h=r;return}function Uw(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+16|0;o=r+4|0;a=r;i=Co(Ww()|0)|0;u[a>>2]=u[t>>2];u[o>>2]=u[a>>2];t=YD(o)|0;ke(0,i|0,e|0,t|0,$D(n)|0)|0;h=r;return}function Ww(){var e=0;if(!(r[7984]|0)){zw(10732);e=7984;u[e>>2]=1;u[e+4>>2]=0}return 10732}function zw(e){e=e|0;Lo(e,qw()|0,2);return}function qw(){return 1744}function Hw(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0;r=h;h=h+32|0;o=r+16|0;i=r+8|0;a=r;Ek(i);e=wo(e)|0;u[a>>2]=u[t>>2];n=u[n>>2]|0;u[o>>2]=u[a>>2];Uw(e,o,n);Ck(i);h=r;return}function Gw(e,t,n,i){e=e|0;t=t|0;n=n|0;i=i|0;var o=0,a=0,l=0,s=0;o=h;h=h+32|0;l=o+16|0;a=o+8|0;s=o;Ek(a);e=wo(e)|0;u[s>>2]=u[t>>2];n=r[n>>0]|0;i=r[i>>0]|0;u[l>>2]=u[s>>2];Vw(e,l,n,i);Ck(a);h=o;return}function Vw(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0;i=h;h=h+16|0;a=i+4|0;l=i;o=Co(Yw()|0)|0;u[l>>2]=u[t>>2];u[a>>2]=u[l>>2];t=YD(a)|0;n=$w(n)|0;nt(0,o|0,e|0,t|0,n|0,$w(r)|0)|0;h=i;return}function Yw(){var e=0;if(!(r[7992]|0)){Xw(10744);e=7992;u[e>>2]=1;u[e+4>>2]=0}return 10744}function $w(e){e=e|0;return Kw(e)|0}function Kw(e){e=e|0;return e&255|0}function Xw(e){e=e|0;Lo(e,Jw()|0,3);return}function Jw(){return 1756}function Qw(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,m=0;m=h;h=h+32|0;s=m+8|0;c=m+4|0;f=m+20|0;d=m;Hs(e,0);i=yk(t)|0;u[s>>2]=0;p=s+4|0;u[p>>2]=0;u[s+8>>2]=0;switch(i<<24>>24){case 0:{r[f>>0]=0;Zw(c,n,f);eE(e,c)|0;Zi(c);break}case 8:{p=gk(t)|0;r[f>>0]=8;bk(d,u[p+4>>2]|0);tE(c,n,f,d,p+8|0);eE(e,c)|0;Zi(c);break}case 9:{a=gk(t)|0;t=u[a+4>>2]|0;if(t|0){l=s+8|0;o=a+12|0;while(1){t=t+-1|0;bk(c,u[o>>2]|0);i=u[p>>2]|0;if(i>>>0<(u[l>>2]|0)>>>0){u[i>>2]=u[c>>2];u[p>>2]=(u[p>>2]|0)+4}else ND(s,c);if(!t)break;else o=o+4|0}}r[f>>0]=9;bk(d,u[a+8>>2]|0);nE(c,n,f,d,s);eE(e,c)|0;Zi(c);break}default:{p=gk(t)|0;r[f>>0]=i;bk(d,u[p+4>>2]|0);rE(c,n,f,d);eE(e,c)|0;Zi(c)}}WD(s);h=m;return}function Zw(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0;i=h;h=h+16|0;u=i;Ek(u);t=wo(t)|0;bE(e,t,r[n>>0]|0);Ck(u);h=i;return}function eE(e,t){e=e|0;t=t|0;var n=0;n=u[e>>2]|0;if(n|0)rt(n|0);u[e>>2]=u[t>>2];u[t>>2]=0;return e|0}function tE(e,t,n,i,o){e=e|0;t=t|0;n=n|0;i=i|0;o=o|0;var a=0,l=0,s=0,c=0;a=h;h=h+32|0;s=a+16|0;l=a+8|0;c=a;Ek(l);t=wo(t)|0;n=r[n>>0]|0;u[c>>2]=u[i>>2];o=u[o>>2]|0;u[s>>2]=u[c>>2];pE(e,t,n,s,o);Ck(l);h=a;return}function nE(e,t,n,i,o){e=e|0;t=t|0;n=n|0;i=i|0;o=o|0;var a=0,l=0,s=0,c=0,f=0;a=h;h=h+32|0;c=a+24|0;l=a+16|0;f=a+12|0;s=a;Ek(l);t=wo(t)|0;n=r[n>>0]|0;u[f>>2]=u[i>>2];qD(s,o);u[c>>2]=u[f>>2];sE(e,t,n,c,s);WD(s);Ck(l);h=a;return}function rE(e,t,n,i){e=e|0;t=t|0;n=n|0;i=i|0;var o=0,a=0,l=0,s=0;o=h;h=h+32|0;l=o+16|0;a=o+8|0;s=o;Ek(a);t=wo(t)|0;n=r[n>>0]|0;u[s>>2]=u[i>>2];u[l>>2]=u[s>>2];iE(e,t,n,l);Ck(a);h=o;return}function iE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0,a=0,l=0;i=h;h=h+16|0;o=i+4|0;l=i;a=Co(uE()|0)|0;n=$w(n)|0;u[l>>2]=u[r>>2];u[o>>2]=u[l>>2];oE(e,ke(0,a|0,t|0,n|0,YD(o)|0)|0);h=i;return}function uE(){var e=0;if(!(r[8e3]|0)){aE(10756);e=8e3;u[e>>2]=1;u[e+4>>2]=0}return 10756}function oE(e,t){e=e|0;t=t|0;Hs(e,t);return}function aE(e){e=e|0;Lo(e,lE()|0,2);return}function lE(){return 1772}function sE(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var o=0,a=0,l=0,s=0,c=0;o=h;h=h+32|0;s=o+16|0;c=o+12|0;a=o;l=Co(cE()|0)|0;n=$w(n)|0;u[c>>2]=u[r>>2];u[s>>2]=u[c>>2];r=YD(s)|0;u[a>>2]=u[i>>2];s=i+4|0;u[a+4>>2]=u[s>>2];c=i+8|0;u[a+8>>2]=u[c>>2];u[c>>2]=0;u[s>>2]=0;u[i>>2]=0;oE(e,nt(0,l|0,t|0,n|0,r|0,XD(a)|0)|0);WD(a);h=o;return}function cE(){var e=0;if(!(r[8008]|0)){fE(10768);e=8008;u[e>>2]=1;u[e+4>>2]=0}return 10768}function fE(e){e=e|0;Lo(e,dE()|0,3);return}function dE(){return 1784}function pE(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var o=0,a=0,l=0,s=0;o=h;h=h+16|0;l=o+4|0;s=o;a=Co(hE()|0)|0;n=$w(n)|0;u[s>>2]=u[r>>2];u[l>>2]=u[s>>2];r=YD(l)|0;oE(e,nt(0,a|0,t|0,n|0,r|0,KD(i)|0)|0);h=o;return}function hE(){var e=0;if(!(r[8016]|0)){mE(10780);e=8016;u[e>>2]=1;u[e+4>>2]=0}return 10780}function mE(e){e=e|0;Lo(e,vE()|0,3);return}function vE(){return 1800}function bE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=Co(gE()|0)|0;oE(e,it(0,r|0,t|0,$w(n)|0)|0);return}function gE(){var e=0;if(!(r[8024]|0)){yE(10792);e=8024;u[e>>2]=1;u[e+4>>2]=0}return 10792}function yE(e){e=e|0;Lo(e,_E()|0,1);return}function _E(){return 1816}function DE(){wE();EE();TE();return}function wE(){u[2702]=$M(65536)|0;return}function EE(){YE(10856);return}function TE(){CE(10816);return}function CE(e){e=e|0;kE(e,5044);ME(e)|0;return}function kE(e,t){e=e|0;t=t|0;var n=0;n=nw()|0;u[e>>2]=n;WE(n,t);cD(u[e>>2]|0);return}function ME(e){e=e|0;var t=0;t=u[e>>2]|0;ry(t,SE()|0);return e|0}function SE(){var e=0;if(!(r[8032]|0)){xE(10820);Fe(64,10820,b|0)|0;e=8032;u[e>>2]=1;u[e+4>>2]=0}if(!(Xa(10820)|0))xE(10820);return 10820}function xE(e){e=e|0;PE(e);sy(e,25);return}function OE(e){e=e|0;AE(e+24|0);return}function AE(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function PE(e){e=e|0;var t=0;t=Za()|0;nl(e,5,18,t,LE()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function RE(e,t){e=e|0;t=t|0;IE(e,t);return}function IE(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;n=h;h=h+16|0;r=n;i=n+4|0;cc(i,t);u[r>>2]=fc(i,t)|0;NE(e,r);h=n;return}function NE(e,t){e=e|0;t=t|0;FE(e+4|0,u[t>>2]|0);r[e+8>>0]=1;return}function FE(e,t){e=e|0;t=t|0;u[e>>2]=t;return}function LE(){return 1824}function BE(e){e=e|0;return jE(e)|0}function jE(e){e=e|0;var t=0,n=0,r=0,i=0,o=0,a=0,l=0;n=h;h=h+16|0;i=n+4|0;a=n;r=UE(8)|0;t=r;l=YM(4)|0;cc(i,e);FE(l,fc(i,e)|0);o=t+4|0;u[o>>2]=l;e=YM(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];iw(e,o,i);u[r>>2]=e;h=n;return t|0}function UE(e){e=e|0;var t=0,n=0;e=e+7&-8;if(e>>>0<=32768?(t=u[2701]|0,e>>>0<=(65536-t|0)>>>0):0){n=(u[2702]|0)+t|0;u[2701]=t+e;e=n}else{e=$M(e+8|0)|0;u[e>>2]=u[2703];u[2703]=e;e=e+8|0}return e|0}function WE(e,t){e=e|0;t=t|0;u[e>>2]=zE()|0;u[e+4>>2]=qE()|0;u[e+12>>2]=t;u[e+8>>2]=HE()|0;u[e+32>>2]=9;return}function zE(){return 11744}function qE(){return 1832}function HE(){return Ry()|0}function GE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Uv(r,896)|0)==512){if(n|0){VE(n);KM(n)}}else if(t|0)KM(t);return}function VE(e){e=e|0;e=u[e+4>>2]|0;if(e|0)GM(e);return}function YE(e){e=e|0;$E(e,5052);KE(e)|0;XE(e,5058,26)|0;JE(e,5069,1)|0;QE(e,5077,10)|0;ZE(e,5087,19)|0;tT(e,5094,27)|0;return}function $E(e,t){e=e|0;t=t|0;var n=0;n=sk()|0;u[e>>2]=n;ck(n,t);cD(u[e>>2]|0);return}function KE(e){e=e|0;var t=0;t=u[e>>2]|0;ry(t,$C()|0);return e|0}function XE(e,t,n){e=e|0;t=t|0;n=n|0;MC(e,Pa(t)|0,n,0);return e|0}function JE(e,t,n){e=e|0;t=t|0;n=n|0;sC(e,Pa(t)|0,n,0);return e|0}function QE(e,t,n){e=e|0;t=t|0;n=n|0;BT(e,Pa(t)|0,n,0);return e|0}function ZE(e,t,n){e=e|0;t=t|0;n=n|0;_T(e,Pa(t)|0,n,0);return e|0}function eT(e,t){e=e|0;t=t|0;var n=0,r=0;e:while(1){n=u[2703]|0;while(1){if((n|0)==(t|0))break e;r=u[n>>2]|0;u[2703]=r;if(!n)n=r;else break}KM(n)}u[2701]=e;return}function tT(e,t,n){e=e|0;t=t|0;n=n|0;nT(e,Pa(t)|0,n,0);return e|0}function nT(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=u[e>>2]|0;i=rT()|0;e=iT(n)|0;La(o,t,i,e,uT(n,r)|0,r);return}function rT(){var e=0,t=0;if(!(r[8040]|0)){dT(10860);Fe(65,10860,b|0)|0;t=8040;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10860)|0)){e=10860;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));dT(10860)}return 10860}function iT(e){e=e|0;return e|0}function uT(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=rT()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){oT(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{aT(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function oT(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function aT(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=lT(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;sT(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;oT(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;cT(e,i);fT(i);h=l;return}}function lT(e){e=e|0;return 536870911}function sT(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function cT(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function fT(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function dT(e){e=e|0;mT(e);return}function pT(e){e=e|0;hT(e+24|0);return}function hT(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function mT(e){e=e|0;var t=0;t=Za()|0;nl(e,1,11,t,vT()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function vT(){return 1840}function bT(e,t,n){e=e|0;t=t|0;n=n|0;yT(u[(gT(e)|0)>>2]|0,t,n);return}function gT(e){e=e|0;return(u[(rT()|0)+24>>2]|0)+(e<<3)|0}function yT(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;r=h;h=h+16|0;u=r+1|0;i=r;cc(u,t);t=fc(u,t)|0;cc(i,n);n=fc(i,n)|0;mx[e&31](t,n);h=r;return}function _T(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=u[e>>2]|0;i=DT()|0;e=wT(n)|0;La(o,t,i,e,ET(n,r)|0,r);return}function DT(){var e=0,t=0;if(!(r[8048]|0)){OT(10896);Fe(66,10896,b|0)|0;t=8048;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10896)|0)){e=10896;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));OT(10896)}return 10896}function wT(e){e=e|0;return e|0}function ET(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=DT()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){TT(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{CT(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function TT(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function CT(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=kT(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;MT(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;TT(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;ST(e,i);xT(i);h=l;return}}function kT(e){e=e|0;return 536870911}function MT(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function ST(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function xT(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function OT(e){e=e|0;RT(e);return}function AT(e){e=e|0;PT(e+24|0);return}function PT(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function RT(e){e=e|0;var t=0;t=Za()|0;nl(e,1,11,t,IT()|0,1);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function IT(){return 1852}function NT(e,t){e=e|0;t=t|0;return LT(u[(FT(e)|0)>>2]|0,t)|0}function FT(e){e=e|0;return(u[(DT()|0)+24>>2]|0)+(e<<3)|0}function LT(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;cc(r,t);t=fc(r,t)|0;t=Qc(vx[e&31](t)|0)|0;h=n;return t|0}function BT(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=u[e>>2]|0;i=jT()|0;e=UT(n)|0;La(o,t,i,e,WT(n,r)|0,r);return}function jT(){var e=0,t=0;if(!(r[8056]|0)){$T(10932);Fe(67,10932,b|0)|0;t=8056;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10932)|0)){e=10932;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));$T(10932)}return 10932}function UT(e){e=e|0;return e|0}function WT(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=jT()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){zT(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{qT(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function zT(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function qT(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=HT(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;GT(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;zT(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;VT(e,i);YT(i);h=l;return}}function HT(e){e=e|0;return 536870911}function GT(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function VT(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function YT(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function $T(e){e=e|0;JT(e);return}function KT(e){e=e|0;XT(e+24|0);return}function XT(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function JT(e){e=e|0;var t=0;t=Za()|0;nl(e,1,7,t,QT()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function QT(){return 1860}function ZT(e,t,n){e=e|0;t=t|0;n=n|0;return tC(u[(eC(e)|0)>>2]|0,t,n)|0}function eC(e){e=e|0;return(u[(jT()|0)+24>>2]|0)+(e<<3)|0}function tC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0;r=h;h=h+32|0;a=r+12|0;o=r+8|0;l=r;s=r+16|0;i=r+4|0;nC(s,t);rC(l,s,t);Us(i,n);n=Ws(i,n)|0;u[a>>2]=u[l>>2];Ax[e&15](o,a,n);n=iC(o)|0;Zi(o);zs(i);h=r;return n|0}function nC(e,t){e=e|0;t=t|0;return}function rC(e,t,n){e=e|0;t=t|0;n=n|0;uC(e,n);return}function iC(e){e=e|0;return wo(e)|0}function uC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+16|0;n=i;r=t;if(!(r&1))u[e>>2]=u[t>>2];else{oC(n,0);Be(r|0,n|0)|0;aC(e,n);lC(n)}h=i;return}function oC(e,t){e=e|0;t=t|0;Po(e,t);u[e+4>>2]=0;r[e+8>>0]=0;return}function aC(e,t){e=e|0;t=t|0;u[e>>2]=u[t+4>>2];return}function lC(e){e=e|0;r[e+8>>0]=0;return}function sC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=u[e>>2]|0;i=cC()|0;e=fC(n)|0;La(o,t,i,e,dC(n,r)|0,r);return}function cC(){var e=0,t=0;if(!(r[8064]|0)){yC(10968);Fe(68,10968,b|0)|0;t=8064;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(10968)|0)){e=10968;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));yC(10968)}return 10968}function fC(e){e=e|0;return e|0}function dC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=cC()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){pC(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{hC(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function pC(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function hC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=mC(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;vC(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;pC(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;bC(e,i);gC(i);h=l;return}}function mC(e){e=e|0;return 536870911}function vC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function bC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function gC(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function yC(e){e=e|0;wC(e);return}function _C(e){e=e|0;DC(e+24|0);return}function DC(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function wC(e){e=e|0;var t=0;t=Za()|0;nl(e,1,1,t,EC()|0,5);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function EC(){return 1872}function TC(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;kC(u[(CC(e)|0)>>2]|0,t,n,r,i,o);return}function CC(e){e=e|0;return(u[(cC()|0)+24>>2]|0)+(e<<3)|0}function kC(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var o=0,a=0,l=0,s=0,c=0,f=0;o=h;h=h+32|0;a=o+16|0;l=o+12|0;s=o+8|0;c=o+4|0;f=o;Us(a,t);t=Ws(a,t)|0;Us(l,n);n=Ws(l,n)|0;Us(s,r);r=Ws(s,r)|0;Us(c,i);i=Ws(c,i)|0;Us(f,u);u=Ws(f,u)|0;cx[e&1](t,n,r,i,u);zs(f);zs(c);zs(s);zs(l);zs(a);h=o;return}function MC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=u[e>>2]|0;i=SC()|0;e=xC(n)|0;La(o,t,i,e,OC(n,r)|0,r);return}function SC(){var e=0,t=0;if(!(r[8072]|0)){LC(11004);Fe(69,11004,b|0)|0;t=8072;u[t>>2]=1;u[t+4>>2]=0}if(!(Xa(11004)|0)){e=11004;t=e+36|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(t|0));LC(11004)}return 11004}function xC(e){e=e|0;return e|0}function OC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;o=l+4|0;u[i>>2]=e;s=SC()|0;a=s+24|0;t=Wa(t,4)|0;u[o>>2]=t;n=s+28|0;r=u[n>>2]|0;if(r>>>0<(u[s+32>>2]|0)>>>0){AC(r,e,t);t=(u[n>>2]|0)+8|0;u[n>>2]=t}else{PC(a,i,o);t=u[n>>2]|0}h=l;return(t-(u[a>>2]|0)>>3)+-1|0}function AC(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;u[e+4>>2]=n;return}function PC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;o=e+4|0;a=((u[o>>2]|0)-(u[e>>2]|0)>>3)+1|0;r=RC(e)|0;if(r>>>0>>0)UM(e);else{s=u[e>>2]|0;f=(u[e+8>>2]|0)-s|0;c=f>>2;IC(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(u[o>>2]|0)-s>>3,e+8|0);a=i+8|0;AC(u[a>>2]|0,u[t>>2]|0,u[n>>2]|0);u[a>>2]=(u[a>>2]|0)+8;NC(e,i);FC(i);h=l;return}}function RC(e){e=e|0;return 536870911}function IC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;u[e+12>>2]=0;u[e+16>>2]=r;do{if(t){if(t>>>0>536870911)$e();else{i=YM(t<<3)|0;break}}else i=0}while(0);u[e>>2]=i;r=i+(n<<3)|0;u[e+8>>2]=r;u[e+4>>2]=r;u[e+12>>2]=i+(t<<3);return}function NC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,o=0,a=0;r=u[e>>2]|0;a=e+4|0;o=t+4|0;i=(u[a>>2]|0)-r|0;n=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=n;if((i|0)>0){iS(n|0,r|0,i|0)|0;r=o;n=u[o>>2]|0}else r=o;o=u[e>>2]|0;u[e>>2]=n;u[r>>2]=o;o=t+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=e+8|0;a=t+12|0;e=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=e;u[t>>2]=u[r>>2];return}function FC(e){e=e|0;var t=0,n=0,r=0;t=u[e+4>>2]|0;n=e+8|0;r=u[n>>2]|0;if((r|0)!=(t|0))u[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=u[e>>2]|0;if(e|0)KM(e);return}function LC(e){e=e|0;UC(e);return}function BC(e){e=e|0;jC(e+24|0);return}function jC(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function UC(e){e=e|0;var t=0;t=Za()|0;nl(e,1,12,t,WC()|0,2);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function WC(){return 1896}function zC(e,t,n){e=e|0;t=t|0;n=n|0;HC(u[(qC(e)|0)>>2]|0,t,n);return}function qC(e){e=e|0;return(u[(SC()|0)+24>>2]|0)+(e<<3)|0}function HC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;r=h;h=h+16|0;u=r+4|0;i=r;GC(u,t);t=VC(u,t)|0;Us(i,n);n=Ws(i,n)|0;mx[e&31](t,n);zs(i);h=r;return}function GC(e,t){e=e|0;t=t|0;return}function VC(e,t){e=e|0;t=t|0;return YC(t)|0}function YC(e){e=e|0;return e|0}function $C(){var e=0;if(!(r[8080]|0)){KC(11040);Fe(70,11040,b|0)|0;e=8080;u[e>>2]=1;u[e+4>>2]=0}if(!(Xa(11040)|0))KC(11040);return 11040}function KC(e){e=e|0;QC(e);sy(e,71);return}function XC(e){e=e|0;JC(e+24|0);return}function JC(e){e=e|0;var t=0,n=0,r=0;n=u[e>>2]|0;r=n;if(n|0){e=e+4|0;t=u[e>>2]|0;if((t|0)!=(n|0))u[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KM(n)}return}function QC(e){e=e|0;var t=0;t=Za()|0;nl(e,5,7,t,nk()|0,0);u[e+24>>2]=0;u[e+28>>2]=0;u[e+32>>2]=0;return}function ZC(e){e=e|0;ek(e);return}function ek(e){e=e|0;tk(e);return}function tk(e){e=e|0;r[e+8>>0]=1;return}function nk(){return 1936}function rk(){return ik()|0}function ik(){var e=0,t=0,n=0,r=0,i=0,o=0,a=0;t=h;h=h+16|0;i=t+4|0;a=t;n=UE(8)|0;e=n;o=e+4|0;u[o>>2]=YM(1)|0;r=YM(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];uk(r,o,i);u[n>>2]=r;h=t;return e|0}function uk(e,t,n){e=e|0;t=t|0;n=n|0;u[e>>2]=t;n=YM(16)|0;u[n+4>>2]=0;u[n+8>>2]=0;u[n>>2]=1916;u[n+12>>2]=t;u[e+4>>2]=n;return}function ok(e){e=e|0;WM(e);KM(e);return}function ak(e){e=e|0;e=u[e+12>>2]|0;if(e|0)KM(e);return}function lk(e){e=e|0;KM(e);return}function sk(){var e=0;if(!(r[8088]|0)){vk(11076);Fe(25,11076,b|0)|0;e=8088;u[e>>2]=1;u[e+4>>2]=0}return 11076}function ck(e,t){e=e|0;t=t|0;u[e>>2]=fk()|0;u[e+4>>2]=dk()|0;u[e+12>>2]=t;u[e+8>>2]=pk()|0;u[e+32>>2]=10;return}function fk(){return 11745}function dk(){return 1940}function pk(){return zv()|0}function hk(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Uv(r,896)|0)==512){if(n|0){mk(n);KM(n)}}else if(t|0)KM(t);return}function mk(e){e=e|0;e=u[e+4>>2]|0;if(e|0)GM(e);return}function vk(e){e=e|0;xl(e);return}function bk(e,t){e=e|0;t=t|0;u[e>>2]=t;return}function gk(e){e=e|0;return u[e>>2]|0}function yk(e){e=e|0;return r[u[e>>2]>>0]|0}function _k(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;u[r>>2]=u[e>>2];Dk(t,r)|0;h=n;return}function Dk(e,t){e=e|0;t=t|0;var n=0;n=wk(u[e>>2]|0,t)|0;t=e+4|0;u[(u[t>>2]|0)+8>>2]=n;return u[(u[t>>2]|0)+8>>2]|0}function wk(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Ek(r);e=wo(e)|0;t=Tk(e,u[t>>2]|0)|0;Ck(r);h=n;return t|0}function Ek(e){e=e|0;u[e>>2]=u[2701];u[e+4>>2]=u[2703];return}function Tk(e,t){e=e|0;t=t|0;var n=0;n=Co(kk()|0)|0;return it(0,n|0,e|0,KD(t)|0)|0}function Ck(e){e=e|0;eT(u[e>>2]|0,u[e+4>>2]|0);return}function kk(){var e=0;if(!(r[8096]|0)){Mk(11120);e=8096;u[e>>2]=1;u[e+4>>2]=0}return 11120}function Mk(e){e=e|0;Lo(e,Sk()|0,1);return}function Sk(){return 1948}function xk(){Ok();return}function Ok(){var e=0,t=0,n=0,i=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0;g=h;h=h+16|0;p=g+4|0;m=g;Re(65536,10804,u[2702]|0,10812);n=CD()|0;t=u[n>>2]|0;e=u[t>>2]|0;if(e|0){i=u[n+8>>2]|0;n=u[n+4>>2]|0;while(1){We(e|0,o[n>>0]|0|0,r[i>>0]|0);t=t+4|0;e=u[t>>2]|0;if(!e)break;else{i=i+1|0;n=n+1|0}}}e=MD()|0;t=u[e>>2]|0;if(t|0)do{ze(t|0,u[e+4>>2]|0);e=e+8|0;t=u[e>>2]|0}while((t|0)!=0);ze(Ak()|0,5167);d=fD()|0;e=u[d>>2]|0;e:do{if(e|0){do{Pk(u[e+4>>2]|0);e=u[e>>2]|0}while((e|0)!=0);e=u[d>>2]|0;if(e|0){f=d;do{while(1){a=e;e=u[e>>2]|0;a=u[a+4>>2]|0;if(!(Rk(a)|0))break;u[m>>2]=f;u[p>>2]=u[m>>2];Ik(d,p)|0;if(!e)break e}Nk(a);f=u[f>>2]|0;t=Fk(a)|0;l=Xe()|0;s=h;h=h+((1*(t<<2)|0)+15&-16)|0;c=h;h=h+((1*(t<<2)|0)+15&-16)|0;t=u[(Sw(a)|0)>>2]|0;if(t|0){n=s;i=c;while(1){u[n>>2]=u[(kw(u[t+4>>2]|0)|0)>>2];u[i>>2]=u[t+8>>2];t=u[t>>2]|0;if(!t)break;else{n=n+4|0;i=i+4|0}}}y=kw(a)|0;t=Lk(a)|0;n=Fk(a)|0;i=Bk(a)|0;Ve(y|0,t|0,s|0,c|0,n|0,i|0,wD(a)|0);Ne(l|0)}while((e|0)!=0)}}}while(0);e=u[(TD()|0)>>2]|0;if(e|0)do{y=e+4|0;d=AD(y)|0;a=FD(d)|0;l=PD(d)|0;s=(RD(d)|0)+1|0;c=jk(d)|0;f=Uk(y)|0;d=Xa(d)|0;p=BD(y)|0;m=Wk(y)|0;He(0,a|0,l|0,s|0,c|0,f|0,d|0,p|0,m|0,zk(y)|0);e=u[e>>2]|0}while((e|0)!=0);e=u[(fD()|0)>>2]|0;e:do{if(e|0){t:while(1){t=u[e+4>>2]|0;if(t|0?(v=u[(kw(t)|0)>>2]|0,b=u[(Aw(t)|0)>>2]|0,b|0):0){n=b;do{t=n+4|0;i=AD(t)|0;n:do{if(i|0)switch(Xa(i)|0){case 0:break t;case 4:case 3:case 2:{c=FD(i)|0;f=PD(i)|0;d=(RD(i)|0)+1|0;p=jk(i)|0;m=Xa(i)|0;y=BD(t)|0;He(v|0,c|0,f|0,d|0,p|0,0,m|0,y|0,Wk(t)|0,zk(t)|0);break n}case 1:{s=FD(i)|0;c=PD(i)|0;f=(RD(i)|0)+1|0;d=jk(i)|0;p=Uk(t)|0;m=Xa(i)|0;y=BD(t)|0;He(v|0,s|0,c|0,f|0,d|0,p|0,m|0,y|0,Wk(t)|0,zk(t)|0);break n}case 5:{d=FD(i)|0;p=PD(i)|0;m=(RD(i)|0)+1|0;y=jk(i)|0;He(v|0,d|0,p|0,m|0,y|0,qk(i)|0,Xa(i)|0,0,0,0);break n}default:break n}}while(0);n=u[n>>2]|0}while((n|0)!=0)}e=u[e>>2]|0;if(!e)break e}$e()}}while(0);Ye();h=g;return}function Ak(){return 11703}function Pk(e){e=e|0;r[e+40>>0]=0;return}function Rk(e){e=e|0;return(r[e+40>>0]|0)!=0|0}function Ik(e,t){e=e|0;t=t|0;t=Hk(t)|0;e=u[t>>2]|0;u[t>>2]=u[e>>2];KM(e);return u[t>>2]|0}function Nk(e){e=e|0;r[e+40>>0]=1;return}function Fk(e){e=e|0;return u[e+20>>2]|0}function Lk(e){e=e|0;return u[e+8>>2]|0}function Bk(e){e=e|0;return u[e+32>>2]|0}function jk(e){e=e|0;return u[e+4>>2]|0}function Uk(e){e=e|0;return u[e+4>>2]|0}function Wk(e){e=e|0;return u[e+8>>2]|0}function zk(e){e=e|0;return u[e+16>>2]|0}function qk(e){e=e|0;return u[e+20>>2]|0}function Hk(e){e=e|0;return u[e>>2]|0}function Gk(e){e=e|0;var t=0,n=0,r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,D=0,w=0,E=0;E=h;h=h+16|0;p=E;do{if(e>>>0<245){c=e>>>0<11?16:e+11&-8;e=c>>>3;d=u[2783]|0;n=d>>>e;if(n&3|0){t=(n&1^1)+e|0;e=11172+(t<<1<<2)|0;n=e+8|0;r=u[n>>2]|0;i=r+8|0;o=u[i>>2]|0;if((e|0)==(o|0))u[2783]=d&~(1<>2]=e;u[n>>2]=o}w=t<<3;u[r+4>>2]=w|3;w=r+w+4|0;u[w>>2]=u[w>>2]|1;w=i;h=E;return w|0}f=u[2785]|0;if(c>>>0>f>>>0){if(n|0){t=2<>>12&16;t=t>>>a;n=t>>>5&8;t=t>>>n;i=t>>>2&4;t=t>>>i;e=t>>>1&2;t=t>>>e;r=t>>>1&1;r=(n|a|i|e|r)+(t>>>r)|0;t=11172+(r<<1<<2)|0;e=t+8|0;i=u[e>>2]|0;a=i+8|0;n=u[a>>2]|0;if((t|0)==(n|0)){e=d&~(1<>2]=t;u[e>>2]=n;e=d}o=(r<<3)-c|0;u[i+4>>2]=c|3;r=i+c|0;u[r+4>>2]=o|1;u[r+o>>2]=o;if(f|0){i=u[2788]|0;t=f>>>3;n=11172+(t<<1<<2)|0;t=1<>2]|0}u[e>>2]=i;u[t+12>>2]=i;u[i+8>>2]=t;u[i+12>>2]=n}u[2785]=o;u[2788]=r;w=a;h=E;return w|0}l=u[2784]|0;if(l){n=(l&0-l)+-1|0;a=n>>>12&16;n=n>>>a;o=n>>>5&8;n=n>>>o;s=n>>>2&4;n=n>>>s;r=n>>>1&2;n=n>>>r;e=n>>>1&1;e=u[11436+((o|a|s|r|e)+(n>>>e)<<2)>>2]|0;n=(u[e+4>>2]&-8)-c|0;r=u[e+16+(((u[e+16>>2]|0)==0&1)<<2)>>2]|0;if(!r){s=e;o=n}else{do{a=(u[r+4>>2]&-8)-c|0;s=a>>>0>>0;n=s?a:n;e=s?r:e;r=u[r+16+(((u[r+16>>2]|0)==0&1)<<2)>>2]|0}while((r|0)!=0);s=e;o=n}a=s+c|0;if(s>>>0>>0){i=u[s+24>>2]|0;t=u[s+12>>2]|0;do{if((t|0)==(s|0)){e=s+20|0;t=u[e>>2]|0;if(!t){e=s+16|0;t=u[e>>2]|0;if(!t){n=0;break}}while(1){n=t+20|0;r=u[n>>2]|0;if(r|0){t=r;e=n;continue}n=t+16|0;r=u[n>>2]|0;if(!r)break;else{t=r;e=n}}u[e>>2]=0;n=t}else{n=u[s+8>>2]|0;u[n+12>>2]=t;u[t+8>>2]=n;n=t}}while(0);do{if(i|0){t=u[s+28>>2]|0;e=11436+(t<<2)|0;if((s|0)==(u[e>>2]|0)){u[e>>2]=n;if(!n){u[2784]=l&~(1<>2]|0)!=(s|0)&1)<<2)>>2]=n;if(!n)break}u[n+24>>2]=i;t=u[s+16>>2]|0;if(t|0){u[n+16>>2]=t;u[t+24>>2]=n}t=u[s+20>>2]|0;if(t|0){u[n+20>>2]=t;u[t+24>>2]=n}}}while(0);if(o>>>0<16){w=o+c|0;u[s+4>>2]=w|3;w=s+w+4|0;u[w>>2]=u[w>>2]|1}else{u[s+4>>2]=c|3;u[a+4>>2]=o|1;u[a+o>>2]=o;if(f|0){r=u[2788]|0;t=f>>>3;n=11172+(t<<1<<2)|0;t=1<>2]|0}u[e>>2]=r;u[t+12>>2]=r;u[r+8>>2]=t;u[r+12>>2]=n}u[2785]=o;u[2788]=a}w=s+8|0;h=E;return w|0}else d=c}else d=c}else d=c}else if(e>>>0<=4294967231){e=e+11|0;c=e&-8;s=u[2784]|0;if(s){r=0-c|0;e=e>>>8;if(e){if(c>>>0>16777215)l=31;else{d=(e+1048320|0)>>>16&8;D=e<>>16&4;D=D<>>16&2;l=14-(f|d|l)+(D<>>15)|0;l=c>>>(l+7|0)&1|l<<1}}else l=0;n=u[11436+(l<<2)>>2]|0;e:do{if(!n){n=0;e=0;D=57}else{e=0;a=c<<((l|0)==31?0:25-(l>>>1)|0);o=0;while(1){i=(u[n+4>>2]&-8)-c|0;if(i>>>0>>0)if(!i){e=n;r=0;i=n;D=61;break e}else{e=n;r=i}i=u[n+20>>2]|0;n=u[n+16+(a>>>31<<2)>>2]|0;o=(i|0)==0|(i|0)==(n|0)?o:i;i=(n|0)==0;if(i){n=o;D=57;break}else a=a<<((i^1)&1)}}}while(0);if((D|0)==57){if((n|0)==0&(e|0)==0){e=2<>>12&16;d=d>>>a;o=d>>>5&8;d=d>>>o;l=d>>>2&4;d=d>>>l;f=d>>>1&2;d=d>>>f;n=d>>>1&1;e=0;n=u[11436+((o|a|l|f|n)+(d>>>n)<<2)>>2]|0}if(!n){l=e;a=r}else{i=n;D=61}}if((D|0)==61)while(1){D=0;n=(u[i+4>>2]&-8)-c|0;d=n>>>0>>0;n=d?n:r;e=d?i:e;i=u[i+16+(((u[i+16>>2]|0)==0&1)<<2)>>2]|0;if(!i){l=e;a=n;break}else{r=n;D=61}}if((l|0)!=0?a>>>0<((u[2785]|0)-c|0)>>>0:0){o=l+c|0;if(l>>>0>=o>>>0){w=0;h=E;return w|0}i=u[l+24>>2]|0;t=u[l+12>>2]|0;do{if((t|0)==(l|0)){e=l+20|0;t=u[e>>2]|0;if(!t){e=l+16|0;t=u[e>>2]|0;if(!t){t=0;break}}while(1){n=t+20|0;r=u[n>>2]|0;if(r|0){t=r;e=n;continue}n=t+16|0;r=u[n>>2]|0;if(!r)break;else{t=r;e=n}}u[e>>2]=0}else{w=u[l+8>>2]|0;u[w+12>>2]=t;u[t+8>>2]=w}}while(0);do{if(i){e=u[l+28>>2]|0;n=11436+(e<<2)|0;if((l|0)==(u[n>>2]|0)){u[n>>2]=t;if(!t){r=s&~(1<>2]|0)!=(l|0)&1)<<2)>>2]=t;if(!t){r=s;break}}u[t+24>>2]=i;e=u[l+16>>2]|0;if(e|0){u[t+16>>2]=e;u[e+24>>2]=t}e=u[l+20>>2]|0;if(e){u[t+20>>2]=e;u[e+24>>2]=t;r=s}else r=s}else r=s}while(0);do{if(a>>>0>=16){u[l+4>>2]=c|3;u[o+4>>2]=a|1;u[o+a>>2]=a;t=a>>>3;if(a>>>0<256){n=11172+(t<<1<<2)|0;e=u[2783]|0;t=1<>2]|0}u[e>>2]=o;u[t+12>>2]=o;u[o+8>>2]=t;u[o+12>>2]=n;break}t=a>>>8;if(t){if(a>>>0>16777215)t=31;else{D=(t+1048320|0)>>>16&8;w=t<>>16&4;w=w<<_;t=(w+245760|0)>>>16&2;t=14-(_|D|t)+(w<>>15)|0;t=a>>>(t+7|0)&1|t<<1}}else t=0;n=11436+(t<<2)|0;u[o+28>>2]=t;e=o+16|0;u[e+4>>2]=0;u[e>>2]=0;e=1<>2]=o;u[o+24>>2]=n;u[o+12>>2]=o;u[o+8>>2]=o;break}e=a<<((t|0)==31?0:25-(t>>>1)|0);n=u[n>>2]|0;while(1){if((u[n+4>>2]&-8|0)==(a|0)){D=97;break}r=n+16+(e>>>31<<2)|0;t=u[r>>2]|0;if(!t){D=96;break}else{e=e<<1;n=t}}if((D|0)==96){u[r>>2]=o;u[o+24>>2]=n;u[o+12>>2]=o;u[o+8>>2]=o;break}else if((D|0)==97){D=n+8|0;w=u[D>>2]|0;u[w+12>>2]=o;u[D>>2]=o;u[o+8>>2]=w;u[o+12>>2]=n;u[o+24>>2]=0;break}}else{w=a+c|0;u[l+4>>2]=w|3;w=l+w+4|0;u[w>>2]=u[w>>2]|1}}while(0);w=l+8|0;h=E;return w|0}else d=c}else d=c}else d=-1}while(0);n=u[2785]|0;if(n>>>0>=d>>>0){t=n-d|0;e=u[2788]|0;if(t>>>0>15){w=e+d|0;u[2788]=w;u[2785]=t;u[w+4>>2]=t|1;u[w+t>>2]=t;u[e+4>>2]=d|3}else{u[2785]=0;u[2788]=0;u[e+4>>2]=n|3;w=e+n+4|0;u[w>>2]=u[w>>2]|1}w=e+8|0;h=E;return w|0}a=u[2786]|0;if(a>>>0>d>>>0){_=a-d|0;u[2786]=_;w=u[2789]|0;D=w+d|0;u[2789]=D;u[D+4>>2]=_|1;u[w+4>>2]=d|3;w=w+8|0;h=E;return w|0}if(!(u[2901]|0)){u[2903]=4096;u[2902]=4096;u[2904]=-1;u[2905]=-1;u[2906]=0;u[2894]=0;e=p&-16^1431655768;u[p>>2]=e;u[2901]=e;e=4096}else e=u[2903]|0;l=d+48|0;s=d+47|0;o=e+s|0;i=0-e|0;c=o&i;if(c>>>0<=d>>>0){w=0;h=E;return w|0}e=u[2893]|0;if(e|0?(f=u[2891]|0,p=f+c|0,p>>>0<=f>>>0|p>>>0>e>>>0):0){w=0;h=E;return w|0}e:do{if(!(u[2894]&4)){n=u[2789]|0;t:do{if(n){r=11580;while(1){e=u[r>>2]|0;if(e>>>0<=n>>>0?(b=r+4|0,(e+(u[b>>2]|0)|0)>>>0>n>>>0):0)break;e=u[r+8>>2]|0;if(!e){D=118;break t}else r=e}t=o-a&i;if(t>>>0<2147483647){e=lS(t|0)|0;if((e|0)==((u[r>>2]|0)+(u[b>>2]|0)|0)){if((e|0)!=(-1|0)){a=t;o=e;D=135;break e}}else{r=e;D=126}}else t=0}else D=118}while(0);do{if((D|0)==118){n=lS(0)|0;if((n|0)!=(-1|0)?(t=n,m=u[2902]|0,v=m+-1|0,t=((v&t|0)==0?0:(v+t&0-m)-t|0)+c|0,m=u[2891]|0,v=t+m|0,t>>>0>d>>>0&t>>>0<2147483647):0){b=u[2893]|0;if(b|0?v>>>0<=m>>>0|v>>>0>b>>>0:0){t=0;break}e=lS(t|0)|0;if((e|0)==(n|0)){a=t;o=n;D=135;break e}else{r=e;D=126}}else t=0}}while(0);do{if((D|0)==126){n=0-t|0;if(!(l>>>0>t>>>0&(t>>>0<2147483647&(r|0)!=(-1|0))))if((r|0)==(-1|0)){t=0;break}else{a=t;o=r;D=135;break e}e=u[2903]|0;e=s-t+e&0-e;if(e>>>0>=2147483647){a=t;o=r;D=135;break e}if((lS(e|0)|0)==(-1|0)){lS(n|0)|0;t=0;break}else{a=e+t|0;o=r;D=135;break e}}}while(0);u[2894]=u[2894]|4;D=133}else{t=0;D=133}}while(0);if(((D|0)==133?c>>>0<2147483647:0)?(_=lS(c|0)|0,b=lS(0)|0,g=b-_|0,y=g>>>0>(d+40|0)>>>0,!((_|0)==(-1|0)|y^1|_>>>0>>0&((_|0)!=(-1|0)&(b|0)!=(-1|0))^1)):0){a=y?g:t;o=_;D=135}if((D|0)==135){t=(u[2891]|0)+a|0;u[2891]=t;if(t>>>0>(u[2892]|0)>>>0)u[2892]=t;s=u[2789]|0;do{if(s){t=11580;while(1){e=u[t>>2]|0;n=t+4|0;r=u[n>>2]|0;if((o|0)==(e+r|0)){D=145;break}i=u[t+8>>2]|0;if(!i)break;else t=i}if(((D|0)==145?(u[t+12>>2]&8|0)==0:0)?s>>>0>>0&s>>>0>=e>>>0:0){u[n>>2]=r+a;w=s+8|0;w=(w&7|0)==0?0:0-w&7;D=s+w|0;w=(u[2786]|0)+(a-w)|0;u[2789]=D;u[2786]=w;u[D+4>>2]=w|1;u[D+w+4>>2]=40;u[2790]=u[2905];break}if(o>>>0<(u[2787]|0)>>>0)u[2787]=o;n=o+a|0;t=11580;while(1){if((u[t>>2]|0)==(n|0)){D=153;break}e=u[t+8>>2]|0;if(!e)break;else t=e}if((D|0)==153?(u[t+12>>2]&8|0)==0:0){u[t>>2]=o;f=t+4|0;u[f>>2]=(u[f>>2]|0)+a;f=o+8|0;f=o+((f&7|0)==0?0:0-f&7)|0;t=n+8|0;t=n+((t&7|0)==0?0:0-t&7)|0;c=f+d|0;l=t-f-d|0;u[f+4>>2]=d|3;do{if((t|0)!=(s|0)){if((t|0)==(u[2788]|0)){w=(u[2785]|0)+l|0;u[2785]=w;u[2788]=c;u[c+4>>2]=w|1;u[c+w>>2]=w;break}e=u[t+4>>2]|0;if((e&3|0)==1){a=e&-8;r=e>>>3;e:do{if(e>>>0<256){e=u[t+8>>2]|0;n=u[t+12>>2]|0;if((n|0)==(e|0)){u[2783]=u[2783]&~(1<>2]=n;u[n+8>>2]=e;break}}else{o=u[t+24>>2]|0;e=u[t+12>>2]|0;do{if((e|0)==(t|0)){r=t+16|0;n=r+4|0;e=u[n>>2]|0;if(!e){e=u[r>>2]|0;if(!e){e=0;break}else n=r}while(1){r=e+20|0;i=u[r>>2]|0;if(i|0){e=i;n=r;continue}r=e+16|0;i=u[r>>2]|0;if(!i)break;else{e=i;n=r}}u[n>>2]=0}else{w=u[t+8>>2]|0;u[w+12>>2]=e;u[e+8>>2]=w}}while(0);if(!o)break;n=u[t+28>>2]|0;r=11436+(n<<2)|0;do{if((t|0)!=(u[r>>2]|0)){u[o+16+(((u[o+16>>2]|0)!=(t|0)&1)<<2)>>2]=e;if(!e)break e}else{u[r>>2]=e;if(e|0)break;u[2784]=u[2784]&~(1<>2]=o;n=t+16|0;r=u[n>>2]|0;if(r|0){u[e+16>>2]=r;u[r+24>>2]=e}n=u[n+4>>2]|0;if(!n)break;u[e+20>>2]=n;u[n+24>>2]=e}}while(0);t=t+a|0;i=a+l|0}else i=l;t=t+4|0;u[t>>2]=u[t>>2]&-2;u[c+4>>2]=i|1;u[c+i>>2]=i;t=i>>>3;if(i>>>0<256){n=11172+(t<<1<<2)|0;e=u[2783]|0;t=1<>2]|0}u[e>>2]=c;u[t+12>>2]=c;u[c+8>>2]=t;u[c+12>>2]=n;break}t=i>>>8;do{if(!t)t=0;else{if(i>>>0>16777215){t=31;break}D=(t+1048320|0)>>>16&8;w=t<>>16&4;w=w<<_;t=(w+245760|0)>>>16&2;t=14-(_|D|t)+(w<>>15)|0;t=i>>>(t+7|0)&1|t<<1}}while(0);r=11436+(t<<2)|0;u[c+28>>2]=t;e=c+16|0;u[e+4>>2]=0;u[e>>2]=0;e=u[2784]|0;n=1<>2]=c;u[c+24>>2]=r;u[c+12>>2]=c;u[c+8>>2]=c;break}e=i<<((t|0)==31?0:25-(t>>>1)|0);n=u[r>>2]|0;while(1){if((u[n+4>>2]&-8|0)==(i|0)){D=194;break}r=n+16+(e>>>31<<2)|0;t=u[r>>2]|0;if(!t){D=193;break}else{e=e<<1;n=t}}if((D|0)==193){u[r>>2]=c;u[c+24>>2]=n;u[c+12>>2]=c;u[c+8>>2]=c;break}else if((D|0)==194){D=n+8|0;w=u[D>>2]|0;u[w+12>>2]=c;u[D>>2]=c;u[c+8>>2]=w;u[c+12>>2]=n;u[c+24>>2]=0;break}}else{w=(u[2786]|0)+l|0;u[2786]=w;u[2789]=c;u[c+4>>2]=w|1}}while(0);w=f+8|0;h=E;return w|0}t=11580;while(1){e=u[t>>2]|0;if(e>>>0<=s>>>0?(w=e+(u[t+4>>2]|0)|0,w>>>0>s>>>0):0)break;t=u[t+8>>2]|0}i=w+-47|0;e=i+8|0;e=i+((e&7|0)==0?0:0-e&7)|0;i=s+16|0;e=e>>>0>>0?s:e;t=e+8|0;n=o+8|0;n=(n&7|0)==0?0:0-n&7;D=o+n|0;n=a+-40-n|0;u[2789]=D;u[2786]=n;u[D+4>>2]=n|1;u[D+n+4>>2]=40;u[2790]=u[2905];n=e+4|0;u[n>>2]=27;u[t>>2]=u[2895];u[t+4>>2]=u[2896];u[t+8>>2]=u[2897];u[t+12>>2]=u[2898];u[2895]=o;u[2896]=a;u[2898]=0;u[2897]=t;t=e+24|0;do{D=t;t=t+4|0;u[t>>2]=7}while((D+8|0)>>>0>>0);if((e|0)!=(s|0)){o=e-s|0;u[n>>2]=u[n>>2]&-2;u[s+4>>2]=o|1;u[e>>2]=o;t=o>>>3;if(o>>>0<256){n=11172+(t<<1<<2)|0;e=u[2783]|0;t=1<>2]|0}u[e>>2]=s;u[t+12>>2]=s;u[s+8>>2]=t;u[s+12>>2]=n;break}t=o>>>8;if(t){if(o>>>0>16777215)n=31;else{D=(t+1048320|0)>>>16&8;w=t<>>16&4;w=w<<_;n=(w+245760|0)>>>16&2;n=14-(_|D|n)+(w<>>15)|0;n=o>>>(n+7|0)&1|n<<1}}else n=0;r=11436+(n<<2)|0;u[s+28>>2]=n;u[s+20>>2]=0;u[i>>2]=0;t=u[2784]|0;e=1<>2]=s;u[s+24>>2]=r;u[s+12>>2]=s;u[s+8>>2]=s;break}e=o<<((n|0)==31?0:25-(n>>>1)|0);n=u[r>>2]|0;while(1){if((u[n+4>>2]&-8|0)==(o|0)){D=216;break}r=n+16+(e>>>31<<2)|0;t=u[r>>2]|0;if(!t){D=215;break}else{e=e<<1;n=t}}if((D|0)==215){u[r>>2]=s;u[s+24>>2]=n;u[s+12>>2]=s;u[s+8>>2]=s;break}else if((D|0)==216){D=n+8|0;w=u[D>>2]|0;u[w+12>>2]=s;u[D>>2]=s;u[s+8>>2]=w;u[s+12>>2]=n;u[s+24>>2]=0;break}}}else{w=u[2787]|0;if((w|0)==0|o>>>0>>0)u[2787]=o;u[2895]=o;u[2896]=a;u[2898]=0;u[2792]=u[2901];u[2791]=-1;t=0;do{w=11172+(t<<1<<2)|0;u[w+12>>2]=w;u[w+8>>2]=w;t=t+1|0}while((t|0)!=32);w=o+8|0;w=(w&7|0)==0?0:0-w&7;D=o+w|0;w=a+-40-w|0;u[2789]=D;u[2786]=w;u[D+4>>2]=w|1;u[D+w+4>>2]=40;u[2790]=u[2905]}}while(0);t=u[2786]|0;if(t>>>0>d>>>0){_=t-d|0;u[2786]=_;w=u[2789]|0;D=w+d|0;u[2789]=D;u[D+4>>2]=_|1;u[w+4>>2]=d|3;w=w+8|0;h=E;return w|0}}u[(Qk()|0)>>2]=12;w=0;h=E;return w|0}function Vk(e){e=e|0;var t=0,n=0,r=0,i=0,o=0,a=0,l=0,s=0;if(!e)return;n=e+-8|0;i=u[2787]|0;e=u[e+-4>>2]|0;t=e&-8;s=n+t|0;do{if(!(e&1)){r=u[n>>2]|0;if(!(e&3))return;a=n+(0-r)|0;o=r+t|0;if(a>>>0>>0)return;if((a|0)==(u[2788]|0)){e=s+4|0;t=u[e>>2]|0;if((t&3|0)!=3){l=a;t=o;break}u[2785]=o;u[e>>2]=t&-2;u[a+4>>2]=o|1;u[a+o>>2]=o;return}n=r>>>3;if(r>>>0<256){e=u[a+8>>2]|0;t=u[a+12>>2]|0;if((t|0)==(e|0)){u[2783]=u[2783]&~(1<>2]=t;u[t+8>>2]=e;l=a;t=o;break}}i=u[a+24>>2]|0;e=u[a+12>>2]|0;do{if((e|0)==(a|0)){n=a+16|0;t=n+4|0;e=u[t>>2]|0;if(!e){e=u[n>>2]|0;if(!e){e=0;break}else t=n}while(1){n=e+20|0;r=u[n>>2]|0;if(r|0){e=r;t=n;continue}n=e+16|0;r=u[n>>2]|0;if(!r)break;else{e=r;t=n}}u[t>>2]=0}else{l=u[a+8>>2]|0;u[l+12>>2]=e;u[e+8>>2]=l}}while(0);if(i){t=u[a+28>>2]|0;n=11436+(t<<2)|0;if((a|0)==(u[n>>2]|0)){u[n>>2]=e;if(!e){u[2784]=u[2784]&~(1<>2]|0)!=(a|0)&1)<<2)>>2]=e;if(!e){l=a;t=o;break}}u[e+24>>2]=i;t=a+16|0;n=u[t>>2]|0;if(n|0){u[e+16>>2]=n;u[n+24>>2]=e}t=u[t+4>>2]|0;if(t){u[e+20>>2]=t;u[t+24>>2]=e;l=a;t=o}else{l=a;t=o}}else{l=a;t=o}}else{l=n;a=n}}while(0);if(a>>>0>=s>>>0)return;e=s+4|0;r=u[e>>2]|0;if(!(r&1))return;if(!(r&2)){e=u[2788]|0;if((s|0)==(u[2789]|0)){s=(u[2786]|0)+t|0;u[2786]=s;u[2789]=l;u[l+4>>2]=s|1;if((l|0)!=(e|0))return;u[2788]=0;u[2785]=0;return}if((s|0)==(e|0)){s=(u[2785]|0)+t|0;u[2785]=s;u[2788]=a;u[l+4>>2]=s|1;u[a+s>>2]=s;return}i=(r&-8)+t|0;n=r>>>3;do{if(r>>>0<256){t=u[s+8>>2]|0;e=u[s+12>>2]|0;if((e|0)==(t|0)){u[2783]=u[2783]&~(1<>2]=e;u[e+8>>2]=t;break}}else{o=u[s+24>>2]|0;e=u[s+12>>2]|0;do{if((e|0)==(s|0)){n=s+16|0;t=n+4|0;e=u[t>>2]|0;if(!e){e=u[n>>2]|0;if(!e){n=0;break}else t=n}while(1){n=e+20|0;r=u[n>>2]|0;if(r|0){e=r;t=n;continue}n=e+16|0;r=u[n>>2]|0;if(!r)break;else{e=r;t=n}}u[t>>2]=0;n=e}else{n=u[s+8>>2]|0;u[n+12>>2]=e;u[e+8>>2]=n;n=e}}while(0);if(o|0){e=u[s+28>>2]|0;t=11436+(e<<2)|0;if((s|0)==(u[t>>2]|0)){u[t>>2]=n;if(!n){u[2784]=u[2784]&~(1<>2]|0)!=(s|0)&1)<<2)>>2]=n;if(!n)break}u[n+24>>2]=o;e=s+16|0;t=u[e>>2]|0;if(t|0){u[n+16>>2]=t;u[t+24>>2]=n}e=u[e+4>>2]|0;if(e|0){u[n+20>>2]=e;u[e+24>>2]=n}}}}while(0);u[l+4>>2]=i|1;u[a+i>>2]=i;if((l|0)==(u[2788]|0)){u[2785]=i;return}}else{u[e>>2]=r&-2;u[l+4>>2]=t|1;u[a+t>>2]=t;i=t}e=i>>>3;if(i>>>0<256){n=11172+(e<<1<<2)|0;t=u[2783]|0;e=1<>2]|0}u[t>>2]=l;u[e+12>>2]=l;u[l+8>>2]=e;u[l+12>>2]=n;return}e=i>>>8;if(e){if(i>>>0>16777215)e=31;else{a=(e+1048320|0)>>>16&8;s=e<>>16&4;s=s<>>16&2;e=14-(o|a|e)+(s<>>15)|0;e=i>>>(e+7|0)&1|e<<1}}else e=0;r=11436+(e<<2)|0;u[l+28>>2]=e;u[l+20>>2]=0;u[l+16>>2]=0;t=u[2784]|0;n=1<>>1)|0);n=u[r>>2]|0;while(1){if((u[n+4>>2]&-8|0)==(i|0)){e=73;break}r=n+16+(t>>>31<<2)|0;e=u[r>>2]|0;if(!e){e=72;break}else{t=t<<1;n=e}}if((e|0)==72){u[r>>2]=l;u[l+24>>2]=n;u[l+12>>2]=l;u[l+8>>2]=l;break}else if((e|0)==73){a=n+8|0;s=u[a>>2]|0;u[s+12>>2]=l;u[a>>2]=l;u[l+8>>2]=s;u[l+12>>2]=n;u[l+24>>2]=0;break}}else{u[2784]=t|n;u[r>>2]=l;u[l+24>>2]=r;u[l+12>>2]=l;u[l+8>>2]=l}}while(0);s=(u[2791]|0)+-1|0;u[2791]=s;if(!s)e=11588;else return;while(1){e=u[e>>2]|0;if(!e)break;else e=e+8|0}u[2791]=-1;return}function Yk(){return 11628}function $k(e){e=e|0;var t=0,n=0;t=h;h=h+16|0;n=t;u[n>>2]=tM(u[e+60>>2]|0)|0;e=Jk(ot(6,n|0)|0)|0;h=t;return e|0}function Kk(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,m=0;d=h;h=h+48|0;c=d+16|0;o=d;i=d+32|0;l=e+28|0;r=u[l>>2]|0;u[i>>2]=r;s=e+20|0;r=(u[s>>2]|0)-r|0;u[i+4>>2]=r;u[i+8>>2]=t;u[i+12>>2]=n;r=r+n|0;a=e+60|0;u[o>>2]=u[a>>2];u[o+4>>2]=i;u[o+8>>2]=2;o=Jk(st(146,o|0)|0)|0;e:do{if((r|0)!=(o|0)){t=2;while(1){if((o|0)<0)break;r=r-o|0;m=u[i+4>>2]|0;p=o>>>0>m>>>0;i=p?i+8|0:i;t=(p<<31>>31)+t|0;m=o-(p?m:0)|0;u[i>>2]=(u[i>>2]|0)+m;p=i+4|0;u[p>>2]=(u[p>>2]|0)-m;u[c>>2]=u[a>>2];u[c+4>>2]=i;u[c+8>>2]=t;o=Jk(st(146,c|0)|0)|0;if((r|0)==(o|0)){f=3;break e}}u[e+16>>2]=0;u[l>>2]=0;u[s>>2]=0;u[e>>2]=u[e>>2]|32;if((t|0)==2)n=0;else n=n-(u[i+4>>2]|0)|0}else f=3}while(0);if((f|0)==3){m=u[e+44>>2]|0;u[e+16>>2]=m+(u[e+48>>2]|0);u[l>>2]=m;u[s>>2]=m}h=d;return n|0}function Xk(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;i=h;h=h+32|0;o=i;r=i+20|0;u[o>>2]=u[e+60>>2];u[o+4>>2]=0;u[o+8>>2]=t;u[o+12>>2]=r;u[o+16>>2]=n;if((Jk(lt(140,o|0)|0)|0)<0){u[r>>2]=-1;e=-1}else e=u[r>>2]|0;h=i;return e|0}function Jk(e){e=e|0;if(e>>>0>4294963200){u[(Qk()|0)>>2]=0-e;e=-1}return e|0}function Qk(){return(Zk()|0)+64|0}function Zk(){return eM()|0}function eM(){return 2084}function tM(e){e=e|0;return e|0}function nM(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0;o=h;h=h+32|0;i=o;u[e+36>>2]=1;if((u[e>>2]&64|0)==0?(u[i>>2]=u[e+60>>2],u[i+4>>2]=21523,u[i+8>>2]=o+16,Je(54,i|0)|0):0)r[e+75>>0]=-1;i=Kk(e,t,n)|0;h=o;return i|0}function rM(e,t){e=e|0;t=t|0;var n=0,i=0;n=r[e>>0]|0;i=r[t>>0]|0;if(n<<24>>24==0?1:n<<24>>24!=i<<24>>24)e=i;else{do{e=e+1|0;t=t+1|0;n=r[e>>0]|0;i=r[t>>0]|0}while(!(n<<24>>24==0?1:n<<24>>24!=i<<24>>24));e=i}return(n&255)-(e&255)|0}function iM(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0;e:do{if(!n)e=0;else{while(1){i=r[e>>0]|0;u=r[t>>0]|0;if(i<<24>>24!=u<<24>>24)break;n=n+-1|0;if(!n){e=0;break e}else{e=e+1|0;t=t+1|0}}e=(i&255)-(u&255)|0}}while(0);return e|0}function uM(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,m=0,v=0,b=0,g=0;g=h;h=h+224|0;d=g+120|0;p=g+80|0;v=g;b=g+136|0;i=p;o=i+40|0;do{u[i>>2]=0;i=i+4|0}while((i|0)<(o|0));u[d>>2]=u[n>>2];if((oM(0,t,d,v,p)|0)<0)n=-1;else{if((u[e+76>>2]|0)>-1)m=aM(e)|0;else m=0;n=u[e>>2]|0;f=n&32;if((r[e+74>>0]|0)<1)u[e>>2]=n&-33;i=e+48|0;if(!(u[i>>2]|0)){o=e+44|0;a=u[o>>2]|0;u[o>>2]=b;l=e+28|0;u[l>>2]=b;s=e+20|0;u[s>>2]=b;u[i>>2]=80;c=e+16|0;u[c>>2]=b+80;n=oM(e,t,d,v,p)|0;if(a){yx[u[e+36>>2]&7](e,0,0)|0;n=(u[s>>2]|0)==0?-1:n;u[o>>2]=a;u[i>>2]=0;u[c>>2]=0;u[l>>2]=0;u[s>>2]=0}}else n=oM(e,t,d,v,p)|0;i=u[e>>2]|0;u[e>>2]=i|f;if(m|0)lM(e);n=(i&32|0)==0?n:-1}h=g;return n|0}function oM(e,t,n,o,a){e=e|0;t=t|0;n=n|0;o=o|0;a=a|0;var l=0,s=0,f=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,D=0,w=0,E=0,T=0,C=0,k=0,M=0,S=0,O=0,A=0,P=0,R=0;R=h;h=h+64|0;S=R+16|0;O=R;k=R+24|0;A=R+8|0;P=R+20|0;u[S>>2]=t;E=(e|0)!=0;T=k+40|0;C=T;k=k+39|0;M=A+4|0;s=0;l=0;m=0;e:while(1){do{if((l|0)>-1)if((s|0)>(2147483647-l|0)){u[(Qk()|0)>>2]=75;l=-1;break}else{l=s+l|0;break}}while(0);s=r[t>>0]|0;if(!(s<<24>>24)){w=87;break}else f=t;t:while(1){switch(s<<24>>24){case 37:{s=f;w=9;break t}case 0:{s=f;break t}default:{}}D=f+1|0;u[S>>2]=D;s=r[D>>0]|0;f=D}t:do{if((w|0)==9)while(1){w=0;if((r[f+1>>0]|0)!=37)break t;s=s+1|0;f=f+2|0;u[S>>2]=f;if((r[f>>0]|0)==37)w=9;else break}}while(0);s=s-t|0;if(E)sM(e,t,s);if(s|0){t=f;continue}d=f+1|0;s=(r[d>>0]|0)+-48|0;if(s>>>0<10){D=(r[f+2>>0]|0)==36;_=D?s:-1;m=D?1:m;d=D?f+3|0:d}else _=-1;u[S>>2]=d;s=r[d>>0]|0;f=(s<<24>>24)+-32|0;t:do{if(f>>>0<32){p=0;v=s;while(1){s=1<>2]=d;s=r[d>>0]|0;f=(s<<24>>24)+-32|0;if(f>>>0>=32)break;else v=s}}else p=0}while(0);if(s<<24>>24==42){f=d+1|0;s=(r[f>>0]|0)+-48|0;if(s>>>0<10?(r[d+2>>0]|0)==36:0){u[a+(s<<2)>>2]=10;s=u[o+((r[f>>0]|0)+-48<<3)>>2]|0;m=1;d=d+3|0}else{if(m|0){l=-1;break}if(E){m=(u[n>>2]|0)+(4-1)&~(4-1);s=u[m>>2]|0;u[n>>2]=m+4;m=0;d=f}else{s=0;m=0;d=f}}u[S>>2]=d;D=(s|0)<0;s=D?0-s|0:s;p=D?p|8192:p}else{s=cM(S)|0;if((s|0)<0){l=-1;break}d=u[S>>2]|0}do{if((r[d>>0]|0)==46){if((r[d+1>>0]|0)!=42){u[S>>2]=d+1;f=cM(S)|0;d=u[S>>2]|0;break}v=d+2|0;f=(r[v>>0]|0)+-48|0;if(f>>>0<10?(r[d+3>>0]|0)==36:0){u[a+(f<<2)>>2]=10;f=u[o+((r[v>>0]|0)+-48<<3)>>2]|0;d=d+4|0;u[S>>2]=d;break}if(m|0){l=-1;break e}if(E){D=(u[n>>2]|0)+(4-1)&~(4-1);f=u[D>>2]|0;u[n>>2]=D+4}else f=0;u[S>>2]=v;d=v}else f=-1}while(0);y=0;while(1){if(((r[d>>0]|0)+-65|0)>>>0>57){l=-1;break e}D=d+1|0;u[S>>2]=D;v=r[(r[d>>0]|0)+-65+(5178+(y*58|0))>>0]|0;b=v&255;if((b+-1|0)>>>0<8){y=b;d=D}else break}if(!(v<<24>>24)){l=-1;break}g=(_|0)>-1;do{if(v<<24>>24==19){if(g){l=-1;break e}else w=49}else{if(g){u[a+(_<<2)>>2]=b;g=o+(_<<3)|0;_=u[g+4>>2]|0;w=O;u[w>>2]=u[g>>2];u[w+4>>2]=_;w=49;break}if(!E){l=0;break e}fM(O,b,n)}}while(0);if((w|0)==49?(w=0,!E):0){s=0;t=D;continue}d=r[d>>0]|0;d=(y|0)!=0&(d&15|0)==3?d&-33:d;g=p&-65537;_=(p&8192|0)==0?p:g;t:do{switch(d|0){case 110:switch((y&255)<<24>>24){case 0:{u[u[O>>2]>>2]=l;s=0;t=D;continue e}case 1:{u[u[O>>2]>>2]=l;s=0;t=D;continue e}case 2:{s=u[O>>2]|0;u[s>>2]=l;u[s+4>>2]=((l|0)<0)<<31>>31;s=0;t=D;continue e}case 3:{i[u[O>>2]>>1]=l;s=0;t=D;continue e}case 4:{r[u[O>>2]>>0]=l;s=0;t=D;continue e}case 6:{u[u[O>>2]>>2]=l;s=0;t=D;continue e}case 7:{s=u[O>>2]|0;u[s>>2]=l;u[s+4>>2]=((l|0)<0)<<31>>31;s=0;t=D;continue e}default:{s=0;t=D;continue e}}case 112:{d=120;f=f>>>0>8?f:8;t=_|8;w=61;break}case 88:case 120:{t=_;w=61;break}case 111:{d=O;t=u[d>>2]|0;d=u[d+4>>2]|0;b=pM(t,d,T)|0;g=C-b|0;p=0;v=5642;f=(_&8|0)==0|(f|0)>(g|0)?f:g+1|0;g=_;w=67;break}case 105:case 100:{d=O;t=u[d>>2]|0;d=u[d+4>>2]|0;if((d|0)<0){t=ZM(0,0,t|0,d|0)|0;d=x;p=O;u[p>>2]=t;u[p+4>>2]=d;p=1;v=5642;w=66;break t}else{p=(_&2049|0)!=0&1;v=(_&2048|0)==0?(_&1|0)==0?5642:5644:5643;w=66;break t}}case 117:{d=O;p=0;v=5642;t=u[d>>2]|0;d=u[d+4>>2]|0;w=66;break}case 99:{r[k>>0]=u[O>>2];t=k;p=0;v=5642;b=T;d=1;f=g;break}case 109:{d=mM(u[(Qk()|0)>>2]|0)|0;w=71;break}case 115:{d=u[O>>2]|0;d=d|0?d:5652;w=71;break}case 67:{u[A>>2]=u[O>>2];u[M>>2]=0;u[O>>2]=A;b=-1;d=A;w=75;break}case 83:{t=u[O>>2]|0;if(!f){bM(e,32,s,0,_);t=0;w=84}else{b=f;d=t;w=75}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{s=yM(e,+c[O>>3],s,f,_,d)|0;t=D;continue e}default:{p=0;v=5642;b=T;d=f;f=_}}}while(0);t:do{if((w|0)==61){_=O;y=u[_>>2]|0;_=u[_+4>>2]|0;b=dM(y,_,T,d&32)|0;v=(t&8|0)==0|(y|0)==0&(_|0)==0;p=v?0:2;v=v?5642:5642+(d>>4)|0;g=t;t=y;d=_;w=67}else if((w|0)==66){b=hM(t,d,T)|0;g=_;w=67}else if((w|0)==71){w=0;_=vM(d,0,f)|0;y=(_|0)==0;t=d;p=0;v=5642;b=y?d+f|0:_;d=y?f:_-d|0;f=g}else if((w|0)==75){w=0;v=d;t=0;f=0;while(1){p=u[v>>2]|0;if(!p)break;f=gM(P,p)|0;if((f|0)<0|f>>>0>(b-t|0)>>>0)break;t=f+t|0;if(b>>>0>t>>>0)v=v+4|0;else break}if((f|0)<0){l=-1;break e}bM(e,32,s,t,_);if(!t){t=0;w=84}else{p=0;while(1){f=u[d>>2]|0;if(!f){w=84;break t}f=gM(P,f)|0;p=f+p|0;if((p|0)>(t|0)){w=84;break t}sM(e,P,f);if(p>>>0>=t>>>0){w=84;break}else d=d+4|0}}}}while(0);if((w|0)==67){w=0;d=(t|0)!=0|(d|0)!=0;_=(f|0)!=0|d;d=((d^1)&1)+(C-b)|0;t=_?b:T;b=T;d=_?(f|0)>(d|0)?f:d:f;f=(f|0)>-1?g&-65537:g}else if((w|0)==84){w=0;bM(e,32,s,t,_^8192);s=(s|0)>(t|0)?s:t;t=D;continue}y=b-t|0;g=(d|0)<(y|0)?y:d;_=g+p|0;s=(s|0)<(_|0)?_:s;bM(e,32,s,_,f);sM(e,v,p);bM(e,48,s,_,f^65536);bM(e,48,g,y,0);sM(e,t,y);bM(e,32,s,_,f^8192);t=D}e:do{if((w|0)==87)if(!e)if(!m)l=0;else{l=1;while(1){t=u[a+(l<<2)>>2]|0;if(!t)break;fM(o+(l<<3)|0,t,n);l=l+1|0;if((l|0)>=10){l=1;break e}}while(1){if(u[a+(l<<2)>>2]|0){l=-1;break e}l=l+1|0;if((l|0)>=10){l=1;break}}}}while(0);h=R;return l|0}function aM(e){e=e|0;return 0}function lM(e){e=e|0;return}function sM(e,t,n){e=e|0;t=t|0;n=n|0;if(!(u[e>>2]&32))AM(t,n,e)|0;return}function cM(e){e=e|0;var t=0,n=0,i=0;n=u[e>>2]|0;i=(r[n>>0]|0)+-48|0;if(i>>>0<10){t=0;do{t=i+(t*10|0)|0;n=n+1|0;u[e>>2]=n;i=(r[n>>0]|0)+-48|0}while(i>>>0<10)}else t=0;return t|0}function fM(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{r=(u[n>>2]|0)+(4-1)&~(4-1);t=u[r>>2]|0;u[n>>2]=r+4;u[e>>2]=t;break e}case 10:{r=(u[n>>2]|0)+(4-1)&~(4-1);t=u[r>>2]|0;u[n>>2]=r+4;r=e;u[r>>2]=t;u[r+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{r=(u[n>>2]|0)+(4-1)&~(4-1);t=u[r>>2]|0;u[n>>2]=r+4;r=e;u[r>>2]=t;u[r+4>>2]=0;break e}case 12:{r=(u[n>>2]|0)+(8-1)&~(8-1);t=r;i=u[t>>2]|0;t=u[t+4>>2]|0;u[n>>2]=r+8;r=e;u[r>>2]=i;u[r+4>>2]=t;break e}case 13:{i=(u[n>>2]|0)+(4-1)&~(4-1);r=u[i>>2]|0;u[n>>2]=i+4;r=(r&65535)<<16>>16;i=e;u[i>>2]=r;u[i+4>>2]=((r|0)<0)<<31>>31;break e}case 14:{i=(u[n>>2]|0)+(4-1)&~(4-1);r=u[i>>2]|0;u[n>>2]=i+4;i=e;u[i>>2]=r&65535;u[i+4>>2]=0;break e}case 15:{i=(u[n>>2]|0)+(4-1)&~(4-1);r=u[i>>2]|0;u[n>>2]=i+4;r=(r&255)<<24>>24;i=e;u[i>>2]=r;u[i+4>>2]=((r|0)<0)<<31>>31;break e}case 16:{i=(u[n>>2]|0)+(4-1)&~(4-1);r=u[i>>2]|0;u[n>>2]=i+4;i=e;u[i>>2]=r&255;u[i+4>>2]=0;break e}case 17:{i=(u[n>>2]|0)+(8-1)&~(8-1);o=+c[i>>3];u[n>>2]=i+8;c[e>>3]=o;break e}case 18:{i=(u[n>>2]|0)+(8-1)&~(8-1);o=+c[i>>3];u[n>>2]=i+8;c[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function dM(e,t,n,i){e=e|0;t=t|0;n=n|0;i=i|0;if(!((e|0)==0&(t|0)==0))do{n=n+-1|0;r[n>>0]=o[5694+(e&15)>>0]|0|i;e=rS(e|0,t|0,4)|0;t=x}while(!((e|0)==0&(t|0)==0));return n|0}function pM(e,t,n){e=e|0;t=t|0;n=n|0;if(!((e|0)==0&(t|0)==0))do{n=n+-1|0;r[n>>0]=e&7|48;e=rS(e|0,t|0,3)|0;t=x}while(!((e|0)==0&(t|0)==0));return n|0}function hM(e,t,n){e=e|0;t=t|0;n=n|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295){while(1){i=cS(e|0,t|0,10,0)|0;n=n+-1|0;r[n>>0]=i&255|48;i=e;e=aS(e|0,t|0,10,0)|0;if(!(t>>>0>9|(t|0)==9&i>>>0>4294967295))break;else t=x}t=e}else t=e;if(t)while(1){n=n+-1|0;r[n>>0]=(t>>>0)%10|0|48;if(t>>>0<10)break;else t=(t>>>0)/10|0}return n|0}function mM(e){e=e|0;return kM(e,u[(CM()|0)+188>>2]|0)|0}function vM(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0,a=0,l=0;a=t&255;i=(n|0)!=0;e:do{if(i&(e&3|0)!=0){o=t&255;while(1){if((r[e>>0]|0)==o<<24>>24){l=6;break e}e=e+1|0;n=n+-1|0;i=(n|0)!=0;if(!(i&(e&3|0)!=0)){l=5;break}}}else l=5}while(0);if((l|0)==5)if(i)l=6;else n=0;e:do{if((l|0)==6){o=t&255;if((r[e>>0]|0)!=o<<24>>24){i=H(a,16843009)|0;t:do{if(n>>>0>3)while(1){a=u[e>>2]^i;if((a&-2139062144^-2139062144)&a+-16843009|0)break;e=e+4|0;n=n+-4|0;if(n>>>0<=3){l=11;break t}}else l=11}while(0);if((l|0)==11)if(!n){n=0;break}while(1){if((r[e>>0]|0)==o<<24>>24)break e;e=e+1|0;n=n+-1|0;if(!n){n=0;break}}}}}while(0);return(n|0?e:0)|0}function bM(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,o=0;o=h;h=h+256|0;u=o;if((n|0)>(r|0)&(i&73728|0)==0){i=n-r|0;tS(u|0,t|0,(i>>>0<256?i:256)|0)|0;if(i>>>0>255){t=n-r|0;do{sM(e,u,256);i=i+-256|0}while(i>>>0>255);i=t&255}sM(e,u,i)}h=o;return}function gM(e,t){e=e|0;t=t|0;if(!e)e=0;else e=EM(e,t,0)|0;return e|0}function yM(e,t,n,i,a,l){e=e|0;t=+t;n=n|0;i=i|0;a=a|0;l=l|0;var s=0,c=0,f=0,d=0,p=0,m=0,v=0,b=0.0,g=0,y=0,_=0,D=0,w=0,E=0,T=0,C=0,k=0,M=0,S=0,O=0,A=0,P=0,R=0;R=h;h=h+560|0;f=R+8|0;_=R;P=R+524|0;A=P;d=R+512|0;u[_>>2]=0;O=d+12|0;_M(t)|0;if((x|0)<0){t=-t;M=1;k=5659}else{M=(a&2049|0)!=0&1;k=(a&2048|0)==0?(a&1|0)==0?5660:5665:5662}_M(t)|0;S=x&2146435072;do{if(S>>>0<2146435072|(S|0)==2146435072&0<0){b=+DM(t,_)*2.0;s=b!=0.0;if(s)u[_>>2]=(u[_>>2]|0)+-1;w=l|32;if((w|0)==97){g=l&32;v=(g|0)==0?k:k+9|0;m=M|2;s=12-i|0;do{if(!(i>>>0>11|(s|0)==0)){t=8.0;do{s=s+-1|0;t=t*16.0}while((s|0)!=0);if((r[v>>0]|0)==45){t=-(t+(-b-t));break}else{t=b+t-t;break}}else t=b}while(0);c=u[_>>2]|0;s=(c|0)<0?0-c|0:c;s=hM(s,((s|0)<0)<<31>>31,O)|0;if((s|0)==(O|0)){s=d+11|0;r[s>>0]=48}r[s+-1>>0]=(c>>31&2)+43;p=s+-2|0;r[p>>0]=l+15;d=(i|0)<1;f=(a&8|0)==0;s=P;do{S=~~t;c=s+1|0;r[s>>0]=o[5694+S>>0]|g;t=(t-+(S|0))*16.0;if((c-A|0)==1?!(f&(d&t==0.0)):0){r[c>>0]=46;s=s+2|0}else s=c}while(t!=0.0);S=s-A|0;A=O-p|0;O=(i|0)!=0&(S+-2|0)<(i|0)?i+2|0:S;s=A+m+O|0;bM(e,32,n,s,a);sM(e,v,m);bM(e,48,n,s,a^65536);sM(e,P,S);bM(e,48,O-S|0,0,0);sM(e,p,A);bM(e,32,n,s,a^8192);break}c=(i|0)<0?6:i;if(s){s=(u[_>>2]|0)+-28|0;u[_>>2]=s;t=b*268435456.0}else{t=b;s=u[_>>2]|0}S=(s|0)<0?f:f+288|0;f=S;do{T=~~t>>>0;u[f>>2]=T;f=f+4|0;t=(t-+(T>>>0))*1.0e9}while(t!=0.0);if((s|0)>0){d=S;m=f;while(1){p=(s|0)<29?s:29;s=m+-4|0;if(s>>>0>=d>>>0){f=0;do{E=nS(u[s>>2]|0,0,p|0)|0;E=eS(E|0,x|0,f|0,0)|0;T=x;D=cS(E|0,T|0,1e9,0)|0;u[s>>2]=D;f=aS(E|0,T|0,1e9,0)|0;s=s+-4|0}while(s>>>0>=d>>>0);if(f){d=d+-4|0;u[d>>2]=f}}f=m;while(1){if(f>>>0<=d>>>0)break;s=f+-4|0;if(!(u[s>>2]|0))f=s;else break}s=(u[_>>2]|0)-p|0;u[_>>2]=s;if((s|0)>0)m=f;else break}}else d=S;if((s|0)<0){i=((c+25|0)/9|0)+1|0;y=(w|0)==102;do{g=0-s|0;g=(g|0)<9?g:9;if(d>>>0>>0){p=(1<>>g;v=0;s=d;do{T=u[s>>2]|0;u[s>>2]=(T>>>g)+v;v=H(T&p,m)|0;s=s+4|0}while(s>>>0>>0);s=(u[d>>2]|0)==0?d+4|0:d;if(!v){d=s;s=f}else{u[f>>2]=v;d=s;s=f+4|0}}else{d=(u[d>>2]|0)==0?d+4|0:d;s=f}f=y?S:d;f=(s-f>>2|0)>(i|0)?f+(i<<2)|0:s;s=(u[_>>2]|0)+g|0;u[_>>2]=s}while((s|0)<0);s=d;i=f}else{s=d;i=f}T=S;if(s>>>0>>0){f=(T-s>>2)*9|0;p=u[s>>2]|0;if(p>>>0>=10){d=10;do{d=d*10|0;f=f+1|0}while(p>>>0>=d>>>0)}}else f=0;y=(w|0)==103;D=(c|0)!=0;d=c-((w|0)!=102?f:0)+((D&y)<<31>>31)|0;if((d|0)<(((i-T>>2)*9|0)+-9|0)){d=d+9216|0;g=S+4+(((d|0)/9|0)+-1024<<2)|0;d=((d|0)%9|0)+1|0;if((d|0)<9){p=10;do{p=p*10|0;d=d+1|0}while((d|0)!=9)}else p=10;m=u[g>>2]|0;v=(m>>>0)%(p>>>0)|0;d=(g+4|0)==(i|0);if(!(d&(v|0)==0)){b=(((m>>>0)/(p>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;E=(p|0)/2|0;t=v>>>0>>0?.5:d&(v|0)==(E|0)?1.0:1.5;if(M){E=(r[k>>0]|0)==45;t=E?-t:t;b=E?-b:b}d=m-v|0;u[g>>2]=d;if(b+t!=b){E=d+p|0;u[g>>2]=E;if(E>>>0>999999999){f=g;while(1){d=f+-4|0;u[f>>2]=0;if(d>>>0>>0){s=s+-4|0;u[s>>2]=0}E=(u[d>>2]|0)+1|0;u[d>>2]=E;if(E>>>0>999999999)f=d;else break}}else d=g;f=(T-s>>2)*9|0;m=u[s>>2]|0;if(m>>>0>=10){p=10;do{p=p*10|0;f=f+1|0}while(m>>>0>=p>>>0)}}else d=g}else d=g;d=d+4|0;d=i>>>0>d>>>0?d:i;E=s}else{d=i;E=s}w=d;while(1){if(w>>>0<=E>>>0){_=0;break}s=w+-4|0;if(!(u[s>>2]|0))w=s;else{_=1;break}}i=0-f|0;do{if(y){s=((D^1)&1)+c|0;if((s|0)>(f|0)&(f|0)>-5){p=l+-1|0;c=s+-1-f|0}else{p=l+-2|0;c=s+-1|0}s=a&8;if(!s){if(_?(C=u[w+-4>>2]|0,(C|0)!=0):0){if(!((C>>>0)%10|0)){d=0;s=10;do{s=s*10|0;d=d+1|0}while(!((C>>>0)%(s>>>0)|0|0))}else d=0}else d=9;s=((w-T>>2)*9|0)+-9|0;if((p|32|0)==102){g=s-d|0;g=(g|0)>0?g:0;c=(c|0)<(g|0)?c:g;g=0;break}else{g=s+f-d|0;g=(g|0)>0?g:0;c=(c|0)<(g|0)?c:g;g=0;break}}else g=s}else{p=l;g=a&8}}while(0);y=c|g;m=(y|0)!=0&1;v=(p|32|0)==102;if(v){D=0;s=(f|0)>0?f:0}else{s=(f|0)<0?i:f;s=hM(s,((s|0)<0)<<31>>31,O)|0;d=O;if((d-s|0)<2)do{s=s+-1|0;r[s>>0]=48}while((d-s|0)<2);r[s+-1>>0]=(f>>31&2)+43;s=s+-2|0;r[s>>0]=p;D=s;s=d-s|0}s=M+1+c+m+s|0;bM(e,32,n,s,a);sM(e,k,M);bM(e,48,n,s,a^65536);if(v){p=E>>>0>S>>>0?S:E;g=P+9|0;m=g;v=P+8|0;d=p;do{f=hM(u[d>>2]|0,0,g)|0;if((d|0)==(p|0)){if((f|0)==(g|0)){r[v>>0]=48;f=v}}else if(f>>>0>P>>>0){tS(P|0,48,f-A|0)|0;do{f=f+-1|0}while(f>>>0>P>>>0)}sM(e,f,m-f|0);d=d+4|0}while(d>>>0<=S>>>0);if(y|0)sM(e,5710,1);if(d>>>0>>0&(c|0)>0)while(1){f=hM(u[d>>2]|0,0,g)|0;if(f>>>0>P>>>0){tS(P|0,48,f-A|0)|0;do{f=f+-1|0}while(f>>>0>P>>>0)}sM(e,f,(c|0)<9?c:9);d=d+4|0;f=c+-9|0;if(!(d>>>0>>0&(c|0)>9)){c=f;break}else c=f}bM(e,48,c+9|0,9,0)}else{y=_?w:E+4|0;if((c|0)>-1){_=P+9|0;g=(g|0)==0;i=_;m=0-A|0;v=P+8|0;p=E;do{f=hM(u[p>>2]|0,0,_)|0;if((f|0)==(_|0)){r[v>>0]=48;f=v}do{if((p|0)==(E|0)){d=f+1|0;sM(e,f,1);if(g&(c|0)<1){f=d;break}sM(e,5710,1);f=d}else{if(f>>>0<=P>>>0)break;tS(P|0,48,f+m|0)|0;do{f=f+-1|0}while(f>>>0>P>>>0)}}while(0);A=i-f|0;sM(e,f,(c|0)>(A|0)?A:c);c=c-A|0;p=p+4|0}while(p>>>0>>0&(c|0)>-1)}bM(e,48,c+18|0,18,0);sM(e,D,O-D|0)}bM(e,32,n,s,a^8192)}else{P=(l&32|0)!=0;s=M+3|0;bM(e,32,n,s,a&-65537);sM(e,k,M);sM(e,t!=t|0.0!=0.0?P?5686:5690:P?5678:5682,3);bM(e,32,n,s,a^8192)}}while(0);h=R;return((s|0)<(n|0)?n:s)|0}function _M(e){e=+e;var t=0;c[d>>3]=e;t=u[d>>2]|0;x=u[d+4>>2]|0;return t|0}function DM(e,t){e=+e;t=t|0;return+ +wM(e,t)}function wM(e,t){e=+e;t=t|0;var n=0,r=0,i=0;c[d>>3]=e;n=u[d>>2]|0;r=u[d+4>>2]|0;i=rS(n|0,r|0,52)|0;switch(i&2047){case 0:{if(e!=0.0){e=+wM(e*18446744073709551616.0,t);n=(u[t>>2]|0)+-64|0}else n=0;u[t>>2]=n;break}case 2047:break;default:{u[t>>2]=(i&2047)+-1022;u[d>>2]=n;u[d+4>>2]=r&-2146435073|1071644672;e=+c[d>>3]}}return+e}function EM(e,t,n){e=e|0;t=t|0;n=n|0;do{if(e){if(t>>>0<128){r[e>>0]=t;e=1;break}if(!(u[u[(TM()|0)+188>>2]>>2]|0))if((t&-128|0)==57216){r[e>>0]=t;e=1;break}else{u[(Qk()|0)>>2]=84;e=-1;break}if(t>>>0<2048){r[e>>0]=t>>>6|192;r[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){r[e>>0]=t>>>12|224;r[e+1>>0]=t>>>6&63|128;r[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){r[e>>0]=t>>>18|240;r[e+1>>0]=t>>>12&63|128;r[e+2>>0]=t>>>6&63|128;r[e+3>>0]=t&63|128;e=4;break}else{u[(Qk()|0)>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function TM(){return eM()|0}function CM(){return eM()|0}function kM(e,t){e=e|0;t=t|0;var n=0,i=0;i=0;while(1){if((o[5712+i>>0]|0)==(e|0)){e=2;break}n=i+1|0;if((n|0)==87){n=5800;i=87;e=5;break}else i=n}if((e|0)==2)if(!i)n=5800;else{n=5800;e=5}if((e|0)==5)while(1){do{e=n;n=n+1|0}while((r[e>>0]|0)!=0);i=i+-1|0;if(!i)break;else e=5}return MM(n,u[t+20>>2]|0)|0}function MM(e,t){e=e|0;t=t|0;return SM(e,t)|0}function SM(e,t){e=e|0;t=t|0;if(!t)t=0;else t=xM(u[t>>2]|0,u[t+4>>2]|0,e)|0;return(t|0?t:e)|0}function xM(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,h=0;h=(u[e>>2]|0)+1794895138|0;a=OM(u[e+8>>2]|0,h)|0;i=OM(u[e+12>>2]|0,h)|0;o=OM(u[e+16>>2]|0,h)|0;e:do{if((a>>>0>>2>>>0?(p=t-(a<<2)|0,i>>>0

>>0&o>>>0

>>0):0)?((o|i)&3|0)==0:0){p=i>>>2;d=o>>>2;f=0;while(1){s=a>>>1;c=f+s|0;l=c<<1;o=l+p|0;i=OM(u[e+(o<<2)>>2]|0,h)|0;o=OM(u[e+(o+1<<2)>>2]|0,h)|0;if(!(o>>>0>>0&i>>>0<(t-o|0)>>>0)){i=0;break e}if(r[e+(o+i)>>0]|0){i=0;break e}i=rM(n,e+o|0)|0;if(!i)break;i=(i|0)<0;if((a|0)==1){i=0;break e}else{f=i?f:c;a=i?s:a-s|0}}i=l+d|0;o=OM(u[e+(i<<2)>>2]|0,h)|0;i=OM(u[e+(i+1<<2)>>2]|0,h)|0;if(i>>>0>>0&o>>>0<(t-i|0)>>>0)i=(r[e+(i+o)>>0]|0)==0?e+i|0:0;else i=0}else i=0}while(0);return i|0}function OM(e,t){e=e|0;t=t|0;var n=0;n=fS(e|0)|0;return((t|0)==0?e:n)|0}function AM(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0,a=0,l=0,s=0;i=n+16|0;o=u[i>>2]|0;if(!o){if(!(PM(n)|0)){o=u[i>>2]|0;a=5}else i=0}else a=5;e:do{if((a|0)==5){s=n+20|0;l=u[s>>2]|0;i=l;if((o-l|0)>>>0>>0){i=yx[u[n+36>>2]&7](n,e,t)|0;break}t:do{if((r[n+75>>0]|0)>-1){l=t;while(1){if(!l){a=0;o=e;break t}o=l+-1|0;if((r[e+o>>0]|0)==10)break;else l=o}i=yx[u[n+36>>2]&7](n,e,l)|0;if(i>>>0>>0)break e;a=l;o=e+l|0;t=t-l|0;i=u[s>>2]|0}else{a=0;o=e}}while(0);iS(i|0,o|0,t|0)|0;u[s>>2]=(u[s>>2]|0)+t;i=a+t|0}}while(0);return i|0}function PM(e){e=e|0;var t=0,n=0;t=e+74|0;n=r[t>>0]|0;r[t>>0]=n+255|n;t=u[e>>2]|0;if(!(t&8)){u[e+8>>2]=0;u[e+4>>2]=0;n=u[e+44>>2]|0;u[e+28>>2]=n;u[e+20>>2]=n;u[e+16>>2]=n+(u[e+48>>2]|0);e=0}else{u[e>>2]=t|32;e=-1}return e|0}function RM(e,t){e=$(e);t=$(t);var n=0,r=0;n=IM(e)|0;do{if((n&2147483647)>>>0<=2139095040){r=IM(t)|0;if((r&2147483647)>>>0<=2139095040)if((r^n|0)<0){e=(n|0)<0?t:e;break}else{e=e>2]=e,u[d>>2]|0)|0}function NM(e,t){e=$(e);t=$(t);var n=0,r=0;n=FM(e)|0;do{if((n&2147483647)>>>0<=2139095040){r=FM(t)|0;if((r&2147483647)>>>0<=2139095040)if((r^n|0)<0){e=(n|0)<0?e:t;break}else{e=e>2]=e,u[d>>2]|0)|0}function LM(e,t){e=$(e);t=$(t);var n=0,r=0,i=0,o=0,a=0,l=0,c=0,f=0;o=(s[d>>2]=e,u[d>>2]|0);l=(s[d>>2]=t,u[d>>2]|0);n=o>>>23&255;a=l>>>23&255;c=o&-2147483648;i=l<<1;e:do{if((i|0)!=0?!((n|0)==255|((BM(t)|0)&2147483647)>>>0>2139095040):0){r=o<<1;if(r>>>0<=i>>>0){t=$(e*$(0.0));return $((r|0)==(i|0)?t:e)}if(!n){n=o<<9;if((n|0)>-1){r=n;n=0;do{n=n+-1|0;r=r<<1}while((r|0)>-1)}else n=0;r=o<<1-n}else r=o&8388607|8388608;if(!a){o=l<<9;if((o|0)>-1){i=0;do{i=i+-1|0;o=o<<1}while((o|0)>-1)}else i=0;a=i;l=l<<1-i}else l=l&8388607|8388608;i=r-l|0;o=(i|0)>-1;t:do{if((n|0)>(a|0)){while(1){if(o)if(!i)break;else r=i;r=r<<1;n=n+-1|0;i=r-l|0;o=(i|0)>-1;if((n|0)<=(a|0))break t}t=$(e*$(0.0));break e}}while(0);if(o)if(!i){t=$(e*$(0.0));break}else r=i;if(r>>>0<8388608)do{r=r<<1;n=n+-1|0}while(r>>>0<8388608);if((n|0)>0)n=r+-8388608|n<<23;else n=r>>>(1-n|0);t=(u[d>>2]=n|c,$(s[d>>2]))}else f=3}while(0);if((f|0)==3){t=$(e*t);t=$(t/t)}return $(t)}function BM(e){e=$(e);return(s[d>>2]=e,u[d>>2]|0)|0}function jM(e,t){e=e|0;t=t|0;return uM(u[582]|0,e,t)|0}function UM(e){e=e|0;$e()}function WM(e){e=e|0;return}function zM(e,t){e=e|0;t=t|0;return 0}function qM(e){e=e|0;if((HM(e+4|0)|0)==-1){hx[u[(u[e>>2]|0)+8>>2]&127](e);e=1}else e=0;return e|0}function HM(e){e=e|0;var t=0;t=u[e>>2]|0;u[e>>2]=t+-1;return t+-1|0}function GM(e){e=e|0;if(qM(e)|0)VM(e);return}function VM(e){e=e|0;var t=0;t=e+8|0;if(!((u[t>>2]|0)!=0?(HM(t)|0)!=-1:0))hx[u[(u[e>>2]|0)+16>>2]&127](e);return}function YM(e){e=e|0;var t=0;t=(e|0)==0?1:e;while(1){e=Gk(t)|0;if(e|0)break;e=JM()|0;if(!e){e=0;break}Px[e&0]()}return e|0}function $M(e){e=e|0;return YM(e)|0}function KM(e){e=e|0;Vk(e);return}function XM(e){e=e|0;if((r[e+11>>0]|0)<0)KM(u[e>>2]|0);return}function JM(){var e=0;e=u[2923]|0;u[2923]=e+0;return e|0}function QM(){}function ZM(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=t-r-(n>>>0>e>>>0|0)>>>0;return(x=r,e-n>>>0|0)|0}function eS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;n=e+n>>>0;return(x=t+r+(n>>>0>>0|0)>>>0,n|0)|0}function tS(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0,a=0,l=0;a=e+n|0;t=t&255;if((n|0)>=67){while(e&3){r[e>>0]=t;e=e+1|0}i=a&-4|0;o=i-64|0;l=t|t<<8|t<<16|t<<24;while((e|0)<=(o|0)){u[e>>2]=l;u[e+4>>2]=l;u[e+8>>2]=l;u[e+12>>2]=l;u[e+16>>2]=l;u[e+20>>2]=l;u[e+24>>2]=l;u[e+28>>2]=l;u[e+32>>2]=l;u[e+36>>2]=l;u[e+40>>2]=l;u[e+44>>2]=l;u[e+48>>2]=l;u[e+52>>2]=l;u[e+56>>2]=l;u[e+60>>2]=l;e=e+64|0}while((e|0)<(i|0)){u[e>>2]=l;e=e+4|0}}while((e|0)<(a|0)){r[e>>0]=t;e=e+1|0}return a-n|0}function nS(e,t,n){e=e|0;t=t|0;n=n|0;if((n|0)<32){x=t<>>32-n;return e<>>n;return e>>>n|(t&(1<>>n-32|0}function iS(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0,a=0;if((n|0)>=8192)return qe(e|0,t|0,n|0)|0;a=e|0;o=e+n|0;if((e&3)==(t&3)){while(e&3){if(!n)return a|0;r[e>>0]=r[t>>0]|0;e=e+1|0;t=t+1|0;n=n-1|0}n=o&-4|0;i=n-64|0;while((e|0)<=(i|0)){u[e>>2]=u[t>>2];u[e+4>>2]=u[t+4>>2];u[e+8>>2]=u[t+8>>2];u[e+12>>2]=u[t+12>>2];u[e+16>>2]=u[t+16>>2];u[e+20>>2]=u[t+20>>2];u[e+24>>2]=u[t+24>>2];u[e+28>>2]=u[t+28>>2];u[e+32>>2]=u[t+32>>2];u[e+36>>2]=u[t+36>>2];u[e+40>>2]=u[t+40>>2];u[e+44>>2]=u[t+44>>2];u[e+48>>2]=u[t+48>>2];u[e+52>>2]=u[t+52>>2];u[e+56>>2]=u[t+56>>2];u[e+60>>2]=u[t+60>>2];e=e+64|0;t=t+64|0}while((e|0)<(n|0)){u[e>>2]=u[t>>2];e=e+4|0;t=t+4|0}}else{n=o-4|0;while((e|0)<(n|0)){r[e>>0]=r[t>>0]|0;r[e+1>>0]=r[t+1>>0]|0;r[e+2>>0]=r[t+2>>0]|0;r[e+3>>0]=r[t+3>>0]|0;e=e+4|0;t=t+4|0}}while((e|0)<(o|0)){r[e>>0]=r[t>>0]|0;e=e+1|0;t=t+1|0}return a|0}function uS(e){e=e|0;var t=0;t=r[v+(e&255)>>0]|0;if((t|0)<8)return t|0;t=r[v+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=r[v+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(r[v+(e>>>24)>>0]|0)+24|0}function oS(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var o=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,h=0,m=0;f=e;s=t;c=s;a=n;p=r;l=p;if(!c){o=(i|0)!=0;if(!l){if(o){u[i>>2]=(f>>>0)%(a>>>0);u[i+4>>2]=0}p=0;i=(f>>>0)/(a>>>0)>>>0;return(x=p,i)|0}else{if(!o){p=0;i=0;return(x=p,i)|0}u[i>>2]=e|0;u[i+4>>2]=t&0;p=0;i=0;return(x=p,i)|0}}o=(l|0)==0;do{if(a){if(!o){o=(Y(l|0)|0)-(Y(c|0)|0)|0;if(o>>>0<=31){d=o+1|0;l=31-o|0;t=o-31>>31;a=d;e=f>>>(d>>>0)&t|c<>>(d>>>0)&t;o=0;l=f<>2]=e|0;u[i+4>>2]=s|t&0;p=0;i=0;return(x=p,i)|0}o=a-1|0;if(o&a|0){l=(Y(a|0)|0)+33-(Y(c|0)|0)|0;m=64-l|0;d=32-l|0;s=d>>31;h=l-32|0;t=h>>31;a=l;e=d-1>>31&c>>>(h>>>0)|(c<>>(l>>>0))&t;t=t&c>>>(l>>>0);o=f<>>(h>>>0))&s|f<>31;break}if(i|0){u[i>>2]=o&f;u[i+4>>2]=0}if((a|0)==1){h=s|t&0;m=e|0|0;return(x=h,m)|0}else{m=uS(a|0)|0;h=c>>>(m>>>0)|0;m=c<<32-m|f>>>(m>>>0)|0;return(x=h,m)|0}}else{if(o){if(i|0){u[i>>2]=(c>>>0)%(a>>>0);u[i+4>>2]=0}h=0;m=(c>>>0)/(a>>>0)>>>0;return(x=h,m)|0}if(!f){if(i|0){u[i>>2]=0;u[i+4>>2]=(c>>>0)%(l>>>0)}h=0;m=(c>>>0)/(l>>>0)>>>0;return(x=h,m)|0}o=l-1|0;if(!(o&l)){if(i|0){u[i>>2]=e|0;u[i+4>>2]=o&c|t&0}h=0;m=c>>>((uS(l|0)|0)>>>0);return(x=h,m)|0}o=(Y(l|0)|0)-(Y(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;l=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;l=f<>2]=e|0;u[i+4>>2]=s|t&0;h=0;m=0;return(x=h,m)|0}}while(0);if(!a){c=l;s=0;l=0}else{d=n|0|0;f=p|r&0;c=eS(d|0,f|0,-1,-1)|0;n=x;s=l;l=0;do{r=s;s=o>>>31|s<<1;o=l|o<<1;r=e<<1|r>>>31|0;p=e>>>31|t<<1|0;ZM(c|0,n|0,r|0,p|0)|0;m=x;h=m>>31|((m|0)<0?-1:0)<<1;l=h&1;e=ZM(r|0,p|0,h&d|0,(((m|0)<0?-1:0)>>31|((m|0)<0?-1:0)<<1)&f|0)|0;t=x;a=a-1|0}while((a|0)!=0);c=s;s=0}a=0;if(i|0){u[i>>2]=e;u[i+4>>2]=t}h=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|s;m=(o<<1|0>>>31)&-2|l;return(x=h,m)|0}function aS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;return oS(e,t,n,r,0)|0}function lS(e){e=e|0;var t=0,n=0;n=e+15&-16|0;t=u[f>>2]|0;e=t+n|0;if((n|0)>0&(e|0)<(t|0)|(e|0)<0){Z()|0;Ge(12);return-1}u[f>>2]=e;if((e|0)>(Q()|0)?(J()|0)==0:0){u[f>>2]=t;Ge(12);return-1}return t|0}function sS(e,t,n){e=e|0;t=t|0;n=n|0;var i=0;if((t|0)<(e|0)&(e|0)<(t+n|0)){i=e;t=t+n|0;e=e+n|0;while((n|0)>0){e=e-1|0;t=t-1|0;n=n-1|0;r[e>>0]=r[t>>0]|0}e=i}else iS(e,t,n)|0;return e|0}function cS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,o=0;o=h;h=h+16|0;i=o|0;oS(e,t,n,r,i)|0;h=o;return(x=u[i+4>>2]|0,u[i>>2]|0)|0}function fS(e){e=e|0;return(e&255)<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>>24|0}function dS(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;cx[e&1](t|0,n|0,r|0,i|0,u|0)}function pS(e,t,n){e=e|0;t=t|0;n=$(n);fx[e&1](t|0,$(n))}function hS(e,t,n){e=e|0;t=t|0;n=+n;dx[e&31](t|0,+n)}function mS(e,t,n,r){e=e|0;t=t|0;n=$(n);r=$(r);return $(px[e&0](t|0,$(n),$(r)))}function vS(e,t){e=e|0;t=t|0;hx[e&127](t|0)}function bS(e,t,n){e=e|0;t=t|0;n=n|0;mx[e&31](t|0,n|0)}function gS(e,t){e=e|0;t=t|0;return vx[e&31](t|0)|0}function yS(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;bx[e&1](t|0,+n,+r,i|0)}function _S(e,t,n,r){e=e|0;t=t|0;n=+n;r=+r;gx[e&1](t|0,+n,+r)}function DS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;return yx[e&7](t|0,n|0,r|0)|0}function wS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;return+_x[e&1](t|0,n|0,r|0)}function ES(e,t){e=e|0;t=t|0;return+Dx[e&15](t|0)}function TS(e,t,n){e=e|0;t=t|0;n=+n;return wx[e&1](t|0,+n)|0}function CS(e,t,n){e=e|0;t=t|0;n=n|0;return Ex[e&15](t|0,n|0)|0}function kS(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=+r;i=+i;u=u|0;Tx[e&1](t|0,n|0,+r,+i,u|0)}function MS(e,t,n,r,i,u,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;o=o|0;Cx[e&1](t|0,n|0,r|0,i|0,u|0,o|0)}function SS(e,t,n){e=e|0;t=t|0;n=n|0;return+kx[e&7](t|0,n|0)}function xS(e){e=e|0;return Mx[e&7]()|0}function OS(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;return Sx[e&1](t|0,n|0,r|0,i|0,u|0)|0}function AS(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=+i;xx[e&1](t|0,n|0,r|0,+i)}function PS(e,t,n,r,i,u,o){e=e|0;t=t|0;n=n|0;r=$(r);i=i|0;u=$(u);o=o|0;Ox[e&1](t|0,n|0,$(r),i|0,$(u),o|0)}function RS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;Ax[e&15](t|0,n|0,r|0)}function IS(e){e=e|0;Px[e&0]()}function NS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;Rx[e&15](t|0,n|0,+r)}function FS(e,t,n){e=e|0;t=+t;n=+n;return Ix[e&1](+t,+n)|0}function LS(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;Nx[e&15](t|0,n|0,r|0,i|0)}function BS(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;K(0)}function jS(e,t){e=e|0;t=$(t);K(1)}function US(e,t){e=e|0;t=+t;K(2)}function WS(e,t,n){e=e|0;t=$(t);n=$(n);K(3);return ft}function zS(e){e=e|0;K(4)}function qS(e,t){e=e|0;t=t|0;K(5)}function HS(e){e=e|0;K(6);return 0}function GS(e,t,n,r){e=e|0;t=+t;n=+n;r=r|0;K(7)}function VS(e,t,n){e=e|0;t=+t;n=+n;K(8)}function YS(e,t,n){e=e|0;t=t|0;n=n|0;K(9);return 0}function $S(e,t,n){e=e|0;t=t|0;n=n|0;K(10);return 0.0}function KS(e){e=e|0;K(11);return 0.0}function XS(e,t){e=e|0;t=+t;K(12);return 0}function JS(e,t){e=e|0;t=t|0;K(13);return 0}function QS(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;K(14)}function ZS(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;K(15)}function ex(e,t){e=e|0;t=t|0;K(16);return 0.0}function tx(){K(17);return 0}function nx(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;K(18);return 0}function rx(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;K(19)}function ix(e,t,n,r,i,u){e=e|0;t=t|0;n=$(n);r=r|0;i=$(i);u=u|0;K(20)}function ux(e,t,n){e=e|0;t=t|0;n=n|0;K(21)}function ox(){K(22)}function ax(e,t,n){e=e|0;t=t|0;n=+n;K(23)}function lx(e,t){e=+e;t=+t;K(24);return 0}function sx(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;K(25)}var cx=[BS,Ew];var fx=[jS,Gi];var dx=[US,bu,gu,yu,_u,Du,wu,Eu,Cu,ku,Su,xu,Ou,Au,Pu,Ru,Iu,Nu,Fu,US,US,US,US,US,US,US,US,US,US,US,US,US];var px=[WS];var hx=[zS,WM,hl,ml,vl,Kd,Xd,Jd,g_,y_,__,uw,ow,aw,ok,ak,lk,_t,Xi,tu,Tu,Mu,jo,Uo,Ka,Tl,zl,ps,Rs,rc,kc,Gc,df,If,Zf,gd,Ld,bp,Fp,th,_h,jh,im,km,Hm,av,Sv,zi,cb,xb,Jb,gg,Fg,uy,by,_y,Uy,qy,a_,E_,k_,V_,pD,Cl,OE,pT,AT,KT,_C,BC,XC,ZC,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS,zS];var mx=[qS,nu,ru,ou,au,lu,su,cu,fu,hu,mu,vu,Zu,no,ro,io,uo,oo,ao,po,bo,Ko,Om,Ym,wg,RE,DD,eT,qS,qS,qS,qS];var vx=[HS,$k,Ki,Uu,Hu,Gu,Vu,Yu,$u,Ku,Ju,Qu,ho,mo,Wo,Av,Ug,K_,BE,UE,HS,HS,HS,HS,HS,HS,HS,HS,HS,HS,HS,HS];var bx=[GS,zo];var gx=[VS,c_];var yx=[YS,Kk,Xk,nM,ac,Dp,hb,ZT];var _x=[$S,rd];var Dx=[KS,eo,to,lo,qo,Ho,Go,Vo,Yo,$o,KS,KS,KS,KS,KS,KS];var wx=[XS,py];var Ex=[JS,zM,vo,tl,bs,Oc,Kc,Wd,Up,fv,Vi,NT,JS,JS,JS,JS];var Tx=[QS,Vl];var Cx=[ZS,TC];var kx=[ex,so,Xo,Jo,Qo,wd,ex,ex];var Mx=[tx,Zo,Yi,Ui,Cy,Yy,A_,rk];var Sx=[nx,Fr];var xx=[rx,Th];var Ox=[ix,yo];var Ax=[ux,Wu,Xu,co,fo,Ls,vf,qh,lm,Hi,Qw,bT,zC,ux,ux,ux];var Px=[ox];var Rx=[ax,iu,uu,du,pu,Lu,Bu,ju,uh,Rb,ly,ax,ax,ax,ax,ax];var Ix=[lx,m_];var Nx=[sx,Bf,jv,tg,Kg,Ay,Zy,B_,gD,GE,hk,sx,sx,sx,sx,sx];return{_llvm_bswap_i32:fS,dynCall_idd:FS,dynCall_i:xS,_i64Subtract:ZM,___udivdi3:aS,dynCall_vif:pS,setThrew:vt,dynCall_viii:RS,_bitshift64Lshr:rS,_bitshift64Shl:nS,dynCall_vi:vS,dynCall_viiddi:kS,dynCall_diii:wS,dynCall_iii:CS,_memset:tS,_sbrk:lS,_memcpy:iS,__GLOBAL__sub_I_Yoga_cpp:ji,dynCall_vii:bS,___uremdi3:cS,dynCall_vid:hS,stackAlloc:dt,_nbind_init:xk,getTempRet0:gt,dynCall_di:ES,dynCall_iid:TS,setTempRet0:bt,_i64Add:eS,dynCall_fiff:mS,dynCall_iiii:DS,_emscripten_get_global_libc:Yk,dynCall_viid:NS,dynCall_viiid:AS,dynCall_viififi:PS,dynCall_ii:gS,__GLOBAL__sub_I_Binding_cc:DE,dynCall_viiii:LS,dynCall_iiiiii:OS,stackSave:pt,dynCall_viiiii:dS,__GLOBAL__sub_I_nbind_cc:ea,dynCall_vidd:_S,_free:Vk,runPostSets:QM,dynCall_viiiiii:MS,establishStackSpace:mt,_memmove:sS,stackRestore:ht,_malloc:Gk,__GLOBAL__sub_I_common_cc:iD,dynCall_viddi:yS,dynCall_dii:SS,dynCall_v:IS}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,getTempRet0=Module.getTempRet0=asm.getTempRet0,___udivdi3=Module.___udivdi3=asm.___udivdi3,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,_memset=Module._memset=asm._memset,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,___uremdi3=Module.___uremdi3=asm.___uremdi3,_nbind_init=Module._nbind_init=asm._nbind_init,_i64Subtract=Module._i64Subtract=asm._i64Subtract,setTempRet0=Module.setTempRet0=asm.setTempRet0,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,__GLOBAL__sub_I_Yoga_cpp=Module.__GLOBAL__sub_I_Yoga_cpp=asm.__GLOBAL__sub_I_Yoga_cpp,__GLOBAL__sub_I_Binding_cc=Module.__GLOBAL__sub_I_Binding_cc=asm.__GLOBAL__sub_I_Binding_cc,stackSave=Module.stackSave=asm.stackSave,__GLOBAL__sub_I_nbind_cc=Module.__GLOBAL__sub_I_nbind_cc=asm.__GLOBAL__sub_I_nbind_cc,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,_memmove=Module._memmove=asm._memmove,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,__GLOBAL__sub_I_common_cc=Module.__GLOBAL__sub_I_common_cc=asm.__GLOBAL__sub_I_common_cc,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vif=Module.dynCall_vif=asm.dynCall_vif,dynCall_vid=Module.dynCall_vid=asm.dynCall_vid,dynCall_fiff=Module.dynCall_fiff=asm.dynCall_fiff,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_vii=Module.dynCall_vii=asm.dynCall_vii,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viddi=Module.dynCall_viddi=asm.dynCall_viddi,dynCall_vidd=Module.dynCall_vidd=asm.dynCall_vidd,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_diii=Module.dynCall_diii=asm.dynCall_diii,dynCall_di=Module.dynCall_di=asm.dynCall_di,dynCall_iid=Module.dynCall_iid=asm.dynCall_iid,dynCall_iii=Module.dynCall_iii=asm.dynCall_iii,dynCall_viiddi=Module.dynCall_viiddi=asm.dynCall_viiddi,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_dii=Module.dynCall_dii=asm.dynCall_dii,dynCall_i=Module.dynCall_i=asm.dynCall_i,dynCall_iiiiii=Module.dynCall_iiiiii=asm.dynCall_iiiiii,dynCall_viiid=Module.dynCall_viiid=asm.dynCall_viiid,dynCall_viififi=Module.dynCall_viififi=asm.dynCall_viififi,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viid=Module.dynCall_viid=asm.dynCall_viid,dynCall_idd=Module.dynCall_idd=asm.dynCall_idd,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii,initialStackTop;function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var preloadStartTime=null,calledMain=!1;function run(e){function t(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module.setStatus("")}),1),t()}),1)):t()))}function exit(e,t){t&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE&&process.exit(e),Module.quit(e,new ExitStatus(e)))}dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){e=e||[],ensureInitRuntime();var t=e.length+1;function n(){for(var e=0;e<3;e++)r.push(0)}var r=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];n();for(var i=0;i0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()},void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){return wrapper}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__=[]))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(79)),i=u(n(23));function u(e){return e&&e.__esModule?e:{default:e}}t.default=class{constructor({width:e,height:t}){const n=[];for(let r=0;re.trimRight()).join("\n")}}},function(e,t,n){"use strict";const r=n(22),i=n(81);e.exports=e=>r(e).replace(i()," ").length},function(e,t,n){"use strict";e.exports=()=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");return new RegExp(e,"g")}},function(e,t,n){"use strict";const r="[\ud800-\udbff][\udc00-\udfff]";e.exports=e=>e&&e.exact?new RegExp(`^${r}$`):new RegExp(r,"g")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(13)),i=o(n(83)),u=o(n(24));function o(e){return e&&e.__esModule?e:{default:e}}const a=(e,t)=>{const{config:n,terminalWidth:o,skipStaticElements:l}=t,s=r.default.Node.create(n);e.yogaNode=s;const c=e.style||{};if("ROOT"===e.nodeName){if(s.setWidth(o||100),e.childNodes.length>0){const n=e.childNodes.filter(e=>!l||!e.unstable__static);for(const[e,r]of Object.entries(n)){const n=a(r,t).yogaNode;s.insertChild(n,e)}}return e}if((0,i.default)(s,c),e.textContent||e.nodeValue){const{width:t,height:n}=(0,u.default)(e.textContent||e.nodeValue);return s.setWidth(c.width||t),s.setHeight(c.height||n),e}if(Array.isArray(e.childNodes)&&e.childNodes.length>0){const n=e.childNodes.filter(e=>!l||!e.unstable__static);for(const[e,r]of Object.entries(n)){const{yogaNode:n}=a(r,t);s.insertChild(n,e)}}return e};var l=a;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(13))&&r.__esModule?r:{default:r};const u=(e,t)=>({}).hasOwnProperty.call(e,t);t.default=(e,t={})=>{((e,t)=>{t.margin&&(e.setMargin(i.default.EDGE_TOP,t.margin),e.setMargin(i.default.EDGE_BOTTOM,t.margin),e.setMargin(i.default.EDGE_START,t.margin),e.setMargin(i.default.EDGE_END,t.margin)),t.marginX&&(e.setMargin(i.default.EDGE_START,t.marginX),e.setMargin(i.default.EDGE_END,t.marginX)),t.marginY&&(e.setMargin(i.default.EDGE_TOP,t.marginY),e.setMargin(i.default.EDGE_BOTTOM,t.marginY)),t.marginTop&&e.setMargin(i.default.EDGE_TOP,t.marginTop),t.marginBottom&&e.setMargin(i.default.EDGE_BOTTOM,t.marginBottom),t.marginLeft&&e.setMargin(i.default.EDGE_START,t.marginLeft),t.marginRight&&e.setMargin(i.default.EDGE_END,t.marginRight)})(e,t),((e,t)=>{t.padding&&(e.setPadding(i.default.EDGE_TOP,t.padding),e.setPadding(i.default.EDGE_BOTTOM,t.padding),e.setPadding(i.default.EDGE_LEFT,t.padding),e.setPadding(i.default.EDGE_RIGHT,t.padding)),t.paddingX&&(e.setPadding(i.default.EDGE_LEFT,t.paddingX),e.setPadding(i.default.EDGE_RIGHT,t.paddingX)),t.paddingY&&(e.setPadding(i.default.EDGE_TOP,t.paddingY),e.setPadding(i.default.EDGE_BOTTOM,t.paddingY)),t.paddingTop&&e.setPadding(i.default.EDGE_TOP,t.paddingTop),t.paddingBottom&&e.setPadding(i.default.EDGE_BOTTOM,t.paddingBottom),t.paddingLeft&&e.setPadding(i.default.EDGE_LEFT,t.paddingLeft),t.paddingRight&&e.setPadding(i.default.EDGE_RIGHT,t.paddingRight)})(e,t),((e,t)=>{t.flexGrow&&e.setFlexGrow(t.flexGrow),t.flexShrink&&e.setFlexShrink(t.flexShrink),t.flexDirection&&("row"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_ROW),"row-reverse"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_ROW_REVERSE),"column"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_COLUMN),"column-reverse"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_COLUMN_REVERSE)),u(t,"flexBasis")&&e.setFlexBasis(t.flexBasis),t.alignItems&&("flex-start"===t.alignItems&&e.setAlignItems(i.default.ALIGN_FLEX_START),"center"===t.alignItems&&e.setAlignItems(i.default.ALIGN_CENTER),"flex-end"===t.alignItems&&e.setAlignItems(i.default.ALIGN_FLEX_END)),t.justifyContent&&("flex-start"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_FLEX_START),"center"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_CENTER),"flex-end"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_FLEX_END),"space-between"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_SPACE_BETWEEN),"space-around"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_SPACE_AROUND))})(e,t),((e,t)=>{u(t,"width")&&e.setWidth(t.width),u(t,"height")&&e.setHeight(t.height),u(t,"minWidth")&&e.setMinWidth(t.minWidth),u(t,"minHeight")&&e.setMinHeight(t.minHeight)})(e,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(25)),i=o(n(27)),u=o(n(28));function o(e){return e&&e.__esModule?e:{default:e}}const a=e=>{if("#text"===e.nodeName)return!0;if("SPAN"===e.nodeName){if(e.textContent)return!0;if(Array.isArray(e.childNodes))return e.childNodes.every(a)}return!1},l=e=>{let t="";for(const n of e.childNodes){let e;"#text"===n.nodeName&&(e=n.nodeValue),"SPAN"===n.nodeName&&(e=n.textContent||l(n)),n.unstable__transformChildren&&(e=n.unstable__transformChildren(e)),t+=e}return t},s=(e,t,{offsetX:n=0,offsetY:o=0,transformers:c=[],skipStaticElements:f})=>{if(e.unstable__static&&f)return;const{yogaNode:d}=e,p=n+d.getComputedLeft(),h=o+d.getComputedTop();let m=c;if(e.unstable__transformChildren&&(m=[e.unstable__transformChildren,...c]),e.textContent){let n=e.textContent;if(e.parentNode.style.textWrap){const t=(0,r.default)(n),o=(0,u.default)(e.parentNode.yogaNode);t>o&&(n=(0,i.default)(n,o,{textWrap:e.parentNode.style.textWrap}))}t.write(p,h,n,{transformers:m})}else if("#text"!==e.nodeName){if(Array.isArray(e.childNodes)&&e.childNodes.length>0){if("row"===e.style.flexDirection&&e.childNodes.every(a)){let n=l(e);if(e.style.textWrap){const t=(0,r.default)(n),o=(0,u.default)(d);t>o&&(n=(0,i.default)(n,o,{textWrap:e.style.textWrap}))}return void t.write(p,h,n,{transformers:m})}for(const n of e.childNodes)s(n,t,{offsetX:p,offsetY:h,transformers:m,skipStaticElements:f})}}else t.write(p,h,e.nodeValue,{transformers:m})};var c=s;t.default=c},function(e,t,n){"use strict";const r=n(23),i=n(26);e.exports=(e,t,n)=>{const u=(n=Object.assign({position:"end"},n)).position;if("string"!=typeof e)throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if("number"!=typeof t)throw new TypeError(`Expected \`columns\` to be a number, got ${typeof t}`);if(t<1)return"";if(1===t)return"…";const o=i(e);if(o<=t)return e;if("start"===u)return"…"+r(e,o-t+1,o);if("middle"===u){const n=Math.floor(t/2);return r(e,0,n)+"…"+r(e,o-(t-n)+1,o)}if("end"===u)return r(e,0,t-1)+"…";throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${u}`)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(87)),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(0)),u=c(n(7)),o=c(n(15)),a=c(n(30)),l=c(n(31)),s=c(n(32));function c(e){return e&&e.__esModule?e:{default:e}}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class d extends i.PureComponent{isRawModeSupported(){return this.props.stdin.isTTY}constructor(){super(),f(this,"handleSetRawMode",e=>{const{stdin:t}=this.props;if(!this.isRawModeSupported())throw t===process.stdin?new Error("Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported"):new Error("Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported");if(t.setEncoding("utf8"),e)return 0===this.rawModeEnabledCount&&(t.addListener("data",this.handleInput),t.resume(),t.setRawMode(!0),r.default.emitKeypressEvents(t)),void this.rawModeEnabledCount++;0==--this.rawModeEnabledCount&&(t.setRawMode(!1),t.removeListener("data",this.handleInput),t.pause())}),f(this,"handleInput",e=>{""===e&&this.props.exitOnCtrlC&&this.handleExit()}),f(this,"handleExit",e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)}),this.rawModeEnabledCount=0}render(){return i.default.createElement(a.default.Provider,{value:{exit:this.handleExit}},i.default.createElement(l.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported()}},i.default.createElement(s.default.Provider,{value:{stdout:this.props.stdout}},this.props.children)))}componentDidMount(){o.default.hide(this.props.stdout)}componentWillUnmount(){o.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(e){this.handleExit(e)}}t.default=d,f(d,"propTypes",{children:u.default.node.isRequired,stdin:u.default.object.isRequired,stdout:u.default.object.isRequired,exitOnCtrlC:u.default.bool.isRequired,onExit:u.default.func.isRequired})},function(e,t){e.exports=require("readline")},function(e,t,n){"use strict";var r=n(89);function i(){}e.exports=function(){function e(e,t,n,i,u,o){if(o!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=i,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(0)),u=(r=n(7))&&r.__esModule?r:{default:r};function o(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},u=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class l extends i.PureComponent{constructor(){super(),this.nodeRef=i.default.createRef()}render(){const e=this.props,{children:t,unstable__transformChildren:n}=e,r=o(e,["children","unstable__transformChildren"]);return i.default.createElement("div",{ref:this.nodeRef,style:r,unstable__transformChildren:n},t)}unstable__getComputedWidth(){return this.nodeRef.current.yogaNode.getComputedWidth()}}t.default=l,a(l,"propTypes",{margin:u.default.number,marginX:u.default.number,marginY:u.default.number,marginTop:u.default.number,marginBottom:u.default.number,marginLeft:u.default.number,marginRight:u.default.number,padding:u.default.number,paddingX:u.default.number,paddingY:u.default.number,paddingTop:u.default.number,paddingBottom:u.default.number,paddingLeft:u.default.number,paddingRight:u.default.number,width:u.default.oneOfType([u.default.number,u.default.string]),minWidth:u.default.number,height:u.default.oneOfType([u.default.number,u.default.string]),minHeight:u.default.number,flexGrow:u.default.number,flexShrink:u.default.number,flexDirection:u.default.oneOf(["row","row-reverse","column","column-reverse"]),flexBasis:u.default.oneOfType([u.default.number,u.default.string]),alignItems:u.default.oneOf(["flex-start","center","flex-end"]),justifyContent:u.default.oneOf(["flex-start","center","flex-end","space-between","space-around"]),textWrap:u.default.oneOf(["wrap","truncate","truncate-start","truncate-middle","truncate-end"]),unstable__transformChildren:u.default.func,children:u.default.node}),a(l,"defaultProps",{flexDirection:"row",flexGrow:0,flexShrink:1})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(0)),i=o(n(7)),u=o(n(33));function o(e){return e&&e.__esModule?e:{default:e}}const a=({bold:e,italic:t,underline:n,strikethrough:i,children:o,unstable__transformChildren:a})=>{return r.default.createElement("span",{style:{flexDirection:"row"},unstable__transformChildren:r=>(e&&(r=u.default.bold(r)),t&&(r=u.default.italic(r)),n&&(r=u.default.underline(r)),i&&(r=u.default.strikethrough(r)),a&&(r=a(r)),r)},o)};a.propTypes={bold:i.default.bool,italic:i.default.bool,underline:i.default.bool,strikethrough:i.default.bool,children:i.default.node.isRequired,unstable__transformChildren:i.default.func},a.defaultProps={bold:!1,italic:!1,underline:!1,strikethrough:!1,unstable__transformChildren:void 0};var l=a;t.default=l},function(e,t,n){"use strict";var r=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(r,"\\$&")}},function(e,t,n){"use strict";const r=n(34),i=n(94),u=process.env;let o;function a(e){return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(function(e){if(!1===o)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(e&&!e.isTTY&&!0!==o)return 0;const t=o?1:0;if("win32"===process.platform){const e=r.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in u)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in u)||"codeship"===u.CI_NAME?1:t;if("TEAMCITY_VERSION"in u)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0;if("truecolor"===u.COLORTERM)return 3;if("TERM_PROGRAM"in u){const e=parseInt((u.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(u.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(u.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(u.TERM)?1:"COLORTERM"in u?1:(u.TERM,t)}(e))}i("no-color")||i("no-colors")||i("color=false")?o=!1:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(o=!0),"FORCE_COLOR"in u&&(o=0===u.FORCE_COLOR.length||0!==parseInt(u.FORCE_COLOR,10)),e.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},function(e,t,n){"use strict";e.exports=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return-1!==r&&(-1===i||rt?l(t):n))}else n.push(Number(t));return n}function c(e){i.lastIndex=0;const t=[];let n;for(;null!==(n=i.exec(e));){const e=n[1];if(n[2]){const r=s(e,n[2]);t.push([e].concat(r))}else t.push([e])}return t}function f(e,t){const n={};for(const e of t)for(const t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(const e of Object.keys(n))if(Array.isArray(n[e])){if(!(e in r))throw new Error(`Unknown Chalk style: ${e}`);r=n[e].length>0?r[e].apply(r,n[e]):r[e]}return r}e.exports=(e,t)=>{const n=[],i=[];let u=[];if(t.replace(r,(t,r,o,a,s,d)=>{if(r)u.push(l(r));else if(a){const t=u.join("");u=[],i.push(0===n.length?t:f(e,n)(t)),n.push({inverse:o,styles:c(a)})}else if(s){if(0===n.length)throw new Error("Found extraneous } in Chalk template literal");i.push(f(e,n)(u.join(""))),u=[],n.pop()}else u.push(d)}),i.push(u.join("")),n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${1===n.length?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(0)),i=a(n(7)),u=a(n(97)),o=a(n(33));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},u=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const s=["hex","hsl","hsv","hwb","rgb","keyword","bgHex","bgHsl","bgHsv","bgHwb","bgRgb","bgKeyword"],c=e=>{let{children:t}=e,n=l(e,["children"]);return r.default.createElement("span",{style:{flexDirection:"row"},unstable__transformChildren:e=>(Object.keys(n).forEach(t=>{n[t]&&(s.includes(t)?e=o.default[t](...(0,u.default)(n[t]))(e):"function"==typeof o.default[t]&&(e=o.default[t](e)))}),e)},t)};c.propTypes={children:i.default.node.isRequired};var f=c;t.default=f},function(e,t,n){"use strict";e.exports=function(e){return null==e?[]:Array.isArray(e)?e:[e]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n(0)),u=(r=n(7))&&r.__esModule?r:{default:r};function o(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},u=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const l=e=>Array.isArray(e)?e:[e];class s extends i.Component{constructor(...e){super(...e),a(this,"state",{lastIndex:null})}render(){const e=this.props,{children:t}=e,n=o(e,["children"]),{lastIndex:r}=this.state;let u=t;return"number"==typeof r&&(u=l(t).slice(r)),i.default.createElement("div",{unstable__static:!0,style:n},u)}componentDidMount(){this.saveLastIndex(this.props.children)}componentDidUpdate(e,t){t.lastIndex===this.state.lastIndex&&this.saveLastIndex(this.props.children)}saveLastIndex(e){const t=l(e).length;this.state.lastIndex!==t&&this.setState({lastIndex:t})}}t.default=s,a(s,"propTypes",{children:u.default.node})},function(e,t,n){"use strict";const r=n(100),{stdout:i,stderr:u}=n(104),{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:a}=n(107),l=["ansi","ansi","ansi256","ansi16m"],s=Object.create(null);class c{constructor(e){return f(e)}}const f=e=>{const t={};return((e,t={})=>{if(t.level>3||t.level<0)throw new Error("The `level` option should be an integer from 0 to 3");const n=i?i.level:0;e.level=void 0===t.level?n:t.level})(t,e),t.template=(...e)=>y(t.template,...e),Object.setPrototypeOf(t,d.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=c,t.template};function d(e){return f(e)}for(const[e,t]of Object.entries(r))s[e]={get(){const n=v(this,m(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};s.visible={get(){const e=v(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const p=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of p)s[e]={get(){const{level:t}=this;return function(...n){const i=m(r.color[l[t]][e](...n),r.color.close,this._styler);return v(this,i,this._isEmpty)}}};for(const e of p){s["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...n){const i=m(r.bgColor[l[t]][e](...n),r.bgColor.close,this._styler);return v(this,i,this._isEmpty)}}}}const h=Object.defineProperties(()=>{},{...s,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),m=(e,t,n)=>{let r,i;return void 0===n?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},v=(e,t,n)=>{const r=(...e)=>b(r,1===e.length?""+e[0]:e.join(" "));return r.__proto__=h,r._generator=e,r._styler=t,r._isEmpty=n,r},b=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(void 0===n)return t;const{openAll:r,closeAll:i}=n;if(-1!==t.indexOf(""))for(;void 0!==n;)t=o(t,n.close,n.open),n=n.parent;const u=t.indexOf("\n");return-1!==u&&(t=a(t,i,r,u)),r+t+i};let g;const y=(e,...t)=>{const[r]=t;if(!Array.isArray(r))return t.join(" ");const i=t.slice(1),u=[r.raw[0]];for(let e=1;e(...n)=>{return`[${e(...n)+t}m`},r=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};5;${r}m`},i=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`},u=e=>e,o=(e,t,n)=>[e,t,n],a=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})};let l;const s=(e,t,r,i)=>{void 0===l&&(l=n(101));const u=i?10:0,o={};for(const[n,i]of Object.entries(l)){const a="ansi16"===n?"ansi":n;n===t?o[a]=e(r,u):"object"==typeof i&&(o[a]=e(i[t],u))}return o};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,n={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};n.color.gray=n.color.blackBright,n.bgColor.bgGray=n.bgColor.bgBlackBright,n.color.grey=n.color.blackBright,n.bgColor.bgGrey=n.bgColor.bgBlackBright;for(const[t,r]of Object.entries(n)){for(const[t,i]of Object.entries(r))n[t]={open:`[${i[0]}m`,close:`[${i[1]}m`},r[t]=n[t],e.set(i[0],i[1]);Object.defineProperty(n,t,{value:r,enumerable:!1})}return Object.defineProperty(n,"codes",{value:e,enumerable:!1}),n.color.close="",n.bgColor.close="",a(n.color,"ansi",()=>s(t,"ansi16",u,!1)),a(n.color,"ansi256",()=>s(r,"ansi256",u,!1)),a(n.color,"ansi16m",()=>s(i,"rgb",o,!1)),a(n.bgColor,"ansi",()=>s(t,"ansi16",u,!0)),a(n.bgColor,"ansi256",()=>s(r,"ansi256",u,!0)),a(n.bgColor,"ansi16m",()=>s(i,"rgb",o,!0)),n}})}).call(this,n(20)(e))},function(e,t,n){const r=n(35),i=n(103),u={};Object.keys(r).forEach(e=>{u[e]={},Object.defineProperty(u[e],"channels",{value:r[e].channels}),Object.defineProperty(u[e],"labels",{value:r[e].labels});const t=i(e);Object.keys(t).forEach(n=>{const r=t[n];u[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)})}),e.exports=u},function(e,t,n){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(e,t,n){const r=n(35);function i(e){const t=function(){const e={},t=Object.keys(r);for(let n=t.length,r=0;r=2,has16m:e>=3}}function s(e,t){if(0===a)return 0;if(u("color=16m")||u("color=full")||u("color=truecolor"))return 3;if(u("color=256"))return 2;if(e&&!t&&void 0===a)return 0;const n=a||0;if("dumb"===o.TERM)return n;if("win32"===process.platform){const e=r.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in o)||"codeship"===o.CI_NAME?1:n;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("GITHUB_ACTIONS"in o)return 1;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)?1:"COLORTERM"in o?1:n}u("no-color")||u("no-colors")||u("color=false")||u("color=never")?a=0:(u("color")||u("colors")||u("color=true")||u("color=always"))&&(a=1),"FORCE_COLOR"in o&&(a="true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(parseInt(o.FORCE_COLOR,10),3)),e.exports={supportsColor:function(e){return l(s(e,e&&e.isTTY))},stdout:l(s(!0,i.isatty(1))),stderr:l(s(!0,i.isatty(2)))}},function(e,t){e.exports=require("tty")},function(e,t,n){"use strict";e.exports=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return-1!==r&&(-1===i||r{let r=e.indexOf(t);if(-1===r)return e;const i=t.length;let u=0,o="";do{o+=e.substr(u,r-u)+t+n,u=r+i,r=e.indexOf(t,u)}while(-1!==r);return o+=e.substr(u)},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,u="";do{const o="\r"===e[r-1];u+=e.substr(i,(o?r-1:r)-i)+t+(o?"\r\n":"\n")+n,i=r+1,r=e.indexOf("\n",i)}while(-1!==r);return u+=e.substr(i)}}},function(e,t,n){"use strict";const r=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,i=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,u=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,o=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,a=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function l(e){const t="u"===e[0],n="{"===e[1];return t&&!n&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):a.get(e)||e}function s(e,t){const n=[],r=t.trim().split(/\s*,\s*/g);let i;for(const t of r){const r=Number(t);if(Number.isNaN(r)){if(!(i=t.match(u)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);n.push(i[2].replace(o,(e,t,n)=>t?l(t):n))}else n.push(r)}return n}function c(e){i.lastIndex=0;const t=[];let n;for(;null!==(n=i.exec(e));){const e=n[1];if(n[2]){const r=s(e,n[2]);t.push([e].concat(r))}else t.push([e])}return t}function f(e,t){const n={};for(const e of t)for(const t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(const[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw new Error(`Unknown Chalk style: ${e}`);r=t.length>0?r[e](...t):r[e]}return r}e.exports=(e,t)=>{const n=[],i=[];let u=[];if(t.replace(r,(t,r,o,a,s,d)=>{if(r)u.push(l(r));else if(a){const t=u.join("");u=[],i.push(0===n.length?t:f(e,n)(t)),n.push({inverse:o,styles:c(a)})}else if(s){if(0===n.length)throw new Error("Found extraneous } in Chalk template literal");i.push(f(e,n)(u.join(""))),u=[],n.pop()}else u.push(d)}),i.push(u.join("")),n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${1===n.length?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")}},function(e,t,n){"use strict";var r=n(110),i=n(111),u=n(112),o=n(2),a=n(113),l=n(114),s=n(115),c=n(116),f=n(4);function d(e,t,n){const d={appId:e,apiKey:t,timeouts:{connect:2,read:5,write:30},requester:c.createNodeHttpRequester(),logger:s.createNullLogger(),responsesCache:r.createNullCache(),requestsCache:r.createNullCache(),hostsCache:i.createInMemoryCache(),userAgent:f.createUserAgent(o.version).add({segment:"Node.js",version:process.versions.node})};return l.createSearchClient({...d,...n,methods:{search:l.multipleQueries,searchForFacetValues:l.multipleSearchForFacetValues,multipleBatch:l.multipleBatch,multipleGetObjects:l.multipleGetObjects,multipleQueries:l.multipleQueries,copyIndex:l.copyIndex,copySettings:l.copySettings,copyRules:l.copyRules,copySynonyms:l.copySynonyms,moveIndex:l.moveIndex,listIndices:l.listIndices,getLogs:l.getLogs,listClusters:l.listClusters,multipleSearchForFacetValues:l.multipleSearchForFacetValues,getApiKey:l.getApiKey,addApiKey:l.addApiKey,listApiKeys:l.listApiKeys,updateApiKey:l.updateApiKey,deleteApiKey:l.deleteApiKey,restoreApiKey:l.restoreApiKey,assignUserID:l.assignUserID,assignUserIDs:l.assignUserIDs,getUserID:l.getUserID,searchUserIDs:l.searchUserIDs,listUserIDs:l.listUserIDs,getTopUserIDs:l.getTopUserIDs,removeUserID:l.removeUserID,hasPendingMappings:l.hasPendingMappings,generateSecuredApiKey:l.generateSecuredApiKey,getSecuredApiKeyRemainingValidity:l.getSecuredApiKeyRemainingValidity,destroy:o.destroy,initIndex:e=>t=>l.initIndex(e)(t,{methods:{batch:l.batch,delete:l.deleteIndex,getObject:l.getObject,getObjects:l.getObjects,saveObject:l.saveObject,saveObjects:l.saveObjects,search:l.search,searchForFacetValues:l.searchForFacetValues,waitTask:l.waitTask,setSettings:l.setSettings,getSettings:l.getSettings,partialUpdateObject:l.partialUpdateObject,partialUpdateObjects:l.partialUpdateObjects,deleteObject:l.deleteObject,deleteObjects:l.deleteObjects,deleteBy:l.deleteBy,clearObjects:l.clearObjects,browseObjects:l.browseObjects,getObjectPosition:l.getObjectPosition,findObject:l.findObject,exists:l.exists,saveSynonym:l.saveSynonym,saveSynonyms:l.saveSynonyms,getSynonym:l.getSynonym,searchSynonyms:l.searchSynonyms,browseSynonyms:l.browseSynonyms,deleteSynonym:l.deleteSynonym,clearSynonyms:l.clearSynonyms,replaceAllObjects:l.replaceAllObjects,replaceAllSynonyms:l.replaceAllSynonyms,searchRules:l.searchRules,getRule:l.getRule,deleteRule:l.deleteRule,saveRule:l.saveRule,saveRules:l.saveRules,replaceAllRules:l.replaceAllRules,browseRules:l.browseRules,clearRules:l.clearRules}}),initAnalytics:()=>e=>u.createAnalyticsClient({...d,...e,methods:{addABTest:u.addABTest,getABTest:u.getABTest,getABTests:u.getABTests,stopABTest:u.stopABTest,deleteABTest:u.deleteABTest}}),initRecommendation:()=>e=>a.createRecommendationClient({...d,...e,methods:{getPersonalizationStrategy:a.getPersonalizationStrategy,setPersonalizationStrategy:a.setPersonalizationStrategy}})}})}d.version=o.version,e.exports=d},function(e,t,n){"use strict";function r(e){const t=[...e.caches],n=t.shift();return void 0===n?i():{get:(e,i,u={miss:()=>Promise.resolve()})=>n.get(e,i,u).catch(()=>r({caches:t}).get(e,i,u)),set:(e,i)=>n.set(e,i).catch(()=>r({caches:t}).set(e,i)),delete:e=>n.delete(e).catch(()=>r({caches:t}).delete(e)),clear:()=>n.clear().catch(()=>r({caches:t}).clear())}}function i(){return{get:(e,t,n={miss:()=>Promise.resolve()})=>t().then(e=>Promise.all([e,n.miss(e)])).then(([e])=>e),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}}n.r(t),n.d(t,"createFallbackableCache",(function(){return r})),n.d(t,"createNullCache",(function(){return i}))},function(e,t,n){"use strict";function r(e={serializable:!0}){let t={};return{get(n,r,i={miss:()=>Promise.resolve()}){const u=JSON.stringify(n);if(u in t)return Promise.resolve(e.serializable?JSON.parse(t[u]):t[u]);const o=r(),a=i&&i.miss||(()=>Promise.resolve());return o.then(e=>a(e)).then(()=>o)},set:(n,r)=>(t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}n.r(t),n.d(t,"createInMemoryCache",(function(){return r}))},function(e,t,n){"use strict";n.r(t),n.d(t,"addABTest",(function(){return a})),n.d(t,"createAnalyticsClient",(function(){return o})),n.d(t,"deleteABTest",(function(){return l})),n.d(t,"getABTest",(function(){return s})),n.d(t,"getABTests",(function(){return c})),n.d(t,"stopABTest",(function(){return f}));var r=n(2),i=n(4),u=n(3);const o=e=>{const t=e.region||"us",n=Object(r.createAuth)(r.AuthMode.WithinHeaders,e.appId,e.apiKey),u=Object(i.createTransporter)({hosts:[{url:`analytics.${t}.algolia.com`}],...e,headers:{...n.headers(),"content-type":"application/json",...e.headers},queryParameters:{...n.queryParameters(),...e.queryParameters}}),o=e.appId;return Object(r.addMethods)({appId:o,transporter:u},e.methods)},a=e=>(t,n)=>e.transporter.write({method:u.a.Post,path:"2/abtests",data:t},n),l=e=>(t,n)=>e.transporter.write({method:u.a.Delete,path:Object(r.encode)("2/abtests/%s",t)},n),s=e=>(t,n)=>e.transporter.read({method:u.a.Get,path:Object(r.encode)("2/abtests/%s",t)},n),c=e=>t=>e.transporter.read({method:u.a.Get,path:"2/abtests"},t),f=e=>(t,n)=>e.transporter.write({method:u.a.Post,path:Object(r.encode)("2/abtests/%s/stop",t)},n)},function(e,t,n){"use strict";n.r(t),n.d(t,"createRecommendationClient",(function(){return o})),n.d(t,"getPersonalizationStrategy",(function(){return a})),n.d(t,"setPersonalizationStrategy",(function(){return l}));var r=n(2),i=n(4),u=n(3);const o=e=>{const t=e.region||"us",n=Object(r.createAuth)(r.AuthMode.WithinHeaders,e.appId,e.apiKey),u=Object(i.createTransporter)({hosts:[{url:`recommendation.${t}.algolia.com`}],...e,headers:{...n.headers(),"content-type":"application/json",...e.headers},queryParameters:{...n.queryParameters(),...e.queryParameters}});return Object(r.addMethods)({appId:e.appId,transporter:u},e.methods)},a=e=>t=>e.transporter.read({method:u.a.Get,path:"1/strategies/personalization"},t),l=e=>(t,n)=>e.transporter.write({method:u.a.Post,path:"1/strategies/personalization",data:t},n)},function(e,t,n){"use strict";n.r(t),n.d(t,"ApiKeyACLEnum",(function(){return Me})),n.d(t,"BatchActionEnum",(function(){return Se})),n.d(t,"ScopeEnum",(function(){return xe})),n.d(t,"StrategyEnum",(function(){return Oe})),n.d(t,"SynonymEnum",(function(){return Ae})),n.d(t,"addApiKey",(function(){return d})),n.d(t,"assignUserID",(function(){return p})),n.d(t,"assignUserIDs",(function(){return h})),n.d(t,"batch",(function(){return W})),n.d(t,"browseObjects",(function(){return z})),n.d(t,"browseRules",(function(){return q})),n.d(t,"browseSynonyms",(function(){return H})),n.d(t,"chunkedBatch",(function(){return G})),n.d(t,"clearObjects",(function(){return V})),n.d(t,"clearRules",(function(){return Y})),n.d(t,"clearSynonyms",(function(){return $})),n.d(t,"copyIndex",(function(){return m})),n.d(t,"copyRules",(function(){return v})),n.d(t,"copySettings",(function(){return b})),n.d(t,"copySynonyms",(function(){return g})),n.d(t,"createBrowsablePromise",(function(){return a})),n.d(t,"createMissingObjectIDError",(function(){return s})),n.d(t,"createObjectNotFoundError",(function(){return c})),n.d(t,"createSearchClient",(function(){return l})),n.d(t,"createValidUntilNotFoundError",(function(){return f})),n.d(t,"deleteApiKey",(function(){return y})),n.d(t,"deleteBy",(function(){return K})),n.d(t,"deleteIndex",(function(){return X})),n.d(t,"deleteObject",(function(){return J})),n.d(t,"deleteObjects",(function(){return Q})),n.d(t,"deleteRule",(function(){return Z})),n.d(t,"deleteSynonym",(function(){return ee})),n.d(t,"exists",(function(){return te})),n.d(t,"findObject",(function(){return ne})),n.d(t,"generateSecuredApiKey",(function(){return _})),n.d(t,"getApiKey",(function(){return D})),n.d(t,"getLogs",(function(){return w})),n.d(t,"getObject",(function(){return re})),n.d(t,"getObjectPosition",(function(){return ie})),n.d(t,"getObjects",(function(){return ue})),n.d(t,"getRule",(function(){return oe})),n.d(t,"getSecuredApiKeyRemainingValidity",(function(){return E})),n.d(t,"getSettings",(function(){return ae})),n.d(t,"getSynonym",(function(){return le})),n.d(t,"getTask",(function(){return se})),n.d(t,"getTopUserIDs",(function(){return T})),n.d(t,"getUserID",(function(){return C})),n.d(t,"hasPendingMappings",(function(){return k})),n.d(t,"initIndex",(function(){return M})),n.d(t,"listApiKeys",(function(){return S})),n.d(t,"listClusters",(function(){return x})),n.d(t,"listIndices",(function(){return O})),n.d(t,"listUserIDs",(function(){return A})),n.d(t,"moveIndex",(function(){return P})),n.d(t,"multipleBatch",(function(){return R})),n.d(t,"multipleGetObjects",(function(){return I})),n.d(t,"multipleQueries",(function(){return N})),n.d(t,"multipleSearchForFacetValues",(function(){return F})),n.d(t,"partialUpdateObject",(function(){return ce})),n.d(t,"partialUpdateObjects",(function(){return fe})),n.d(t,"removeUserID",(function(){return L})),n.d(t,"replaceAllObjects",(function(){return de})),n.d(t,"replaceAllRules",(function(){return pe})),n.d(t,"replaceAllSynonyms",(function(){return he})),n.d(t,"restoreApiKey",(function(){return B})),n.d(t,"saveObject",(function(){return me})),n.d(t,"saveObjects",(function(){return ve})),n.d(t,"saveRule",(function(){return be})),n.d(t,"saveRules",(function(){return ge})),n.d(t,"saveSynonym",(function(){return ye})),n.d(t,"saveSynonyms",(function(){return _e})),n.d(t,"search",(function(){return De})),n.d(t,"searchForFacetValues",(function(){return we})),n.d(t,"searchRules",(function(){return Ee})),n.d(t,"searchSynonyms",(function(){return Te})),n.d(t,"searchUserIDs",(function(){return j})),n.d(t,"setSettings",(function(){return Ce})),n.d(t,"updateApiKey",(function(){return U})),n.d(t,"waitTask",(function(){return ke}));var r=n(2),i=n(4),u=n(3),o=n(38);function a(e){const t=n=>e.request(n).then(r=>{if(void 0!==e.batch&&e.batch(r.hits),!e.shouldStop(r))return r.cursor?t({cursor:r.cursor}):t({page:(n.page||0)+1})});return t({})}const l=e=>{const t=e.appId,n=Object(r.createAuth)(void 0!==e.authMode?e.authMode:r.AuthMode.WithinHeaders,t,e.apiKey),u=Object(i.createTransporter)({hosts:[{url:`${t}-dsn.algolia.net`,accept:i.CallEnum.Read},{url:`${t}.algolia.net`,accept:i.CallEnum.Write}].concat(Object(r.shuffle)([{url:`${t}-1.algolianet.com`},{url:`${t}-2.algolianet.com`},{url:`${t}-3.algolianet.com`}])),...e,headers:{...n.headers(),"content-type":"application/x-www-form-urlencoded",...e.headers},queryParameters:{...n.queryParameters(),...e.queryParameters}}),o={transporter:u,appId:t,addAlgoliaAgent(e,t){u.userAgent.add({segment:e,version:t})},clearCache:()=>Promise.all([u.requestsCache.clear(),u.responsesCache.clear()]).then(()=>void 0)};return Object(r.addMethods)(o,e.methods)};function s(){return{name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}}function c(){return{name:"ObjectNotFoundError",message:"Object not found."}}function f(){return{name:"ValidUntilNotFoundError",message:"ValidUntil not found in given secured api key."}}const d=e=>(t,n)=>{const{queryParameters:i,...o}=n||{},a={acl:t,...void 0!==i?{queryParameters:i}:{}};return Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:"1/keys",data:a},o),(t,n)=>Object(r.createRetryablePromise)(r=>D(e)(t.key,n).catch(e=>{if(404!==e.status)throw e;return r()})))},p=e=>(t,n,r)=>{const o=Object(i.createMappedRequestOptions)(r);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:u.a.Post,path:"1/clusters/mapping",data:{cluster:n}},o)},h=e=>(t,n,r)=>e.transporter.write({method:u.a.Post,path:"1/clusters/mapping/batch",data:{users:t,cluster:n}},r),m=e=>(t,n,i)=>{return Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/operation",t),data:{operation:"copy",destination:n}},i),(n,r)=>M(e)(t,{methods:{waitTask:ke}}).waitTask(n.taskID,r))},v=e=>(t,n,r)=>m(e)(t,n,{...r,scope:[xe.Rules]}),b=e=>(t,n,r)=>m(e)(t,n,{...r,scope:[xe.Settings]}),g=e=>(t,n,r)=>m(e)(t,n,{...r,scope:[xe.Synonyms]}),y=e=>(t,n)=>{return Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Delete,path:Object(r.encode)("1/keys/%s",t)},n),(n,i)=>Object(r.createRetryablePromise)(n=>D(e)(t,i).then(n).catch(e=>{if(404!==e.status)throw e})))},_=()=>(e,t)=>{const n=Object(i.serializeQueryParameters)(t),r=Object(o.createHmac)("sha256",e).update(n).digest("hex");return Buffer.from(r+n).toString("base64")},D=e=>(t,n)=>e.transporter.read({method:u.a.Get,path:Object(r.encode)("1/keys/%s",t)},n),w=e=>t=>e.transporter.read({method:u.a.Get,path:"1/logs"},t),E=()=>e=>{const t=Buffer.from(e,"base64").toString("ascii").match(/validUntil=(\d+)/);if(null===t)throw{name:"ValidUntilNotFoundError",message:"ValidUntil not found in given secured api key."};return parseInt(t[1],10)-Math.round((new Date).getTime()/1e3)},T=e=>t=>e.transporter.read({method:u.a.Get,path:"1/clusters/mapping/top"},t),C=e=>(t,n)=>e.transporter.read({method:u.a.Get,path:Object(r.encode)("1/clusters/mapping/%s",t)},n),k=e=>t=>{const{retrieveMappings:n,...r}=t||{};return!0===n&&(r.getClusters=!0),e.transporter.read({method:u.a.Get,path:"1/clusters/mapping/pending"},r)},M=e=>(t,n={})=>{const i={transporter:e.transporter,appId:e.appId,indexName:t};return Object(r.addMethods)(i,n.methods)},S=e=>t=>e.transporter.read({method:u.a.Get,path:"1/keys"},t),x=e=>t=>e.transporter.read({method:u.a.Get,path:"1/clusters"},t),O=e=>t=>e.transporter.read({method:u.a.Get,path:"1/indexes"},t),A=e=>t=>e.transporter.read({method:u.a.Get,path:"1/clusters/mapping"},t),P=e=>(t,n,i)=>{return Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/operation",t),data:{operation:"move",destination:n}},i),(n,r)=>M(e)(t,{methods:{waitTask:ke}}).waitTask(n.taskID,r))},R=e=>(t,n)=>{return Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:"1/indexes/*/batch",data:{requests:t}},n),(t,n)=>Promise.all(Object.keys(t.taskID).map(r=>M(e)(r,{methods:{waitTask:ke}}).waitTask(t.taskID[r],n))))},I=e=>(t,n)=>e.transporter.read({method:u.a.Post,path:"1/indexes/*/objects",data:{requests:t}},n),N=e=>(t,n)=>{const r=t.map(e=>({...e,params:Object(i.serializeQueryParameters)(e.params||{})}));return e.transporter.read({method:u.a.Post,path:"1/indexes/*/queries",data:{requests:r},cacheable:!0},n)},F=e=>(t,n)=>Promise.all(t.map(t=>{const{facetName:r,facetQuery:i,...u}=t.params;return M(e)(t.indexName,{methods:{searchForFacetValues:we}}).searchForFacetValues(r,i,{...n,...u})})),L=e=>(t,n)=>{const r=Object(i.createMappedRequestOptions)(n);return r.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:u.a.Delete,path:"1/clusters/mapping"},r)},B=e=>(t,n)=>{return Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/keys/%s/restore",t)},n),(n,i)=>Object(r.createRetryablePromise)(n=>D(e)(t,i).catch(e=>{if(404!==e.status)throw e;return n()})))},j=e=>(t,n)=>e.transporter.read({method:u.a.Post,path:"1/clusters/mapping/search",data:{query:t}},n),U=e=>(t,n)=>{const i=Object.assign({},n),{queryParameters:o,...a}=n||{},l=o?{queryParameters:o}:{},s=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Put,path:Object(r.encode)("1/keys/%s",t),data:l},a),(n,u)=>Object(r.createRetryablePromise)(n=>D(e)(t,u).then(e=>(e=>Object.keys(i).filter(e=>-1!==s.indexOf(e)).every(t=>e[t]===i[t]))(e)?Promise.resolve():n())))},W=e=>(t,n)=>{return Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/batch",e.indexName),data:{requests:t}},n),(t,n)=>ke(e)(t.taskID,n))},z=e=>t=>a({...t,shouldStop:e=>void 0===e.cursor,request:n=>e.transporter.read({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/browse",e.indexName),data:n},t)}),q=e=>t=>{const n={hitsPerPage:1e3,...t};return a({...n,shouldStop:e=>e.hits.lengthEe(e)("",{...n,...t}).then(e=>({...e,hits:e.hits.map(e=>(delete e._highlightResult,e))}))})},H=e=>t=>{const n={hitsPerPage:1e3,...t};return a({...n,shouldStop:e=>e.hits.lengthTe(e)("",{...n,...t}).then(e=>({...e,hits:e.hits.map(e=>(delete e._highlightResult,e))}))})},G=e=>(t,n,i)=>{const{batchSize:u,...o}=i||{},a={taskIDs:[],objectIDs:[]},l=(r=0)=>{const i=[];let s;for(s=r;s({action:n,body:e})),o).then(e=>(a.objectIDs=a.objectIDs.concat(e.objectIDs),a.taskIDs.push(e.taskID),l(++s)))};return Object(r.createWaitablePromise)(l(),(t,n)=>Promise.all(t.taskIDs.map(t=>ke(e)(t,n))))},V=e=>t=>Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/clear",e.indexName)},t),(t,n)=>ke(e)(t.taskID,n)),Y=e=>t=>{const{forwardToReplicas:n,...o}=t||{},a=Object(i.createMappedRequestOptions)(o);return n&&(a.queryParameters.forwardToReplicas=1),Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/rules/clear",e.indexName)},a),(t,n)=>ke(e)(t.taskID,n))},$=e=>t=>{const{forwardToReplicas:n,...o}=t||{},a=Object(i.createMappedRequestOptions)(o);return n&&(a.queryParameters.forwardToReplicas=1),Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/synonyms/clear",e.indexName)},a),(t,n)=>ke(e)(t.taskID,n))},K=e=>(t,n)=>Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/deleteByQuery",e.indexName),data:t},n),(t,n)=>ke(e)(t.taskID,n)),X=e=>t=>Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Delete,path:Object(r.encode)("1/indexes/%s",e.indexName)},t),(t,n)=>ke(e)(t.taskID,n)),J=e=>(t,n)=>Object(r.createWaitablePromise)(Q(e)([t],n).then(e=>({taskID:e.taskIDs[0]})),(t,n)=>ke(e)(t.taskID,n)),Q=e=>(t,n)=>{const r=t.map(e=>({objectID:e}));return G(e)(r,Se.DeleteObject,n)},Z=e=>(t,n)=>{const{forwardToReplicas:o,...a}=n||{},l=Object(i.createMappedRequestOptions)(a);return o&&(l.queryParameters.forwardToReplicas=1),Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Delete,path:Object(r.encode)("1/indexes/%s/rules/%s",e.indexName,t)},l),(t,n)=>ke(e)(t.taskID,n))},ee=e=>(t,n)=>{const{forwardToReplicas:o,...a}=n||{},l=Object(i.createMappedRequestOptions)(a);return o&&(l.queryParameters.forwardToReplicas=1),Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Delete,path:Object(r.encode)("1/indexes/%s/synonyms/%s",e.indexName,t)},l),(t,n)=>ke(e)(t.taskID,n))},te=e=>t=>ae(e)(t).then(()=>!0).catch(e=>{if(404!==e.status)throw e;return!1}),ne=e=>(t,n)=>{const{query:r,paginate:i,...u}=n||{};let o=0;const a=()=>De(e)(r||"",{...u,page:o}).then(e=>{for(const[n,r]of Object.entries(e.hits))if(t(r))return{object:r,position:parseInt(n,10),page:o};if(o++,!1===i||o>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return a()});return a()},re=e=>(t,n)=>e.transporter.read({method:u.a.Get,path:Object(r.encode)("1/indexes/%s/%s",e.indexName,t)},n),ie=()=>(e,t)=>{for(const[n,r]of Object.entries(e.hits))if(r.objectID===t)return parseInt(n,10);return-1},ue=e=>(t,n)=>{const{attributesToRetrieve:r,...i}=n||{},o=t.map(t=>({indexName:e.indexName,objectID:t,...r?{attributesToRetrieve:r}:{}}));return e.transporter.read({method:u.a.Post,path:"1/indexes/*/objects",data:{requests:o}},i)},oe=e=>(t,n)=>e.transporter.read({method:u.a.Get,path:Object(r.encode)("1/indexes/%s/rules/%s",e.indexName,t)},n),ae=e=>t=>e.transporter.read({method:u.a.Get,path:Object(r.encode)("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t),le=e=>(t,n)=>e.transporter.read({method:u.a.Get,path:Object(r.encode)("1/indexes/%s/synonyms/%s",e.indexName,t)},n),se=e=>(t,n)=>e.transporter.read({method:u.a.Get,path:Object(r.encode)("1/indexes/%s/task/%s",e.indexName,t.toString())},n),ce=e=>(t,n)=>Object(r.createWaitablePromise)(fe(e)([t],n).then(e=>({objectID:e.objectIDs[0],taskID:e.taskIDs[0]})),(t,n)=>ke(e)(t.taskID,n)),fe=e=>(t,n)=>{const{createIfNotExists:r,...i}=n||{},u=r?Se.PartialUpdateObject:Se.PartialUpdateObjectNoCreate;return G(e)(t,u,i)},de=e=>(t,n)=>{const{safe:i,autoGenerateObjectIDIfNotExist:o,batchSize:a,...l}=n||{},s=(t,n,i,o)=>Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/operation",t),data:{operation:i,destination:n}},o),(t,n)=>ke(e)(t.taskID,n)),c=Math.random().toString(36).substring(7),f=`${e.indexName}_tmp_${c}`,d=ve({appId:e.appId,transporter:e.transporter,indexName:f});let p=[];const h=s(e.indexName,f,"copy",{...l,scope:["settings","synonyms","rules"]});p.push(h);const m=(i?h.wait(l):h).then(()=>{const e=d(t,{...l,autoGenerateObjectIDIfNotExist:o,batchSize:a});return p.push(e),i?e.wait(l):e}).then(()=>{const t=s(f,e.indexName,"move",l);return p.push(t),i?t.wait(l):t}).then(()=>Promise.all(p)).then(([e,t,n])=>({objectIDs:t.objectIDs,taskIDs:[e.taskID,...t.taskIDs,n.taskID]}));return Object(r.createWaitablePromise)(m,(e,t)=>Promise.all(p.map(e=>e.wait(t))))},pe=e=>(t,n)=>ge(e)(t,{...n,clearExistingRules:!0}),he=e=>(t,n)=>_e(e)(t,{...n,replaceExistingSynonyms:!0}),me=e=>(t,n)=>Object(r.createWaitablePromise)(ve(e)([t],n).then(e=>({objectID:e.objectIDs[0],taskID:e.taskIDs[0]})),(t,n)=>ke(e)(t.taskID,n)),ve=e=>(t,n)=>{const{autoGenerateObjectIDIfNotExist:i,...u}=n||{},o=i?Se.AddObject:Se.UpdateObject;if(o===Se.UpdateObject)for(const e of t)if(void 0===e.objectID)return Object(r.createWaitablePromise)(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}));return G(e)(t,o,u)},be=e=>(t,n)=>ge(e)([t],n),ge=e=>(t,n)=>{const{forwardToReplicas:o,clearExistingRules:a,...l}=n||{},s=Object(i.createMappedRequestOptions)(l);return o&&(s.queryParameters.forwardToReplicas=1),a&&(s.queryParameters.clearExistingRules=1),Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/rules/batch",e.indexName),data:t},s),(t,n)=>ke(e)(t.taskID,n))},ye=e=>(t,n)=>_e(e)([t],n),_e=e=>(t,n)=>{const{forwardToReplicas:o,replaceExistingSynonyms:a,...l}=n||{},s=Object(i.createMappedRequestOptions)(l);return o&&(s.queryParameters.forwardToReplicas=1),a&&(s.queryParameters.replaceExistingSynonyms=1),Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/synonyms/batch",e.indexName),data:t},s),(t,n)=>ke(e)(t.taskID,n))},De=e=>(t,n)=>e.transporter.read({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n),we=e=>(t,n,i)=>e.transporter.read({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},i),Ee=e=>(t,n)=>e.transporter.read({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/rules/search",e.indexName),data:{query:t}},n),Te=e=>(t,n)=>e.transporter.read({method:u.a.Post,path:Object(r.encode)("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},n),Ce=e=>(t,n)=>{const{forwardToReplicas:o,...a}=n||{},l=Object(i.createMappedRequestOptions)(a);return o&&(l.queryParameters.forwardToReplicas=1),Object(r.createWaitablePromise)(e.transporter.write({method:u.a.Put,path:Object(r.encode)("1/indexes/%s/settings",e.indexName),data:t},l),(t,n)=>ke(e)(t.taskID,n))},ke=e=>(t,n)=>Object(r.createRetryablePromise)(r=>se(e)(t,n).then(e=>"published"!==e.status?r():void 0)),Me={AddObject:"addObject",Analytics:"analytics",Browser:"browse",DeleteIndex:"deleteIndex",DeleteObject:"deleteObject",EditSettings:"editSettings",ListIndexes:"listIndexes",Logs:"logs",Recommendation:"recommendation",Search:"search",SeeUnretrievableAttributes:"seeUnretrievableAttributes",Settings:"settings",Usage:"usage"},Se={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject"},xe={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},Oe={None:"none",StopIfEnoughMatches:"stopIfEnoughMatches"},Ae={Synonym:"synonym",OneWaySynonym:"oneWaySynonym",AltCorrection1:"altCorrection1",AltCorrection2:"altCorrection2",Placeholder:"placeholder"}},function(e,t,n){"use strict";function r(){return{debug:(e,t)=>Promise.resolve(),info:(e,t)=>Promise.resolve(),error:(e,t)=>Promise.resolve()}}n.r(t),n.d(t,"LogLevelEnum",(function(){return i})),n.d(t,"createNullLogger",(function(){return r}));const i={Debug:1,Info:2,Error:3}},function(e,t,n){"use strict";n.r(t),n.d(t,"createNodeHttpRequester",(function(){return o}));var r=n(9),i=n(10),u=n(39);function o(){const e={keepAlive:!0},t=new r.Agent(e),n=new i.Agent(e);return{send:e=>new Promise(o=>{const a=Object(u.parse)(e.url),l=null===a.query?a.pathname:`${a.pathname}?${a.query}`,s={agent:"https:"===a.protocol?n:t,hostname:a.hostname,path:l,method:e.method,headers:e.headers,...void 0!==a.port?{port:a.port||""}:{}},c=("https:"===a.protocol?i:r).request(s,e=>{let t="";e.on("data",e=>t+=e),e.on("end",()=>{clearTimeout(d),clearTimeout(p),o({status:e.statusCode||0,content:t,isTimedOut:!1})})}),f=(e,t)=>setTimeout(()=>{c.abort(),o({status:0,content:t,isTimedOut:!0})},1e3*e),d=f(e.connectTimeout,"Connection timeout");let p;c.on("error",e=>{clearTimeout(d),clearTimeout(p),o({status:0,content:e.message,isTimedOut:!1})}),c.once("response",()=>{clearTimeout(d),p=f(e.responseTimeout,"Socket timeout")}),void 0!==e.data&&c.write(e.data),c.end()}),destroy:()=>(t.destroy(),n.destroy(),Promise.resolve())}}},function(e,t,n){"use strict";n.r(t);function r(e,t,n,r){var i,u=arguments.length,o=u<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(u<3?i(o):u>3?i(t,n,o):i(t,n))||o);return u>3&&o&&Object.defineProperty(t,n,o),o}var i,u=n(8),o=n(5),a=n(1),l=n(0),s=n.n(l);!function(e){e.BEFORE="before",e.AFTER="after"}(i||(i={}));const c=function(e,t,{active:n,minus:r,plus:i,set:u,loop:o=!0}){const{stdin:s}=Object(l.useContext)(a.StdinContext);Object(l.useEffect)(()=>{if(!n)return;const a=(n,a)=>{const l=t.indexOf(e);switch(a.name){case r:{const e=l-1;if(o)return void u(t[(t.length+e)%t.length]);if(e<0)return;u(t[e])}break;case i:{const e=l+1;if(o)return void u(t[e%t.length]);if(e>=t.length)return;u(t[e])}}};return s.on("keypress",a),()=>{s.off("keypress",a)}},[t,e,n])},f=({active:e=!0,children:t=[],radius:n=10,size:r=1,loop:u=!0,onFocusRequest:o,willReachEnd:f})=>{const d=s.a.Children.map(t,e=>(e=>{if(null===e.key)throw new Error("Expected all children to have a key");return e.key})(e)),p=d[0],[h,m]=Object(l.useState)(p),v=d.indexOf(h);Object(l.useEffect)(()=>{d.includes(h)||m(p)},[t]),Object(l.useEffect)(()=>{f&&v>=d.length-2&&f()},[v]),function({active:e,handler:t}){const{stdin:n}=Object(l.useContext)(a.StdinContext);Object(l.useEffect)(()=>{if(!e||void 0===t)return;const r=(e,n)=>{"tab"===n.name&&(n.shift?t(i.BEFORE):t(i.AFTER))};return n.on("keypress",r),()=>{n.off("keypress",r)}},[e,t])}({active:e,handler:o}),c(h,d,{active:e,minus:"up",plus:"down",set:m,loop:u});let b=v-n,g=v+n;g>d.length&&(b-=g-d.length,g=d.length),b<0&&(g+=-b,b=0),g>=d.length&&(g=d.length-1);const y=[];for(let n=b;n<=g;++n){const i=d[n],u=e&&i===h;y.push(s.a.createElement(a.Box,{key:i,height:r},s.a.createElement(a.Box,{marginLeft:1,marginRight:1},u?s.a.createElement(a.Color,{cyan:!0,bold:!0},">"):" "),s.a.createElement(a.Box,null,s.a.cloneElement(t[n],{active:u}))))}return s.a.createElement(a.Box,{flexDirection:"column",width:"100%"},y)},d=s.a.createContext(null),p=function({children:e}){const{setRawMode:t}=Object(l.useContext)(a.StdinContext);Object(l.useEffect)(()=>{t&&t(!0)},[]);const[n,r]=Object(l.useState)(new Map),i=Object(l.useMemo)(()=>({getAll:()=>n,get:e=>n.get(e),set:(e,t)=>r(new Map([...n,[e,t]]))}),[n,r]);return s.a.createElement(d.Provider,{value:i,children:e})};function h(e,t){const n=Object(l.useContext)(d);if(null===n)throw new Error("Expected this hook to run with a ministore context attached");if(void 0===e)return n.getAll();const r=Object(l.useCallback)(t=>{n.set(e,t)},[e,n.set]);let i=n.get(e);return void 0===i&&(i=t),[i,r]}const m=function({active:e,handler:t}){const{stdin:n}=Object(l.useContext)(a.StdinContext);Object(l.useEffect)(()=>{if(!e)return;const r=(e,n)=>{"space"===n.name&&t()};return n.on("keypress",r),()=>{n.off("keypress",r)}},[t])};async function v(e,t){let n;const{waitUntilExit:r}=Object(a.render)(s.a.createElement(p,null,s.a.createElement(e,Object.assign({},t,{useSubmit:e=>{const{exit:t}=Object(l.useContext)(a.AppContext),{stdin:r}=Object(l.useContext)(a.StdinContext);Object(l.useEffect)(()=>{const i=(r,i)=>{"return"===i.name&&(n=e,t())};return r.on("keypress",i),()=>{r.off("keypress",i)}},[r,t,e])}}))));return await r(),n}var b=n(6),g=n(36),y=n.n(g),_=n(37);const D={appId:"OFCNCOG2CU",apiKey:"6fe4476ee5a1832882e326b506d14126",indexName:"npm-search"},w=n.n(_)()(D.appId,D.apiKey).initIndex(D.indexName),E=async(e,t=0)=>{return await w.search(e,{analyticsTags:["yarn-plugin-interactive-tools"],attributesToRetrieve:["name","version","owner","repository","humanDownloadsLast30Days"],page:t,hitsPerPage:10})},T=["regular","dev","peer"];class C extends u.BaseCommand{async execute(){const e=await o.Configuration.find(this.context.cwd,this.context.plugins),t=()=>s.a.createElement(a.Box,{flexDirection:"row"},s.a.createElement(a.Box,{flexDirection:"column",width:48},s.a.createElement(a.Box,null,"Press ",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},""),"/",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},"")," to move between packages."),s.a.createElement(a.Box,null,"Press ",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},"")," to select a package."),s.a.createElement(a.Box,null,"Press ",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},"")," again to change the target.")),s.a.createElement(a.Box,{flexDirection:"column"},s.a.createElement(a.Box,{marginLeft:1},"Press ",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},"")," to install the selected packages."),s.a.createElement(a.Box,{marginLeft:1},"Press ",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},"")," to abort."))),n=()=>s.a.createElement(s.a.Fragment,null,s.a.createElement(a.Box,{width:15},s.a.createElement(a.Color,{bold:!0,underline:!0,gray:!0},"Owner")),s.a.createElement(a.Box,{width:11},s.a.createElement(a.Color,{bold:!0,underline:!0,gray:!0},"Version")),s.a.createElement(a.Box,{width:10},s.a.createElement(a.Color,{bold:!0,underline:!0,gray:!0},"Downloads"))),r=()=>s.a.createElement(a.Box,{width:17},s.a.createElement(a.Color,{bold:!0,underline:!0,gray:!0},"Target")),i=({hit:t,active:n})=>{const[r,i]=h(t.name,null);m({active:n,handler:()=>{if(!r)return void i(T[0]);const e=T.indexOf(r)+1;e===T.length?i(null):i(T[e])}});const u=o.structUtils.parseIdent(t.name),l=o.structUtils.prettyIdent(e,u);return s.a.createElement(a.Box,null,s.a.createElement(a.Box,{width:45,textWrap:"wrap"},s.a.createElement(a.Text,{bold:!0},l)),s.a.createElement(a.Box,{width:14,textWrap:"truncate",marginLeft:1},s.a.createElement(a.Text,{bold:!0},t.owner.name)),s.a.createElement(a.Box,{width:10,textWrap:"truncate",marginLeft:1},s.a.createElement(a.Text,{italic:!0},t.version)),s.a.createElement(a.Box,{width:16,textWrap:"truncate",marginLeft:1},t.humanDownloadsLast30Days))},u=({name:t,active:n})=>{const[r]=h(t,null),i=o.structUtils.parseIdent(t);return s.a.createElement(a.Box,null,s.a.createElement(a.Box,{width:47},s.a.createElement(a.Text,{bold:!0}," - ",o.structUtils.prettyIdent(e,i))),T.map(e=>s.a.createElement(a.Box,{key:e,width:14,marginLeft:1},r===e?s.a.createElement(a.Color,{green:!0}," ◉ "):s.a.createElement(a.Color,{yellow:!0}," ◯ "),s.a.createElement(a.Text,{bold:!0},e))))},c=()=>s.a.createElement(a.Box,{marginTop:1},s.a.createElement(a.Text,null,"Powered by Algolia.")),d=await v(({useSubmit:e})=>{const o=h();e(o);const d=Array.from(o.keys()).filter(e=>null!==o.get(e)),[p,m]=Object(l.useState)(""),[v,b]=Object(l.useState)(0),[g,_]=Object(l.useState)([]);Object(l.useEffect)(()=>{p?(async()=>{b(0);const e=await E(p);e.query===p&&_(e.hits)})():_([])},[p]);const D=y.a;return s.a.createElement(a.Box,{flexDirection:"column"},s.a.createElement(t,null),s.a.createElement(a.Box,{flexDirection:"row",marginTop:1},s.a.createElement(a.Text,{bold:!0},"Search: "),s.a.createElement(a.Box,{width:41},s.a.createElement(D,{value:p,onChange:e=>{e.match(/\t| /)||m(e)},placeholder:"i.e. babel, webpack, react...",showCursor:!1})),s.a.createElement(n,null)),g.length?s.a.createElement(f,{radius:2,loop:!1,children:g.map(e=>s.a.createElement(i,{key:e.name,hit:e,active:!1})),willReachEnd:async()=>{const e=await E(p,v+1);e.query===p&&e.page-1===v&&(b(e.page),_([...g,...e.hits]))}}):s.a.createElement(a.Color,{gray:!0},"Start typing..."),s.a.createElement(a.Box,{flexDirection:"row",marginTop:1},s.a.createElement(a.Box,{width:49},s.a.createElement(a.Text,{bold:!0},"Selected:")),s.a.createElement(r,null)),d.length?d.map(e=>s.a.createElement(u,{key:e,name:e,active:!1})):s.a.createElement(a.Color,{gray:!0},"No selected packages..."),s.a.createElement(c,null))},{});if(void 0===d)return 1;const p=Array.from(d.keys()).filter(e=>"regular"===d.get(e)),b=Array.from(d.keys()).filter(e=>"dev"===d.get(e)),g=Array.from(d.keys()).filter(e=>"peer"===d.get(e));return p.length&&await this.cli.run(["add",...p]),b.length&&await this.cli.run(["add","--dev",...b]),g&&await this.cli.run(["add","--peer",...g]),0}}C.usage=b.Command.Usage({category:"Interactive commands",description:"open the search interface",details:"\n This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry.\n ",examples:[["Open the search window","yarn search"]]}),r([b.Command.Path("search")],C.prototype,"execute",null);const k=function({active:e,options:t,value:n,onChange:r,sizes:i=[]}){const u=t.map(({value:e})=>e),o=u.indexOf(n);return c(n,u,{active:e,minus:"left",plus:"right",set:r}),s.a.createElement(s.a.Fragment,null,t.map(({label:e},t)=>t===o?s.a.createElement(a.Box,{key:e,width:i[t]-1||0,marginLeft:1,textWrap:"truncate"},s.a.createElement(a.Color,{green:!0}," ◉ ")," ",s.a.createElement(a.Text,{bold:!0},e)):s.a.createElement(a.Box,{key:e,width:i[t]-1||0,marginLeft:1,textWrap:"truncate"},s.a.createElement(a.Color,{yellow:!0}," ◯ ")," ",s.a.createElement(a.Text,{bold:!0},e))))};var M=n(40);function S(){}function x(e,t,n,r,i){for(var u=0,o=t.length,a=0,l=0;ue.length?n:e})),s.value=e.join(f)}else s.value=e.join(n.slice(a,a+s.count));a+=s.count,s.added||(l+=s.count)}}var d=t[o-1];return o>1&&"string"==typeof d.value&&(d.added||d.removed)&&e.equals("",d.value)&&(t[o-2].value+=d.value,t.pop()),t}function O(e){return{newPos:e.newPos,components:e.components.slice(0)}}S.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var i=this;function u(e){return r?(setTimeout((function(){r(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var o=(t=this.removeEmpty(this.tokenize(t))).length,a=e.length,l=1,s=o+a,c=[{newPos:-1,components:[]}],f=this.extractCommon(c[0],t,e,0);if(c[0].newPos+1>=o&&f+1>=a)return u([{value:this.join(t),count:t.length}]);function d(){for(var n=-1*l;n<=l;n+=2){var r=void 0,s=c[n-1],f=c[n+1],d=(f?f.newPos:0)-n;s&&(c[n-1]=void 0);var p=s&&s.newPos+1=o&&d+1>=a)return u(x(i,r.components,t,e,i.useLongestToken));c[n]=r}else c[n]=void 0}l++}if(r)!function e(){setTimeout((function(){if(l>s)return r();d()||e()}),0)}();else for(;l<=s;){var p=d();if(p)return p}},pushComponent:function(e,t,n){var r=e[e.length-1];r&&r.added===t&&r.removed===n?e[e.length-1]={count:r.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,r){for(var i=t.length,u=n.length,o=e.newPos,a=o-r,l=0;o+1=?)?)([0-9]+)(\.[0-9]+)(\.[0-9]+)((?:-\S+)?)$/;class G extends u.BaseCommand{async execute(){const e=await o.Configuration.find(this.context.cwd,this.context.plugins),{project:t,workspace:n}=await o.Project.find(e,this.context.cwd),r=await o.Cache.find(e);if(!n)throw new u.WorkspaceRequiredError(t.cwd,this.context.cwd);const i=(t,n)=>{const r=function(e,t,n){return n=A(n,{ignoreWhitespace:!0}),I.diff(e,t,n)}(t,n);let i="";for(const t of r)t.added?i+=e.format(t.value,"green"):t.removed||(i+=t.value);return i},c=(t,n)=>{if(t===n)return n;const r=o.structUtils.parseRange(t),u=o.structUtils.parseRange(n),a=r.selector.match(H),l=u.selector.match(H);if(!a||!l)return i(t,n);const s=["gray","red","yellow","green","magenta"];let c=null,f="";for(let t=1;t{const u=await M.suggestUtils.fetchDescriptorFrom(e,i,{project:t,cache:r,preserveModifier:n});return null!==u?u.range:e.range},p=()=>s.a.createElement(a.Box,{flexDirection:"row"},s.a.createElement(a.Box,{flexDirection:"column",width:49},s.a.createElement(a.Box,{marginLeft:1},"Press ",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},""),"/",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},"")," to select packages."),s.a.createElement(a.Box,{marginLeft:1},"Press ",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},""),"/",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},"")," to select versions.")),s.a.createElement(a.Box,{flexDirection:"column"},s.a.createElement(a.Box,{marginLeft:1},"Press ",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},"")," to install."),s.a.createElement(a.Box,{marginLeft:1},"Press ",s.a.createElement(a.Color,{bold:!0,cyanBright:!0},"")," to abort."))),m=()=>s.a.createElement(a.Box,{flexDirection:"row",paddingTop:1,paddingBottom:1},s.a.createElement(a.Box,{width:50},s.a.createElement(a.Text,{bold:!0},s.a.createElement(a.Color,{greenBright:!0},"?")," Pick the packages you want to upgrade.")),s.a.createElement(a.Box,{width:17},s.a.createElement(a.Color,{bold:!0,underline:!0,gray:!0},"Current")),s.a.createElement(a.Box,{width:17},s.a.createElement(a.Color,{bold:!0,underline:!0,gray:!0},"Range/Latest"))),b=({active:t,descriptor:n})=>{const[r,i]=h(n.descriptorHash,null),[u,f]=Object(l.useState)(null),p=Object(l.useRef)(!0);return Object(l.useEffect)(()=>()=>{p.current=!1},[]),Object(l.useEffect)(()=>{(async e=>{const t=q.a.valid(e.range)?`^${e.range}`:e.range,[n,r]=await Promise.all([d(e,e.range,t),d(e,e.range,"latest")]),i=[{value:null,label:e.range}];return n!==e.range&&i.push({value:n,label:c(e.range,n)}),r!==n&&r!==e.range&&i.push({value:r,label:c(e.range,r)}),i})(n).then(e=>{p.current&&f(e)})},[n.descriptorHash]),s.a.createElement(a.Box,null,s.a.createElement(a.Box,{width:45,textWrap:"wrap"},s.a.createElement(a.Text,{bold:!0},o.structUtils.prettyIdent(e,n))),null!==u?s.a.createElement(k,{active:t,options:u,value:r,onChange:i,sizes:[17,17,17]}):s.a.createElement(a.Box,{marginLeft:2},s.a.createElement(a.Color,{gray:!0},"Fetching suggestions...")))},g=await v(({useSubmit:e})=>{e(h());const n=new Map;for(const e of t.workspaces)for(const r of["dependencies","devDependencies"])for(const i of e.manifest[r].values())null===t.tryWorkspaceByDescriptor(i)&&n.set(i.descriptorHash,i);const r=o.miscUtils.sortMap(n.values(),e=>o.structUtils.stringifyDescriptor(e));return s.a.createElement(s.a.Fragment,null,s.a.createElement(a.Box,{flexDirection:"column"},s.a.createElement(p,null),s.a.createElement(m,null),s.a.createElement(f,{radius:10,children:r.map(e=>s.a.createElement(b,{key:e.descriptorHash,active:!1,descriptor:e}))})))},{});if(void 0===g)return 1;let y=!1;for(const e of t.workspaces)for(const t of["dependencies","devDependencies"]){const n=e.manifest[t];for(const e of n.values()){const t=g.get(e.descriptorHash);null!=t&&(n.set(e.identHash,o.structUtils.makeDescriptor(e,t)),y=!0)}}if(!y)return 0;return(await o.StreamReport.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async e=>{await t.install({cache:r,report:e})})).exitCode()}}G.usage=b.Command.Usage({category:"Interactive commands",description:"open the upgrade interface",details:"\n This command opens a fullscreen terminal interface where you can see the packages used by your application, their status compared to the latest versions available on the remote registry, and let you upgrade.\n ",examples:[["Open the upgrade window","yarn upgrade-interactive"]]}),r([b.Command.Path("upgrade-interactive")],G.prototype,"execute",null);const V={commands:[C,G]};t.default=V}]);return plugin}}; \ No newline at end of file diff --git a/.yarn/releases/yarn-1.22.4.js b/.yarn/releases/yarn-1.22.4.js deleted file mode 100755 index 20c45edf99df..000000000000 --- a/.yarn/releases/yarn-1.22.4.js +++ /dev/null @@ -1,147391 +0,0 @@ -#!/usr/bin/env node -module.exports = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // identity function for calling harmony imports with the correct context -/******/ __webpack_require__.i = function(value) { return value; }; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 549); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { - -module.exports = require("path"); - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = __extends; -/* unused harmony export __assign */ -/* unused harmony export __rest */ -/* unused harmony export __decorate */ -/* unused harmony export __param */ -/* unused harmony export __metadata */ -/* unused harmony export __awaiter */ -/* unused harmony export __generator */ -/* unused harmony export __exportStar */ -/* unused harmony export __values */ -/* unused harmony export __read */ -/* unused harmony export __spread */ -/* unused harmony export __await */ -/* unused harmony export __asyncGenerator */ -/* unused harmony export __asyncDelegator */ -/* unused harmony export __asyncValues */ -/* unused harmony export __makeTemplateObject */ -/* unused harmony export __importStar */ -/* unused harmony export __importDefault */ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} - -function __values(o) { - var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; - if (m) return m.call(o); - return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _promise = __webpack_require__(227); - -var _promise2 = _interopRequireDefault(_promise); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (fn) { - return function () { - var gen = fn.apply(this, arguments); - return new _promise2.default(function (resolve, reject) { - function step(key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - return _promise2.default.resolve(value).then(function (value) { - step("next", value); - }, function (err) { - step("throw", err); - }); - } - } - - return step("next"); - }); - }; -}; - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -module.exports = require("util"); - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -let buildActionsForCopy = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { - - // - let build = (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - const src = data.src, - dest = data.dest, - type = data.type; - - const onFresh = data.onFresh || noop; - const onDone = data.onDone || noop; - - // TODO https://github.com/yarnpkg/yarn/issues/3751 - // related to bundled dependencies handling - if (files.has(dest.toLowerCase())) { - reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`); - } else { - files.add(dest.toLowerCase()); - } - - if (type === 'symlink') { - yield mkdirp((_path || _load_path()).default.dirname(dest)); - onFresh(); - actions.symlink.push({ - dest, - linkname: src - }); - onDone(); - return; - } - - if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { - // ignored file - return; - } - - const srcStat = yield lstat(src); - let srcFiles; - - if (srcStat.isDirectory()) { - srcFiles = yield readdir(src); - } - - let destStat; - try { - // try accessing the destination - destStat = yield lstat(dest); - } catch (e) { - // proceed if destination doesn't exist, otherwise error - if (e.code !== 'ENOENT') { - throw e; - } - } - - // if destination exists - if (destStat) { - const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); - const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); - const bothFiles = srcStat.isFile() && destStat.isFile(); - - // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving - // us modes that aren't valid. investigate this, it's generally safe to proceed. - - /* if (srcStat.mode !== destStat.mode) { - try { - await access(dest, srcStat.mode); - } catch (err) {} - } */ - - if (bothFiles && artifactFiles.has(dest)) { - // this file gets changed during build, likely by a custom install script. Don't bother checking it. - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); - return; - } - - if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) { - // we can safely assume this is the same file - onDone(); - reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime)); - return; - } - - if (bothSymlinks) { - const srcReallink = yield readlink(src); - if (srcReallink === (yield readlink(dest))) { - // if both symlinks are the same then we can continue on - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); - return; - } - } - - if (bothFolders) { - // mark files that aren't in this folder as possibly extraneous - const destFiles = yield readdir(dest); - invariant(srcFiles, 'src files not initialised'); - - for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { - var _ref6; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref6 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref6 = _i4.value; - } - - const file = _ref6; - - if (srcFiles.indexOf(file) < 0) { - const loc = (_path || _load_path()).default.join(dest, file); - possibleExtraneous.add(loc); - - if ((yield lstat(loc)).isDirectory()) { - for (var _iterator5 = yield readdir(loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { - var _ref7; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref7 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref7 = _i5.value; - } - - const file = _ref7; - - possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); - } - } - } - } - } - } - - if (destStat && destStat.isSymbolicLink()) { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); - destStat = null; - } - - if (srcStat.isSymbolicLink()) { - onFresh(); - const linkname = yield readlink(src); - actions.symlink.push({ - dest, - linkname - }); - onDone(); - } else if (srcStat.isDirectory()) { - if (!destStat) { - reporter.verbose(reporter.lang('verboseFileFolder', dest)); - yield mkdirp(dest); - } - - const destParts = dest.split((_path || _load_path()).default.sep); - while (destParts.length) { - files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); - destParts.pop(); - } - - // push all files to queue - invariant(srcFiles, 'src files not initialised'); - let remaining = srcFiles.length; - if (!remaining) { - onDone(); - } - for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { - var _ref8; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref8 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref8 = _i6.value; - } - - const file = _ref8; - - queue.push({ - dest: (_path || _load_path()).default.join(dest, file), - onFresh, - onDone: function (_onDone) { - function onDone() { - return _onDone.apply(this, arguments); - } - - onDone.toString = function () { - return _onDone.toString(); - }; - - return onDone; - }(function () { - if (--remaining === 0) { - onDone(); - } - }), - src: (_path || _load_path()).default.join(src, file) - }); - } - } else if (srcStat.isFile()) { - onFresh(); - actions.file.push({ - src, - dest, - atime: srcStat.atime, - mtime: srcStat.mtime, - mode: srcStat.mode - }); - onDone(); - } else { - throw new Error(`unsure how to copy this: ${src}`); - } - }); - - return function build(_x5) { - return _ref5.apply(this, arguments); - }; - })(); - - const artifactFiles = new Set(events.artifactFiles || []); - const files = new Set(); - - // initialise events - for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref2; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref2 = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref2 = _i.value; - } - - const item = _ref2; - - const onDone = item.onDone; - item.onDone = function () { - events.onProgress(item.dest); - if (onDone) { - onDone(); - } - }; - } - events.onStart(queue.length); - - // start building actions - const actions = { - file: [], - symlink: [], - link: [] - }; - - // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items - // at a time due to the requirement to push items onto the queue - while (queue.length) { - const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); - yield Promise.all(items.map(build)); - } - - // simulate the existence of some files to prevent considering them extraneous - for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref3; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } - - const file = _ref3; - - if (possibleExtraneous.has(file)) { - reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); - possibleExtraneous.delete(file); - } - } - - for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { - var _ref4; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - const loc = _ref4; - - if (files.has(loc.toLowerCase())) { - possibleExtraneous.delete(loc); - } - } - - return actions; - }); - - return function buildActionsForCopy(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -})(); - -let buildActionsForHardlink = (() => { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { - - // - let build = (() => { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - const src = data.src, - dest = data.dest; - - const onFresh = data.onFresh || noop; - const onDone = data.onDone || noop; - if (files.has(dest.toLowerCase())) { - // Fixes issue https://github.com/yarnpkg/yarn/issues/2734 - // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1, - // package-linker passes that modules A1 and B1 need to be hardlinked, - // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case - // an exception. - onDone(); - return; - } - files.add(dest.toLowerCase()); - - if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { - // ignored file - return; - } - - const srcStat = yield lstat(src); - let srcFiles; - - if (srcStat.isDirectory()) { - srcFiles = yield readdir(src); - } - - const destExists = yield exists(dest); - if (destExists) { - const destStat = yield lstat(dest); - - const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); - const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); - const bothFiles = srcStat.isFile() && destStat.isFile(); - - if (srcStat.mode !== destStat.mode) { - try { - yield access(dest, srcStat.mode); - } catch (err) { - // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving - // us modes that aren't valid. investigate this, it's generally safe to proceed. - reporter.verbose(err); - } - } - - if (bothFiles && artifactFiles.has(dest)) { - // this file gets changed during build, likely by a custom install script. Don't bother checking it. - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); - return; - } - - // correct hardlink - if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) { - onDone(); - reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.ino)); - return; - } - - if (bothSymlinks) { - const srcReallink = yield readlink(src); - if (srcReallink === (yield readlink(dest))) { - // if both symlinks are the same then we can continue on - onDone(); - reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); - return; - } - } - - if (bothFolders) { - // mark files that aren't in this folder as possibly extraneous - const destFiles = yield readdir(dest); - invariant(srcFiles, 'src files not initialised'); - - for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { - var _ref14; - - if (_isArray10) { - if (_i10 >= _iterator10.length) break; - _ref14 = _iterator10[_i10++]; - } else { - _i10 = _iterator10.next(); - if (_i10.done) break; - _ref14 = _i10.value; - } - - const file = _ref14; - - if (srcFiles.indexOf(file) < 0) { - const loc = (_path || _load_path()).default.join(dest, file); - possibleExtraneous.add(loc); - - if ((yield lstat(loc)).isDirectory()) { - for (var _iterator11 = yield readdir(loc), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { - var _ref15; - - if (_isArray11) { - if (_i11 >= _iterator11.length) break; - _ref15 = _iterator11[_i11++]; - } else { - _i11 = _iterator11.next(); - if (_i11.done) break; - _ref15 = _i11.value; - } - - const file = _ref15; - - possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); - } - } - } - } - } - } - - if (srcStat.isSymbolicLink()) { - onFresh(); - const linkname = yield readlink(src); - actions.symlink.push({ - dest, - linkname - }); - onDone(); - } else if (srcStat.isDirectory()) { - reporter.verbose(reporter.lang('verboseFileFolder', dest)); - yield mkdirp(dest); - - const destParts = dest.split((_path || _load_path()).default.sep); - while (destParts.length) { - files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); - destParts.pop(); - } - - // push all files to queue - invariant(srcFiles, 'src files not initialised'); - let remaining = srcFiles.length; - if (!remaining) { - onDone(); - } - for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { - var _ref16; - - if (_isArray12) { - if (_i12 >= _iterator12.length) break; - _ref16 = _iterator12[_i12++]; - } else { - _i12 = _iterator12.next(); - if (_i12.done) break; - _ref16 = _i12.value; - } - - const file = _ref16; - - queue.push({ - onFresh, - src: (_path || _load_path()).default.join(src, file), - dest: (_path || _load_path()).default.join(dest, file), - onDone: function (_onDone2) { - function onDone() { - return _onDone2.apply(this, arguments); - } - - onDone.toString = function () { - return _onDone2.toString(); - }; - - return onDone; - }(function () { - if (--remaining === 0) { - onDone(); - } - }) - }); - } - } else if (srcStat.isFile()) { - onFresh(); - actions.link.push({ - src, - dest, - removeDest: destExists - }); - onDone(); - } else { - throw new Error(`unsure how to copy this: ${src}`); - } - }); - - return function build(_x10) { - return _ref13.apply(this, arguments); - }; - })(); - - const artifactFiles = new Set(events.artifactFiles || []); - const files = new Set(); - - // initialise events - for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { - var _ref10; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref10 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref10 = _i7.value; - } - - const item = _ref10; - - const onDone = item.onDone || noop; - item.onDone = function () { - events.onProgress(item.dest); - onDone(); - }; - } - events.onStart(queue.length); - - // start building actions - const actions = { - file: [], - symlink: [], - link: [] - }; - - // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items - // at a time due to the requirement to push items onto the queue - while (queue.length) { - const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); - yield Promise.all(items.map(build)); - } - - // simulate the existence of some files to prevent considering them extraneous - for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { - var _ref11; - - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref11 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref11 = _i8.value; - } - - const file = _ref11; - - if (possibleExtraneous.has(file)) { - reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); - possibleExtraneous.delete(file); - } - } - - for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { - var _ref12; - - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref12 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref12 = _i9.value; - } - - const loc = _ref12; - - if (files.has(loc.toLowerCase())) { - possibleExtraneous.delete(loc); - } - } - - return actions; - }); - - return function buildActionsForHardlink(_x6, _x7, _x8, _x9) { - return _ref9.apply(this, arguments); - }; -})(); - -let copyBulk = exports.copyBulk = (() => { - var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { - const events = { - onStart: _events && _events.onStart || noop, - onProgress: _events && _events.onProgress || noop, - possibleExtraneous: _events ? _events.possibleExtraneous : new Set(), - ignoreBasenames: _events && _events.ignoreBasenames || [], - artifactFiles: _events && _events.artifactFiles || [] - }; - - const actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter); - events.onStart(actions.file.length + actions.symlink.length + actions.link.length); - - const fileActions = actions.file; - - const currentlyWriting = new Map(); - - yield (_promise || _load_promise()).queue(fileActions, (() => { - var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - let writePromise; - while (writePromise = currentlyWriting.get(data.dest)) { - yield writePromise; - } - - reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest)); - const copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () { - return currentlyWriting.delete(data.dest); - }); - currentlyWriting.set(data.dest, copier); - events.onProgress(data.dest); - return copier; - }); - - return function (_x14) { - return _ref18.apply(this, arguments); - }; - })(), CONCURRENT_QUEUE_ITEMS); - - // we need to copy symlinks last as they could reference files we were copying - const symlinkActions = actions.symlink; - yield (_promise || _load_promise()).queue(symlinkActions, function (data) { - const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); - reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); - return symlink(linkname, data.dest); - }); - }); - - return function copyBulk(_x11, _x12, _x13) { - return _ref17.apply(this, arguments); - }; -})(); - -let hardlinkBulk = exports.hardlinkBulk = (() => { - var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { - const events = { - onStart: _events && _events.onStart || noop, - onProgress: _events && _events.onProgress || noop, - possibleExtraneous: _events ? _events.possibleExtraneous : new Set(), - artifactFiles: _events && _events.artifactFiles || [], - ignoreBasenames: [] - }; - - const actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter); - events.onStart(actions.file.length + actions.symlink.length + actions.link.length); - - const fileActions = actions.link; - - yield (_promise || _load_promise()).queue(fileActions, (() => { - var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { - reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest)); - if (data.removeDest) { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest); - } - yield link(data.src, data.dest); - }); - - return function (_x18) { - return _ref20.apply(this, arguments); - }; - })(), CONCURRENT_QUEUE_ITEMS); - - // we need to copy symlinks last as they could reference files we were copying - const symlinkActions = actions.symlink; - yield (_promise || _load_promise()).queue(symlinkActions, function (data) { - const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); - reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); - return symlink(linkname, data.dest); - }); - }); - - return function hardlinkBulk(_x15, _x16, _x17) { - return _ref19.apply(this, arguments); - }; -})(); - -let readFileAny = exports.readFileAny = (() => { - var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { - for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { - var _ref22; - - if (_isArray13) { - if (_i13 >= _iterator13.length) break; - _ref22 = _iterator13[_i13++]; - } else { - _i13 = _iterator13.next(); - if (_i13.done) break; - _ref22 = _i13.value; - } - - const file = _ref22; - - if (yield exists(file)) { - return readFile(file); - } - } - return null; - }); - - return function readFileAny(_x19) { - return _ref21.apply(this, arguments); - }; -})(); - -let readJson = exports.readJson = (() => { - var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - return (yield readJsonAndFile(loc)).object; - }); - - return function readJson(_x20) { - return _ref23.apply(this, arguments); - }; -})(); - -let readJsonAndFile = exports.readJsonAndFile = (() => { - var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - const file = yield readFile(loc); - try { - return { - object: (0, (_map || _load_map()).default)(JSON.parse(stripBOM(file))), - content: file - }; - } catch (err) { - err.message = `${loc}: ${err.message}`; - throw err; - } - }); - - return function readJsonAndFile(_x21) { - return _ref24.apply(this, arguments); - }; -})(); - -let find = exports.find = (() => { - var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { - const parts = dir.split((_path || _load_path()).default.sep); - - while (parts.length) { - const loc = parts.concat(filename).join((_path || _load_path()).default.sep); - - if (yield exists(loc)) { - return loc; - } else { - parts.pop(); - } - } - - return false; - }); - - return function find(_x22, _x23) { - return _ref25.apply(this, arguments); - }; -})(); - -let symlink = exports.symlink = (() => { - var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { - if (process.platform !== 'win32') { - // use relative paths otherwise which will be retained if the directory is moved - src = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src); - // When path.relative returns an empty string for the current directory, we should instead use - // '.', which is a valid fs.symlink target. - src = src || '.'; - } - - try { - const stats = yield lstat(dest); - if (stats.isSymbolicLink()) { - const resolved = dest; - if (resolved === src) { - return; - } - } - } catch (err) { - if (err.code !== 'ENOENT') { - throw err; - } - } - - // We use rimraf for unlink which never throws an ENOENT on missing target - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); - - if (process.platform === 'win32') { - // use directory junctions if possible on win32, this requires absolute paths - yield fsSymlink(src, dest, 'junction'); - } else { - yield fsSymlink(src, dest); - } - }); - - return function symlink(_x24, _x25) { - return _ref26.apply(this, arguments); - }; -})(); - -let walk = exports.walk = (() => { - var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = new Set()) { - let files = []; - - let filenames = yield readdir(dir); - if (ignoreBasenames.size) { - filenames = filenames.filter(function (name) { - return !ignoreBasenames.has(name); - }); - } - - for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { - var _ref28; - - if (_isArray14) { - if (_i14 >= _iterator14.length) break; - _ref28 = _iterator14[_i14++]; - } else { - _i14 = _iterator14.next(); - if (_i14.done) break; - _ref28 = _i14.value; - } - - const name = _ref28; - - const relative = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name; - const loc = (_path || _load_path()).default.join(dir, name); - const stat = yield lstat(loc); - - files.push({ - relative, - basename: name, - absolute: loc, - mtime: +stat.mtime - }); - - if (stat.isDirectory()) { - files = files.concat((yield walk(loc, relative, ignoreBasenames))); - } - } - - return files; - }); - - return function walk(_x26, _x27) { - return _ref27.apply(this, arguments); - }; -})(); - -let getFileSizeOnDisk = exports.getFileSizeOnDisk = (() => { - var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { - const stat = yield lstat(loc); - const size = stat.size, - blockSize = stat.blksize; - - - return Math.ceil(size / blockSize) * blockSize; - }); - - return function getFileSizeOnDisk(_x28) { - return _ref29.apply(this, arguments); - }; -})(); - -let getEolFromFile = (() => { - var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { - if (!(yield exists(path))) { - return undefined; - } - - const buffer = yield readFileBuffer(path); - - for (let i = 0; i < buffer.length; ++i) { - if (buffer[i] === cr) { - return '\r\n'; - } - if (buffer[i] === lf) { - return '\n'; - } - } - return undefined; - }); - - return function getEolFromFile(_x29) { - return _ref30.apply(this, arguments); - }; -})(); - -let writeFilePreservingEol = exports.writeFilePreservingEol = (() => { - var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { - const eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; - if (eol !== '\n') { - data = data.replace(/\n/g, eol); - } - yield writeFile(path, data); - }); - - return function writeFilePreservingEol(_x30, _x31) { - return _ref31.apply(this, arguments); - }; -})(); - -let hardlinksWork = exports.hardlinksWork = (() => { - var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { - const filename = 'test-file' + Math.random(); - const file = (_path || _load_path()).default.join(dir, filename); - const fileLink = (_path || _load_path()).default.join(dir, filename + '-link'); - try { - yield writeFile(file, 'test'); - yield link(file, fileLink); - } catch (err) { - return false; - } finally { - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file); - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink); - } - return true; - }); - - return function hardlinksWork(_x32) { - return _ref32.apply(this, arguments); - }; -})(); - -// not a strict polyfill for Node's fs.mkdtemp - - -let makeTempDir = exports.makeTempDir = (() => { - var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { - const dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`); - yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir); - yield mkdirp(dir); - return dir; - }); - - return function makeTempDir(_x33) { - return _ref33.apply(this, arguments); - }; -})(); - -let readFirstAvailableStream = exports.readFirstAvailableStream = (() => { - var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { - for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { - var _ref35; - - if (_isArray15) { - if (_i15 >= _iterator15.length) break; - _ref35 = _iterator15[_i15++]; - } else { - _i15 = _iterator15.next(); - if (_i15.done) break; - _ref35 = _i15.value; - } - - const path = _ref35; - - try { - const fd = yield open(path, 'r'); - return (_fs || _load_fs()).default.createReadStream(path, { fd }); - } catch (err) { - // Try the next one - } - } - return null; - }); - - return function readFirstAvailableStream(_x34) { - return _ref34.apply(this, arguments); - }; -})(); - -let getFirstSuitableFolder = exports.getFirstSuitableFolder = (() => { - var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths, mode = constants.W_OK | constants.X_OK) { - const result = { - skipped: [], - folder: null - }; - - for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) { - var _ref37; - - if (_isArray16) { - if (_i16 >= _iterator16.length) break; - _ref37 = _iterator16[_i16++]; - } else { - _i16 = _iterator16.next(); - if (_i16.done) break; - _ref37 = _i16.value; - } - - const folder = _ref37; - - try { - yield mkdirp(folder); - yield access(folder, mode); - - result.folder = folder; - - return result; - } catch (error) { - result.skipped.push({ - error, - folder - }); - } - } - return result; - }); - - return function getFirstSuitableFolder(_x35) { - return _ref36.apply(this, arguments); - }; -})(); - -exports.copy = copy; -exports.readFile = readFile; -exports.readFileRaw = readFileRaw; -exports.normalizeOS = normalizeOS; - -var _fs; - -function _load_fs() { - return _fs = _interopRequireDefault(__webpack_require__(5)); -} - -var _glob; - -function _load_glob() { - return _glob = _interopRequireDefault(__webpack_require__(99)); -} - -var _os; - -function _load_os() { - return _os = _interopRequireDefault(__webpack_require__(46)); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(0)); -} - -var _blockingQueue; - -function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); -} - -var _promise; - -function _load_promise() { - return _promise = _interopRequireWildcard(__webpack_require__(50)); -} - -var _promise2; - -function _load_promise2() { - return _promise2 = __webpack_require__(50); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(29)); -} - -var _fsNormalized; - -function _load_fsNormalized() { - return _fsNormalized = __webpack_require__(218); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : { - R_OK: (_fs || _load_fs()).default.R_OK, - W_OK: (_fs || _load_fs()).default.W_OK, - X_OK: (_fs || _load_fs()).default.X_OK -}; - -const lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock'); - -const readFileBuffer = exports.readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile); -const open = exports.open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open); -const writeFile = exports.writeFile = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.writeFile); -const readlink = exports.readlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readlink); -const realpath = exports.realpath = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.realpath); -const readdir = exports.readdir = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readdir); -const rename = exports.rename = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.rename); -const access = exports.access = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.access); -const stat = exports.stat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.stat); -const mkdirp = exports.mkdirp = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(145)); -const exists = exports.exists = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.exists, true); -const lstat = exports.lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat); -const chmod = exports.chmod = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.chmod); -const link = exports.link = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.link); -const glob = exports.glob = (0, (_promise2 || _load_promise2()).promisify)((_glob || _load_glob()).default); -exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink; - -// fs.copyFile uses the native file copying instructions on the system, performing much better -// than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the -// concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD. - -const CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4; - -const fsSymlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.symlink); -const invariant = __webpack_require__(9); -const stripBOM = __webpack_require__(160); - -const noop = () => {}; - -function copy(src, dest, reporter) { - return copyBulk([{ src, dest }], reporter); -} - -function _readFile(loc, encoding) { - return new Promise((resolve, reject) => { - (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) { - if (err) { - reject(err); - } else { - resolve(content); - } - }); - }); -} - -function readFile(loc) { - return _readFile(loc, 'utf8').then(normalizeOS); -} - -function readFileRaw(loc) { - return _readFile(loc, 'binary'); -} - -function normalizeOS(body) { - return body.replace(/\r\n/g, '\n'); -} - -const cr = '\r'.charCodeAt(0); -const lf = '\n'.charCodeAt(0); - -/***/ }), -/* 5 */ -/***/ (function(module, exports) { - -module.exports = require("fs"); - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -class MessageError extends Error { - constructor(msg, code) { - super(msg); - this.code = code; - } - -} - -exports.MessageError = MessageError; -class ProcessSpawnError extends MessageError { - constructor(msg, code, process) { - super(msg, code); - this.process = process; - } - -} - -exports.ProcessSpawnError = ProcessSpawnError; -class SecurityError extends MessageError {} - -exports.SecurityError = SecurityError; -class ProcessTermError extends MessageError {} - -exports.ProcessTermError = ProcessTermError; -class ResponseError extends Error { - constructor(msg, responseCode) { - super(msg); - this.responseCode = responseCode; - } - -} - -exports.ResponseError = ResponseError; -class OneTimePasswordError extends Error {} -exports.OneTimePasswordError = OneTimePasswordError; - -/***/ }), -/* 7 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscriber; }); -/* unused harmony export SafeSubscriber */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isFunction__ = __webpack_require__(154); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(420); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__ = __webpack_require__(321); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config__ = __webpack_require__(185); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_hostReportError__ = __webpack_require__(323); -/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */ - - - - - - - -var Subscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subscriber, _super); - function Subscriber(destinationOrNext, error, complete) { - var _this = _super.call(this) || this; - _this.syncErrorValue = null; - _this.syncErrorThrown = false; - _this.syncErrorThrowable = false; - _this.isStopped = false; - _this._parentSubscription = null; - switch (arguments.length) { - case 0: - _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]; - break; - case 1: - if (!destinationOrNext) { - _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]; - break; - } - if (typeof destinationOrNext === 'object') { - if (destinationOrNext instanceof Subscriber) { - _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable; - _this.destination = destinationOrNext; - destinationOrNext.add(_this); - } - else { - _this.syncErrorThrowable = true; - _this.destination = new SafeSubscriber(_this, destinationOrNext); - } - break; - } - default: - _this.syncErrorThrowable = true; - _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete); - break; - } - return _this; - } - Subscriber.prototype[__WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () { return this; }; - Subscriber.create = function (next, error, complete) { - var subscriber = new Subscriber(next, error, complete); - subscriber.syncErrorThrowable = false; - return subscriber; - }; - Subscriber.prototype.next = function (value) { - if (!this.isStopped) { - this._next(value); - } - }; - Subscriber.prototype.error = function (err) { - if (!this.isStopped) { - this.isStopped = true; - this._error(err); - } - }; - Subscriber.prototype.complete = function () { - if (!this.isStopped) { - this.isStopped = true; - this._complete(); - } - }; - Subscriber.prototype.unsubscribe = function () { - if (this.closed) { - return; - } - this.isStopped = true; - _super.prototype.unsubscribe.call(this); - }; - Subscriber.prototype._next = function (value) { - this.destination.next(value); - }; - Subscriber.prototype._error = function (err) { - this.destination.error(err); - this.unsubscribe(); - }; - Subscriber.prototype._complete = function () { - this.destination.complete(); - this.unsubscribe(); - }; - Subscriber.prototype._unsubscribeAndRecycle = function () { - var _a = this, _parent = _a._parent, _parents = _a._parents; - this._parent = null; - this._parents = null; - this.unsubscribe(); - this.closed = false; - this.isStopped = false; - this._parent = _parent; - this._parents = _parents; - this._parentSubscription = null; - return this; - }; - return Subscriber; -}(__WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */])); - -var SafeSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SafeSubscriber, _super); - function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) { - var _this = _super.call(this) || this; - _this._parentSubscriber = _parentSubscriber; - var next; - var context = _this; - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(observerOrNext)) { - next = observerOrNext; - } - else if (observerOrNext) { - next = observerOrNext.next; - error = observerOrNext.error; - complete = observerOrNext.complete; - if (observerOrNext !== __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]) { - context = Object.create(observerOrNext); - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(context.unsubscribe)) { - _this.add(context.unsubscribe.bind(context)); - } - context.unsubscribe = _this.unsubscribe.bind(_this); - } - } - _this._context = context; - _this._next = next; - _this._error = error; - _this._complete = complete; - return _this; - } - SafeSubscriber.prototype.next = function (value) { - if (!this.isStopped && this._next) { - var _parentSubscriber = this._parentSubscriber; - if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { - this.__tryOrUnsub(this._next, value); - } - else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) { - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.error = function (err) { - if (!this.isStopped) { - var _parentSubscriber = this._parentSubscriber; - var useDeprecatedSynchronousErrorHandling = __WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling; - if (this._error) { - if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { - this.__tryOrUnsub(this._error, err); - this.unsubscribe(); - } - else { - this.__tryOrSetError(_parentSubscriber, this._error, err); - this.unsubscribe(); - } - } - else if (!_parentSubscriber.syncErrorThrowable) { - this.unsubscribe(); - if (useDeprecatedSynchronousErrorHandling) { - throw err; - } - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); - } - else { - if (useDeprecatedSynchronousErrorHandling) { - _parentSubscriber.syncErrorValue = err; - _parentSubscriber.syncErrorThrown = true; - } - else { - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); - } - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.complete = function () { - var _this = this; - if (!this.isStopped) { - var _parentSubscriber = this._parentSubscriber; - if (this._complete) { - var wrappedComplete = function () { return _this._complete.call(_this._context); }; - if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { - this.__tryOrUnsub(wrappedComplete); - this.unsubscribe(); - } - else { - this.__tryOrSetError(_parentSubscriber, wrappedComplete); - this.unsubscribe(); - } - } - else { - this.unsubscribe(); - } - } - }; - SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) { - try { - fn.call(this._context, value); - } - catch (err) { - this.unsubscribe(); - if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - throw err; - } - else { - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); - } - } - }; - SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) { - if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - throw new Error('bad call'); - } - try { - fn.call(this._context, value); - } - catch (err) { - if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - parent.syncErrorValue = err; - parent.syncErrorThrown = true; - return true; - } - else { - __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); - return true; - } - } - return false; - }; - SafeSubscriber.prototype._unsubscribe = function () { - var _parentSubscriber = this._parentSubscriber; - this._context = null; - this._parentSubscriber = null; - _parentSubscriber.unsubscribe(); - }; - return SafeSubscriber; -}(Subscriber)); - -//# sourceMappingURL=Subscriber.js.map - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getPathKey = getPathKey; -const os = __webpack_require__(46); -const path = __webpack_require__(0); -const userHome = __webpack_require__(67).default; - -var _require = __webpack_require__(225); - -const getCacheDir = _require.getCacheDir, - getConfigDir = _require.getConfigDir, - getDataDir = _require.getDataDir; - -const isWebpackBundle = __webpack_require__(278); - -const DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies']; -const OWNED_DEPENDENCY_TYPES = exports.OWNED_DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies']; - -const RESOLUTIONS = exports.RESOLUTIONS = 'resolutions'; -const MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES]; - -const SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0'; - -const YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com'; -const NPM_REGISTRY_RE = exports.NPM_REGISTRY_RE = /https?:\/\/registry\.npmjs\.org/g; - -const YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/'; -const YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh'; -const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi'; - -const SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; - -// cache version, bump whenever we make backwards incompatible changes -const CACHE_VERSION = exports.CACHE_VERSION = 6; - -// lockfile version, bump whenever we make backwards incompatible changes -const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; - -// max amount of network requests to perform concurrently -const NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8; - -// HTTP timeout used when downloading packages -const NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds - -// max amount of child processes to execute concurrently -const CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5; - -const REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid']; - -function getPreferredCacheDirectories() { - const preferredCacheDirectories = [getCacheDir()]; - - if (process.getuid) { - // $FlowFixMe: process.getuid exists, dammit - preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache-${process.getuid()}`)); - } - - preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache`)); - - return preferredCacheDirectories; -} - -const PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); -const CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir(); -const DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir(); -const LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link'); -const GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global'); - -const NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath; -const YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath(); - -// Webpack needs to be configured with node.__dirname/__filename = false -function getYarnBinPath() { - if (isWebpackBundle) { - return __filename; - } else { - return path.join(__dirname, '..', 'bin', 'yarn.js'); - } -} - -const NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules'; -const NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json'; - -const PNP_FILENAME = exports.PNP_FILENAME = '.pnp.js'; - -const POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`; -const FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn'); - -const META_FOLDER = exports.META_FOLDER = '.yarn-meta'; -const INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity'; -const LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock'; -const METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json'; -const TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz'; -const CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean'; - -const NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json'; -const NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json'; - -const DEFAULT_INDENT = exports.DEFAULT_INDENT = ' '; -const SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997; -const SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance'; - -const ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env); - -function getPathKey(platform, env) { - let pathKey = 'PATH'; - - // windows calls its path "Path" usually, but this is not guaranteed. - if (platform === 'win32') { - pathKey = 'Path'; - - for (const key in env) { - if (key.toLowerCase() === 'path') { - pathKey = key; - } - } - } - - return pathKey; -} - -const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { - major: 'red', - premajor: 'red', - minor: 'yellow', - preminor: 'yellow', - patch: 'green', - prepatch: 'green', - prerelease: 'red', - unchanged: 'white', - unknown: 'red' -}; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var NODE_ENV = process.env.NODE_ENV; - -var invariant = function(condition, format, a, b, c, d, e, f) { - if (NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error( - 'Minified exception occurred; use the non-minified dev environment ' + - 'for the full error message and additional helpful warnings.' - ); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error( - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -}; - -module.exports = invariant; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var YAMLException = __webpack_require__(54); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (map !== null) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports) { - -module.exports = require("crypto"); - -/***/ }), -/* 12 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Observable; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_canReportError__ = __webpack_require__(322); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__ = __webpack_require__(932); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__ = __webpack_require__(117); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(324); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(185); -/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_internal_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */ - - - - - -var Observable = /*@__PURE__*/ (function () { - function Observable(subscribe) { - this._isScalar = false; - if (subscribe) { - this._subscribe = subscribe; - } - } - Observable.prototype.lift = function (operator) { - var observable = new Observable(); - observable.source = this; - observable.operator = operator; - return observable; - }; - Observable.prototype.subscribe = function (observerOrNext, error, complete) { - var operator = this.operator; - var sink = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__["a" /* toSubscriber */])(observerOrNext, error, complete); - if (operator) { - operator.call(sink, this.source); - } - else { - sink.add(this.source || (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ? - this._subscribe(sink) : - this._trySubscribe(sink)); - } - if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - if (sink.syncErrorThrowable) { - sink.syncErrorThrowable = false; - if (sink.syncErrorThrown) { - throw sink.syncErrorValue; - } - } - } - return sink; - }; - Observable.prototype._trySubscribe = function (sink) { - try { - return this._subscribe(sink); - } - catch (err) { - if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { - sink.syncErrorThrown = true; - sink.syncErrorValue = err; - } - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_canReportError__["a" /* canReportError */])(sink)) { - sink.error(err); - } - else { - console.warn(err); - } - } - }; - Observable.prototype.forEach = function (next, promiseCtor) { - var _this = this; - promiseCtor = getPromiseCtor(promiseCtor); - return new promiseCtor(function (resolve, reject) { - var subscription; - subscription = _this.subscribe(function (value) { - try { - next(value); - } - catch (err) { - reject(err); - if (subscription) { - subscription.unsubscribe(); - } - } - }, reject, resolve); - }); - }; - Observable.prototype._subscribe = function (subscriber) { - var source = this.source; - return source && source.subscribe(subscriber); - }; - Observable.prototype[__WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__["a" /* observable */]] = function () { - return this; - }; - Observable.prototype.pipe = function () { - var operations = []; - for (var _i = 0; _i < arguments.length; _i++) { - operations[_i] = arguments[_i]; - } - if (operations.length === 0) { - return this; - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["b" /* pipeFromArray */])(operations)(this); - }; - Observable.prototype.toPromise = function (promiseCtor) { - var _this = this; - promiseCtor = getPromiseCtor(promiseCtor); - return new promiseCtor(function (resolve, reject) { - var value; - _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); }); - }); - }; - Observable.create = function (subscribe) { - return new Observable(subscribe); - }; - return Observable; -}()); - -function getPromiseCtor(promiseCtor) { - if (!promiseCtor) { - promiseCtor = __WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].Promise || Promise; - } - if (!promiseCtor) { - throw new Error('no Promise impl found'); - } - return promiseCtor; -} -//# sourceMappingURL=Observable.js.map - - -/***/ }), -/* 13 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OuterSubscriber; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); -/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ - - -var OuterSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](OuterSubscriber, _super); - function OuterSubscriber() { - return _super !== null && _super.apply(this, arguments) || this; - } - OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { - this.destination.next(innerValue); - }; - OuterSubscriber.prototype.notifyError = function (error, innerSub) { - this.destination.error(error); - }; - OuterSubscriber.prototype.notifyComplete = function (innerSub) { - this.destination.complete(); - }; - return OuterSubscriber; -}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); - -//# sourceMappingURL=OuterSubscriber.js.map - - -/***/ }), -/* 14 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = subscribeToResult; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__ = __webpack_require__(84); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeTo__ = __webpack_require__(446); -/** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo PURE_IMPORTS_END */ - - -function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, destination) { - if (destination === void 0) { - destination = new __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__["a" /* InnerSubscriber */](outerSubscriber, outerValue, outerIndex); - } - if (destination.closed) { - return; - } - return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__subscribeTo__["a" /* subscribeTo */])(result)(destination); -} -//# sourceMappingURL=subscribeToResult.js.map - - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* eslint-disable node/no-deprecated-api */ - - - -var buffer = __webpack_require__(64) -var Buffer = buffer.Buffer - -var safer = {} - -var key - -for (key in buffer) { - if (!buffer.hasOwnProperty(key)) continue - if (key === 'SlowBuffer' || key === 'Buffer') continue - safer[key] = buffer[key] -} - -var Safer = safer.Buffer = {} -for (key in Buffer) { - if (!Buffer.hasOwnProperty(key)) continue - if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue - Safer[key] = Buffer[key] -} - -safer.Buffer.prototype = Buffer.prototype - -if (!Safer.from || Safer.from === Uint8Array.from) { - Safer.from = function (value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) - } - if (value && typeof value.length === 'undefined') { - throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) - } - return Buffer(value, encodingOrOffset, length) - } -} - -if (!Safer.alloc) { - Safer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) - } - if (size < 0 || size >= 2 * (1 << 30)) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } - var buf = Buffer(size) - if (!fill || fill.length === 0) { - buf.fill(0) - } else if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - return buf - } -} - -if (!safer.kStringMaxLength) { - try { - safer.kStringMaxLength = process.binding('buffer').kStringMaxLength - } catch (e) { - // we can't determine kStringMaxLength in environments where process.binding - // is unsupported, so let's not set it - } -} - -if (!safer.constants) { - safer.constants = { - MAX_LENGTH: safer.kMaxLength - } - if (safer.kStringMaxLength) { - safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength - } -} - -module.exports = safer - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright (c) 2012, Mark Cavage. All rights reserved. -// Copyright 2015 Joyent, Inc. - -var assert = __webpack_require__(28); -var Stream = __webpack_require__(23).Stream; -var util = __webpack_require__(3); - - -///--- Globals - -/* JSSTYLED */ -var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; - - -///--- Internal - -function _capitalize(str) { - return (str.charAt(0).toUpperCase() + str.slice(1)); -} - -function _toss(name, expected, oper, arg, actual) { - throw new assert.AssertionError({ - message: util.format('%s (%s) is required', name, expected), - actual: (actual === undefined) ? typeof (arg) : actual(arg), - expected: expected, - operator: oper || '===', - stackStartFunction: _toss.caller - }); -} - -function _getClass(arg) { - return (Object.prototype.toString.call(arg).slice(8, -1)); -} - -function noop() { - // Why even bother with asserts? -} - - -///--- Exports - -var types = { - bool: { - check: function (arg) { return typeof (arg) === 'boolean'; } - }, - func: { - check: function (arg) { return typeof (arg) === 'function'; } - }, - string: { - check: function (arg) { return typeof (arg) === 'string'; } - }, - object: { - check: function (arg) { - return typeof (arg) === 'object' && arg !== null; - } - }, - number: { - check: function (arg) { - return typeof (arg) === 'number' && !isNaN(arg); - } - }, - finite: { - check: function (arg) { - return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); - } - }, - buffer: { - check: function (arg) { return Buffer.isBuffer(arg); }, - operator: 'Buffer.isBuffer' - }, - array: { - check: function (arg) { return Array.isArray(arg); }, - operator: 'Array.isArray' - }, - stream: { - check: function (arg) { return arg instanceof Stream; }, - operator: 'instanceof', - actual: _getClass - }, - date: { - check: function (arg) { return arg instanceof Date; }, - operator: 'instanceof', - actual: _getClass - }, - regexp: { - check: function (arg) { return arg instanceof RegExp; }, - operator: 'instanceof', - actual: _getClass - }, - uuid: { - check: function (arg) { - return typeof (arg) === 'string' && UUID_REGEXP.test(arg); - }, - operator: 'isUUID' - } -}; - -function _setExports(ndebug) { - var keys = Object.keys(types); - var out; - - /* re-export standard assert */ - if (process.env.NODE_NDEBUG) { - out = noop; - } else { - out = function (arg, msg) { - if (!arg) { - _toss(msg, 'true', arg); - } - }; - } - - /* standard checks */ - keys.forEach(function (k) { - if (ndebug) { - out[k] = noop; - return; - } - var type = types[k]; - out[k] = function (arg, msg) { - if (!type.check(arg)) { - _toss(msg, k, type.operator, arg, type.actual); - } - }; - }); - - /* optional checks */ - keys.forEach(function (k) { - var name = 'optional' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - out[name] = function (arg, msg) { - if (arg === undefined || arg === null) { - return; - } - if (!type.check(arg)) { - _toss(msg, k, type.operator, arg, type.actual); - } - }; - }); - - /* arrayOf checks */ - keys.forEach(function (k) { - var name = 'arrayOf' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - var expected = '[' + k + ']'; - out[name] = function (arg, msg) { - if (!Array.isArray(arg)) { - _toss(msg, expected, type.operator, arg, type.actual); - } - var i; - for (i = 0; i < arg.length; i++) { - if (!type.check(arg[i])) { - _toss(msg, expected, type.operator, arg, type.actual); - } - } - }; - }); - - /* optionalArrayOf checks */ - keys.forEach(function (k) { - var name = 'optionalArrayOf' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - var expected = '[' + k + ']'; - out[name] = function (arg, msg) { - if (arg === undefined || arg === null) { - return; - } - if (!Array.isArray(arg)) { - _toss(msg, expected, type.operator, arg, type.actual); - } - var i; - for (i = 0; i < arg.length; i++) { - if (!type.check(arg[i])) { - _toss(msg, expected, type.operator, arg, type.actual); - } - } - }; - }); - - /* re-export built-in assertions */ - Object.keys(assert).forEach(function (k) { - if (k === 'AssertionError') { - out[k] = assert[k]; - return; - } - if (ndebug) { - out[k] = noop; - return; - } - out[k] = assert[k]; - }); - - /* export ourselves (for unit tests _only_) */ - out._setExports = _setExports; - - return out; -} - -module.exports = _setExports(process.env.NODE_NDEBUG); - - -/***/ }), -/* 17 */ -/***/ (function(module, exports) { - -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); -if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.sortAlpha = sortAlpha; -exports.sortOptionsByFlags = sortOptionsByFlags; -exports.entries = entries; -exports.removePrefix = removePrefix; -exports.removeSuffix = removeSuffix; -exports.addSuffix = addSuffix; -exports.hyphenate = hyphenate; -exports.camelCase = camelCase; -exports.compareSortedArrays = compareSortedArrays; -exports.sleep = sleep; -const _camelCase = __webpack_require__(230); - -function sortAlpha(a, b) { - // sort alphabetically in a deterministic way - const shortLen = Math.min(a.length, b.length); - for (let i = 0; i < shortLen; i++) { - const aChar = a.charCodeAt(i); - const bChar = b.charCodeAt(i); - if (aChar !== bChar) { - return aChar - bChar; - } - } - return a.length - b.length; -} - -function sortOptionsByFlags(a, b) { - const aOpt = a.flags.replace(/-/g, ''); - const bOpt = b.flags.replace(/-/g, ''); - return sortAlpha(aOpt, bOpt); -} - -function entries(obj) { - const entries = []; - if (obj) { - for (const key in obj) { - entries.push([key, obj[key]]); - } - } - return entries; -} - -function removePrefix(pattern, prefix) { - if (pattern.startsWith(prefix)) { - pattern = pattern.slice(prefix.length); - } - - return pattern; -} - -function removeSuffix(pattern, suffix) { - if (pattern.endsWith(suffix)) { - return pattern.slice(0, -suffix.length); - } - - return pattern; -} - -function addSuffix(pattern, suffix) { - if (!pattern.endsWith(suffix)) { - return pattern + suffix; - } - - return pattern; -} - -function hyphenate(str) { - return str.replace(/[A-Z]/g, match => { - return '-' + match.charAt(0).toLowerCase(); - }); -} - -function camelCase(str) { - if (/[A-Z]/.test(str)) { - return null; - } else { - return _camelCase(str); - } -} - -function compareSortedArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (let i = 0, len = array1.length; i < len; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; -} - -function sleep(ms) { - return new Promise(resolve => { - setTimeout(resolve, ms); - }); -} - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.stringify = exports.parse = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -var _parse; - -function _load_parse() { - return _parse = __webpack_require__(105); -} - -Object.defineProperty(exports, 'parse', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_parse || _load_parse()).default; - } -}); - -var _stringify; - -function _load_stringify() { - return _stringify = __webpack_require__(199); -} - -Object.defineProperty(exports, 'stringify', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_stringify || _load_stringify()).default; - } -}); -exports.implodeEntry = implodeEntry; -exports.explodeEntry = explodeEntry; - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(18); -} - -var _normalizePattern; - -function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(37); -} - -var _parse2; - -function _load_parse2() { - return _parse2 = _interopRequireDefault(__webpack_require__(105)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(8); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const invariant = __webpack_require__(9); - -const path = __webpack_require__(0); -const ssri = __webpack_require__(65); - -function getName(pattern) { - return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name; -} - -function blankObjectUndefined(obj) { - return obj && Object.keys(obj).length ? obj : undefined; -} - -function keyForRemote(remote) { - return remote.resolved || (remote.reference && remote.hash ? `${remote.reference}#${remote.hash}` : null); -} - -function serializeIntegrity(integrity) { - // We need this because `Integrity.toString()` does not use sorting to ensure a stable string output - // See https://git.io/vx2Hy - return integrity.toString().split(' ').sort().join(' '); -} - -function implodeEntry(pattern, obj) { - const inferredName = getName(pattern); - const integrity = obj.integrity ? serializeIntegrity(obj.integrity) : ''; - const imploded = { - name: inferredName === obj.name ? undefined : obj.name, - version: obj.version, - uid: obj.uid === obj.version ? undefined : obj.uid, - resolved: obj.resolved, - registry: obj.registry === 'npm' ? undefined : obj.registry, - dependencies: blankObjectUndefined(obj.dependencies), - optionalDependencies: blankObjectUndefined(obj.optionalDependencies), - permissions: blankObjectUndefined(obj.permissions), - prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants) - }; - if (integrity) { - imploded.integrity = integrity; - } - return imploded; -} - -function explodeEntry(pattern, obj) { - obj.optionalDependencies = obj.optionalDependencies || {}; - obj.dependencies = obj.dependencies || {}; - obj.uid = obj.uid || obj.version; - obj.permissions = obj.permissions || {}; - obj.registry = obj.registry || 'npm'; - obj.name = obj.name || getName(pattern); - const integrity = obj.integrity; - if (integrity && integrity.isIntegrity) { - obj.integrity = ssri.parse(integrity); - } - return obj; -} - -class Lockfile { - constructor({ cache, source, parseResultType } = {}) { - this.source = source || ''; - this.cache = cache; - this.parseResultType = parseResultType; - } - - // source string if the `cache` was parsed - - - // if true, we're parsing an old yarn file and need to update integrity fields - hasEntriesExistWithoutIntegrity() { - if (!this.cache) { - return false; - } - - for (const key in this.cache) { - // $FlowFixMe - `this.cache` is clearly defined at this point - if (!/^.*@(file:|http)/.test(key) && this.cache[key] && !this.cache[key].integrity) { - return true; - } - } - - return false; - } - - static fromDirectory(dir, reporter) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // read the manifest in this directory - const lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME); - - let lockfile; - let rawLockfile = ''; - let parseResult; - - if (yield (_fs || _load_fs()).exists(lockfileLoc)) { - rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc); - parseResult = (0, (_parse2 || _load_parse2()).default)(rawLockfile, lockfileLoc); - - if (reporter) { - if (parseResult.type === 'merge') { - reporter.info(reporter.lang('lockfileMerged')); - } else if (parseResult.type === 'conflict') { - reporter.warn(reporter.lang('lockfileConflict')); - } - } - - lockfile = parseResult.object; - } else if (reporter) { - reporter.info(reporter.lang('noLockfileFound')); - } - - if (lockfile && lockfile.__metadata) { - const lockfilev2 = lockfile; - lockfile = {}; - } - - return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type }); - })(); - } - - getLocked(pattern) { - const cache = this.cache; - if (!cache) { - return undefined; - } - - const shrunk = pattern in cache && cache[pattern]; - - if (typeof shrunk === 'string') { - return this.getLocked(shrunk); - } else if (shrunk) { - explodeEntry(pattern, shrunk); - return shrunk; - } - - return undefined; - } - - removePattern(pattern) { - const cache = this.cache; - if (!cache) { - return; - } - delete cache[pattern]; - } - - getLockfile(patterns) { - const lockfile = {}; - const seen = new Map(); - - // order by name so that lockfile manifest is assigned to the first dependency with this manifest - // the others that have the same remoteKey will just refer to the first - // ordering allows for consistency in lockfile when it is serialized - const sortedPatternsKeys = Object.keys(patterns).sort((_misc || _load_misc()).sortAlpha); - - for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - const pattern = _ref; - - const pkg = patterns[pattern]; - const remote = pkg._remote, - ref = pkg._reference; - - invariant(ref, 'Package is missing a reference'); - invariant(remote, 'Package is missing a remote'); - - const remoteKey = keyForRemote(remote); - const seenPattern = remoteKey && seen.get(remoteKey); - if (seenPattern) { - // no point in duplicating it - lockfile[pattern] = seenPattern; - - // if we're relying on our name being inferred and two of the patterns have - // different inferred names then we need to set it - if (!seenPattern.name && getName(pattern) !== pkg.name) { - seenPattern.name = pkg.name; - } - continue; - } - const obj = implodeEntry(pattern, { - name: pkg.name, - version: pkg.version, - uid: pkg._uid, - resolved: remote.resolved, - integrity: remote.integrity, - registry: remote.registry, - dependencies: pkg.dependencies, - peerDependencies: pkg.peerDependencies, - optionalDependencies: pkg.optionalDependencies, - permissions: ref.permissions, - prebuiltVariants: pkg.prebuiltVariants - }); - - lockfile[pattern] = obj; - - if (remoteKey) { - seen.set(remoteKey, obj); - } - } - - return lockfile; - } -} -exports.default = Lockfile; - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -var store = __webpack_require__(133)('wks'); -var uid = __webpack_require__(137); -var Symbol = __webpack_require__(17).Symbol; -var USE_SYMBOL = typeof Symbol == 'function'; - -var $exports = module.exports = function (name) { - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; - -$exports.store = store; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _assign = __webpack_require__(591); - -var _assign2 = _interopRequireDefault(_assign); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _assign2.default || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - -/***/ }), -/* 22 */ -/***/ (function(module, exports) { - -exports = module.exports = SemVer; - -// The debug function is excluded entirely from the minified version. -/* nomin */ var debug; -/* nomin */ if (typeof process === 'object' && - /* nomin */ process.env && - /* nomin */ process.env.NODE_DEBUG && - /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) - /* nomin */ debug = function() { - /* nomin */ var args = Array.prototype.slice.call(arguments, 0); - /* nomin */ args.unshift('SEMVER'); - /* nomin */ console.log.apply(console, args); - /* nomin */ }; -/* nomin */ else - /* nomin */ debug = function() {}; - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0'; - -var MAX_LENGTH = 256; -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; - -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16; - -// The actual regexps go on exports.re -var re = exports.re = []; -var src = exports.src = []; -var R = 0; - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -var NUMERICIDENTIFIER = R++; -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -var NUMERICIDENTIFIERLOOSE = R++; -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; - - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -var NONNUMERICIDENTIFIER = R++; -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; - - -// ## Main Version -// Three dot-separated numeric identifiers. - -var MAINVERSION = R++; -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')'; - -var MAINVERSIONLOOSE = R++; -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -var PRERELEASEIDENTIFIER = R++; -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - -var PRERELEASEIDENTIFIERLOOSE = R++; -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -var PRERELEASE = R++; -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; - -var PRERELEASELOOSE = R++; -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -var BUILDIDENTIFIER = R++; -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -var BUILD = R++; -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; - - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -var FULL = R++; -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?'; - -src[FULL] = '^' + FULLPLAIN + '$'; - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?'; - -var LOOSE = R++; -src[LOOSE] = '^' + LOOSEPLAIN + '$'; - -var GTLT = R++; -src[GTLT] = '((?:<|>)?=?)'; - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++; -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -var XRANGEIDENTIFIER = R++; -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; - -var XRANGEPLAIN = R++; -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGEPLAINLOOSE = R++; -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGE = R++; -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; -var XRANGELOOSE = R++; -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -var COERCE = R++; -src[COERCE] = '(?:^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])'; - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++; -src[LONETILDE] = '(?:~>?)'; - -var TILDETRIM = R++; -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; - -var TILDE = R++; -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; -var TILDELOOSE = R++; -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++; -src[LONECARET] = '(?:\\^)'; - -var CARETTRIM = R++; -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; - -var CARET = R++; -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; -var CARETLOOSE = R++; -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++; -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; -var COMPARATOR = R++; -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; - - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++; -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; - -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; - - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++; -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$'; - -var HYPHENRANGELOOSE = R++; -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$'; - -// Star ranges basically just allow anything at all. -var STAR = R++; -src[STAR] = '(<|>)?=?\\s*\\*'; - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]); - if (!re[i]) - re[i] = new RegExp(src[i]); -} - -exports.parse = parse; -function parse(version, loose) { - if (version instanceof SemVer) - return version; - - if (typeof version !== 'string') - return null; - - if (version.length > MAX_LENGTH) - return null; - - var r = loose ? re[LOOSE] : re[FULL]; - if (!r.test(version)) - return null; - - try { - return new SemVer(version, loose); - } catch (er) { - return null; - } -} - -exports.valid = valid; -function valid(version, loose) { - var v = parse(version, loose); - return v ? v.version : null; -} - - -exports.clean = clean; -function clean(version, loose) { - var s = parse(version.trim().replace(/^[=v]+/, ''), loose); - return s ? s.version : null; -} - -exports.SemVer = SemVer; - -function SemVer(version, loose) { - if (version instanceof SemVer) { - if (version.loose === loose) - return version; - else - version = version.version; - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version); - } - - if (version.length > MAX_LENGTH) - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - - if (!(this instanceof SemVer)) - return new SemVer(version, loose); - - debug('SemVer', version, loose); - this.loose = loose; - var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); - - if (!m) - throw new TypeError('Invalid Version: ' + version); - - this.raw = version; - - // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) - throw new TypeError('Invalid major version') - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) - throw new TypeError('Invalid minor version') - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) - throw new TypeError('Invalid patch version') - - // numberify any prerelease numeric ids - if (!m[4]) - this.prerelease = []; - else - this.prerelease = m[4].split('.').map(function(id) { - if (/^[0-9]+$/.test(id)) { - var num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) - return num; - } - return id; - }); - - this.build = m[5] ? m[5].split('.') : []; - this.format(); -} - -SemVer.prototype.format = function() { - this.version = this.major + '.' + this.minor + '.' + this.patch; - if (this.prerelease.length) - this.version += '-' + this.prerelease.join('.'); - return this.version; -}; - -SemVer.prototype.toString = function() { - return this.version; -}; - -SemVer.prototype.compare = function(other) { - debug('SemVer.compare', this.version, this.loose, other); - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return this.compareMain(other) || this.comparePre(other); -}; - -SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch); -}; - -SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) - return -1; - else if (!this.prerelease.length && other.prerelease.length) - return 1; - else if (!this.prerelease.length && !other.prerelease.length) - return 0; - - var i = 0; - do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - debug('prerelease compare', i, a, b); - if (a === undefined && b === undefined) - return 0; - else if (b === undefined) - return 1; - else if (a === undefined) - return -1; - else if (a === b) - continue; - else - return compareIdentifiers(a, b); - } while (++i); -}; - -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function(release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc('pre', identifier); - break; - case 'preminor': - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc('pre', identifier); - break; - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0; - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) - this.major++; - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) - this.minor++; - this.patch = 0; - this.prerelease = []; - break; - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) - this.patch++; - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) - this.prerelease = [0]; - else { - var i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) // didn't increment anything - this.prerelease.push(0); - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) - this.prerelease = [identifier, 0]; - } else - this.prerelease = [identifier, 0]; - } - break; - - default: - throw new Error('invalid increment argument: ' + release); - } - this.format(); - this.raw = this.version; - return this; -}; - -exports.inc = inc; -function inc(version, release, loose, identifier) { - if (typeof(loose) === 'string') { - identifier = loose; - loose = undefined; - } - - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; - } -} - -exports.diff = diff; -function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - if (v1.prerelease.length || v2.prerelease.length) { - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return 'pre'+key; - } - } - } - return 'prerelease'; - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return key; - } - } - } - } -} - -exports.compareIdentifiers = compareIdentifiers; - -var numeric = /^[0-9]+$/; -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - - if (anum && bnum) { - a = +a; - b = +b; - } - - return (anum && !bnum) ? -1 : - (bnum && !anum) ? 1 : - a < b ? -1 : - a > b ? 1 : - 0; -} - -exports.rcompareIdentifiers = rcompareIdentifiers; -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); -} - -exports.major = major; -function major(a, loose) { - return new SemVer(a, loose).major; -} - -exports.minor = minor; -function minor(a, loose) { - return new SemVer(a, loose).minor; -} - -exports.patch = patch; -function patch(a, loose) { - return new SemVer(a, loose).patch; -} - -exports.compare = compare; -function compare(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); -} - -exports.compareLoose = compareLoose; -function compareLoose(a, b) { - return compare(a, b, true); -} - -exports.rcompare = rcompare; -function rcompare(a, b, loose) { - return compare(b, a, loose); -} - -exports.sort = sort; -function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compare(a, b, loose); - }); -} - -exports.rsort = rsort; -function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.rcompare(a, b, loose); - }); -} - -exports.gt = gt; -function gt(a, b, loose) { - return compare(a, b, loose) > 0; -} - -exports.lt = lt; -function lt(a, b, loose) { - return compare(a, b, loose) < 0; -} - -exports.eq = eq; -function eq(a, b, loose) { - return compare(a, b, loose) === 0; -} - -exports.neq = neq; -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; -} - -exports.gte = gte; -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; -} - -exports.lte = lte; -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; -} - -exports.cmp = cmp; -function cmp(a, op, b, loose) { - var ret; - switch (op) { - case '===': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a === b; - break; - case '!==': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a !== b; - break; - case '': case '=': case '==': ret = eq(a, b, loose); break; - case '!=': ret = neq(a, b, loose); break; - case '>': ret = gt(a, b, loose); break; - case '>=': ret = gte(a, b, loose); break; - case '<': ret = lt(a, b, loose); break; - case '<=': ret = lte(a, b, loose); break; - default: throw new TypeError('Invalid operator: ' + op); - } - return ret; -} - -exports.Comparator = Comparator; -function Comparator(comp, loose) { - if (comp instanceof Comparator) { - if (comp.loose === loose) - return comp; - else - comp = comp.value; - } - - if (!(this instanceof Comparator)) - return new Comparator(comp, loose); - - debug('comparator', comp, loose); - this.loose = loose; - this.parse(comp); - - if (this.semver === ANY) - this.value = ''; - else - this.value = this.operator + this.semver.version; - - debug('comp', this); -} - -var ANY = {}; -Comparator.prototype.parse = function(comp) { - var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var m = comp.match(r); - - if (!m) - throw new TypeError('Invalid comparator: ' + comp); - - this.operator = m[1]; - if (this.operator === '=') - this.operator = ''; - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) - this.semver = ANY; - else - this.semver = new SemVer(m[2], this.loose); -}; - -Comparator.prototype.toString = function() { - return this.value; -}; - -Comparator.prototype.test = function(version) { - debug('Comparator.test', version, this.loose); - - if (this.semver === ANY) - return true; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - return cmp(version, this.operator, this.semver, this.loose); -}; - -Comparator.prototype.intersects = function(comp, loose) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required'); - } - - var rangeTmp; - - if (this.operator === '') { - rangeTmp = new Range(comp.value, loose); - return satisfies(this.value, rangeTmp, loose); - } else if (comp.operator === '') { - rangeTmp = new Range(this.value, loose); - return satisfies(comp.semver, rangeTmp, loose); - } - - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>'); - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<'); - var sameSemVer = this.semver.version === comp.semver.version; - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<='); - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, loose) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')); - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, loose) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')); - - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; -}; - - -exports.Range = Range; -function Range(range, loose) { - if (range instanceof Range) { - if (range.loose === loose) { - return range; - } else { - return new Range(range.raw, loose); - } - } - - if (range instanceof Comparator) { - return new Range(range.value, loose); - } - - if (!(this instanceof Range)) - return new Range(range, loose); - - this.loose = loose; - - // First, split based on boolean or || - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function(range) { - return this.parseRange(range.trim()); - }, this).filter(function(c) { - // throw out any that are not relevant for whatever reason - return c.length; - }); - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); - } - - this.format(); -} - -Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; - -Range.prototype.toString = function() { - return this.range; -}; - -Range.prototype.parseRange = function(range) { - var loose = this.loose; - range = range.trim(); - debug('range', range, loose); - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug('hyphen replace', range); - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); - debug('comparator trim', range, re[COMPARATORTRIM]); - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace); - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace); - - // normalize spaces - range = range.split(/\s+/).join(' '); - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var set = range.split(' ').map(function(comp) { - return parseComparator(comp, loose); - }).join(' ').split(/\s+/); - if (this.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set = set.map(function(comp) { - return new Comparator(comp, loose); - }); - - return set; -}; - -Range.prototype.intersects = function(range, loose) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required'); - } - - return this.set.some(function(thisComparators) { - return thisComparators.every(function(thisComparator) { - return range.set.some(function(rangeComparators) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, loose); - }); - }); - }); - }); -}; - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators; -function toComparators(range, loose) { - return new Range(range, loose).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(' ').trim().split(' '); - }); -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator(comp, loose) { - debug('comp', comp); - comp = replaceCarets(comp, loose); - debug('caret', comp); - comp = replaceTildes(comp, loose); - debug('tildes', comp); - comp = replaceXRanges(comp, loose); - debug('xrange', comp); - comp = replaceStars(comp, loose); - debug('stars', comp); - return comp; -} - -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceTilde(comp, loose); - }).join(' '); -} - -function replaceTilde(comp, loose) { - var r = loose ? re[TILDELOOSE] : re[TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else if (pr) { - debug('replaceTilde pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - - debug('tilde return', ret); - return ret; - }); -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceCaret(comp, loose); - }).join(' '); -} - -function replaceCaret(comp, loose) { - debug('caret', comp, loose); - var r = loose ? re[CARETLOOSE] : re[CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) { - if (M === '0') - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; - } else if (pr) { - debug('replaceCaret pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0'; - } else { - debug('no pr'); - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0'; - } - - debug('caret return', ret); - return ret; - }); -} - -function replaceXRanges(comp, loose) { - debug('replaceXRanges', comp, loose); - return comp.split(/\s+/).map(function(comp) { - return replaceXRange(comp, loose); - }).join(' '); -} - -function replaceXRange(comp, loose) { - comp = comp.trim(); - var r = loose ? re[XRANGELOOSE] : re[XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - - if (gtlt === '=' && anyX) - gtlt = ''; - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0'; - } else { - // nothing is forbidden - ret = '*'; - } - } else if (gtlt && anyX) { - // replace X with 0 - if (xm) - m = 0; - if (xp) - p = 0; - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>='; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else if (xp) { - m = +m + 1; - p = 0; - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<'; - if (xm) - M = +M + 1; - else - m = +m + 1; - } - - ret = gtlt + M + '.' + m + '.' + p; - } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - } - - debug('xRange return', ret); - - return ret; - }); -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars(comp, loose) { - debug('replaceStars', comp, loose); - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], ''); -} - -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - - if (isX(fM)) - from = ''; - else if (isX(fm)) - from = '>=' + fM + '.0.0'; - else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0'; - else - from = '>=' + from; - - if (isX(tM)) - to = ''; - else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0'; - else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0'; - else if (tpr) - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - else - to = '<=' + to; - - return (from + ' ' + to).trim(); -} - - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function(version) { - if (!version) - return false; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version)) - return true; - } - return false; -}; - -function testSet(set, version) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) - return false; - } - - if (version.prerelease.length) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (var i = 0; i < set.length; i++) { - debug(set[i].semver); - if (set[i].semver === ANY) - continue; - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver; - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) - return true; - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false; - } - - return true; -} - -exports.satisfies = satisfies; -function satisfies(version, range, loose) { - try { - range = new Range(range, loose); - } catch (er) { - return false; - } - return range.test(version); -} - -exports.maxSatisfying = maxSatisfying; -function maxSatisfying(versions, range, loose) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range(range, loose); - } catch (er) { - return null; - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { // satisfies(v, range, loose) - if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) - max = v; - maxSV = new SemVer(max, loose); - } - } - }) - return max; -} - -exports.minSatisfying = minSatisfying; -function minSatisfying(versions, range, loose) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range(range, loose); - } catch (er) { - return null; - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { // satisfies(v, range, loose) - if (!min || minSV.compare(v) === 1) { // compare(min, v, true) - min = v; - minSV = new SemVer(min, loose); - } - } - }) - return min; -} - -exports.validRange = validRange; -function validRange(range, loose) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, loose).range || '*'; - } catch (er) { - return null; - } -} - -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr; -function ltr(version, range, loose) { - return outside(version, range, '<', loose); -} - -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr; -function gtr(version, range, loose) { - return outside(version, range, '>', loose); -} - -exports.outside = outside; -function outside(version, range, hilo, loose) { - version = new SemVer(version, loose); - range = new Range(range, loose); - - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case '>': - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = '>'; - ecomp = '>='; - break; - case '<': - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = '<'; - ecomp = '<='; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - - // If it satisifes the range it is not outside - if (satisfies(version, range, loose)) { - return false; - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; - - var high = null; - var low = null; - - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, loose)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, loose)) { - low = comparator; - } - }); - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false; - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - return true; -} - -exports.prerelease = prerelease; -function prerelease(version, loose) { - var parsed = parse(version, loose); - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; -} - -exports.intersects = intersects; -function intersects(r1, r2, loose) { - r1 = new Range(r1, loose) - r2 = new Range(r2, loose) - return r1.intersects(r2) -} - -exports.coerce = coerce; -function coerce(version) { - if (version instanceof SemVer) - return version; - - if (typeof version !== 'string') - return null; - - var match = version.match(re[COERCE]); - - if (match == null) - return null; - - return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); -} - - -/***/ }), -/* 23 */ -/***/ (function(module, exports) { - -module.exports = require("stream"); - -/***/ }), -/* 24 */ -/***/ (function(module, exports) { - -module.exports = require("url"); - -/***/ }), -/* 25 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(41); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isObject__ = __webpack_require__(444); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(154); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(56); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(48); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__ = __webpack_require__(441); -/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_tryCatch,_util_errorObject,_util_UnsubscriptionError PURE_IMPORTS_END */ - - - - - - -var Subscription = /*@__PURE__*/ (function () { - function Subscription(unsubscribe) { - this.closed = false; - this._parent = null; - this._parents = null; - this._subscriptions = null; - if (unsubscribe) { - this._unsubscribe = unsubscribe; - } - } - Subscription.prototype.unsubscribe = function () { - var hasErrors = false; - var errors; - if (this.closed) { - return; - } - var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions; - this.closed = true; - this._parent = null; - this._parents = null; - this._subscriptions = null; - var index = -1; - var len = _parents ? _parents.length : 0; - while (_parent) { - _parent.remove(this); - _parent = ++index < len && _parents[index] || null; - } - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(_unsubscribe)) { - var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(_unsubscribe).call(this); - if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) { - hasErrors = true; - errors = errors || (__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */] ? - flattenUnsubscriptionErrors(__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e.errors) : [__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e]); - } - } - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(_subscriptions)) { - index = -1; - len = _subscriptions.length; - while (++index < len) { - var sub = _subscriptions[index]; - if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isObject__["a" /* isObject */])(sub)) { - var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(sub.unsubscribe).call(sub); - if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) { - hasErrors = true; - errors = errors || []; - var err = __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e; - if (err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) { - errors = errors.concat(flattenUnsubscriptionErrors(err.errors)); - } - else { - errors.push(err); - } - } - } - } - } - if (hasErrors) { - throw new __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */](errors); - } - }; - Subscription.prototype.add = function (teardown) { - if (!teardown || (teardown === Subscription.EMPTY)) { - return Subscription.EMPTY; - } - if (teardown === this) { - return this; - } - var subscription = teardown; - switch (typeof teardown) { - case 'function': - subscription = new Subscription(teardown); - case 'object': - if (subscription.closed || typeof subscription.unsubscribe !== 'function') { - return subscription; - } - else if (this.closed) { - subscription.unsubscribe(); - return subscription; - } - else if (typeof subscription._addParent !== 'function') { - var tmp = subscription; - subscription = new Subscription(); - subscription._subscriptions = [tmp]; - } - break; - default: - throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.'); - } - var subscriptions = this._subscriptions || (this._subscriptions = []); - subscriptions.push(subscription); - subscription._addParent(this); - return subscription; - }; - Subscription.prototype.remove = function (subscription) { - var subscriptions = this._subscriptions; - if (subscriptions) { - var subscriptionIndex = subscriptions.indexOf(subscription); - if (subscriptionIndex !== -1) { - subscriptions.splice(subscriptionIndex, 1); - } - } - }; - Subscription.prototype._addParent = function (parent) { - var _a = this, _parent = _a._parent, _parents = _a._parents; - if (!_parent || _parent === parent) { - this._parent = parent; - } - else if (!_parents) { - this._parents = [parent]; - } - else if (_parents.indexOf(parent) === -1) { - _parents.push(parent); - } - }; - Subscription.EMPTY = (function (empty) { - empty.closed = true; - return empty; - }(new Subscription())); - return Subscription; -}()); - -function flattenUnsubscriptionErrors(errors) { - return errors.reduce(function (errs, err) { return errs.concat((err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) ? err.errors : err); }, []); -} -//# sourceMappingURL=Subscription.js.map - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = { - bufferSplit: bufferSplit, - addRSAMissing: addRSAMissing, - calculateDSAPublic: calculateDSAPublic, - calculateED25519Public: calculateED25519Public, - calculateX25519Public: calculateX25519Public, - mpNormalize: mpNormalize, - mpDenormalize: mpDenormalize, - ecNormalize: ecNormalize, - countZeros: countZeros, - assertCompatible: assertCompatible, - isCompatible: isCompatible, - opensslKeyDeriv: opensslKeyDeriv, - opensshCipherInfo: opensshCipherInfo, - publicFromPrivateECDSA: publicFromPrivateECDSA, - zeroPadToLength: zeroPadToLength, - writeBitString: writeBitString, - readBitString: readBitString -}; - -var assert = __webpack_require__(16); -var Buffer = __webpack_require__(15).Buffer; -var PrivateKey = __webpack_require__(33); -var Key = __webpack_require__(27); -var crypto = __webpack_require__(11); -var algs = __webpack_require__(32); -var asn1 = __webpack_require__(66); - -var ec, jsbn; -var nacl; - -var MAX_CLASS_DEPTH = 3; - -function isCompatible(obj, klass, needVer) { - if (obj === null || typeof (obj) !== 'object') - return (false); - if (needVer === undefined) - needVer = klass.prototype._sshpkApiVersion; - if (obj instanceof klass && - klass.prototype._sshpkApiVersion[0] == needVer[0]) - return (true); - var proto = Object.getPrototypeOf(obj); - var depth = 0; - while (proto.constructor.name !== klass.name) { - proto = Object.getPrototypeOf(proto); - if (!proto || ++depth > MAX_CLASS_DEPTH) - return (false); - } - if (proto.constructor.name !== klass.name) - return (false); - var ver = proto._sshpkApiVersion; - if (ver === undefined) - ver = klass._oldVersionDetect(obj); - if (ver[0] != needVer[0] || ver[1] < needVer[1]) - return (false); - return (true); -} - -function assertCompatible(obj, klass, needVer, name) { - if (name === undefined) - name = 'object'; - assert.ok(obj, name + ' must not be null'); - assert.object(obj, name + ' must be an object'); - if (needVer === undefined) - needVer = klass.prototype._sshpkApiVersion; - if (obj instanceof klass && - klass.prototype._sshpkApiVersion[0] == needVer[0]) - return; - var proto = Object.getPrototypeOf(obj); - var depth = 0; - while (proto.constructor.name !== klass.name) { - proto = Object.getPrototypeOf(proto); - assert.ok(proto && ++depth <= MAX_CLASS_DEPTH, - name + ' must be a ' + klass.name + ' instance'); - } - assert.strictEqual(proto.constructor.name, klass.name, - name + ' must be a ' + klass.name + ' instance'); - var ver = proto._sshpkApiVersion; - if (ver === undefined) - ver = klass._oldVersionDetect(obj); - assert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1], - name + ' must be compatible with ' + klass.name + ' klass ' + - 'version ' + needVer[0] + '.' + needVer[1]); -} - -var CIPHER_LEN = { - 'des-ede3-cbc': { key: 7, iv: 8 }, - 'aes-128-cbc': { key: 16, iv: 16 } -}; -var PKCS5_SALT_LEN = 8; - -function opensslKeyDeriv(cipher, salt, passphrase, count) { - assert.buffer(salt, 'salt'); - assert.buffer(passphrase, 'passphrase'); - assert.number(count, 'iteration count'); - - var clen = CIPHER_LEN[cipher]; - assert.object(clen, 'supported cipher'); - - salt = salt.slice(0, PKCS5_SALT_LEN); - - var D, D_prev, bufs; - var material = Buffer.alloc(0); - while (material.length < clen.key + clen.iv) { - bufs = []; - if (D_prev) - bufs.push(D_prev); - bufs.push(passphrase); - bufs.push(salt); - D = Buffer.concat(bufs); - for (var j = 0; j < count; ++j) - D = crypto.createHash('md5').update(D).digest(); - material = Buffer.concat([material, D]); - D_prev = D; - } - - return ({ - key: material.slice(0, clen.key), - iv: material.slice(clen.key, clen.key + clen.iv) - }); -} - -/* Count leading zero bits on a buffer */ -function countZeros(buf) { - var o = 0, obit = 8; - while (o < buf.length) { - var mask = (1 << obit); - if ((buf[o] & mask) === mask) - break; - obit--; - if (obit < 0) { - o++; - obit = 8; - } - } - return (o*8 + (8 - obit) - 1); -} - -function bufferSplit(buf, chr) { - assert.buffer(buf); - assert.string(chr); - - var parts = []; - var lastPart = 0; - var matches = 0; - for (var i = 0; i < buf.length; ++i) { - if (buf[i] === chr.charCodeAt(matches)) - ++matches; - else if (buf[i] === chr.charCodeAt(0)) - matches = 1; - else - matches = 0; - - if (matches >= chr.length) { - var newPart = i + 1; - parts.push(buf.slice(lastPart, newPart - matches)); - lastPart = newPart; - matches = 0; - } - } - if (lastPart <= buf.length) - parts.push(buf.slice(lastPart, buf.length)); - - return (parts); -} - -function ecNormalize(buf, addZero) { - assert.buffer(buf); - if (buf[0] === 0x00 && buf[1] === 0x04) { - if (addZero) - return (buf); - return (buf.slice(1)); - } else if (buf[0] === 0x04) { - if (!addZero) - return (buf); - } else { - while (buf[0] === 0x00) - buf = buf.slice(1); - if (buf[0] === 0x02 || buf[0] === 0x03) - throw (new Error('Compressed elliptic curve points ' + - 'are not supported')); - if (buf[0] !== 0x04) - throw (new Error('Not a valid elliptic curve point')); - if (!addZero) - return (buf); - } - var b = Buffer.alloc(buf.length + 1); - b[0] = 0x0; - buf.copy(b, 1); - return (b); -} - -function readBitString(der, tag) { - if (tag === undefined) - tag = asn1.Ber.BitString; - var buf = der.readString(tag, true); - assert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' + - 'not supported (0x' + buf[0].toString(16) + ')'); - return (buf.slice(1)); -} - -function writeBitString(der, buf, tag) { - if (tag === undefined) - tag = asn1.Ber.BitString; - var b = Buffer.alloc(buf.length + 1); - b[0] = 0x00; - buf.copy(b, 1); - der.writeBuffer(b, tag); -} - -function mpNormalize(buf) { - assert.buffer(buf); - while (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00) - buf = buf.slice(1); - if ((buf[0] & 0x80) === 0x80) { - var b = Buffer.alloc(buf.length + 1); - b[0] = 0x00; - buf.copy(b, 1); - buf = b; - } - return (buf); -} - -function mpDenormalize(buf) { - assert.buffer(buf); - while (buf.length > 1 && buf[0] === 0x00) - buf = buf.slice(1); - return (buf); -} - -function zeroPadToLength(buf, len) { - assert.buffer(buf); - assert.number(len); - while (buf.length > len) { - assert.equal(buf[0], 0x00); - buf = buf.slice(1); - } - while (buf.length < len) { - var b = Buffer.alloc(buf.length + 1); - b[0] = 0x00; - buf.copy(b, 1); - buf = b; - } - return (buf); -} - -function bigintToMpBuf(bigint) { - var buf = Buffer.from(bigint.toByteArray()); - buf = mpNormalize(buf); - return (buf); -} - -function calculateDSAPublic(g, p, x) { - assert.buffer(g); - assert.buffer(p); - assert.buffer(x); - try { - var bigInt = __webpack_require__(81).BigInteger; - } catch (e) { - throw (new Error('To load a PKCS#8 format DSA private key, ' + - 'the node jsbn library is required.')); - } - g = new bigInt(g); - p = new bigInt(p); - x = new bigInt(x); - var y = g.modPow(x, p); - var ybuf = bigintToMpBuf(y); - return (ybuf); -} - -function calculateED25519Public(k) { - assert.buffer(k); - - if (nacl === undefined) - nacl = __webpack_require__(76); - - var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); - return (Buffer.from(kp.publicKey)); -} - -function calculateX25519Public(k) { - assert.buffer(k); - - if (nacl === undefined) - nacl = __webpack_require__(76); - - var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); - return (Buffer.from(kp.publicKey)); -} - -function addRSAMissing(key) { - assert.object(key); - assertCompatible(key, PrivateKey, [1, 1]); - try { - var bigInt = __webpack_require__(81).BigInteger; - } catch (e) { - throw (new Error('To write a PEM private key from ' + - 'this source, the node jsbn lib is required.')); - } - - var d = new bigInt(key.part.d.data); - var buf; - - if (!key.part.dmodp) { - var p = new bigInt(key.part.p.data); - var dmodp = d.mod(p.subtract(1)); - - buf = bigintToMpBuf(dmodp); - key.part.dmodp = {name: 'dmodp', data: buf}; - key.parts.push(key.part.dmodp); - } - if (!key.part.dmodq) { - var q = new bigInt(key.part.q.data); - var dmodq = d.mod(q.subtract(1)); - - buf = bigintToMpBuf(dmodq); - key.part.dmodq = {name: 'dmodq', data: buf}; - key.parts.push(key.part.dmodq); - } -} - -function publicFromPrivateECDSA(curveName, priv) { - assert.string(curveName, 'curveName'); - assert.buffer(priv); - if (ec === undefined) - ec = __webpack_require__(139); - if (jsbn === undefined) - jsbn = __webpack_require__(81).BigInteger; - var params = algs.curves[curveName]; - var p = new jsbn(params.p); - var a = new jsbn(params.a); - var b = new jsbn(params.b); - var curve = new ec.ECCurveFp(p, a, b); - var G = curve.decodePointHex(params.G.toString('hex')); - - var d = new jsbn(mpNormalize(priv)); - var pub = G.multiply(d); - pub = Buffer.from(curve.encodePointHex(pub), 'hex'); - - var parts = []; - parts.push({name: 'curve', data: Buffer.from(curveName)}); - parts.push({name: 'Q', data: pub}); - - var key = new Key({type: 'ecdsa', curve: curve, parts: parts}); - return (key); -} - -function opensshCipherInfo(cipher) { - var inf = {}; - switch (cipher) { - case '3des-cbc': - inf.keySize = 24; - inf.blockSize = 8; - inf.opensslName = 'des-ede3-cbc'; - break; - case 'blowfish-cbc': - inf.keySize = 16; - inf.blockSize = 8; - inf.opensslName = 'bf-cbc'; - break; - case 'aes128-cbc': - case 'aes128-ctr': - case 'aes128-gcm@openssh.com': - inf.keySize = 16; - inf.blockSize = 16; - inf.opensslName = 'aes-128-' + cipher.slice(7, 10); - break; - case 'aes192-cbc': - case 'aes192-ctr': - case 'aes192-gcm@openssh.com': - inf.keySize = 24; - inf.blockSize = 16; - inf.opensslName = 'aes-192-' + cipher.slice(7, 10); - break; - case 'aes256-cbc': - case 'aes256-ctr': - case 'aes256-gcm@openssh.com': - inf.keySize = 32; - inf.blockSize = 16; - inf.opensslName = 'aes-256-' + cipher.slice(7, 10); - break; - default: - throw (new Error( - 'Unsupported openssl cipher "' + cipher + '"')); - } - return (inf); -} - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2017 Joyent, Inc. - -module.exports = Key; - -var assert = __webpack_require__(16); -var algs = __webpack_require__(32); -var crypto = __webpack_require__(11); -var Fingerprint = __webpack_require__(156); -var Signature = __webpack_require__(75); -var DiffieHellman = __webpack_require__(325).DiffieHellman; -var errs = __webpack_require__(74); -var utils = __webpack_require__(26); -var PrivateKey = __webpack_require__(33); -var edCompat; - -try { - edCompat = __webpack_require__(454); -} catch (e) { - /* Just continue through, and bail out if we try to use it. */ -} - -var InvalidAlgorithmError = errs.InvalidAlgorithmError; -var KeyParseError = errs.KeyParseError; - -var formats = {}; -formats['auto'] = __webpack_require__(455); -formats['pem'] = __webpack_require__(86); -formats['pkcs1'] = __webpack_require__(327); -formats['pkcs8'] = __webpack_require__(157); -formats['rfc4253'] = __webpack_require__(103); -formats['ssh'] = __webpack_require__(456); -formats['ssh-private'] = __webpack_require__(192); -formats['openssh'] = formats['ssh-private']; -formats['dnssec'] = __webpack_require__(326); - -function Key(opts) { - assert.object(opts, 'options'); - assert.arrayOfObject(opts.parts, 'options.parts'); - assert.string(opts.type, 'options.type'); - assert.optionalString(opts.comment, 'options.comment'); - - var algInfo = algs.info[opts.type]; - if (typeof (algInfo) !== 'object') - throw (new InvalidAlgorithmError(opts.type)); - - var partLookup = {}; - for (var i = 0; i < opts.parts.length; ++i) { - var part = opts.parts[i]; - partLookup[part.name] = part; - } - - this.type = opts.type; - this.parts = opts.parts; - this.part = partLookup; - this.comment = undefined; - this.source = opts.source; - - /* for speeding up hashing/fingerprint operations */ - this._rfc4253Cache = opts._rfc4253Cache; - this._hashCache = {}; - - var sz; - this.curve = undefined; - if (this.type === 'ecdsa') { - var curve = this.part.curve.data.toString(); - this.curve = curve; - sz = algs.curves[curve].size; - } else if (this.type === 'ed25519' || this.type === 'curve25519') { - sz = 256; - this.curve = 'curve25519'; - } else { - var szPart = this.part[algInfo.sizePart]; - sz = szPart.data.length; - sz = sz * 8 - utils.countZeros(szPart.data); - } - this.size = sz; -} - -Key.formats = formats; - -Key.prototype.toBuffer = function (format, options) { - if (format === undefined) - format = 'ssh'; - assert.string(format, 'format'); - assert.object(formats[format], 'formats[format]'); - assert.optionalObject(options, 'options'); - - if (format === 'rfc4253') { - if (this._rfc4253Cache === undefined) - this._rfc4253Cache = formats['rfc4253'].write(this); - return (this._rfc4253Cache); - } - - return (formats[format].write(this, options)); -}; - -Key.prototype.toString = function (format, options) { - return (this.toBuffer(format, options).toString()); -}; - -Key.prototype.hash = function (algo) { - assert.string(algo, 'algorithm'); - algo = algo.toLowerCase(); - if (algs.hashAlgs[algo] === undefined) - throw (new InvalidAlgorithmError(algo)); - - if (this._hashCache[algo]) - return (this._hashCache[algo]); - var hash = crypto.createHash(algo). - update(this.toBuffer('rfc4253')).digest(); - this._hashCache[algo] = hash; - return (hash); -}; - -Key.prototype.fingerprint = function (algo) { - if (algo === undefined) - algo = 'sha256'; - assert.string(algo, 'algorithm'); - var opts = { - type: 'key', - hash: this.hash(algo), - algorithm: algo - }; - return (new Fingerprint(opts)); -}; - -Key.prototype.defaultHashAlgorithm = function () { - var hashAlgo = 'sha1'; - if (this.type === 'rsa') - hashAlgo = 'sha256'; - if (this.type === 'dsa' && this.size > 1024) - hashAlgo = 'sha256'; - if (this.type === 'ed25519') - hashAlgo = 'sha512'; - if (this.type === 'ecdsa') { - if (this.size <= 256) - hashAlgo = 'sha256'; - else if (this.size <= 384) - hashAlgo = 'sha384'; - else - hashAlgo = 'sha512'; - } - return (hashAlgo); -}; - -Key.prototype.createVerify = function (hashAlgo) { - if (hashAlgo === undefined) - hashAlgo = this.defaultHashAlgorithm(); - assert.string(hashAlgo, 'hash algorithm'); - - /* ED25519 is not supported by OpenSSL, use a javascript impl. */ - if (this.type === 'ed25519' && edCompat !== undefined) - return (new edCompat.Verifier(this, hashAlgo)); - if (this.type === 'curve25519') - throw (new Error('Curve25519 keys are not suitable for ' + - 'signing or verification')); - - var v, nm, err; - try { - nm = hashAlgo.toUpperCase(); - v = crypto.createVerify(nm); - } catch (e) { - err = e; - } - if (v === undefined || (err instanceof Error && - err.message.match(/Unknown message digest/))) { - nm = 'RSA-'; - nm += hashAlgo.toUpperCase(); - v = crypto.createVerify(nm); - } - assert.ok(v, 'failed to create verifier'); - var oldVerify = v.verify.bind(v); - var key = this.toBuffer('pkcs8'); - var curve = this.curve; - var self = this; - v.verify = function (signature, fmt) { - if (Signature.isSignature(signature, [2, 0])) { - if (signature.type !== self.type) - return (false); - if (signature.hashAlgorithm && - signature.hashAlgorithm !== hashAlgo) - return (false); - if (signature.curve && self.type === 'ecdsa' && - signature.curve !== curve) - return (false); - return (oldVerify(key, signature.toBuffer('asn1'))); - - } else if (typeof (signature) === 'string' || - Buffer.isBuffer(signature)) { - return (oldVerify(key, signature, fmt)); - - /* - * Avoid doing this on valid arguments, walking the prototype - * chain can be quite slow. - */ - } else if (Signature.isSignature(signature, [1, 0])) { - throw (new Error('signature was created by too old ' + - 'a version of sshpk and cannot be verified')); - - } else { - throw (new TypeError('signature must be a string, ' + - 'Buffer, or Signature object')); - } - }; - return (v); -}; - -Key.prototype.createDiffieHellman = function () { - if (this.type === 'rsa') - throw (new Error('RSA keys do not support Diffie-Hellman')); - - return (new DiffieHellman(this)); -}; -Key.prototype.createDH = Key.prototype.createDiffieHellman; - -Key.parse = function (data, format, options) { - if (typeof (data) !== 'string') - assert.buffer(data, 'data'); - if (format === undefined) - format = 'auto'; - assert.string(format, 'format'); - if (typeof (options) === 'string') - options = { filename: options }; - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - assert.optionalString(options.filename, 'options.filename'); - if (options.filename === undefined) - options.filename = '(unnamed)'; - - assert.object(formats[format], 'formats[format]'); - - try { - var k = formats[format].read(data, options); - if (k instanceof PrivateKey) - k = k.toPublic(); - if (!k.comment) - k.comment = options.filename; - return (k); - } catch (e) { - if (e.name === 'KeyEncryptedError') - throw (e); - throw (new KeyParseError(options.filename, format, e)); - } -}; - -Key.isKey = function (obj, ver) { - return (utils.isCompatible(obj, Key, ver)); -}; - -/* - * API versions for Key: - * [1,0] -- initial ver, may take Signature for createVerify or may not - * [1,1] -- added pkcs1, pkcs8 formats - * [1,2] -- added auto, ssh-private, openssh formats - * [1,3] -- added defaultHashAlgorithm - * [1,4] -- added ed support, createDH - * [1,5] -- first explicitly tagged version - * [1,6] -- changed ed25519 part names - */ -Key.prototype._sshpkApiVersion = [1, 6]; - -Key._oldVersionDetect = function (obj) { - assert.func(obj.toBuffer); - assert.func(obj.fingerprint); - if (obj.createDH) - return ([1, 4]); - if (obj.defaultHashAlgorithm) - return ([1, 3]); - if (obj.formats['auto']) - return ([1, 2]); - if (obj.formats['pkcs1']) - return ([1, 1]); - return ([1, 0]); -}; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports) { - -module.exports = require("assert"); - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = nullify; -function nullify(obj = {}) { - if (Array.isArray(obj)) { - for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - const item = _ref; - - nullify(item); - } - } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') { - Object.setPrototypeOf(obj, null); - - // for..in can only be applied to 'object', not 'function' - if (typeof obj === 'object') { - for (const key in obj) { - nullify(obj[key]); - } - } - } - - return obj; -} - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const escapeStringRegexp = __webpack_require__(388); -const ansiStyles = __webpack_require__(506); -const stdoutColor = __webpack_require__(598).stdout; - -const template = __webpack_require__(599); - -const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); - -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; - -// `color-convert` models to exclude from the Chalk API due to conflicts and such -const skipModels = new Set(['gray']); - -const styles = Object.create(null); - -function applyOptions(obj, options) { - options = options || {}; - - // Detect level if not set manually - const scLevel = stdoutColor ? stdoutColor.level : 0; - obj.level = options.level === undefined ? scLevel : options.level; - obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; -} - -function Chalk(options) { - // We check for this.template here since calling `chalk.constructor()` - // by itself will have a `this` of a previously constructed chalk object - if (!this || !(this instanceof Chalk) || this.template) { - const chalk = {}; - applyOptions(chalk, options); - - chalk.template = function () { - const args = [].slice.call(arguments); - return chalkTag.apply(null, [chalk.template].concat(args)); - }; - - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); - - chalk.template.constructor = Chalk; - - return chalk.template; - } - - applyOptions(this, options); -} - -// Use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001B[94m'; -} - -for (const key of Object.keys(ansiStyles)) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); - - styles[key] = { - get() { - const codes = ansiStyles[key]; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); - } - }; -} - -styles.visible = { - get() { - return build.call(this, this._styles || [], true, 'visible'); - } -}; - -ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); -for (const model of Object.keys(ansiStyles.color.ansi)) { - if (skipModels.has(model)) { - continue; - } - - styles[model] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.color.close, - closeRe: ansiStyles.color.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); - }; - } - }; -} - -ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); -for (const model of Object.keys(ansiStyles.bgColor.ansi)) { - if (skipModels.has(model)) { - continue; - } - - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.bgColor.close, - closeRe: ansiStyles.bgColor.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); - }; - } - }; -} - -const proto = Object.defineProperties(() => {}, styles); - -function build(_styles, _empty, key) { - const builder = function () { - return applyStyle.apply(builder, arguments); - }; - - builder._styles = _styles; - builder._empty = _empty; - - const self = this; - - Object.defineProperty(builder, 'level', { - enumerable: true, - get() { - return self.level; - }, - set(level) { - self.level = level; - } - }); - - Object.defineProperty(builder, 'enabled', { - enumerable: true, - get() { - return self.enabled; - }, - set(enabled) { - self.enabled = enabled; - } - }); - - // See below for fix regarding invisible grey/dim combination on Windows - builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; - - // `__proto__` is used because we must return a function, but there is - // no way to create a function with a different prototype - builder.__proto__ = proto; // eslint-disable-line no-proto - - return builder; -} - -function applyStyle() { - // Support varags, but simply cast to string in case there's only one arg - const args = arguments; - const argsLen = args.length; - let str = String(arguments[0]); - - if (argsLen === 0) { - return ''; - } - - if (argsLen > 1) { - // Don't slice `arguments`, it prevents V8 optimizations - for (let a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } - - if (!this.enabled || this.level <= 0 || !str) { - return this._empty ? '' : str; - } - - // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, - // see https://github.com/chalk/chalk/issues/58 - // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. - const originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && this.hasGrey) { - ansiStyles.dim.open = ''; - } - - for (const code of this._styles.slice().reverse()) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - str = code.open + str.replace(code.closeRe, code.open) + code.close; - - // Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS - // https://github.com/chalk/chalk/pull/92 - str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); - } - - // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue - ansiStyles.dim.open = originalDim; - - return str; -} - -function chalkTag(chalk, strings) { - if (!Array.isArray(strings)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return [].slice.call(arguments, 1).join(' '); - } - - const args = [].slice.call(arguments, 2); - const parts = [strings.raw[0]]; - - for (let i = 1; i < strings.length; i++) { - parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); - parts.push(String(strings.raw[i])); - } - - return template(chalk, parts.join('')); -} - -Object.defineProperties(Chalk.prototype, styles); - -module.exports = Chalk(); // eslint-disable-line new-cap -module.exports.supportsColor = stdoutColor; -module.exports.default = module.exports; // For TypeScript - - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -var core = module.exports = { version: '2.5.7' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -var Buffer = __webpack_require__(15).Buffer; - -var algInfo = { - 'dsa': { - parts: ['p', 'q', 'g', 'y'], - sizePart: 'p' - }, - 'rsa': { - parts: ['e', 'n'], - sizePart: 'n' - }, - 'ecdsa': { - parts: ['curve', 'Q'], - sizePart: 'Q' - }, - 'ed25519': { - parts: ['A'], - sizePart: 'A' - } -}; -algInfo['curve25519'] = algInfo['ed25519']; - -var algPrivInfo = { - 'dsa': { - parts: ['p', 'q', 'g', 'y', 'x'] - }, - 'rsa': { - parts: ['n', 'e', 'd', 'iqmp', 'p', 'q'] - }, - 'ecdsa': { - parts: ['curve', 'Q', 'd'] - }, - 'ed25519': { - parts: ['A', 'k'] - } -}; -algPrivInfo['curve25519'] = algPrivInfo['ed25519']; - -var hashAlgs = { - 'md5': true, - 'sha1': true, - 'sha256': true, - 'sha384': true, - 'sha512': true -}; - -/* - * Taken from - * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf - */ -var curves = { - 'nistp256': { - size: 256, - pkcs8oid: '1.2.840.10045.3.1.7', - p: Buffer.from(('00' + - 'ffffffff 00000001 00000000 00000000' + - '00000000 ffffffff ffffffff ffffffff'). - replace(/ /g, ''), 'hex'), - a: Buffer.from(('00' + - 'FFFFFFFF 00000001 00000000 00000000' + - '00000000 FFFFFFFF FFFFFFFF FFFFFFFC'). - replace(/ /g, ''), 'hex'), - b: Buffer.from(( - '5ac635d8 aa3a93e7 b3ebbd55 769886bc' + - '651d06b0 cc53b0f6 3bce3c3e 27d2604b'). - replace(/ /g, ''), 'hex'), - s: Buffer.from(('00' + - 'c49d3608 86e70493 6a6678e1 139d26b7' + - '819f7e90'). - replace(/ /g, ''), 'hex'), - n: Buffer.from(('00' + - 'ffffffff 00000000 ffffffff ffffffff' + - 'bce6faad a7179e84 f3b9cac2 fc632551'). - replace(/ /g, ''), 'hex'), - G: Buffer.from(('04' + - '6b17d1f2 e12c4247 f8bce6e5 63a440f2' + - '77037d81 2deb33a0 f4a13945 d898c296' + - '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' + - '2bce3357 6b315ece cbb64068 37bf51f5'). - replace(/ /g, ''), 'hex') - }, - 'nistp384': { - size: 384, - pkcs8oid: '1.3.132.0.34', - p: Buffer.from(('00' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff fffffffe' + - 'ffffffff 00000000 00000000 ffffffff'). - replace(/ /g, ''), 'hex'), - a: Buffer.from(('00' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' + - 'FFFFFFFF 00000000 00000000 FFFFFFFC'). - replace(/ /g, ''), 'hex'), - b: Buffer.from(( - 'b3312fa7 e23ee7e4 988e056b e3f82d19' + - '181d9c6e fe814112 0314088f 5013875a' + - 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'). - replace(/ /g, ''), 'hex'), - s: Buffer.from(('00' + - 'a335926a a319a27a 1d00896a 6773a482' + - '7acdac73'). - replace(/ /g, ''), 'hex'), - n: Buffer.from(('00' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff c7634d81 f4372ddf' + - '581a0db2 48b0a77a ecec196a ccc52973'). - replace(/ /g, ''), 'hex'), - G: Buffer.from(('04' + - 'aa87ca22 be8b0537 8eb1c71e f320ad74' + - '6e1d3b62 8ba79b98 59f741e0 82542a38' + - '5502f25d bf55296c 3a545e38 72760ab7' + - '3617de4a 96262c6f 5d9e98bf 9292dc29' + - 'f8f41dbd 289a147c e9da3113 b5f0b8c0' + - '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'). - replace(/ /g, ''), 'hex') - }, - 'nistp521': { - size: 521, - pkcs8oid: '1.3.132.0.35', - p: Buffer.from(( - '01ffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffff').replace(/ /g, ''), 'hex'), - a: Buffer.from(('01FF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC'). - replace(/ /g, ''), 'hex'), - b: Buffer.from(('51' + - '953eb961 8e1c9a1f 929a21a0 b68540ee' + - 'a2da725b 99b315f3 b8b48991 8ef109e1' + - '56193951 ec7e937b 1652c0bd 3bb1bf07' + - '3573df88 3d2c34f1 ef451fd4 6b503f00'). - replace(/ /g, ''), 'hex'), - s: Buffer.from(('00' + - 'd09e8800 291cb853 96cc6717 393284aa' + - 'a0da64ba').replace(/ /g, ''), 'hex'), - n: Buffer.from(('01ff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff fffffffa' + - '51868783 bf2f966b 7fcc0148 f709a5d0' + - '3bb5c9b8 899c47ae bb6fb71e 91386409'). - replace(/ /g, ''), 'hex'), - G: Buffer.from(('04' + - '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' + - '9c648139 053fb521 f828af60 6b4d3dba' + - 'a14b5e77 efe75928 fe1dc127 a2ffa8de' + - '3348b3c1 856a429b f97e7e31 c2e5bd66' + - '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' + - '98f54449 579b4468 17afbd17 273e662c' + - '97ee7299 5ef42640 c550b901 3fad0761' + - '353c7086 a272c240 88be9476 9fd16650'). - replace(/ /g, ''), 'hex') - } -}; - -module.exports = { - info: algInfo, - privInfo: algPrivInfo, - hashAlgs: hashAlgs, - curves: curves -}; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2017 Joyent, Inc. - -module.exports = PrivateKey; - -var assert = __webpack_require__(16); -var Buffer = __webpack_require__(15).Buffer; -var algs = __webpack_require__(32); -var crypto = __webpack_require__(11); -var Fingerprint = __webpack_require__(156); -var Signature = __webpack_require__(75); -var errs = __webpack_require__(74); -var util = __webpack_require__(3); -var utils = __webpack_require__(26); -var dhe = __webpack_require__(325); -var generateECDSA = dhe.generateECDSA; -var generateED25519 = dhe.generateED25519; -var edCompat; -var nacl; - -try { - edCompat = __webpack_require__(454); -} catch (e) { - /* Just continue through, and bail out if we try to use it. */ -} - -var Key = __webpack_require__(27); - -var InvalidAlgorithmError = errs.InvalidAlgorithmError; -var KeyParseError = errs.KeyParseError; -var KeyEncryptedError = errs.KeyEncryptedError; - -var formats = {}; -formats['auto'] = __webpack_require__(455); -formats['pem'] = __webpack_require__(86); -formats['pkcs1'] = __webpack_require__(327); -formats['pkcs8'] = __webpack_require__(157); -formats['rfc4253'] = __webpack_require__(103); -formats['ssh-private'] = __webpack_require__(192); -formats['openssh'] = formats['ssh-private']; -formats['ssh'] = formats['ssh-private']; -formats['dnssec'] = __webpack_require__(326); - -function PrivateKey(opts) { - assert.object(opts, 'options'); - Key.call(this, opts); - - this._pubCache = undefined; -} -util.inherits(PrivateKey, Key); - -PrivateKey.formats = formats; - -PrivateKey.prototype.toBuffer = function (format, options) { - if (format === undefined) - format = 'pkcs1'; - assert.string(format, 'format'); - assert.object(formats[format], 'formats[format]'); - assert.optionalObject(options, 'options'); - - return (formats[format].write(this, options)); -}; - -PrivateKey.prototype.hash = function (algo) { - return (this.toPublic().hash(algo)); -}; - -PrivateKey.prototype.toPublic = function () { - if (this._pubCache) - return (this._pubCache); - - var algInfo = algs.info[this.type]; - var pubParts = []; - for (var i = 0; i < algInfo.parts.length; ++i) { - var p = algInfo.parts[i]; - pubParts.push(this.part[p]); - } - - this._pubCache = new Key({ - type: this.type, - source: this, - parts: pubParts - }); - if (this.comment) - this._pubCache.comment = this.comment; - return (this._pubCache); -}; - -PrivateKey.prototype.derive = function (newType) { - assert.string(newType, 'type'); - var priv, pub, pair; - - if (this.type === 'ed25519' && newType === 'curve25519') { - if (nacl === undefined) - nacl = __webpack_require__(76); - - priv = this.part.k.data; - if (priv[0] === 0x00) - priv = priv.slice(1); - - pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv)); - pub = Buffer.from(pair.publicKey); - - return (new PrivateKey({ - type: 'curve25519', - parts: [ - { name: 'A', data: utils.mpNormalize(pub) }, - { name: 'k', data: utils.mpNormalize(priv) } - ] - })); - } else if (this.type === 'curve25519' && newType === 'ed25519') { - if (nacl === undefined) - nacl = __webpack_require__(76); - - priv = this.part.k.data; - if (priv[0] === 0x00) - priv = priv.slice(1); - - pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv)); - pub = Buffer.from(pair.publicKey); - - return (new PrivateKey({ - type: 'ed25519', - parts: [ - { name: 'A', data: utils.mpNormalize(pub) }, - { name: 'k', data: utils.mpNormalize(priv) } - ] - })); - } - throw (new Error('Key derivation not supported from ' + this.type + - ' to ' + newType)); -}; - -PrivateKey.prototype.createVerify = function (hashAlgo) { - return (this.toPublic().createVerify(hashAlgo)); -}; - -PrivateKey.prototype.createSign = function (hashAlgo) { - if (hashAlgo === undefined) - hashAlgo = this.defaultHashAlgorithm(); - assert.string(hashAlgo, 'hash algorithm'); - - /* ED25519 is not supported by OpenSSL, use a javascript impl. */ - if (this.type === 'ed25519' && edCompat !== undefined) - return (new edCompat.Signer(this, hashAlgo)); - if (this.type === 'curve25519') - throw (new Error('Curve25519 keys are not suitable for ' + - 'signing or verification')); - - var v, nm, err; - try { - nm = hashAlgo.toUpperCase(); - v = crypto.createSign(nm); - } catch (e) { - err = e; - } - if (v === undefined || (err instanceof Error && - err.message.match(/Unknown message digest/))) { - nm = 'RSA-'; - nm += hashAlgo.toUpperCase(); - v = crypto.createSign(nm); - } - assert.ok(v, 'failed to create verifier'); - var oldSign = v.sign.bind(v); - var key = this.toBuffer('pkcs1'); - var type = this.type; - var curve = this.curve; - v.sign = function () { - var sig = oldSign(key); - if (typeof (sig) === 'string') - sig = Buffer.from(sig, 'binary'); - sig = Signature.parse(sig, type, 'asn1'); - sig.hashAlgorithm = hashAlgo; - sig.curve = curve; - return (sig); - }; - return (v); -}; - -PrivateKey.parse = function (data, format, options) { - if (typeof (data) !== 'string') - assert.buffer(data, 'data'); - if (format === undefined) - format = 'auto'; - assert.string(format, 'format'); - if (typeof (options) === 'string') - options = { filename: options }; - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - assert.optionalString(options.filename, 'options.filename'); - if (options.filename === undefined) - options.filename = '(unnamed)'; - - assert.object(formats[format], 'formats[format]'); - - try { - var k = formats[format].read(data, options); - assert.ok(k instanceof PrivateKey, 'key is not a private key'); - if (!k.comment) - k.comment = options.filename; - return (k); - } catch (e) { - if (e.name === 'KeyEncryptedError') - throw (e); - throw (new KeyParseError(options.filename, format, e)); - } -}; - -PrivateKey.isPrivateKey = function (obj, ver) { - return (utils.isCompatible(obj, PrivateKey, ver)); -}; - -PrivateKey.generate = function (type, options) { - if (options === undefined) - options = {}; - assert.object(options, 'options'); - - switch (type) { - case 'ecdsa': - if (options.curve === undefined) - options.curve = 'nistp256'; - assert.string(options.curve, 'options.curve'); - return (generateECDSA(options.curve)); - case 'ed25519': - return (generateED25519()); - default: - throw (new Error('Key generation not supported with key ' + - 'type "' + type + '"')); - } -}; - -/* - * API versions for PrivateKey: - * [1,0] -- initial ver - * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats - * [1,2] -- added defaultHashAlgorithm - * [1,3] -- added derive, ed, createDH - * [1,4] -- first tagged version - * [1,5] -- changed ed25519 part names and format - */ -PrivateKey.prototype._sshpkApiVersion = [1, 5]; - -PrivateKey._oldVersionDetect = function (obj) { - assert.func(obj.toPublic); - assert.func(obj.createSign); - if (obj.derive) - return ([1, 3]); - if (obj.defaultHashAlgorithm) - return ([1, 2]); - if (obj.formats['auto']) - return ([1, 1]); - return ([1, 0]); -}; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefined; - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(21)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -let install = exports.install = (() => { - var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) { - yield wrapLifecycle(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const install = new Install(flags, config, reporter, lockfile); - yield install.init(); - })); - }); - - return function install(_x7, _x8, _x9, _x10) { - return _ref29.apply(this, arguments); - }; -})(); - -let run = exports.run = (() => { - var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - let lockfile; - let error = 'installCommandRenamed'; - if (flags.lockfile === false) { - lockfile = new (_lockfile || _load_lockfile()).default(); - } else { - lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - } - - if (args.length) { - const exampleArgs = args.slice(); - - if (flags.saveDev) { - exampleArgs.push('--dev'); - } - if (flags.savePeer) { - exampleArgs.push('--peer'); - } - if (flags.saveOptional) { - exampleArgs.push('--optional'); - } - if (flags.saveExact) { - exampleArgs.push('--exact'); - } - if (flags.saveTilde) { - exampleArgs.push('--tilde'); - } - let command = 'add'; - if (flags.global) { - error = 'globalFlagRemoved'; - command = 'global add'; - } - throw new (_errors || _load_errors()).MessageError(reporter.lang(error, `yarn ${command} ${exampleArgs.join(' ')}`)); - } - - yield install(config, reporter, flags, lockfile); - }); - - return function run(_x11, _x12, _x13, _x14) { - return _ref31.apply(this, arguments); - }; -})(); - -let wrapLifecycle = exports.wrapLifecycle = (() => { - var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) { - yield config.executeLifecycleScript('preinstall'); - - yield factory(); - - // npm behaviour, seems kinda funky but yay compatibility - yield config.executeLifecycleScript('install'); - yield config.executeLifecycleScript('postinstall'); - - if (!config.production) { - if (!config.disablePrepublish) { - yield config.executeLifecycleScript('prepublish'); - } - yield config.executeLifecycleScript('prepare'); - } - }); - - return function wrapLifecycle(_x15, _x16, _x17) { - return _ref32.apply(this, arguments); - }; -})(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _objectPath; - -function _load_objectPath() { - return _objectPath = _interopRequireDefault(__webpack_require__(304)); -} - -var _hooks; - -function _load_hooks() { - return _hooks = __webpack_require__(374); -} - -var _index; - -function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(220)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _integrityChecker; - -function _load_integrityChecker() { - return _integrityChecker = _interopRequireDefault(__webpack_require__(208)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(19)); -} - -var _lockfile2; - -function _load_lockfile2() { - return _lockfile2 = __webpack_require__(19); -} - -var _packageFetcher; - -function _load_packageFetcher() { - return _packageFetcher = _interopRequireWildcard(__webpack_require__(210)); -} - -var _packageInstallScripts; - -function _load_packageInstallScripts() { - return _packageInstallScripts = _interopRequireDefault(__webpack_require__(557)); -} - -var _packageCompatibility; - -function _load_packageCompatibility() { - return _packageCompatibility = _interopRequireWildcard(__webpack_require__(209)); -} - -var _packageResolver; - -function _load_packageResolver() { - return _packageResolver = _interopRequireDefault(__webpack_require__(366)); -} - -var _packageLinker; - -function _load_packageLinker() { - return _packageLinker = _interopRequireDefault(__webpack_require__(211)); -} - -var _index2; - -function _load_index2() { - return _index2 = __webpack_require__(57); -} - -var _index3; - -function _load_index3() { - return _index3 = __webpack_require__(78); -} - -var _autoclean; - -function _load_autoclean() { - return _autoclean = __webpack_require__(354); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(8)); -} - -var _normalizePattern; - -function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(37); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(29)); -} - -var _yarnVersion; - -function _load_yarnVersion() { - return _yarnVersion = __webpack_require__(120); -} - -var _generatePnpMap; - -function _load_generatePnpMap() { - return _generatePnpMap = __webpack_require__(579); -} - -var _workspaceLayout; - -function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(90)); -} - -var _resolutionMap; - -function _load_resolutionMap() { - return _resolutionMap = _interopRequireDefault(__webpack_require__(214)); -} - -var _guessName; - -function _load_guessName() { - return _guessName = _interopRequireDefault(__webpack_require__(169)); -} - -var _audit; - -function _load_audit() { - return _audit = _interopRequireDefault(__webpack_require__(353)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const deepEqual = __webpack_require__(631); - -const emoji = __webpack_require__(302); -const invariant = __webpack_require__(9); -const path = __webpack_require__(0); -const semver = __webpack_require__(22); -const uuid = __webpack_require__(119); -const ssri = __webpack_require__(65); - -const ONE_DAY = 1000 * 60 * 60 * 24; - -/** - * Try and detect the installation method for Yarn and provide a command to update it with. - */ - -function getUpdateCommand(installationMethod) { - if (installationMethod === 'tar') { - return `curl --compressed -o- -L ${(_constants || _load_constants()).YARN_INSTALLER_SH} | bash`; - } - - if (installationMethod === 'homebrew') { - return 'brew upgrade yarn'; - } - - if (installationMethod === 'deb') { - return 'sudo apt-get update && sudo apt-get install yarn'; - } - - if (installationMethod === 'rpm') { - return 'sudo yum install yarn'; - } - - if (installationMethod === 'npm') { - return 'npm install --global yarn'; - } - - if (installationMethod === 'chocolatey') { - return 'choco upgrade yarn'; - } - - if (installationMethod === 'apk') { - return 'apk update && apk add -u yarn'; - } - - if (installationMethod === 'portage') { - return 'sudo emerge --sync && sudo emerge -au sys-apps/yarn'; - } - - return null; -} - -function getUpdateInstaller(installationMethod) { - // Windows - if (installationMethod === 'msi') { - return (_constants || _load_constants()).YARN_INSTALLER_MSI; - } - - return null; -} - -function normalizeFlags(config, rawFlags) { - const flags = { - // install - har: !!rawFlags.har, - ignorePlatform: !!rawFlags.ignorePlatform, - ignoreEngines: !!rawFlags.ignoreEngines, - ignoreScripts: !!rawFlags.ignoreScripts, - ignoreOptional: !!rawFlags.ignoreOptional, - force: !!rawFlags.force, - flat: !!rawFlags.flat, - lockfile: rawFlags.lockfile !== false, - pureLockfile: !!rawFlags.pureLockfile, - updateChecksums: !!rawFlags.updateChecksums, - skipIntegrityCheck: !!rawFlags.skipIntegrityCheck, - frozenLockfile: !!rawFlags.frozenLockfile, - linkDuplicates: !!rawFlags.linkDuplicates, - checkFiles: !!rawFlags.checkFiles, - audit: !!rawFlags.audit, - - // add - peer: !!rawFlags.peer, - dev: !!rawFlags.dev, - optional: !!rawFlags.optional, - exact: !!rawFlags.exact, - tilde: !!rawFlags.tilde, - ignoreWorkspaceRootCheck: !!rawFlags.ignoreWorkspaceRootCheck, - - // outdated, update-interactive - includeWorkspaceDeps: !!rawFlags.includeWorkspaceDeps, - - // add, remove, update - workspaceRootIsCwd: rawFlags.workspaceRootIsCwd !== false - }; - - if (config.getOption('ignore-scripts')) { - flags.ignoreScripts = true; - } - - if (config.getOption('ignore-platform')) { - flags.ignorePlatform = true; - } - - if (config.getOption('ignore-engines')) { - flags.ignoreEngines = true; - } - - if (config.getOption('ignore-optional')) { - flags.ignoreOptional = true; - } - - if (config.getOption('force')) { - flags.force = true; - } - - return flags; -} - -class Install { - constructor(flags, config, reporter, lockfile) { - this.rootManifestRegistries = []; - this.rootPatternsToOrigin = (0, (_map || _load_map()).default)(); - this.lockfile = lockfile; - this.reporter = reporter; - this.config = config; - this.flags = normalizeFlags(config, flags); - this.resolutions = (0, (_map || _load_map()).default)(); // Legacy resolutions field used for flat install mode - this.resolutionMap = new (_resolutionMap || _load_resolutionMap()).default(config); // Selective resolutions for nested dependencies - this.resolver = new (_packageResolver || _load_packageResolver()).default(config, lockfile, this.resolutionMap); - this.integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config); - this.linker = new (_packageLinker || _load_packageLinker()).default(config, this.resolver); - this.scripts = new (_packageInstallScripts || _load_packageInstallScripts()).default(config, this.resolver, this.flags.force); - } - - /** - * Create a list of dependency requests from the current directories manifests. - */ - - fetchRequestFromCwd(excludePatterns = [], ignoreUnusedPatterns = false) { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const patterns = []; - const deps = []; - let resolutionDeps = []; - const manifest = {}; - - const ignorePatterns = []; - const usedPatterns = []; - let workspaceLayout; - - // some commands should always run in the context of the entire workspace - const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd; - - // non-workspaces are always root, otherwise check for workspace root - const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd; - - // exclude package names that are in install args - const excludeNames = []; - for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - const pattern = _ref; - - if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) { - excludeNames.push((0, (_guessName || _load_guessName()).default)(pattern)); - } else { - // extract the name - const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern); - excludeNames.push(parts.name); - } - } - - const stripExcluded = function stripExcluded(manifest) { - for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref2; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref2 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref2 = _i2.value; - } - - const exclude = _ref2; - - if (manifest.dependencies && manifest.dependencies[exclude]) { - delete manifest.dependencies[exclude]; - } - if (manifest.devDependencies && manifest.devDependencies[exclude]) { - delete manifest.devDependencies[exclude]; - } - if (manifest.optionalDependencies && manifest.optionalDependencies[exclude]) { - delete manifest.optionalDependencies[exclude]; - } - } - }; - - for (var _iterator3 = Object.keys((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { - var _ref3; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref3 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref3 = _i3.value; - } - - const registry = _ref3; - - const filename = (_index2 || _load_index2()).registries[registry].filename; - - const loc = path.join(cwd, filename); - if (!(yield (_fs || _load_fs()).exists(loc))) { - continue; - } - - _this.rootManifestRegistries.push(registry); - - const projectManifestJson = yield _this.config.readJson(loc); - yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot); - - Object.assign(_this.resolutions, projectManifestJson.resolutions); - Object.assign(manifest, projectManifestJson); - - _this.resolutionMap.init(_this.resolutions); - for (var _iterator4 = Object.keys(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { - var _ref4; - - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref4 = _iterator4[_i4++]; - } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref4 = _i4.value; - } - - const packageName = _ref4; - - const optional = (_objectPath || _load_objectPath()).default.has(manifest.optionalDependencies, packageName) && _this.flags.ignoreOptional; - for (var _iterator8 = _this.resolutionMap.resolutionsByPackage[packageName], _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { - var _ref9; - - if (_isArray8) { - if (_i8 >= _iterator8.length) break; - _ref9 = _iterator8[_i8++]; - } else { - _i8 = _iterator8.next(); - if (_i8.done) break; - _ref9 = _i8.value; - } - - const _ref8 = _ref9; - const pattern = _ref8.pattern; - - resolutionDeps = [...resolutionDeps, { registry, pattern, optional, hint: 'resolution' }]; - } - } - - const pushDeps = function pushDeps(depType, manifest, { hint, optional }, isUsed) { - if (ignoreUnusedPatterns && !isUsed) { - return; - } - // We only take unused dependencies into consideration to get deterministic hoisting. - // Since flat mode doesn't care about hoisting and everything is top level and specified then we can safely - // leave these out. - if (_this.flags.flat && !isUsed) { - return; - } - const depMap = manifest[depType]; - for (const name in depMap) { - if (excludeNames.indexOf(name) >= 0) { - continue; - } - - let pattern = name; - if (!_this.lockfile.getLocked(pattern)) { - // when we use --save we save the dependency to the lockfile with just the name rather than the - // version combo - pattern += '@' + depMap[name]; - } - - // normalization made sure packages are mentioned only once - if (isUsed) { - usedPatterns.push(pattern); - } else { - ignorePatterns.push(pattern); - } - - _this.rootPatternsToOrigin[pattern] = depType; - patterns.push(pattern); - deps.push({ pattern, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc }); - } - }; - - if (cwdIsRoot) { - pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true); - pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production); - pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true); - } - - if (_this.config.workspaceRootFolder) { - const workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename); - const workspacesRoot = path.dirname(workspaceLoc); - - let workspaceManifestJson = projectManifestJson; - if (!cwdIsRoot) { - // the manifest we read before was a child workspace, so get the root - workspaceManifestJson = yield _this.config.readJson(workspaceLoc); - yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true); - } - - const workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson); - workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config); - - // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine - const workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies); - for (var _iterator5 = Object.keys(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { - var _ref5; - - if (_isArray5) { - if (_i5 >= _iterator5.length) break; - _ref5 = _iterator5[_i5++]; - } else { - _i5 = _iterator5.next(); - if (_i5.done) break; - _ref5 = _i5.value; - } - - const workspaceName = _ref5; - - const workspaceManifest = workspaces[workspaceName].manifest; - workspaceDependencies[workspaceName] = workspaceManifest.version; - - // include dependencies from all workspaces - if (_this.flags.includeWorkspaceDeps) { - pushDeps('dependencies', workspaceManifest, { hint: null, optional: false }, true); - pushDeps('devDependencies', workspaceManifest, { hint: 'dev', optional: false }, !_this.config.production); - pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true); - } - } - const virtualDependencyManifest = { - _uid: '', - name: `workspace-aggregator-${uuid.v4()}`, - version: '1.0.0', - _registry: 'npm', - _loc: workspacesRoot, - dependencies: workspaceDependencies, - devDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.devDependencies), - optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies), - private: workspaceManifestJson.private, - workspaces: workspaceManifestJson.workspaces - }; - workspaceLayout.virtualManifestName = virtualDependencyManifest.name; - const virtualDep = {}; - virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version; - workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest }; - - // ensure dependencies that should be excluded are stripped from the correct manifest - stripExcluded(cwdIsRoot ? virtualDependencyManifest : workspaces[projectManifestJson.name].manifest); - - pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true); - - const implicitWorkspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceDependencies); - - for (var _iterator6 = (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { - var _ref6; - - if (_isArray6) { - if (_i6 >= _iterator6.length) break; - _ref6 = _iterator6[_i6++]; - } else { - _i6 = _iterator6.next(); - if (_i6.done) break; - _ref6 = _i6.value; - } - - const type = _ref6; - - for (var _iterator7 = Object.keys(projectManifestJson[type] || {}), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { - var _ref7; - - if (_isArray7) { - if (_i7 >= _iterator7.length) break; - _ref7 = _iterator7[_i7++]; - } else { - _i7 = _iterator7.next(); - if (_i7.done) break; - _ref7 = _i7.value; - } - - const dependencyName = _ref7; - - delete implicitWorkspaceDependencies[dependencyName]; - } - } - - pushDeps('dependencies', { dependencies: implicitWorkspaceDependencies }, { hint: 'workspaces', optional: false }, true); - } - - break; - } - - // inherit root flat flag - if (manifest.flat) { - _this.flags.flat = true; - } - - return { - requests: [...resolutionDeps, ...deps], - patterns, - manifest, - usedPatterns, - ignorePatterns, - workspaceLayout - }; - })(); - } - - /** - * TODO description - */ - - prepareRequests(requests) { - return requests; - } - - preparePatterns(patterns) { - return patterns; - } - preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { - return patterns; - } - - prepareManifests() { - var _this2 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const manifests = yield _this2.config.getRootManifests(); - return manifests; - })(); - } - - bailout(patterns, workspaceLayout) { - var _this3 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // We don't want to skip the audit - it could yield important errors - if (_this3.flags.audit) { - return false; - } - // PNP is so fast that the integrity check isn't pertinent - if (_this3.config.plugnplayEnabled) { - return false; - } - if (_this3.flags.skipIntegrityCheck || _this3.flags.force) { - return false; - } - const lockfileCache = _this3.lockfile.cache; - if (!lockfileCache) { - return false; - } - const lockfileClean = _this3.lockfile.parseResultType === 'success'; - const match = yield _this3.integrityChecker.check(patterns, lockfileCache, _this3.flags, workspaceLayout); - if (_this3.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) { - throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('frozenLockfileError')); - } - - const haveLockfile = yield (_fs || _load_fs()).exists(path.join(_this3.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); - - const lockfileIntegrityPresent = !_this3.lockfile.hasEntriesExistWithoutIntegrity(); - const integrityBailout = lockfileIntegrityPresent || !_this3.config.autoAddIntegrity; - - if (match.integrityMatches && haveLockfile && lockfileClean && integrityBailout) { - _this3.reporter.success(_this3.reporter.lang('upToDate')); - return true; - } - - if (match.integrityFileMissing && haveLockfile) { - // Integrity file missing, force script installations - _this3.scripts.setForce(true); - return false; - } - - if (match.hardRefreshRequired) { - // e.g. node version doesn't match, force script installations - _this3.scripts.setForce(true); - return false; - } - - if (!patterns.length && !match.integrityFileMissing) { - _this3.reporter.success(_this3.reporter.lang('nothingToInstall')); - yield _this3.createEmptyManifestFolders(); - yield _this3.saveLockfileAndIntegrity(patterns, workspaceLayout); - return true; - } - - return false; - })(); - } - - /** - * Produce empty folders for all used root manifests. - */ - - createEmptyManifestFolders() { - var _this4 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (_this4.config.modulesFolder) { - // already created - return; - } - - for (var _iterator9 = _this4.rootManifestRegistries, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { - var _ref10; - - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref10 = _iterator9[_i9++]; - } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref10 = _i9.value; - } - - const registryName = _ref10; - const folder = _this4.config.registries[registryName].folder; - - yield (_fs || _load_fs()).mkdirp(path.join(_this4.config.lockfileFolder, folder)); - } - })(); - } - - /** - * TODO description - */ - - markIgnored(patterns) { - for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { - var _ref11; - - if (_isArray10) { - if (_i10 >= _iterator10.length) break; - _ref11 = _iterator10[_i10++]; - } else { - _i10 = _iterator10.next(); - if (_i10.done) break; - _ref11 = _i10.value; - } - - const pattern = _ref11; - - const manifest = this.resolver.getStrictResolvedPattern(pattern); - const ref = manifest._reference; - invariant(ref, 'expected package reference'); - - // just mark the package as ignored. if the package is used by a required package, the hoister - // will take care of that. - ref.ignore = true; - } - } - - /** - * helper method that gets only recent manifests - * used by global.ls command - */ - getFlattenedDeps() { - var _this5 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref12 = yield _this5.fetchRequestFromCwd(); - - const depRequests = _ref12.requests, - rawPatterns = _ref12.patterns; - - - yield _this5.resolver.init(depRequests, {}); - - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this5.resolver.getManifests(), _this5.config); - _this5.resolver.updateManifests(manifests); - - return _this5.flatten(rawPatterns); - })(); - } - - /** - * TODO description - */ - - init() { - var _this6 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this6.checkUpdate(); - - // warn if we have a shrinkwrap - if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_SHRINKWRAP_FILENAME))) { - _this6.reporter.warn(_this6.reporter.lang('shrinkwrapWarning')); - } - - // warn if we have an npm lockfile - if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_LOCK_FILENAME))) { - _this6.reporter.warn(_this6.reporter.lang('npmLockfileWarning')); - } - - if (_this6.config.plugnplayEnabled) { - _this6.reporter.info(_this6.reporter.lang('plugnplaySuggestV2L1')); - _this6.reporter.info(_this6.reporter.lang('plugnplaySuggestV2L2')); - } - - let flattenedTopLevelPatterns = []; - const steps = []; - - var _ref13 = yield _this6.fetchRequestFromCwd(); - - const depRequests = _ref13.requests, - rawPatterns = _ref13.patterns, - ignorePatterns = _ref13.ignorePatterns, - workspaceLayout = _ref13.workspaceLayout, - manifest = _ref13.manifest; - - let topLevelPatterns = []; - - const artifacts = yield _this6.integrityChecker.getArtifacts(); - if (artifacts) { - _this6.linker.setArtifacts(artifacts); - _this6.scripts.setArtifacts(artifacts); - } - - if ((_packageCompatibility || _load_packageCompatibility()).shouldCheck(manifest, _this6.flags)) { - steps.push((() => { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this6.reporter.step(curr, total, _this6.reporter.lang('checkingManifest'), emoji.get('mag')); - yield _this6.checkCompatibility(); - }); - - return function (_x, _x2) { - return _ref14.apply(this, arguments); - }; - })()); - } - - const audit = new (_audit || _load_audit()).default(_this6.config, _this6.reporter, { groups: (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES }); - let auditFoundProblems = false; - - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('resolveStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this6.reporter.step(curr, total, _this6.reporter.lang('resolvingPackages'), emoji.get('mag')); - yield _this6.resolver.init(_this6.prepareRequests(depRequests), { - isFlat: _this6.flags.flat, - isFrozen: _this6.flags.frozenLockfile, - workspaceLayout - }); - topLevelPatterns = _this6.preparePatterns(rawPatterns); - flattenedTopLevelPatterns = yield _this6.flatten(topLevelPatterns); - return { bailout: !_this6.flags.audit && (yield _this6.bailout(topLevelPatterns, workspaceLayout)) }; - })); - }); - - if (_this6.flags.audit) { - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('auditStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this6.reporter.step(curr, total, _this6.reporter.lang('auditRunning'), emoji.get('mag')); - if (_this6.flags.offline) { - _this6.reporter.warn(_this6.reporter.lang('auditOffline')); - return { bailout: false }; - } - const preparedManifests = yield _this6.prepareManifests(); - // $FlowFixMe - Flow considers `m` in the map operation to be "mixed", so does not recognize `m.object` - const mergedManifest = Object.assign({}, ...Object.values(preparedManifests).map(function (m) { - return m.object; - })); - const auditVulnerabilityCounts = yield audit.performAudit(mergedManifest, _this6.lockfile, _this6.resolver, _this6.linker, topLevelPatterns); - auditFoundProblems = auditVulnerabilityCounts.info || auditVulnerabilityCounts.low || auditVulnerabilityCounts.moderate || auditVulnerabilityCounts.high || auditVulnerabilityCounts.critical; - return { bailout: yield _this6.bailout(topLevelPatterns, workspaceLayout) }; - })); - }); - } - - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('fetchStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this6.markIgnored(ignorePatterns); - _this6.reporter.step(curr, total, _this6.reporter.lang('fetchingPackages'), emoji.get('truck')); - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this6.resolver.getManifests(), _this6.config); - _this6.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(_this6.resolver.getManifests(), _this6.config, _this6.flags.ignoreEngines); - })); - }); - - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('linkStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // remove integrity hash to make this operation atomic - yield _this6.integrityChecker.removeIntegrityFile(); - _this6.reporter.step(curr, total, _this6.reporter.lang('linkingDependencies'), emoji.get('link')); - flattenedTopLevelPatterns = _this6.preparePatternsForLinking(flattenedTopLevelPatterns, manifest, _this6.config.lockfileFolder === _this6.config.cwd); - yield _this6.linker.init(flattenedTopLevelPatterns, workspaceLayout, { - linkDuplicates: _this6.flags.linkDuplicates, - ignoreOptional: _this6.flags.ignoreOptional - }); - })); - }); - - if (_this6.config.plugnplayEnabled) { - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('pnpStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const pnpPath = `${_this6.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; - - const code = yield (0, (_generatePnpMap || _load_generatePnpMap()).generatePnpMap)(_this6.config, flattenedTopLevelPatterns, { - resolver: _this6.resolver, - reporter: _this6.reporter, - targetPath: pnpPath, - workspaceLayout - }); - - try { - const file = yield (_fs || _load_fs()).readFile(pnpPath); - if (file === code) { - return; - } - } catch (error) {} - - yield (_fs || _load_fs()).writeFile(pnpPath, code); - yield (_fs || _load_fs()).chmod(pnpPath, 0o755); - })); - }); - } - - steps.push(function (curr, total) { - return (0, (_hooks || _load_hooks()).callThroughHook)('buildStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this6.reporter.step(curr, total, _this6.flags.force ? _this6.reporter.lang('rebuildingPackages') : _this6.reporter.lang('buildingFreshPackages'), emoji.get('hammer')); - - if (_this6.config.ignoreScripts) { - _this6.reporter.warn(_this6.reporter.lang('ignoredScripts')); - } else { - yield _this6.scripts.init(flattenedTopLevelPatterns); - } - })); - }); - - if (_this6.flags.har) { - steps.push((() => { - var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - const formattedDate = new Date().toISOString().replace(/:/g, '-'); - const filename = `yarn-install_${formattedDate}.har`; - _this6.reporter.step(curr, total, _this6.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record')); - yield _this6.config.requestManager.saveHar(filename); - }); - - return function (_x3, _x4) { - return _ref21.apply(this, arguments); - }; - })()); - } - - if (yield _this6.shouldClean()) { - steps.push((() => { - var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this6.reporter.step(curr, total, _this6.reporter.lang('cleaningModules'), emoji.get('recycle')); - yield (0, (_autoclean || _load_autoclean()).clean)(_this6.config, _this6.reporter); - }); - - return function (_x5, _x6) { - return _ref22.apply(this, arguments); - }; - })()); - } - - let currentStep = 0; - for (var _iterator11 = steps, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { - var _ref23; - - if (_isArray11) { - if (_i11 >= _iterator11.length) break; - _ref23 = _iterator11[_i11++]; - } else { - _i11 = _iterator11.next(); - if (_i11.done) break; - _ref23 = _i11.value; - } - - const step = _ref23; - - const stepResult = yield step(++currentStep, steps.length); - if (stepResult && stepResult.bailout) { - if (_this6.flags.audit) { - audit.summary(); - } - if (auditFoundProblems) { - _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails')); - } - _this6.maybeOutputUpdate(); - return flattenedTopLevelPatterns; - } - } - - // fin! - if (_this6.flags.audit) { - audit.summary(); - } - if (auditFoundProblems) { - _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails')); - } - yield _this6.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout); - yield _this6.persistChanges(); - _this6.maybeOutputUpdate(); - _this6.config.requestManager.clearCache(); - return flattenedTopLevelPatterns; - })(); - } - - checkCompatibility() { - var _this7 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref24 = yield _this7.fetchRequestFromCwd(); - - const manifest = _ref24.manifest; - - yield (_packageCompatibility || _load_packageCompatibility()).checkOne(manifest, _this7.config, _this7.flags.ignoreEngines); - })(); - } - - persistChanges() { - var _this8 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // get all the different registry manifests in this folder - const manifests = yield _this8.config.getRootManifests(); - - if (yield _this8.applyChanges(manifests)) { - yield _this8.config.saveRootManifests(manifests); - } - })(); - } - - applyChanges(manifests) { - let hasChanged = false; - - if (this.config.plugnplayPersist) { - const object = manifests.npm.object; - - - if (typeof object.installConfig !== 'object') { - object.installConfig = {}; - } - - if (this.config.plugnplayEnabled && object.installConfig.pnp !== true) { - object.installConfig.pnp = true; - hasChanged = true; - } else if (!this.config.plugnplayEnabled && typeof object.installConfig.pnp !== 'undefined') { - delete object.installConfig.pnp; - hasChanged = true; - } - - if (Object.keys(object.installConfig).length === 0) { - delete object.installConfig; - } - } - - return Promise.resolve(hasChanged); - } - - /** - * Check if we should run the cleaning step. - */ - - shouldClean() { - return (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME)); - } - - /** - * TODO - */ - - flatten(patterns) { - var _this9 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (!_this9.flags.flat) { - return patterns; - } - - const flattenedPatterns = []; - - for (var _iterator12 = _this9.resolver.getAllDependencyNamesByLevelOrder(patterns), _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { - var _ref25; - - if (_isArray12) { - if (_i12 >= _iterator12.length) break; - _ref25 = _iterator12[_i12++]; - } else { - _i12 = _iterator12.next(); - if (_i12.done) break; - _ref25 = _i12.value; - } - - const name = _ref25; - - const infos = _this9.resolver.getAllInfoForPackageName(name).filter(function (manifest) { - const ref = manifest._reference; - invariant(ref, 'expected package reference'); - return !ref.ignore; - }); - - if (infos.length === 0) { - continue; - } - - if (infos.length === 1) { - // single version of this package - // take out a single pattern as multiple patterns may have resolved to this package - flattenedPatterns.push(_this9.resolver.patternsByPackage[name][0]); - continue; - } - - const options = infos.map(function (info) { - const ref = info._reference; - invariant(ref, 'expected reference'); - return { - // TODO `and is required by {PARENT}`, - name: _this9.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version), - - value: info.version - }; - }); - const versions = infos.map(function (info) { - return info.version; - }); - let version; - - const resolutionVersion = _this9.resolutions[name]; - if (resolutionVersion && versions.indexOf(resolutionVersion) >= 0) { - // use json `resolution` version - version = resolutionVersion; - } else { - version = yield _this9.reporter.select(_this9.reporter.lang('manualVersionResolution', name), _this9.reporter.lang('answer'), options); - _this9.resolutions[name] = version; - } - - flattenedPatterns.push(_this9.resolver.collapseAllVersionsOfPackage(name, version)); - } - - // save resolutions to their appropriate root manifest - if (Object.keys(_this9.resolutions).length) { - const manifests = yield _this9.config.getRootManifests(); - - for (const name in _this9.resolutions) { - const version = _this9.resolutions[name]; - - const patterns = _this9.resolver.patternsByPackage[name]; - if (!patterns) { - continue; - } - - let manifest; - for (var _iterator13 = patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { - var _ref26; - - if (_isArray13) { - if (_i13 >= _iterator13.length) break; - _ref26 = _iterator13[_i13++]; - } else { - _i13 = _iterator13.next(); - if (_i13.done) break; - _ref26 = _i13.value; - } - - const pattern = _ref26; - - manifest = _this9.resolver.getResolvedPattern(pattern); - if (manifest) { - break; - } - } - invariant(manifest, 'expected manifest'); - - const ref = manifest._reference; - invariant(ref, 'expected reference'); - - const object = manifests[ref.registry].object; - object.resolutions = object.resolutions || {}; - object.resolutions[name] = version; - } - - yield _this9.config.saveRootManifests(manifests); - } - - return flattenedPatterns; - })(); - } - - /** - * Remove offline tarballs that are no longer required - */ - - pruneOfflineMirror(lockfile) { - var _this10 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const mirror = _this10.config.getOfflineMirrorPath(); - if (!mirror) { - return; - } - - const requiredTarballs = new Set(); - for (const dependency in lockfile) { - const resolved = lockfile[dependency].resolved; - if (resolved) { - const basename = path.basename(resolved.split('#')[0]); - if (dependency[0] === '@' && basename[0] !== '@') { - requiredTarballs.add(`${dependency.split('/')[0]}-${basename}`); - } - requiredTarballs.add(basename); - } - } - - const mirrorFiles = yield (_fs || _load_fs()).walk(mirror); - for (var _iterator14 = mirrorFiles, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { - var _ref27; - - if (_isArray14) { - if (_i14 >= _iterator14.length) break; - _ref27 = _iterator14[_i14++]; - } else { - _i14 = _iterator14.next(); - if (_i14.done) break; - _ref27 = _i14.value; - } - - const file = _ref27; - - const isTarball = path.extname(file.basename) === '.tgz'; - // if using experimental-pack-script-packages-in-mirror flag, don't unlink prebuilt packages - const hasPrebuiltPackage = file.relative.startsWith('prebuilt/'); - if (isTarball && !hasPrebuiltPackage && !requiredTarballs.has(file.basename)) { - yield (_fs || _load_fs()).unlink(file.absolute); - } - } - })(); - } - - /** - * Save updated integrity and lockfiles. - */ - - saveLockfileAndIntegrity(patterns, workspaceLayout) { - var _this11 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const resolvedPatterns = {}; - Object.keys(_this11.resolver.patterns).forEach(function (pattern) { - if (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern)) { - resolvedPatterns[pattern] = _this11.resolver.patterns[pattern]; - } - }); - - // TODO this code is duplicated in a few places, need a common way to filter out workspace patterns from lockfile - patterns = patterns.filter(function (p) { - return !workspaceLayout || !workspaceLayout.getManifestByPattern(p); - }); - - const lockfileBasedOnResolver = _this11.lockfile.getLockfile(resolvedPatterns); - - if (_this11.config.pruneOfflineMirror) { - yield _this11.pruneOfflineMirror(lockfileBasedOnResolver); - } - - // write integrity hash - if (!_this11.config.plugnplayEnabled) { - yield _this11.integrityChecker.save(patterns, lockfileBasedOnResolver, _this11.flags, workspaceLayout, _this11.scripts.getArtifacts()); - } - - // --no-lockfile or --pure-lockfile or --frozen-lockfile - if (_this11.flags.lockfile === false || _this11.flags.pureLockfile || _this11.flags.frozenLockfile) { - return; - } - - const lockFileHasAllPatterns = patterns.every(function (p) { - return _this11.lockfile.getLocked(p); - }); - const lockfilePatternsMatch = Object.keys(_this11.lockfile.cache || {}).every(function (p) { - return lockfileBasedOnResolver[p]; - }); - const resolverPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { - const manifest = _this11.lockfile.getLocked(pattern); - return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved && deepEqual(manifest.prebuiltVariants, lockfileBasedOnResolver[pattern].prebuiltVariants); - }); - const integrityPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { - const existingIntegrityInfo = lockfileBasedOnResolver[pattern].integrity; - if (!existingIntegrityInfo) { - // if this entry does not have an integrity, no need to re-write the lockfile because of it - return true; - } - const manifest = _this11.lockfile.getLocked(pattern); - if (manifest && manifest.integrity) { - const manifestIntegrity = ssri.stringify(manifest.integrity); - return manifestIntegrity === existingIntegrityInfo; - } - return false; - }); - - // remove command is followed by install with force, lockfile will be rewritten in any case then - if (!_this11.flags.force && _this11.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && integrityPatternsAreSameAsInLockfile && patterns.length) { - return; - } - - // build lockfile location - const loc = path.join(_this11.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME); - - // write lockfile - const lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, _this11.config.enableLockfileVersions); - yield (_fs || _load_fs()).writeFilePreservingEol(loc, lockSource); - - _this11._logSuccessSaveLockfile(); - })(); - } - - _logSuccessSaveLockfile() { - this.reporter.success(this.reporter.lang('savedLockfile')); - } - - /** - * Load the dependency graph of the current install. Only does package resolving and wont write to the cwd. - */ - hydrate(ignoreUnusedPatterns) { - var _this12 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const request = yield _this12.fetchRequestFromCwd([], ignoreUnusedPatterns); - const depRequests = request.requests, - rawPatterns = request.patterns, - ignorePatterns = request.ignorePatterns, - workspaceLayout = request.workspaceLayout; - - - yield _this12.resolver.init(depRequests, { - isFlat: _this12.flags.flat, - isFrozen: _this12.flags.frozenLockfile, - workspaceLayout - }); - yield _this12.flatten(rawPatterns); - _this12.markIgnored(ignorePatterns); - - // fetch packages, should hit cache most of the time - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this12.resolver.getManifests(), _this12.config); - _this12.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(_this12.resolver.getManifests(), _this12.config, _this12.flags.ignoreEngines); - - // expand minimal manifests - for (var _iterator15 = _this12.resolver.getManifests(), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { - var _ref28; - - if (_isArray15) { - if (_i15 >= _iterator15.length) break; - _ref28 = _iterator15[_i15++]; - } else { - _i15 = _iterator15.next(); - if (_i15.done) break; - _ref28 = _i15.value; - } - - const manifest = _ref28; - - const ref = manifest._reference; - invariant(ref, 'expected reference'); - const type = ref.remote.type; - // link specifier won't ever hit cache - - let loc = ''; - if (type === 'link') { - continue; - } else if (type === 'workspace') { - if (!ref.remote.reference) { - continue; - } - loc = ref.remote.reference; - } else { - loc = _this12.config.generateModuleCachePath(ref); - } - const newPkg = yield _this12.config.readManifest(loc); - yield _this12.resolver.updateManifest(ref, newPkg); - } - - return request; - })(); - } - - /** - * Check for updates every day and output a nag message if there's a newer version. - */ - - checkUpdate() { - if (this.config.nonInteractive) { - // don't show upgrade dialog on CI or non-TTY terminals - return; - } - - // don't check if disabled - if (this.config.getOption('disable-self-update-check')) { - return; - } - - // only check for updates once a day - const lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0; - if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) { - return; - } - - // don't bug for updates on tagged releases - if ((_yarnVersion || _load_yarnVersion()).version.indexOf('-') >= 0) { - return; - } - - this._checkUpdate().catch(() => { - // swallow errors - }); - } - - _checkUpdate() { - var _this13 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let latestVersion = yield _this13.config.requestManager.request({ - url: (_constants || _load_constants()).SELF_UPDATE_VERSION_URL - }); - invariant(typeof latestVersion === 'string', 'expected string'); - latestVersion = latestVersion.trim(); - if (!semver.valid(latestVersion)) { - return; - } - - // ensure we only check for updates periodically - _this13.config.registries.yarn.saveHomeConfig({ - lastUpdateCheck: Date.now() - }); - - if (semver.gt(latestVersion, (_yarnVersion || _load_yarnVersion()).version)) { - const installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)(); - _this13.maybeOutputUpdate = function () { - _this13.reporter.warn(_this13.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version)); - - const command = getUpdateCommand(installationMethod); - if (command) { - _this13.reporter.info(_this13.reporter.lang('yarnOutdatedCommand')); - _this13.reporter.command(command); - } else { - const installer = getUpdateInstaller(installationMethod); - if (installer) { - _this13.reporter.info(_this13.reporter.lang('yarnOutdatedInstaller', installer)); - } - } - }; - } - })(); - } - - /** - * Method to override with a possible upgrade message. - */ - - maybeOutputUpdate() {} -} - -exports.Install = Install; -function hasWrapper(commander, args) { - return true; -} - -function setFlags(commander) { - commander.description('Yarn install is used to install all dependencies for a project.'); - commander.usage('install [flags]'); - commander.option('-A, --audit', 'Run vulnerability audit on installed packages'); - commander.option('-g, --global', 'DEPRECATED'); - commander.option('-S, --save', 'DEPRECATED - save package to your `dependencies`'); - commander.option('-D, --save-dev', 'DEPRECATED - save package to your `devDependencies`'); - commander.option('-P, --save-peer', 'DEPRECATED - save package to your `peerDependencies`'); - commander.option('-O, --save-optional', 'DEPRECATED - save package to your `optionalDependencies`'); - commander.option('-E, --save-exact', 'DEPRECATED'); - commander.option('-T, --save-tilde', 'DEPRECATED'); -} - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(52); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; - - -/***/ }), -/* 36 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SubjectSubscriber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subject; }); -/* unused harmony export AnonymousSubject */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(12); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__ = __webpack_require__(189); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__ = __webpack_require__(422); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__ = __webpack_require__(321); -/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */ - - - - - - - -var SubjectSubscriber = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubjectSubscriber, _super); - function SubjectSubscriber(destination) { - var _this = _super.call(this, destination) || this; - _this.destination = destination; - return _this; - } - return SubjectSubscriber; -}(__WEBPACK_IMPORTED_MODULE_2__Subscriber__["a" /* Subscriber */])); - -var Subject = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subject, _super); - function Subject() { - var _this = _super.call(this) || this; - _this.observers = []; - _this.closed = false; - _this.isStopped = false; - _this.hasError = false; - _this.thrownError = null; - return _this; - } - Subject.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () { - return new SubjectSubscriber(this); - }; - Subject.prototype.lift = function (operator) { - var subject = new AnonymousSubject(this, this); - subject.operator = operator; - return subject; - }; - Subject.prototype.next = function (value) { - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - if (!this.isStopped) { - var observers = this.observers; - var len = observers.length; - var copy = observers.slice(); - for (var i = 0; i < len; i++) { - copy[i].next(value); - } - } - }; - Subject.prototype.error = function (err) { - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - this.hasError = true; - this.thrownError = err; - this.isStopped = true; - var observers = this.observers; - var len = observers.length; - var copy = observers.slice(); - for (var i = 0; i < len; i++) { - copy[i].error(err); - } - this.observers.length = 0; - }; - Subject.prototype.complete = function () { - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - this.isStopped = true; - var observers = this.observers; - var len = observers.length; - var copy = observers.slice(); - for (var i = 0; i < len; i++) { - copy[i].complete(); - } - this.observers.length = 0; - }; - Subject.prototype.unsubscribe = function () { - this.isStopped = true; - this.closed = true; - this.observers = null; - }; - Subject.prototype._trySubscribe = function (subscriber) { - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - else { - return _super.prototype._trySubscribe.call(this, subscriber); - } - }; - Subject.prototype._subscribe = function (subscriber) { - if (this.closed) { - throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); - } - else if (this.hasError) { - subscriber.error(this.thrownError); - return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; - } - else if (this.isStopped) { - subscriber.complete(); - return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; - } - else { - this.observers.push(subscriber); - return new __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__["a" /* SubjectSubscription */](this, subscriber); - } - }; - Subject.prototype.asObservable = function () { - var observable = new __WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */](); - observable.source = this; - return observable; - }; - Subject.create = function (destination, source) { - return new AnonymousSubject(destination, source); - }; - return Subject; -}(__WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */])); - -var AnonymousSubject = /*@__PURE__*/ (function (_super) { - __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AnonymousSubject, _super); - function AnonymousSubject(destination, source) { - var _this = _super.call(this) || this; - _this.destination = destination; - _this.source = source; - return _this; - } - AnonymousSubject.prototype.next = function (value) { - var destination = this.destination; - if (destination && destination.next) { - destination.next(value); - } - }; - AnonymousSubject.prototype.error = function (err) { - var destination = this.destination; - if (destination && destination.error) { - this.destination.error(err); - } - }; - AnonymousSubject.prototype.complete = function () { - var destination = this.destination; - if (destination && destination.complete) { - this.destination.complete(); - } - }; - AnonymousSubject.prototype._subscribe = function (subscriber) { - var source = this.source; - if (source) { - return this.source.subscribe(subscriber); - } - else { - return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; - } - }; - return AnonymousSubject; -}(Subject)); - -//# sourceMappingURL=Subject.js.map - - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.normalizePattern = normalizePattern; - -/** - * Explode and normalize a pattern into its name and range. - */ - -function normalizePattern(pattern) { - let hasVersion = false; - let range = 'latest'; - let name = pattern; - - // if we're a scope then remove the @ and add it back later - let isScoped = false; - if (name[0] === '@') { - isScoped = true; - name = name.slice(1); - } - - // take first part as the name - const parts = name.split('@'); - if (parts.length > 1) { - name = parts.shift(); - range = parts.join('@'); - - if (range) { - hasVersion = true; - } else { - range = '*'; - } - } - - // add back @ scope suffix - if (isScoped) { - name = `@${name}`; - } - - return { name, range, hasVersion }; -} - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** - * @license - * Lodash - * Copyright JS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '4.17.10'; - - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Error message constants. */ - var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', - FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used as the maximum memoize cache size. */ - var MAX_MEMOIZE_SIZE = 500; - - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; - - /** Used to compose bitmasks for value comparisons. */ - var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - - /** Used to compose bitmasks for function metadata. */ - var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_BOUND_FLAG = 4, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256, - WRAP_FLIP_FLAG = 512; - - /** Used as default options for `_.truncate`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; - - /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 800, - HOT_SPAN = 16; - - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - - /** Used to associate wrap methods with their bit flags. */ - var wrapFlags = [ - ['ary', WRAP_ARY_FLAG], - ['bind', WRAP_BIND_FLAG], - ['bindKey', WRAP_BIND_KEY_FLAG], - ['curry', WRAP_CURRY_FLAG], - ['curryRight', WRAP_CURRY_RIGHT_FLAG], - ['flip', WRAP_FLIP_FLAG], - ['partial', WRAP_PARTIAL_FLAG], - ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], - ['rearg', WRAP_REARG_FLAG] - ]; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - domExcTag = '[object DOMException]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]', - weakSetTag = '[object WeakSet]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, - reUnescapedHtml = /[&<>"']/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g, - reTrimStart = /^\s+/, - reTrimEnd = /\s+$/; - - /** Used to match wrap detail comments. */ - var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, - reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, - reSplitDetails = /,? & /; - - /** Used to match words composed of alphanumeric characters. */ - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** - * Used to match - * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to match Latin Unicode letters (excluding mathematical operators). */ - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; - - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - - /** Used to compose unicode capture groups. */ - var rsApos = "['\u2019]", - rsAstral = '[' + rsAstralRange + ']', - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; - - /** Used to compose unicode regexes. */ - var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', - rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', - rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - - /** Used to match apostrophes. */ - var reApos = RegExp(rsApos, 'g'); - - /** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); - - /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - - /** Used to match complex or compound words. */ - var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', - rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, - rsUpper + '+' + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join('|'), 'g'); - - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - - /** Used to detect strings that need a more robust regexp to match words. */ - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', - 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', - 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', - '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' - ]; - - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; - - /** Used to map Latin Unicode letters to basic Latin letters. */ - var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' - }; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" - }; - - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /** Built-in method references without a dependency on `root`. */ - var freeParseFloat = parseFloat, - freeParseInt = parseInt; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; - - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; - - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} - }()); - - /* Node.js helper references. */ - var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, - nodeIsDate = nodeUtil && nodeUtil.isDate, - nodeIsMap = nodeUtil && nodeUtil.isMap, - nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, - nodeIsSet = nodeUtil && nodeUtil.isSet, - nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - - /*--------------------------------------------------------------------------*/ - - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - - /** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; - } - - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.forEachRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array == null ? 0 : array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.every` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } - - /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; - } - - /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; - } - - /** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } - - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; - } - - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * A specialized version of `_.reduceRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - - /** - * Gets the size of an ASCII `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - var asciiSize = baseProperty('length'); - - /** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function asciiToArray(string) { - return string.split(''); - } - - /** - * Splits an ASCII `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function asciiWords(string) { - return string.match(reAsciiWord) || []; - } - - /** - * The base implementation of methods like `_.findKey` and `_.findLastKey`, - * without support for iteratee shorthands, which iterates over `collection` - * using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFindKey(collection, predicate, eachFunc) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = key; - return false; - } - }); - return result; - } - - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); - } - - /** - * This function is like `baseIndexOf` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @param {Function} comparator The comparator invoked per element. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOfWith(array, value, fromIndex, comparator) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (comparator(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ - function baseIsNaN(value) { - return value !== value; - } - - /** - * The base implementation of `_.mean` and `_.meanBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the mean. - */ - function baseMean(array, iteratee) { - var length = array == null ? 0 : array.length; - return length ? (baseSum(array, iteratee) / length) : NAN; - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.sortBy` which uses `comparer` to define the - * sort order of `array` and replaces criteria objects with their corresponding - * values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; - - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } - - /** - * The base implementation of `_.sum` and `_.sumBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(array, iteratee) { - var result, - index = -1, - length = array.length; - - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined) { - result = result === undefined ? current : (result + current); - } - } - return result; - } - - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the key-value pairs. - */ - function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); - } - - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); - } - - /** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function cacheHas(cache, key) { - return cache.has(key); - } - - /** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ - function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; - - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** - * Gets the number of `placeholder` occurrences in `array`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} placeholder The placeholder to search for. - * @returns {number} Returns the placeholder count. - */ - function countHolders(array, placeholder) { - var length = array.length, - result = 0; - - while (length--) { - if (array[length] === placeholder) { - ++result; - } - } - return result; - } - - /** - * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A - * letters to basic Latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - var deburrLetter = basePropertyOf(deburredLetters); - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - var escapeHtmlChar = basePropertyOf(htmlEscapes); - - /** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } - - /** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ - function hasUnicode(string) { - return reHasUnicode.test(string); - } - - /** - * Checks if `string` contains a word composed of Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a word is found, else `false`. - */ - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } - - /** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ - function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; - } - - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } - - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; - } - } - return result; - } - - /** - * Gets the value at `key`, unless `key` is "__proto__". - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function safeGet(object, key) { - return key == '__proto__' - ? undefined - : object[key]; - } - - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } - - /** - * Converts `set` to its value-value pairs. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the value-value pairs. - */ - function setToPairs(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = [value, value]; - }); - return result; - } - - /** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * A specialized version of `_.lastIndexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictLastIndexOf(array, value, fromIndex) { - var index = fromIndex + 1; - while (index--) { - if (array[index] === value) { - return index; - } - } - return index; - } - - /** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ - function stringSize(string) { - return hasUnicode(string) - ? unicodeSize(string) - : asciiSize(string); - } - - /** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); - } - - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - var unescapeHtmlChar = basePropertyOf(htmlUnescapes); - - /** - * Gets the size of a Unicode `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - ++result; - } - return result; - } - - /** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function unicodeToArray(string) { - return string.match(reUnicode) || []; - } - - /** - * Splits a Unicode `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function unicodeWords(string) { - return string.match(reUnicodeWord) || []; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Create a new pristine `lodash` function using the `context` object. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Util - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // Create a suped-up `defer` in Node.js. - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - var runInContext = (function runInContext(context) { - context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); - - /** Built-in constructor references. */ - var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; - - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to detect overreaching core-js shims. */ - var coreJsData = context['__core-js_shared__']; - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var nativeObjectToString = objectProto.toString; - - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Buffer = moduleExports ? context.Buffer : undefined, - Symbol = context.Symbol, - Uint8Array = context.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, - symIterator = Symbol ? Symbol.iterator : undefined, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; - - var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} - }()); - - /** Mocked built-ins. */ - var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, - ctxNow = Date && Date.now !== root.Date.now && Date.now, - ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeFloor = Math.floor, - nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeIsFinite = context.isFinite, - nativeJoin = arrayProto.join, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = Date.now, - nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeReverse = arrayProto.reverse; - - /* Built-in method references that are verified to be native. */ - var DataView = getNative(context, 'DataView'), - Map = getNative(context, 'Map'), - Promise = getNative(context, 'Promise'), - Set = getNative(context, 'Set'), - WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; - - /** Used to lookup unminified function names. */ - var realNames = {}; - - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chain sequences. Methods that operate on and return arrays, collections, - * and functions can be chained together. Methods that retrieve a single value - * or may return a primitive value will automatically end the chain sequence - * and return the unwrapped value. Otherwise, the value must be unwrapped - * with `_#value`. - * - * Explicit chain sequences, which must be unwrapped with `_#value`, may be - * enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. - * Shortcut fusion is an optimization to merge iteratee calls; this avoids - * the creation of intermediate arrays and can greatly reduce the number of - * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array and iteratees accept only - * one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, - * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, - * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, - * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, - * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, - * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, - * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, - * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, - * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, - * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, - * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, - * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, - * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, - * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, - * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, - * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, - * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, - * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, - * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, - * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, - * `zipObject`, `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, - * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, - * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, - * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, - * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, - * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, - * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, - * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, - * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, - * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, - * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, - * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, - * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, - * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, - * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, - * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, - * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, - * `upperFirst`, `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; - }()); - - /** - * The function whose prototype chain sequence wrappers inherit from. - * - * @private - */ - function baseLodash() { - // No operation performed. - } - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable explicit method chain sequences. - */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; - } - - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB) as well as ES2015 template strings. Change the - * following template settings to use alternative delimiters. - * - * @static - * @memberOf _ - * @type {Object} - */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'escape': reEscape, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'evaluate': reEvaluate, - - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type {string} - */ - 'variable': '', - - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type {Object} - */ - 'imports': { - - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type {Function} - */ - '_': lodash - } - }; - - // Ensure wrappers are instances of `baseLodash`. - lodash.prototype = baseLodash.prototype; - lodash.prototype.constructor = lodash; - - LodashWrapper.prototype = baseCreate(baseLodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @constructor - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; - } - - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; - } - - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } - - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); - - if (!isArr || (!isRight && arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); - - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; - } - - // Ensure `LazyWrapper` is an instance of `baseLodash`. - LazyWrapper.prototype = baseCreate(baseLodash.prototype); - LazyWrapper.prototype.constructor = LazyWrapper; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } - - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } - - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } - - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); - } - - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } - - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } - - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - --this.size; - return true; - } - - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; - } - - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } - - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } - - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; - } - - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } - - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } - - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; - } - - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /*------------------------------------------------------------------------*/ - - /** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } - } - - /** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } - - /** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function setCacheHas(value) { - return this.__data__.has(value); - } - - // Add methods to `SetCache`. - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; - } - - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = new ListCache; - this.size = 0; - } - - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; - } - - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - return this.__data__.get(key); - } - - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - return this.__data__.has(key); - } - - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ - function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; - } - - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ - function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; - } - - /** - * A specialized version of `_.sample` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @returns {*} Returns the random element. - */ - function arraySample(array) { - var length = array.length; - return length ? array[baseRandom(0, length - 1)] : undefined; - } - - /** - * A specialized version of `_.sampleSize` for arrays. - * - * @private - * @param {Array} array The array to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); - } - - /** - * A specialized version of `_.shuffle` for arrays. - * - * @private - * @param {Array} array The array to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function arrayShuffle(array) { - return shuffleSelf(copyArray(array)); - } - - /** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } - } - - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } - - /** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); - } - - /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } - } - - /** - * The base implementation of `_.at` without support for individual paths. - * - * @private - * @param {Object} object The object to iterate over. - * @param {string[]} paths The property paths to pick. - * @returns {Array} Returns the picked elements. - */ - function baseAt(object, paths) { - var index = -1, - length = paths.length, - result = Array(length), - skip = object == null; - - while (++index < length) { - result[index] = skip ? undefined : get(object, paths[index]); - } - return result; - } - - /** - * The base implementation of `_.clamp` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - */ - function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined) { - number = number <= upper ? number : upper; - } - if (lower !== undefined) { - number = number >= lower ? number : lower; - } - } - return number; - } - - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - - return result; - } - - if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - - return result; - } - - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); - - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; - } - - /** - * The base implementation of `_.conforms` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new spec function. - */ - function baseConforms(source) { - var props = keys(source); - return function(object) { - return baseConformsTo(object, source, props); - }; - } - - /** - * The base implementation of `_.conformsTo` which accepts `props` to check. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - */ - function baseConformsTo(object, source, props) { - var length = props.length; - if (object == null) { - return !length; - } - object = Object(object); - while (length--) { - var key = props[length], - predicate = source[key], - value = object[key]; - - if ((value === undefined && !(key in object)) || !predicate(value)) { - return false; - } - } - return true; - } - - /** - * The base implementation of `_.delay` and `_.defer` which accepts `args` - * to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Array} args The arguments to provide to `func`. - * @returns {number|Object} Returns the timer id or timeout object. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee == null ? value : iteratee(value); - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `_.forEachRight` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEachRight = createBaseEach(baseForOwnRight, true); - - /** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - - /** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index], - current = iteratee(value); - - if (current != null && (computed === undefined - ? (current === current && !isSymbol(current)) - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; - } - - /** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ - function baseFill(array, value, start, end) { - var length = array.length; - - start = toInteger(start); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; - } - return array; - } - - /** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } - - /** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.forOwnRight` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); - } - - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from `props`. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the function names. - */ - function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); - } - - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = castPath(path, object); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); - } - - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); - } - - /** - * The base implementation of `_.gt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - */ - function baseGt(value, other) { - return value > other; - } - - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - return object != null && hasOwnProperty.call(object, key); - } - - /** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return object != null && key in Object(object); - } - - /** - * The base implementation of `_.inRange` which doesn't coerce arguments. - * - * @private - * @param {number} number The number to check. - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - */ - function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); - } - - /** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - */ - function baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - length = arrays[0].length, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - maxLength = Infinity, - result = []; - - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee) { - array = arrayMap(array, baseUnary(iteratee)); - } - maxLength = nativeMin(array.length, maxLength); - caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) - ? new SetCache(othIndex && array) - : undefined; - } - array = arrays[0]; - - var index = -1, - seen = caches[0]; - - outer: - while (++index < length && result.length < maxLength) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (!(seen - ? cacheHas(seen, computed) - : includes(result, computed, comparator) - )) { - othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache - ? cacheHas(cache, computed) - : includes(arrays[othIndex], computed, comparator)) - ) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.invert` and `_.invertBy` which inverts - * `object` with values transformed by `iteratee` and set by `setter`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform values. - * @param {Object} accumulator The initial inverted object. - * @returns {Function} Returns `accumulator`. - */ - function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { - setter(accumulator, iteratee(value), key, object); - }); - return accumulator; - } - - /** - * The base implementation of `_.invoke` without support for individual - * method arguments. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ - function baseInvoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - var func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined : apply(func, object, args); - } - - /** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; - } - - /** - * The base implementation of `_.isArrayBuffer` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - */ - function baseIsArrayBuffer(value) { - return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; - } - - /** - * The base implementation of `_.isDate` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - */ - function baseIsDate(value) { - return isObjectLike(value) && baseGetTag(value) == dateTag; - } - - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); - - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); - } - - /** - * The base implementation of `_.isMap` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - */ - function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; - } - - /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { - return false; - } - } - } - return true; - } - - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } - - /** - * The base implementation of `_.isRegExp` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - */ - function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; - } - - /** - * The base implementation of `_.isSet` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - */ - function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; - } - - /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; - } - - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } - - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; - } - - /** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - - /** - * The base implementation of `_.lt` which doesn't coerce arguments. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - */ - function baseLt(value, other) { - return value < other; - } - - /** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; - } - - /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; - } - - /** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - if (isObject(srcValue)) { - stack || (stack = new Stack); - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; - - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); - } - - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; - - var isCommon = newValue === undefined; - - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); - - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); - } - - /** - * The base implementation of `_.nth` which doesn't coerce arguments. - * - * @private - * @param {Array} array The array to query. - * @param {number} n The index of the element to return. - * @returns {*} Returns the nth element of `array`. - */ - function baseNth(array, n) { - var length = array.length; - if (!length) { - return; - } - n += n < 0 ? length : 0; - return isIndex(n, length) ? array[n] : undefined; - } - - /** - * The base implementation of `_.orderBy` without param guards. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ - function baseOrderBy(collection, iteratees, orders) { - var index = -1; - iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); - - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); - } - - /** - * The base implementation of `_.pick` without support for individual - * property identifiers. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. - */ - function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); - } - - /** - * The base implementation of `_.pickBy` without support for iteratee shorthands. - * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. - */ - function basePickBy(object, paths, predicate) { - var index = -1, - length = paths.length, - result = {}; - - while (++index < length) { - var path = paths[index], - value = baseGet(object, path); - - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); - } - } - return result; - } - - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; - } - - /** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - */ - function basePullAll(array, values, iteratee, comparator) { - var indexOf = comparator ? baseIndexOfWith : baseIndexOf, - index = -1, - length = values.length, - seen = array; - - if (array === values) { - values = copyArray(values); - } - if (iteratee) { - seen = arrayMap(array, baseUnary(iteratee)); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; - - while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; - } - - /** - * The base implementation of `_.pullAt` without support for individual - * indexes or capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; - - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } else { - baseUnset(array, index); - } - } - } - return array; - } - - /** - * The base implementation of `_.random` without support for returning - * floating-point numbers. - * - * @private - * @param {number} lower The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the random number. - */ - function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); - } - - /** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. - */ - function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; - } - - /** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ - function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; - } - - /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); - } - - /** - * The base implementation of `_.sample`. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - */ - function baseSample(collection) { - return arraySample(values(collection)); - } - - /** - * The base implementation of `_.sampleSize` without param guards. - * - * @private - * @param {Array|Object} collection The collection to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. - */ - function baseSampleSize(collection, n) { - var array = values(collection); - return shuffleSelf(array, baseClamp(n, 0, array.length)); - } - - /** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; - } - path = castPath(path, object); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; - - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; - } - - /** - * The base implementation of `setData` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; - - /** - * The base implementation of `setToString` without support for hot loop shorting. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); - }; - - /** - * The base implementation of `_.shuffle`. - * - * @private - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - */ - function baseShuffle(collection) { - return shuffleSelf(values(collection)); - } - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - - /** - * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which - * performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndex(array, value, retHighest) { - var low = 0, - high = array == null ? low : array.length; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; - - if (computed !== null && !isSymbol(computed) && - (retHighest ? (computed <= value) : (computed < value))) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); - } - - /** - * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` - * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The iteratee invoked per element. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - - var low = 0, - high = array == null ? 0 : array.length, - valIsNaN = value !== value, - valIsNull = value === null, - valIsSymbol = isSymbol(value), - valIsUndefined = value === undefined; - - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - othIsDefined = computed !== undefined, - othIsNull = computed === null, - othIsReflexive = computed === computed, - othIsSymbol = isSymbol(computed); - - if (valIsNaN) { - var setLow = retHighest || othIsReflexive; - } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); - } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); - } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); - } else if (othIsNull || othIsSymbol) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); - } - - /** - * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseSortedUniq(array, iteratee) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (!index || !eq(computed, seen)) { - var seen = computed; - result[resIndex++] = value === 0 ? 0 : value; - } - } - return result; - } - - /** - * The base implementation of `_.toNumber` which doesn't ensure correct - * conversions of binary, hexadecimal, or octal string values. - * - * @private - * @param {*} value The value to process. - * @returns {number} Returns the number. - */ - function baseToNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - return +value; - } - - /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.unset`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The property path to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ - function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; - } - - /** - * The base implementation of `_.update`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to update. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseUpdate(object, path, updater, customizer) { - return baseSet(object, path, updater(baseGet(object, path)), customizer); - } - - /** - * The base implementation of methods like `_.dropWhile` and `_.takeWhile` - * without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} - - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - return arrayReduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); - } - - /** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - */ - function baseXor(arrays, iteratee, comparator) { - var length = arrays.length; - if (length < 2) { - return length ? baseUniq(arrays[0]) : []; - } - var index = -1, - result = Array(length); - - while (++index < length) { - var array = arrays[index], - othIndex = -1; - - while (++othIndex < length) { - if (othIndex != index) { - result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); - } - } - } - return baseUniq(baseFlatten(result, 1), iteratee, comparator); - } - - /** - * This base implementation of `_.zipObject` which assigns values using `assignFunc`. - * - * @private - * @param {Array} props The property identifiers. - * @param {Array} values The property values. - * @param {Function} assignFunc The function to assign values. - * @returns {Object} Returns the new object. - */ - function baseZipObject(props, values, assignFunc) { - var index = -1, - length = props.length, - valsLength = values.length, - result = {}; - - while (++index < length) { - var value = index < valsLength ? values[index] : undefined; - assignFunc(result, props[index], value); - } - return result; - } - - /** - * Casts `value` to an empty array if it's not an array like object. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array|Object} Returns the cast array-like object. - */ - function castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; - } - - /** - * Casts `value` to `identity` if it's not a function. - * - * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. - */ - function castFunction(value) { - return typeof value == 'function' ? value : identity; - } - - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ - function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); - } - - /** - * A `baseRest` alias which can be replaced with `identity` by module - * replacement plugins. - * - * @private - * @type {Function} - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - var castRest = baseRest; - - /** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ - function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); - } - - /** - * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). - * - * @private - * @param {number|Object} id The timer id or timeout object of the timer to clear. - */ - var clearTimeout = ctxClearTimeout || function(id) { - return root.clearTimeout(id); - }; - - /** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; - } - - /** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; - } - - /** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } - - /** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } - - /** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } - - /** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - - /** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = isSymbol(value); - - var othIsDefined = other !== undefined, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = isSymbol(other); - - if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || - (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || - (valIsNull && othIsDefined && othIsReflexive) || - (!valIsDefined && othIsReflexive) || - !valIsReflexive) { - return 1; - } - if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || - (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || - (othIsNull && valIsDefined && valIsReflexive) || - (!othIsDefined && valIsReflexive) || - !othIsReflexive) { - return -1; - } - } - return 0; - } - - /** - * Used by `_.orderBy` to compare multiple properties of a value to another - * and stable sort them. - * - * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, - * specify an order of "desc" for descending or "asc" for ascending sort order - * of corresponding values. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]|string[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; - - while (++index < length) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersLength = holders.length, - leftIndex = -1, - leftLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(leftLength + rangeLength), - isUncurried = !isCurried; - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - } - while (rangeLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; - } - - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersIndex = -1, - holdersLength = holders.length, - rightIndex = -1, - rightLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(rangeLength + rightLength), - isUncurried = !isCurried; - - while (++argsIndex < rangeLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - } - return result; - } - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; - } - - /** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } - - /** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); - } - - /** - * Creates a function like `_.groupBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; - - return func(collection, setter, getIteratee(iteratee, 2), accumulator); - }; - } - - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createBind(func, bitmask, thisArg) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); - } - return wrapper; - } - - /** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. - */ - function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; - - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); - - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); - - return chr[methodName]() + trailing; - }; - } - - /** - * Creates a function like `_.camelCase`. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); - }; - } - - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtor(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - - /** - * Creates a function that wraps `func` to enable currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {number} arity The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createCurry(func, bitmask, arity) { - var Ctor = createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length, - placeholder = getHolder(wrapper); - - while (index--) { - args[index] = arguments[index]; - } - var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) - ? [] - : replaceHolders(args, placeholder); - - length -= holders.length; - if (length < arity) { - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, undefined, - args, holders, undefined, undefined, arity - length); - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return apply(fn, this, args); - } - return wrapper; - } - - /** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} findIndexFunc The function to find the collection index. - * @returns {Function} Returns the new find function. - */ - function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = getIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; - }; - } - - /** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ - function createFlow(fromRight) { - return flatRest(function(funcs) { - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; - - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; - - if (data && isLaziable(data[0]) && - data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && - !data[4].length && data[9] == 1 - ) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) - ? wrapper[funcName]() - : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value)) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }); - } - - /** - * Creates a function that wraps `func` to invoke it with optional `this` - * binding of `thisArg`, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided - * to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & WRAP_ARY_FLAG, - isBind = bitmask & WRAP_BIND_FLAG, - isBindKey = bitmask & WRAP_BIND_KEY_FLAG, - isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), - isFlip = bitmask & WRAP_FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length; - - while (index--) { - args[index] = arguments[index]; - } - if (isCurried) { - var placeholder = getHolder(wrapper), - holdersCount = countHolders(args, placeholder); - } - if (partials) { - args = composeArgs(args, partials, holders, isCurried); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight, isCurried); - } - length -= holdersCount; - if (isCurried && length < arity) { - var newHolders = replaceHolders(args, placeholder); - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, thisArg, - args, newHolders, argPos, ary, arity - length - ); - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - - length = args.length; - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && length > 1) { - args.reverse(); - } - if (isAry && ary < length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtor(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; - } - - /** - * Creates a function like `_.invertBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} toIteratee The function to resolve iteratees. - * @returns {Function} Returns the new inverter function. - */ - function createInverter(setter, toIteratee) { - return function(object, iteratee) { - return baseInverter(object, setter, toIteratee(iteratee), {}); - }; - } - - /** - * Creates a function that performs a mathematical operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @param {number} [defaultValue] The value used for `undefined` arguments. - * @returns {Function} Returns the new mathematical operation function. - */ - function createMathOperation(operator, defaultValue) { - return function(value, other) { - var result; - if (value === undefined && other === undefined) { - return defaultValue; - } - if (value !== undefined) { - result = value; - } - if (other !== undefined) { - if (result === undefined) { - return other; - } - if (typeof value == 'string' || typeof other == 'string') { - value = baseToString(value); - other = baseToString(other); - } else { - value = baseToNumber(value); - other = baseToNumber(other); - } - result = operator(value, other); - } - return result; - }; - } - - /** - * Creates a function like `_.over`. - * - * @private - * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new over function. - */ - function createOver(arrayFunc) { - return flatRest(function(iteratees) { - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - return baseRest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { - return apply(iteratee, thisArg, args); - }); - }); - }); - } - - /** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ - function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return hasUnicode(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); - } - - /** - * Creates a function that wraps `func` to invoke it with the `this` binding - * of `thisArg` and `partials` prepended to the arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to - * the new function. - * @returns {Function} Returns the new wrapped function. - */ - function createPartial(func, bitmask, thisArg, partials) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn, isBind ? thisArg : this, args); - } - return wrapper; - } - - /** - * Creates a `_.range` or `_.rangeRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. - */ - function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); - return baseRange(start, end, step, fromRight); - }; - } - - /** - * Creates a function that performs a relational operation on two values. - * - * @private - * @param {Function} operator The function to perform the operation. - * @returns {Function} Returns the new relational operation function. - */ - function createRelationalOperation(operator) { - return function(value, other) { - if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); - } - return operator(value, other); - }; - } - - /** - * Creates a function that wraps `func` to continue currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder value. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { - var isCurry = bitmask & WRAP_CURRY_FLAG, - newHolders = isCurry ? holders : undefined, - newHoldersRight = isCurry ? undefined : holders, - newPartials = isCurry ? partials : undefined, - newPartialsRight = isCurry ? undefined : partials; - - bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); - - if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { - bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); - } - var newData = [ - func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, - newHoldersRight, argPos, ary, arity - ]; - - var result = wrapFunc.apply(undefined, newData); - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return setWrapToString(result, func, bitmask); - } - - /** - * Creates a function like `_.round`. - * - * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. - */ - function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision) { - // Shift with exponential notation to avoid floating-point issues. - // See [MDN](https://mdn.io/round#Examples) for more details. - var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); - - pair = (toString(value) + 'e').split('e'); - return +(pair[0] + 'e' + (+pair[1] - precision)); - } - return func(number); - }; - } - - /** - * Creates a set object of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ - var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); - }; - - /** - * Creates a `_.toPairs` or `_.toPairsIn` function. - * - * @private - * @param {Function} keysFunc The function to get the keys of a given object. - * @returns {Function} Returns the new pairs function. - */ - function createToPairs(keysFunc) { - return function(object) { - var tag = getTag(object); - if (tag == mapTag) { - return mapToArray(object); - } - if (tag == setTag) { - return setToPairs(object); - } - return baseToPairs(object, keysFunc(object)); - }; - } - - /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * 512 - `_.flip` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); - partials = holders = undefined; - } - ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); - arity = arity === undefined ? arity : toInteger(arity); - length -= holders ? holders.length : 0; - - if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = undefined; - } - var data = isBindKey ? undefined : getData(func); - - var newData = [ - func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, - argPos, ary, arity - ]; - - if (data) { - mergeData(newData, data); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] === undefined - ? (isBindKey ? 0 : func.length) - : nativeMax(newData[9] - length, 0); - - if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { - bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); - } - if (!bitmask || bitmask == WRAP_BIND_FLAG) { - var result = createBind(func, bitmask, thisArg); - } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { - result = createCurry(func, bitmask, arity); - } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { - result = createPartial(func, bitmask, thisArg, partials); - } else { - result = createHybrid.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setWrapToString(setter(result, newData), func, bitmask); - } - - /** - * Used by `_.defaults` to customize its `_.assignIn` use to assign properties - * of source objects to the destination object for all destination properties - * that resolve to `undefined`. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ - function customDefaultsAssignIn(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; - } - - /** - * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source - * objects into destination objects that are passed thru. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to merge. - * @param {Object} object The parent object of `objValue`. - * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - * @returns {*} Returns the value to assign. - */ - function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { - if (isObject(objValue) && isObject(srcValue)) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); - stack['delete'](srcValue); - } - return objValue; - } - - /** - * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain - * objects. - * - * @private - * @param {*} value The value to inspect. - * @param {string} key The key of the property to inspect. - * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. - */ - function customOmitClone(value) { - return isPlainObject(value) ? undefined : value; - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked && stack.get(other)) { - return stacked == other; - } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; - } - - /** - * A specialized version of `baseRest` which flattens the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); - } - - /** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); - } - - /** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); - } - - /** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; - - /** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ - function getFuncName(func) { - var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; - } - - /** - * Gets the argument placeholder value for `func`. - * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. - */ - function getHolder(func) { - var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; - return object.placeholder; - } - - /** - * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, - * this function returns the custom method, otherwise it returns `baseIteratee`. - * If arguments are provided, the chosen function is invoked with them and - * its result is returned. - * - * @private - * @param {*} [value] The value to convert to an iteratee. - * @param {number} [arity] The arity of the created iteratee. - * @returns {Function} Returns the chosen function or its result. - */ - function getIteratee() { - var result = lodash.iteratee || iteratee; - result = result === iteratee ? baseIteratee : result; - return arguments.length ? result(arguments[0], arguments[1]) : result; - } - - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } - - /** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } - - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; - } - - /** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); - }; - - /** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; - }; - - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; - } - - /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ - function getView(start, end, transforms) { - var index = -1, - length = transforms.length; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; - } - - /** - * Extracts wrapper details from the `source` body comment. - * - * @private - * @param {string} source The source to inspect. - * @returns {Array} Returns the wrapper details. - */ - function getWrapDetails(source) { - var match = source.match(reWrapDetails); - return match ? match[1].split(reSplitDetails) : []; - } - - /** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ - function hasPath(object, path, hasFunc) { - path = castPath(path, object); - - var index = -1, - length = path.length, - result = false; - - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); - } - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; - } - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return new Ctor; - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return new Ctor; - - case symbolTag: - return cloneSymbol(object); - } - } - - /** - * Inserts wrapper `details` in a comment at the top of the `source` body. - * - * @private - * @param {string} source The source to modify. - * @returns {Array} details The details to insert. - * @returns {string} Returns the modified source. - */ - function insertWrapDetails(source, details) { - var length = details.length; - if (!length) { - return source; - } - var lastIndex = length - 1; - details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; - details = details.join(length > 2 ? ', ' : ' '); - return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); - } - - /** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ - function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); - } - - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; - } - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } - - /** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, - * else `false`. - */ - function isLaziable(func) { - var funcName = getFuncName(func), - other = lodash[funcName]; - - if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { - return false; - } - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; - } - - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } - - /** - * Checks if `func` is capable of being masked. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `func` is maskable, else `false`. - */ - var isMaskable = coreJsData ? isFunction : stubFalse; - - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } - - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } - - /** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; - } - - /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. - * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. - */ - function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; - } - - /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers used to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and - * `_.rearg` modify function arguments, making the order in which they are - * executed important, preventing the merging of metadata. However, we make - * an exception for a safe combined case where curried functions have `_.ary` - * and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); - - var isCombo = - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || - ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & WRAP_BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : value; - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = value; - } - // Use source `ary` if it's smaller. - if (srcBitmask & WRAP_ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; - } - - /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } - - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } - - /** - * A specialized version of `baseRest` which transforms the rest array. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ - function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; - } - - /** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ - function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); - } - - /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } - - /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity - * function to avoid garbage collection pauses in V8. See - * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var setData = shortOut(baseSetData); - - /** - * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @returns {number|Object} Returns the timer id or timeout object. - */ - var setTimeout = ctxSetTimeout || function(func, wait) { - return root.setTimeout(func, wait); - }; - - /** - * Sets the `toString` method of `func` to return `string`. - * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. - */ - var setToString = shortOut(baseSetToString); - - /** - * Sets the `toString` method of `wrapper` to mimic the source of `reference` - * with wrapper details in a comment at the top of the source body. - * - * @private - * @param {Function} wrapper The function to modify. - * @param {Function} reference The reference function. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Function} Returns `wrapper`. - */ - function setWrapToString(wrapper, reference, bitmask) { - var source = (reference + ''); - return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); - } - - /** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. - * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. - */ - function shortOut(func) { - var count = 0, - lastCalled = 0; - - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; - } - - /** - * A specialized version of `_.shuffle` which mutates and sets the size of `array`. - * - * @private - * @param {Array} array The array to shuffle. - * @param {number} [size=array.length] The size of `array`. - * @returns {Array} Returns `array`. - */ - function shuffleSelf(array, size) { - var index = -1, - length = array.length, - lastIndex = length - 1; - - size = size === undefined ? length : size; - while (++index < size) { - var rand = baseRandom(index, lastIndex), - value = array[rand]; - - array[rand] = array[index]; - array[index] = value; - } - array.length = size; - return array; - } - - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46 /* . */) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - }); - - /** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } - - /** - * Updates wrapper `details` based on `bitmask` flags. - * - * @private - * @returns {Array} details The details to modify. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Array} Returns `details`. - */ - function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = '_.' + pair[0]; - if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { - details.push(value); - } - }); - return details.sort(); - } - - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements split into groups the length of `size`. - * If `array` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the new array of chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size, guard) { - if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { - size = 1; - } else { - size = nativeMax(toInteger(size), 0); - } - var length = array == null ? 0 : array.length; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = 0, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[resIndex++] = baseSlice(array, index, (index += size)); - } - return result; - } - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[resIndex++] = value; - } - } - return result; - } - - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - function concat() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), - array = arguments[0], - index = length; - - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); - } - - /** - * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * **Note:** Unlike `_.pullAll`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.without, _.xor - * @example - * - * _.difference([2, 1], [2, 3]); - * // => [1] - */ - var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; - }); - - /** - * This method is like `_.difference` except that it accepts `iteratee` which - * is invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * **Note:** Unlike `_.pullAllBy`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2] - * - * // The `_.property` iteratee shorthand. - * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var differenceBy = baseRest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) - : []; - }); - - /** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The order and - * references of result values are determined by the first array. The comparator - * is invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.pullAllWith`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - var differenceWith = baseRest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) - : []; - }); - - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.dropRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney'] - * - * // The `_.matches` iteratee shorthand. - * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropRightWhile(users, ['active', false]); - * // => objects for ['barney'] - * - * // The `_.property` iteratee shorthand. - * _.dropRightWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true, true) - : []; - } - - /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.dropWhile(users, function(o) { return !o.active; }); - * // => objects for ['pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.dropWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropWhile(users, ['active', false]); - * // => objects for ['pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.dropWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true) - : []; - } - - /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8, 10], '*', 1, 3); - * // => [4, '*', '*', 10] - */ - function fill(array, value, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); - } - - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 - */ - function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseFindIndex(array, getIteratee(predicate, 3), index); - } - - /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 - * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 - */ - function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, getIteratee(predicate, 3), index, true); - } - - /** - * Flattens `array` a single level deep. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] - */ - function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; - } - - /** - * Recursively flattens `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, [3, [4]], 5]]); - * // => [1, 2, 3, 4, 5] - */ - function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; - } - - /** - * Recursively flatten `array` up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Array - * @param {Array} array The array to flatten. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * var array = [1, [2, [3, [4]], 5]]; - * - * _.flattenDepth(array, 1); - * // => [1, 2, [3, [4]], 5] - * - * _.flattenDepth(array, 2); - * // => [1, 2, 3, [4], 5] - */ - function flattenDepth(array, depth) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(array, depth); - } - - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['a', 1], ['b', 2]]); - * // => { 'a': 1, 'b': 2 } - */ - function fromPairs(pairs) { - var index = -1, - length = pairs == null ? 0 : pairs.length, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; - } - - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 - * - * _.head([]); - * // => undefined - */ - function head(array) { - return (array && array.length) ? array[0] : undefined; - } - - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the - * offset from the end of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseIndexOf(array, value, index); - } - - /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ - function initial(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; - } - - /** - * Creates an array of unique values that are included in all given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersection([2, 1], [2, 3]); - * // => [2] - */ - var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [2.1] - * - * // The `_.property` iteratee shorthand. - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - var intersectionBy = baseRest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - if (iteratee === last(mapped)) { - iteratee = undefined; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee, 2)) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The order and references - * of result values are determined by the first array. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of intersecting values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - var intersectionWith = baseRest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - comparator = typeof comparator == 'function' ? comparator : undefined; - if (comparator) { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined, comparator) - : []; - }); - - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to convert. - * @param {string} [separator=','] The element separator. - * @returns {string} Returns the joined string. - * @example - * - * _.join(['a', 'b', 'c'], '~'); - * // => 'a~b~c' - */ - function join(array, separator) { - return array == null ? '' : nativeJoin.call(array, separator); - } - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; - } - - /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // Search from the `fromIndex`. - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); - } - return value === value - ? strictLastIndexOf(array, value, index) - : baseFindIndex(array, baseIsNaN, index, true); - } - - /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth - * element from the end is returned. - * - * @static - * @memberOf _ - * @since 4.11.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=0] The index of the element to return. - * @returns {*} Returns the nth element of `array`. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * - * _.nth(array, 1); - * // => 'b' - * - * _.nth(array, -2); - * // => 'c'; - */ - function nth(array, n) { - return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; - } - - /** - * Removes all given values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` - * to remove elements from an array by predicate. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; - * - * _.pull(array, 'a', 'c'); - * console.log(array); - * // => ['b', 'b'] - */ - var pull = baseRest(pullAll); - - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; - * - * _.pullAll(array, ['a', 'c']); - * console.log(array); - * // => ['b', 'b'] - */ - function pullAll(array, values) { - return (array && array.length && values && values.length) - ? basePullAll(array, values) - : array; - } - - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - function pullAllBy(array, values, iteratee) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, getIteratee(iteratee, 2)) - : array; - } - - /** - * This method is like `_.pullAll` except that it accepts `comparator` which - * is invoked to compare elements of `array` to `values`. The comparator is - * invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; - * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - function pullAllWith(array, values, comparator) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, undefined, comparator) - : array; - } - - /** - * Removes elements from `array` corresponding to `indexes` and returns an - * array of removed elements. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = ['a', 'b', 'c', 'd']; - * var pulled = _.pullAt(array, [1, 3]); - * - * console.log(array); - * // => ['a', 'c'] - * - * console.log(pulled); - * // => ['b', 'd'] - */ - var pullAt = flatRest(function(array, indexes) { - var length = array == null ? 0 : array.length, - result = baseAt(array, indexes); - - basePullAt(array, arrayMap(indexes, function(index) { - return isIndex(index, length) ? +index : index; - }).sort(compareAscending)); - - return result; - }); - - /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is invoked - * with three arguments: (value, index, array). - * - * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` - * to pull elements from an array by value. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ - function remove(array, predicate) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = getIteratee(predicate, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; - } - - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function reverse(array) { - return array == null ? array : nativeReverse.call(array); - } - - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of - * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are - * returned. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - else { - start = start == null ? 0 : toInteger(start); - end = end === undefined ? length : toInteger(end); - } - return baseSlice(array, start, end); - } - - /** - * Uses a binary search to determine the lowest index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - */ - function sortedIndex(array, value) { - return baseSortedIndex(array, value); - } - - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); - * // => 0 - */ - function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); - } - - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([4, 5, 5, 5, 6], 5); - * // => 1 - */ - function sortedIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value); - if (index < length && eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 5, 5, 5, 6], 5); - * // => 4 - */ - function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); - } - - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; - * - * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 1 - * - * // The `_.property` iteratee shorthand. - * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); - * // => 1 - */ - function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); - } - - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); - * // => 3 - */ - function sortedLastIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value, true) - 1; - if (eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - function sortedUniq(array) { - return (array && array.length) - ? baseSortedUniq(array) - : []; - } - - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.3] - */ - function sortedUniqBy(array, iteratee) { - return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee, 2)) - : []; - } - - /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.tail([1, 2, 3]); - * // => [2, 3] - */ - function tail(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 1, length) : []; - } - - /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ - function take(array, n, guard) { - if (!(array && array.length)) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.takeRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeRightWhile(users, ['active', false]); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.takeRightWhile(users, 'active'); - * // => [] - */ - function takeRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), false, true) - : []; - } - - /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.takeWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matches` iteratee shorthand. - * _.takeWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeWhile(users, ['active', false]); - * // => objects for ['barney', 'fred'] - * - * // The `_.property` iteratee shorthand. - * _.takeWhile(users, 'active'); - * // => [] - */ - function takeWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3)) - : []; - } - - /** - * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([2], [1, 2]); - * // => [2, 1] - */ - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); - }); - - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which uniqueness is computed. Result values are chosen from the first - * array in which the value occurs. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.unionBy([2.1], [1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - var unionBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); - }); - - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. Result values are chosen from - * the first array in which the value occurs. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var unionWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); - }); - - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. The order of result values is determined by the order they occur - * in the array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - function uniq(array) { - return (array && array.length) ? baseUniq(array) : []; - } - - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The order of result values is determined by the - * order they occur in the array. The iteratee is invoked with one argument: - * (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniqBy(array, iteratee) { - return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; - } - - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The order of result values is - * determined by the order they occur in the array.The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - function uniqWith(array, comparator) { - comparator = typeof comparator == 'function' ? comparator : undefined; - return (array && array.length) ? baseUniq(array, undefined, comparator) : []; - } - - /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @since 1.2.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - * - * _.unzip(zipped); - * // => [['a', 'b'], [1, 2], [true, false]] - */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var length = 0; - array = arrayFilter(array, function(group) { - if (isArrayLikeObject(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - return baseTimes(length, function(index) { - return arrayMap(array, baseProperty(index)); - }); - } - - /** - * This method is like `_.unzip` except that it accepts `iteratee` to specify - * how regrouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee=_.identity] The function to combine - * regrouped values. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ - function unzipWith(array, iteratee) { - if (!(array && array.length)) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - return arrayMap(result, function(group) { - return apply(iteratee, undefined, group); - }); - } - - /** - * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.pull`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.xor - * @example - * - * _.without([2, 1, 2, 3], 1, 2); - * // => [3] - */ - var without = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, values) - : []; - }); - - /** - * Creates an array of unique values that is the - * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the given arrays. The order of result values is determined by the order - * they occur in the arrays. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.without - * @example - * - * _.xor([2, 1], [2, 3]); - * // => [1, 3] - */ - var xor = baseRest(function(arrays) { - return baseXor(arrayFilter(arrays, isArrayLikeObject)); - }); - - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which by which they're compared. The order of result values is determined - * by the order they occur in the arrays. The iteratee is invoked with one - * argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2, 3.4] - * - * // The `_.property` iteratee shorthand. - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var xorBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); - }); - - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The order of result values is - * determined by the order they occur in the arrays. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var xorWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); - }); - - /** - * Creates an array of grouped elements, the first of which contains the - * first elements of the given arrays, the second of which contains the - * second elements of the given arrays, and so on. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - */ - var zip = baseRest(unzip); - - /** - * This method is like `_.fromPairs` except that it accepts two arrays, - * one of property identifiers and one of corresponding values. - * - * @static - * @memberOf _ - * @since 0.4.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject(['a', 'b'], [1, 2]); - * // => { 'a': 1, 'b': 2 } - */ - function zipObject(props, values) { - return baseZipObject(props || [], values || [], assignValue); - } - - /** - * This method is like `_.zipObject` except that it supports property paths. - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Array - * @param {Array} [props=[]] The property identifiers. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); - * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } - */ - function zipObjectDeep(props, values) { - return baseZipObject(props || [], values || [], baseSet); - } - - /** - * This method is like `_.zip` except that it accepts `iteratee` to specify - * how grouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee=_.identity] The function to combine - * grouped values. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { - * return a + b + c; - * }); - * // => [111, 222] - */ - var zipWith = baseRest(function(arrays) { - var length = arrays.length, - iteratee = length > 1 ? arrays[length - 1] : undefined; - - iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; - return unzipWith(arrays, iteratee); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` wrapper instance that wraps `value` with explicit method - * chain sequences enabled. The result of such sequences must be unwrapped - * with `_#value`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** - * This method invokes `interceptor` and returns `value`. The interceptor - * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain sequence in order to modify intermediate results. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * // Mutate input array. - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor) { - interceptor(value); - return value; - } - - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain sequence. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor) { - return interceptor(value); - } - - /** - * This method is the wrapper version of `_.at`. - * - * @name at - * @memberOf _ - * @since 1.0.0 - * @category Seq - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _(object).at(['a[0].b.c', 'a[1]']).value(); - * // => [3, 4] - */ - var wrapperAt = flatRest(function(paths) { - var length = paths.length, - start = length ? paths[0] : 0, - value = this.__wrapped__, - interceptor = function(object) { return baseAt(object, paths); }; - - if (length > 1 || this.__actions__.length || - !(value instanceof LazyWrapper) || !isIndex(start)) { - return this.thru(interceptor); - } - value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ - 'func': thru, - 'args': [interceptor], - 'thisArg': undefined - }); - return new LodashWrapper(value, this.__chain__).thru(function(array) { - if (length && !array.length) { - array.push(undefined); - } - return array; - }); - }); - - /** - * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. - * - * @name chain - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // A sequence without explicit chaining. - * _(users).head(); - * // => { 'user': 'barney', 'age': 36 } - * - * // A sequence with explicit chaining. - * _(users) - * .chain() - * .head() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** - * Executes the chain sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } - - /** - * Gets the next value on a wrapped object following the - * [iterator protocol](https://mdn.io/iteration_protocols#iterator). - * - * @name next - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the next iterator value. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped.next(); - * // => { 'done': false, 'value': 1 } - * - * wrapped.next(); - * // => { 'done': false, 'value': 2 } - * - * wrapped.next(); - * // => { 'done': true, 'value': undefined } - */ - function wrapperNext() { - if (this.__values__ === undefined) { - this.__values__ = toArray(this.value()); - } - var done = this.__index__ >= this.__values__.length, - value = done ? undefined : this.__values__[this.__index__++]; - - return { 'done': done, 'value': value }; - } - - /** - * Enables the wrapper to be iterable. - * - * @name Symbol.iterator - * @memberOf _ - * @since 4.0.0 - * @category Seq - * @returns {Object} Returns the wrapper object. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped[Symbol.iterator]() === wrapped; - * // => true - * - * Array.from(wrapped); - * // => [1, 2] - */ - function wrapperToIterator() { - return this; - } - - /** - * Creates a clone of the chain sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @since 3.2.0 - * @category Seq - * @param {*} value The value to plant. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2]).map(square); - * var other = wrapped.plant([3, 4]); - * - * other.value(); - * // => [9, 16] - * - * wrapped.value(); - * // => [1, 4] - */ - function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - clone.__index__ = 0; - clone.__values__ = undefined; - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; - } - - /** - * This method is the wrapper version of `_.reverse`. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @since 0.1.0 - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); - } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ - 'func': thru, - 'args': [reverse], - 'thisArg': undefined - }); - return new LodashWrapper(wrapped, this.__chain__); - } - return this.thru(reverse); - } - - /** - * Executes the chain sequence to resolve the unwrapped value. - * - * @name value - * @memberOf _ - * @since 0.1.0 - * @alias toJSON, valueOf - * @category Seq - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the number of times the key was returned by `iteratee`. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': 1, '6': 2 } - * - * // The `_.property` iteratee shorthand. - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - ++result[key]; - } else { - baseAssignValue(result, key, 1); - } - }); - - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - */ - function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ - var find = createFind(findIndex); - - /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=collection.length-1] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ - var findLast = createFind(findLastIndex); - - /** - * Creates a flattened array of values by running each element in `collection` - * thru `iteratee` and flattening the mapped results. The iteratee is invoked - * with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _.flatMap([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee), 1); - } - - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMapDeep(collection, iteratee) { - return baseFlatten(map(collection, iteratee), INFINITY); - } - - /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. - * - * @static - * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [[[n, n]]]; - * } - * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] - */ - function flatMapDepth(collection, iteratee, depth) { - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee), depth); - } - - /** - * Iterates over elements of `collection` and invokes `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" - * property are iterated like arrays. To avoid this behavior use `_.forIn` - * or `_.forOwn` for object iteration. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEachRight - * @example - * - * _.forEach([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `1` then `2`. - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forEach(collection, iteratee) { - var func = isArray(collection) ? arrayEach : baseEach; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @alias eachRight - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEach - * @example - * - * _.forEachRight([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `2` then `1`. - */ - function forEachRight(collection, iteratee) { - var func = isArray(collection) ? arrayEachRight : baseEachRight; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The order of grouped values - * is determined by the order they occur in `collection`. The corresponding - * value of each key is an array of elements responsible for generating the - * key. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } - * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - baseAssignValue(result, key, [value]); - } - }); - - /** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true - * - * _.includes('abcd', 'bc'); - * // => true - */ - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); - } - - /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `path` is a function, it's invoked - * for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invokeMap = baseRest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); - }); - return result; - }); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the last element responsible for generating the key. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var array = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.keyBy(array, function(o) { - * return String.fromCharCode(o.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.keyBy(array, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - */ - var keyBy = createAggregator(function(result, value, key) { - baseAssignValue(result, key, value); - }); - - /** - * Creates an array of values by running each element in `collection` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, - * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, - * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, - * `template`, `trim`, `trimEnd`, `trimStart`, and `words` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] - * The iteratees to sort by. - * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // Sort by `user` in ascending order and by `age` in descending order. - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] - */ - function orderBy(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined : orders; - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseOrderBy(collection, iteratees, orders); - } - - /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, the second of which - * contains elements `predicate` returns falsey for. The predicate is - * invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * _.partition(users, function(o) { return o.active; }); - * // => objects for [['fred'], ['barney', 'pebbles']] - * - * // The `_.matches` iteratee shorthand. - * _.partition(users, { 'age': 1, 'active': false }); - * // => objects for [['pebbles'], ['barney', 'fred']] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.partition(users, ['active', false]); - * // => objects for [['barney', 'pebbles'], ['fred']] - * - * // The `_.property` iteratee shorthand. - * _.partition(users, 'active'); - * // => objects for [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` thru `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not given, the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduceRight - * @example - * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); - } - - /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduce - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduceRight : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); - } - - /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.filter - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * _.reject(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.reject(users, { 'age': 40, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.reject(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.reject(users, 'active'); - * // => objects for ['barney'] - */ - function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(getIteratee(predicate, 3))); - } - - /** - * Gets a random element from `collection`. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - */ - function sample(collection) { - var func = isArray(collection) ? arraySample : baseSample; - return func(collection); - } - - /** - * Gets `n` random elements at unique keys from `collection` up to the - * size of `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @param {number} [n=1] The number of elements to sample. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the random elements. - * @example - * - * _.sampleSize([1, 2, 3], 2); - * // => [3, 1] - * - * _.sampleSize([1, 2, 3], 4); - * // => [2, 3, 1] - */ - function sampleSize(collection, n, guard) { - if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - var func = isArray(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n); - } - - /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - var func = isArray(collection) ? arrayShuffle : baseShuffle; - return func(collection); - } - - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable string keyed properties for objects. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the collection size. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike(collection)) { - return isString(collection) ? stringSize(collection) : collection.length; - } - var tag = getTag(collection); - if (tag == mapTag || tag == setTag) { - return collection.size; - } - return baseKeys(collection).length; - } - - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, guard) { - var func = isArray(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection thru each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[])} [iteratees=[_.identity]] - * The iteratees to sort by. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] - */ - var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; - } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ - var now = ctxNow || function() { - return root.Date.now(); - }; - - /*------------------------------------------------------------------------*/ - - /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => Logs 'done saving!' after the two async saves have completed. - */ - function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that invokes `func`, with up to `n` arguments, - * ignoring any additional arguments. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ - function ary(func, n, guard) { - n = guard ? undefined : n; - n = (func && n == null) ? func.length : n; - return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); - } - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => Allows adding up to 4 contacts to the list. - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and `partials` prepended to the arguments it receives. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * function greet(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = baseRest(function(func, thisArg, partials) { - var bitmask = WRAP_BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bind)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(func, bitmask, thisArg, partials, holders); - }); - - /** - * Creates a function that invokes the method at `object[key]` with `partials` - * prepended to the arguments it receives. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. See - * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Function - * @param {Object} object The object to invoke the method on. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // Bound with placeholders. - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ - var bindKey = baseRest(function(object, key, partials) { - var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(key, bitmask, object, partials, holders); - }); - - /** - * Creates a function that accepts arguments of `func` and either invokes - * `func` returning its result, if at least `arity` number of arguments have - * been provided, or returns a function that accepts the remaining `func` - * arguments, and so on. The arity of `func` may be specified if `func.length` - * is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ - function curry(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curry.placeholder; - return result; - } - - /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ - function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryRight.placeholder; - return result; - } - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - timeWaiting = wait - timeSinceLastCall; - - return maxing - ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) - : timeWaiting; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => Logs 'deferred' after one millisecond. - */ - var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => Logs 'later' after one second. - */ - var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); - }); - - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new flipped function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - function flip(func) { - return createWrap(func, WRAP_FLIP_FLAG); - } - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `clear`, `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } - - // Expose `MapCache`. - memoize.Cache = MapCache; - - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new negated function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - var args = arguments; - switch (args.length) { - case 0: return !predicate.call(this); - case 1: return !predicate.call(this, args[0]); - case 2: return !predicate.call(this, args[0], args[1]); - case 3: return !predicate.call(this, args[0], args[1], args[2]); - } - return !predicate.apply(this, args); - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // => `createApplication` is invoked once - */ - function once(func) { - return before(2, func); - } - - /** - * Creates a function that invokes `func` with its arguments transformed. - * - * @static - * @since 4.0.0 - * @memberOf _ - * @category Function - * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms=[_.identity]] - * The argument transforms. - * @returns {Function} Returns the new function. - * @example - * - * function doubled(n) { - * return n * 2; - * } - * - * function square(n) { - * return n * n; - * } - * - * var func = _.overArgs(function(x, y) { - * return [x, y]; - * }, [square, doubled]); - * - * func(9, 3); - * // => [81, 6] - * - * func(10, 5); - * // => [100, 10] - */ - var overArgs = castRest(function(func, transforms) { - transforms = (transforms.length == 1 && isArray(transforms[0])) - ? arrayMap(transforms[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); - - var funcsLength = transforms.length; - return baseRest(function(args) { - var index = -1, - length = nativeMin(args.length, funcsLength); - - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); - } - return apply(func, this, args); - }); - }); - - /** - * Creates a function that invokes `func` with `partials` prepended to the - * arguments it receives. This method is like `_.bind` except it does **not** - * alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @since 0.2.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // Partially applied with placeholders. - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ - var partial = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partial)); - return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); - }); - - /** - * This method is like `_.partial` except that partially applied arguments - * are appended to the arguments it receives. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // Partially applied with placeholders. - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ - var partialRight = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); - }); - - /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified `indexes` where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, [2, 0, 1]); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - */ - var rearg = flatRest(function(func, indexes) { - return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); - }); - - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start === undefined ? start : toInteger(start); - return baseRest(func, start); - } - - /** - * Creates a function that invokes `func` with the `this` binding of the - * create function and an array of arguments much like - * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). - * - * **Note:** This method is based on the - * [spread operator](https://mdn.io/spread_operator). - * - * @static - * @memberOf _ - * @since 3.2.0 - * @category Function - * @param {Function} func The function to spread arguments over. - * @param {number} [start=0] The start position of the spread. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ - function spread(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start == null ? 0 : nativeMax(toInteger(start), 0); - return baseRest(function(args) { - var array = args[start], - otherArgs = castSlice(args, 0, start); - - if (array) { - arrayPush(otherArgs, array); - } - return apply(func, this, otherArgs); - }); - } - - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide `options` to indicate whether `func` - * should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); - } - - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - function unary(func) { - return ary(func, 1); - } - - /** - * Creates a function that provides `value` to `wrapper` as its first - * argument. Any additional arguments provided to the function are appended - * to those provided to the `wrapper`. The wrapper is invoked with the `this` - * binding of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {*} value The value to wrap. - * @param {Function} [wrapper=identity] The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

' + func(text) + '

'; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

fred, barney, & pebbles

' - */ - function wrap(value, wrapper) { - return partial(castFunction(wrapper), value); - } - - /*------------------------------------------------------------------------*/ - - /** - * Casts `value` as an array if it's not one. - * - * @static - * @memberOf _ - * @since 4.4.0 - * @category Lang - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast array. - * @example - * - * _.castArray(1); - * // => [1] - * - * _.castArray({ 'a': 1 }); - * // => [{ 'a': 1 }] - * - * _.castArray('abc'); - * // => ['abc'] - * - * _.castArray(null); - * // => [null] - * - * _.castArray(undefined); - * // => [undefined] - * - * _.castArray(); - * // => [] - * - * var array = [1, 2, 3]; - * console.log(_.castArray(array) === array); - * // => true - */ - function castArray() { - if (!arguments.length) { - return []; - } - var value = arguments[0]; - return isArray(value) ? value : [value]; - } - - /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @see _.cloneDeep - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ - function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); - } - - /** - * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined`, - * cloning is handled by the method instead. The `customizer` is invoked with - * up to four arguments; (value [, index|key, object, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the cloned value. - * @see _.cloneDeepWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * } - * - * var el = _.cloneWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 0 - */ - function cloneWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); - } - - /** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ - function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); - } - - /** - * This method is like `_.cloneWith` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the deep cloned value. - * @see _.cloneWith - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * } - * - * var el = _.cloneDeepWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 20 - */ - function cloneDeepWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); - } - - /** - * Checks if `object` conforms to `source` by invoking the predicate - * properties of `source` with the corresponding property values of `object`. - * - * **Note:** This method is equivalent to `_.conforms` when `source` is - * partially applied. - * - * @static - * @memberOf _ - * @since 4.14.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); - * // => true - * - * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); - * // => false - */ - function conformsTo(object, source) { - return source == null || baseConformsTo(object, source, keys(source)); - } - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. - * @see _.lt - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - var gt = createRelationalOperation(baseGt); - - /** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to - * `other`, else `false`. - * @see _.lte - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ - var gte = createRelationalOperation(function(value, other) { - return value >= other; - }); - - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); - }; - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is classified as an `ArrayBuffer` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. - * @example - * - * _.isArrayBuffer(new ArrayBuffer(2)); - * // => true - * - * _.isArrayBuffer(new Array(2)); - * // => false - */ - var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == boolTag); - } - - /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ - var isBuffer = nativeIsBuffer || stubFalse; - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; - - /** - * Checks if `value` is likely a DOM element. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); - } - - /** - * Checks if `value` is an empty object, collection, map, or set. - * - * Objects are considered empty if they have no own enumerable string keyed - * properties. - * - * Array-like values such as `arguments` objects, arrays, buffers, strings, or - * jQuery-like collections are considered empty if they have a `length` of `0`. - * Similarly, maps and sets are considered empty if they have a `size` of `0`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; - } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are compared by strict equality, i.e. `===`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - function isEqual(value, other) { - return baseIsEqual(value, other); - } - - /** - * This method is like `_.isEqual` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with up to - * six arguments: (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - if (!isObjectLike(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == errorTag || tag == domExcTag || - (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on - * [`Number.isFinite`](https://mdn.io/Number/isFinite). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MIN_VALUE); - * // => true - * - * _.isFinite(Infinity); - * // => false - * - * _.isFinite('3'); - * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } - - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on - * [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == 'object'; - } - - /** - * Checks if `value` is classified as a `Map` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. - * @example - * - * _.isMap(new Map); - * // => true - * - * _.isMap(new WeakMap); - * // => false - */ - var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; - - /** - * Performs a partial deep comparison between `object` and `source` to - * determine if `object` contains equivalent property values. - * - * **Note:** This method is equivalent to `_.matches` when `source` is - * partially applied. - * - * Partial comparisons will match empty array and empty object `source` - * values against any array or object value, respectively. See `_.isEqual` - * for a list of supported value comparisons. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * - * _.isMatch(object, { 'b': 2 }); - * // => true - * - * _.isMatch(object, { 'b': 1 }); - * // => false - */ - function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); - } - - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined`, comparisons - * are handled by the method instead. The `customizer` is invoked with five - * arguments: (objValue, srcValue, index|key, object, source). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseIsMatch(object, source, getMatchData(source), customizer); - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is based on - * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as - * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for - * `undefined` and other non-number values. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some - // ActiveX objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a pristine native function. - * - * **Note:** This method can't reliably detect native functions in the presence - * of the core-js package because core-js circumvents this kind of detection. - * Despite multiple requests, the core-js maintainer has made it clear: any - * attempt to fix the detection will be obstructed. As a result, we're left - * with little choice but to throw an error. Unfortunately, this also affects - * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), - * which rely on core-js. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (isMaskable(value)) { - throw new Error(CORE_ERROR_TEXT); - } - return baseIsNative(value); - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - function isNil(value) { - return value == null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are - * classified as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a number, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == numberTag); - } - - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; - } - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; - - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on - * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is classified as a `Set` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. - * @example - * - * _.isSet(new Set); - * // => true - * - * _.isSet(new WeakSet); - * // => false - */ - var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - - /** - * Checks if `value` is `undefined`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is classified as a `WeakMap` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. - * @example - * - * _.isWeakMap(new WeakMap); - * // => true - * - * _.isWeakMap(new Map); - * // => false - */ - function isWeakMap(value) { - return isObjectLike(value) && getTag(value) == weakMapTag; - } - - /** - * Checks if `value` is classified as a `WeakSet` object. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. - * @example - * - * _.isWeakSet(new WeakSet); - * // => true - * - * _.isWeakSet(new Set); - * // => false - */ - function isWeakSet(value) { - return isObjectLike(value) && baseGetTag(value) == weakSetTag; - } - - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. - * @see _.gt - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - var lt = createRelationalOperation(baseLt); - - /** - * Checks if `value` is less than or equal to `other`. - * - * @static - * @memberOf _ - * @since 3.9.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to - * `other`, else `false`. - * @see _.gte - * @example - * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true - * - * _.lte(3, 1); - * // => false - */ - var lte = createRelationalOperation(function(value, other) { - return value <= other; - }); - - /** - * Converts `value` to an array. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * _.toArray({ 'a': 1, 'b': 2 }); - * // => [1, 2] - * - * _.toArray('abc'); - * // => ['a', 'b', 'c'] - * - * _.toArray(1); - * // => [] - * - * _.toArray(null); - * // => [] - */ - function toArray(value) { - if (!value) { - return []; - } - if (isArrayLike(value)) { - return isString(value) ? stringToArray(value) : copyArray(value); - } - if (symIterator && value[symIterator]) { - return iteratorToArray(value[symIterator]()); - } - var tag = getTag(value), - func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); - - return func(value); - } - - /** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; - } - - /** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ - function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; - } - - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toLength(3.2); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3.2'); - * // => 3 - */ - function toLength(value) { - return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - /** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return copyObject(value, keysIn(value)); - } - - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toSafeInteger(3.2); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3.2'); - * // => 3 - */ - function toSafeInteger(value) { - return value - ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) - : (value === 0 ? value : 0); - } - - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - return value == null ? '' : baseToString(value); - } - - /*------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } - */ - var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); - } - } - }); - - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assign - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * function Bar() { - * this.c = 3; - * } - * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; - * - * _.assignIn({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } - */ - var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); - }); - - /** - * This method is like `_.assignIn` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); - }); - - /** - * This method is like `_.assign` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignInWith - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keys(source), object, customizer); - }); - - /** - * Creates an array of values corresponding to `paths` of `object`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Array} Returns the picked values. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _.at(object, ['a[0].b.c', 'a[1]']); - * // => [3, 4] - */ - var at = flatRest(baseAt); - - /** - * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given, its own enumerable string keyed properties - * are assigned to the created object. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties) { - var result = baseCreate(prototype); - return properties == null ? result : baseAssign(result, properties); - } - - /** - * Assigns own and inherited enumerable string keyed properties of source - * objects to the destination object for all destination properties that - * resolve to `undefined`. Source objects are applied from left to right. - * Once a property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaultsDeep - * @example - * - * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var defaults = baseRest(function(object, sources) { - object = Object(object); - - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; - } - - while (++index < length) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object[key]; - - if (value === undefined || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { - object[key] = source[key]; - } - } - } - - return object; - }); - - /** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.defaults - * @example - * - * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); - * // => { 'a': { 'b': 2, 'c': 3 } } - */ - var defaultsDeep = baseRest(function(args) { - args.push(undefined, customDefaultsMerge); - return apply(mergeWith, undefined, args); - }); - - /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(o) { return o.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) - * - * // The `_.matches` iteratee shorthand. - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findKey(users, 'active'); - * // => 'barney' - */ - function findKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); - } - - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(o) { return o.age < 40; }); - * // => returns 'pebbles' assuming `_.findKey` returns 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - function findLastKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); - } - - /** - * Iterates over own and inherited enumerable string keyed properties of an - * object and invokes `iteratee` for each property. The iteratee is invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forInRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). - */ - function forIn(object, iteratee) { - return object == null - ? object - : baseFor(object, getIteratee(iteratee, 3), keysIn); - } - - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forIn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. - */ - function forInRight(object, iteratee) { - return object == null - ? object - : baseForRight(object, getIteratee(iteratee, 3), keysIn); - } - - /** - * Iterates over own enumerable string keyed properties of an object and - * invokes `iteratee` for each property. The iteratee is invoked with three - * arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwnRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forOwn(object, iteratee) { - return object && baseForOwn(object, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwn - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. - */ - function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, getIteratee(iteratee, 3)); - } - - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functionsIn - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); - } - - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functions - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); - } - - /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } - - /** - * Checks if `path` is a direct property of `object`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': 2 } }; - * var other = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b'); - * // => true - * - * _.has(object, ['a', 'b']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - function has(object, path) { - return object != null && hasPath(object, path, baseHas); - } - - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); - } - - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite - * property assignments of previous values. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Object - * @param {Object} object The object to invert. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - */ - var invert = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - result[value] = key; - }, constant(identity)); - - /** - * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` thru `iteratee`. The - * corresponding inverted value of each inverted key is an array of keys - * responsible for generating the inverted value. The iteratee is invoked - * with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.1.0 - * @category Object - * @param {Object} object The object to invert. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invertBy(object); - * // => { '1': ['a', 'c'], '2': ['b'] } - * - * _.invertBy(object, function(value) { - * return 'group' + value; - * }); - * // => { 'group1': ['a', 'c'], 'group2': ['b'] } - */ - var invertBy = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - }, getIteratee); - - /** - * Invokes the method at `path` of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - * @example - * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; - * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] - */ - var invoke = baseRest(baseInvoke); - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } - - /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * string keyed property of `object` thru `iteratee`. The iteratee is invoked - * with three arguments: (value, key, object). - * - * @static - * @memberOf _ - * @since 3.8.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapValues - * @example - * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } - */ - function mapKeys(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, iteratee(value, key, object), value); - }); - return result; - } - - /** - * Creates an object with the same keys as `object` and values generated - * by running each own enumerable string keyed property of `object` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, key, object). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapKeys - * @example - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * _.mapValues(users, function(o) { return o.age; }); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - * - * // The `_.property` iteratee shorthand. - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - function mapValues(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, key, iteratee(value, key, object)); - }); - return result; - } - - /** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; - * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } - */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); - - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined`, merging is handled by the - * method instead. The `customizer` is invoked with six arguments: - * (objValue, srcValue, key, object, source, stack). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { 'a': [1], 'b': [2] }; - * var other = { 'a': [3], 'b': [4] }; - * - * _.mergeWith(object, other, customizer); - * // => { 'a': [1, 3], 'b': [2, 4] } - */ - var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { - baseMerge(object, source, srcIndex, customizer); - }); - - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable property paths of `object` that are not omitted. - * - * **Note:** This method is considerably slower than `_.pick`. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to omit. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - var omit = flatRest(function(object, paths) { - var result = {}; - if (object == null) { - return result; - } - var isDeep = false; - paths = arrayMap(paths, function(path) { - path = castPath(path, object); - isDeep || (isDeep = path.length > 1); - return path; - }); - copyObject(object, getAllKeysIn(object), result); - if (isDeep) { - result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); - } - var length = paths.length; - while (length--) { - baseUnset(result, paths[length]); - } - return result; - }); - - /** - * The opposite of `_.pickBy`; this method creates an object composed of - * the own and inherited enumerable string keyed properties of `object` that - * `predicate` doesn't return truthy for. The predicate is invoked with two - * arguments: (value, key). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - function omitBy(object, predicate) { - return pickBy(object, negate(getIteratee(predicate))); - } - - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); - }); - - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - function pickBy(object, predicate) { - if (object == null) { - return {}; - } - var props = arrayMap(getAllKeysIn(object), function(prop) { - return [prop]; - }); - predicate = getIteratee(predicate); - return basePickBy(object, props, function(value, path) { - return predicate(value, path[0]); - }); - } - - /** - * This method is like `_.get` except that if the resolved value is a - * function it's invoked with the `this` binding of its parent object and - * its result is returned. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' - * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - path = castPath(path, object); - - var index = -1, - length = path.length; - - // Ensure the loop is entered when path is empty. - if (!length) { - length = 1; - object = undefined; - } - while (++index < length) { - var value = object == null ? undefined : object[toKey(path[index])]; - if (value === undefined) { - index = length; - value = defaultValue; - } - object = isFunction(value) ? value.call(object) : value; - } - return object; - } - - /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, - * it's created. Arrays are created for missing index properties while objects - * are created for all other missing properties. Use `_.setWith` to customize - * `path` creation. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, ['x', '0', 'y', 'z'], 5); - * console.log(object.x[0].y.z); - * // => 5 - */ - function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); - } - - /** - * This method is like `_.set` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.setWith(object, '[0][1]', 'a', Object); - * // => { '0': { '1': 'a' } } - */ - function setWith(object, path, value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseSet(object, path, value, customizer); - } - - /** - * Creates an array of own enumerable string keyed-value pairs for `object` - * which can be consumed by `_.fromPairs`. If `object` is a map or set, its - * entries are returned. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias entries - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairs(new Foo); - * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) - */ - var toPairs = createToPairs(keys); - - /** - * Creates an array of own and inherited enumerable string keyed-value pairs - * for `object` which can be consumed by `_.fromPairs`. If `object` is a map - * or set, its entries are returned. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @alias entriesIn - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairsIn(new Foo); - * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) - */ - var toPairsIn = createToPairs(keysIn); - - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own - * enumerable string keyed properties thru `iteratee`, with each invocation - * potentially mutating the `accumulator` object. If `accumulator` is not - * provided, a new object with the same `[[Prototype]]` will be used. The - * iteratee is invoked with four arguments: (accumulator, value, key, object). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }, []); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function transform(object, iteratee, accumulator) { - var isArr = isArray(object), - isArrLike = isArr || isBuffer(object) || isTypedArray(object); - - iteratee = getIteratee(iteratee, 4); - if (accumulator == null) { - var Ctor = object && object.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor : []; - } - else if (isObject(object)) { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - else { - accumulator = {}; - } - } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - - /** - * Removes the property at `path` of `object`. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 7 } }] }; - * _.unset(object, 'a[0].b.c'); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - * - * _.unset(object, ['a', '0', 'b', 'c']); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - */ - function unset(object, path) { - return object == null ? true : baseUnset(object, path); - } - - /** - * This method is like `_.set` except that accepts `updater` to produce the - * value to set. Use `_.updateWith` to customize `path` creation. The `updater` - * is invoked with one argument: (value). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.update(object, 'a[0].b.c', function(n) { return n * n; }); - * console.log(object.a[0].b.c); - * // => 9 - * - * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); - * console.log(object.x[0].y.z); - * // => 0 - */ - function update(object, path, updater) { - return object == null ? object : baseUpdate(object, path, castFunction(updater)); - } - - /** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ - function updateWith(object, path, updater, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); - } - - /** - * Creates an array of the own enumerable string keyed property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return object == null ? [] : baseValues(object, keys(object)); - } - - /** - * Creates an array of the own and inherited enumerable string keyed property - * values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return object == null ? [] : baseValues(object, keysIn(object)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - function clamp(number, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); - } - - /** - * Checks if `n` is between `start` and up to, but not including, `end`. If - * `end` is not specified, it's set to `start` with `start` then set to `0`. - * If `start` is greater than `end` the params are swapped to support - * negative ranges. - * - * @static - * @memberOf _ - * @since 3.3.0 - * @category Number - * @param {number} number The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - * @see _.range, _.rangeRight - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - * - * _.inRange(-3, -2, -6); - * // => true - */ - function inRange(number, start, end) { - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - number = toNumber(number); - return baseInRange(number, start, end); - } - - /** - * Produces a random number between the inclusive `lower` and `upper` bounds. - * If only one argument is provided a number between `0` and the given number - * is returned. If `floating` is `true`, or either `lower` or `upper` are - * floats, a floating-point number is returned instead of an integer. - * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. - * - * @static - * @memberOf _ - * @since 0.7.0 - * @category Number - * @param {number} [lower=0] The lower bound. - * @param {number} [upper=1] The upper bound. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(lower, upper, floating) { - if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined; - } - if (floating === undefined) { - if (typeof upper == 'boolean') { - floating = upper; - upper = undefined; - } - else if (typeof lower == 'boolean') { - floating = lower; - lower = undefined; - } - } - if (lower === undefined && upper === undefined) { - lower = 0; - upper = 1; - } - else { - lower = toFinite(lower); - if (upper === undefined) { - upper = lower; - lower = 0; - } else { - upper = toFinite(upper); - } - } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom(); - return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); - } - return baseRandom(lower, upper); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar--'); - * // => 'fooBar' - * - * _.camelCase('__FOO_BAR__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); - }); - - /** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ - function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); - } - - /** - * Deburrs `string` by converting - * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) - * letters to basic Latin letters and removing - * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); - } - - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search up to. - * @returns {boolean} Returns `true` if `string` ends with `target`, - * else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = toString(string); - target = baseToString(target); - - var length = string.length; - position = position === undefined - ? length - : baseClamp(toInteger(position), 0, length); - - var end = position; - position -= target.length; - return position >= 0 && string.slice(position, end) == target; - } - - /** - * Converts the characters "&", "<", ">", '"', and "'" in `string` to their - * corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. See - * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * When working with HTML you should always - * [quote attribute values](http://wonko.com/post/html-escaping) to reduce - * XSS vectors. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** - * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", - * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' - */ - function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; - } - - /** - * Converts `string` to - * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__FOO_BAR__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - - /** - * Converts `string`, as space separated words, to lower case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the lower cased string. - * @example - * - * _.lowerCase('--Foo-Bar--'); - * // => 'foo bar' - * - * _.lowerCase('fooBar'); - * // => 'foo bar' - * - * _.lowerCase('__FOO_BAR__'); - * // => 'foo bar' - */ - var lowerCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + word.toLowerCase(); - }); - - /** - * Converts the first character of `string` to lower case. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.lowerFirst('Fred'); - * // => 'fred' - * - * _.lowerFirst('FRED'); - * // => 'fRED' - */ - var lowerFirst = createCaseFirst('toLowerCase'); - - /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - if (!length || strLength >= length) { - return string; - } - var mid = (length - strLength) / 2; - return ( - createPadding(nativeFloor(mid), chars) + - string + - createPadding(nativeCeil(mid), chars) - ); - } - - /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padEnd('abc', 6); - * // => 'abc ' - * - * _.padEnd('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padEnd('abc', 3); - * // => 'abc' - */ - function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (string + createPadding(length - strLength, chars)) - : string; - } - - /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padStart('abc', 6); - * // => ' abc' - * - * _.padStart('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padStart('abc', 3); - * // => 'abc' - */ - function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (createPadding(length - strLength, chars) + string) - : string; - } - - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a - * hexadecimal, in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the - * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category String - * @param {string} string The string to convert. - * @param {number} [radix=10] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - if (guard || radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); - } - - /** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=1] The number of times to repeat the string. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n, guard) { - if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - return baseRepeat(toString(string), n); - } - - /** - * Replaces matches for `pattern` in `string` with `replacement`. - * - * **Note:** This method is based on - * [`String#replace`](https://mdn.io/String/replace). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to modify. - * @param {RegExp|string} pattern The pattern to replace. - * @param {Function|string} replacement The match replacement. - * @returns {string} Returns the modified string. - * @example - * - * _.replace('Hi Fred', 'Fred', 'Barney'); - * // => 'Hi Barney' - */ - function replace() { - var args = arguments, - string = toString(args[0]); - - return args.length < 3 ? string : string.replace(args[1], args[2]); - } - - /** - * Converts `string` to - * [snake case](https://en.wikipedia.org/wiki/Snake_case). - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. - * @example - * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' - * - * _.snakeCase('--FOO-BAR--'); - * // => 'foo_bar' - */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); - - /** - * Splits `string` by `separator`. - * - * **Note:** This method is based on - * [`String#split`](https://mdn.io/String/split). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to split. - * @param {RegExp|string} separator The separator pattern to split by. - * @param {number} [limit] The length to truncate results to. - * @returns {Array} Returns the string segments. - * @example - * - * _.split('a-b-c', '-', 2); - * // => ['a', 'b'] - */ - function split(string, separator, limit) { - if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { - separator = limit = undefined; - } - limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; - if (!limit) { - return []; - } - string = toString(string); - if (string && ( - typeof separator == 'string' || - (separator != null && !isRegExp(separator)) - )) { - separator = baseToString(separator); - if (!separator && hasUnicode(string)) { - return castSlice(stringToArray(string), 0, limit); - } - } - return string.split(separator, limit); - } - - /** - * Converts `string` to - * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). - * - * @static - * @memberOf _ - * @since 3.1.0 - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. - * @example - * - * _.startCase('--foo-bar--'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' - * - * _.startCase('__FOO_BAR__'); - * // => 'FOO BAR' - */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + upperFirst(word); - }); - - /** - * Checks if `string` starts with the given target string. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to inspect. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, - * else `false`. - * @example - * - * _.startsWith('abc', 'a'); - * // => true - * - * _.startsWith('abc', 'b'); - * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true - */ - function startsWith(string, target, position) { - string = toString(string); - position = position == null - ? 0 - : baseClamp(toInteger(position), 0, string.length); - - target = baseToString(target); - return string.slice(position, position + target.length) == target; - } - - /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is given, it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for easier debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options={}] The options object. - * @param {RegExp} [options.escape=_.templateSettings.escape] - * The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] - * The "evaluate" delimiter. - * @param {Object} [options.imports=_.templateSettings.imports] - * An object to import into the template as free variables. - * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] - * The "interpolate" delimiter. - * @param {string} [options.sourceURL='lodash.templateSources[n]'] - * The sourceURL of the compiled template. - * @param {string} [options.variable='obj'] - * The data object variable name. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the compiled template function. - * @example - * - * // Use the "interpolate" delimiter to create a compiled template. - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // Use the HTML "escape" delimiter to escape data property values. - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': '