@datagrok/compute 1.33.3 → 1.33.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/package.js +1 -2
- package/dist/package.js.map +1 -1
- package/package.json +4 -3
- package/webpack.config.js +1 -0
- package/dist/package.js.LICENSE.txt +0 -48
package/dist/package.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/*! For license information please see package.js.LICENSE.txt */
|
|
2
|
-
var compute;(()=>{var t={933:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(354),i=r.n(n),s=r(314),o=r.n(s)()(i());o.push([t.id,".pipeline-view .d4-ribbon-name.selected {\n color: var(--grey-6)\n}\n\n.pipeline-view .d4-ribbon-name {\n color: var(--blue-1);\n margin: 12px 6px;\n font-weight: normal;\n place-content: center;\n}\n\n.pipeline-view .d4-ribbon-name + .d4-ribbon-name::before {\n color: var(--grey-3);\n}\n\n.pipeline-view .d4-ribbon-name.d4-disabled {\n cursor: default;\n pointer-events: none;\n color: var(--grey-3);\n}\n\n.ui-input-editor button.ui-btn-nav.ui-btn.d4-disabled {\n color: var(--grey-3)\n}","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/function-views/css/pipeline-view.css"],names:[],mappings:"AAAA;EACE;AACF;;AAEA;EACE,oBAAoB;EACpB,gBAAgB;EAChB,mBAAmB;EACnB,qBAAqB;AACvB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,eAAe;EACf,oBAAoB;EACpB,oBAAoB;AACtB;;AAEA;EACE;AACF",sourcesContent:[".pipeline-view .d4-ribbon-name.selected {\n color: var(--grey-6)\n}\n\n.pipeline-view .d4-ribbon-name {\n color: var(--blue-1);\n margin: 12px 6px;\n font-weight: normal;\n place-content: center;\n}\n\n.pipeline-view .d4-ribbon-name + .d4-ribbon-name::before {\n color: var(--grey-3);\n}\n\n.pipeline-view .d4-ribbon-name.d4-disabled {\n cursor: default;\n pointer-events: none;\n color: var(--grey-3);\n}\n\n.ui-input-editor button.ui-btn-nav.ui-btn.d4-disabled {\n color: var(--grey-3)\n}"],sourceRoot:""}]);const a=o},362:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(354),i=r.n(n),s=r(314),o=r.n(s)()(i());o.push([t.id,".ui-form .ui-input-buttons.rfv-buttons {\n margin-top: 0px;\n position: sticky;\n}\n\n.ui-form .ui-input-buttons.rfv-buttons .ui-input-editor {\n flex-wrap: wrap;\n}\n\n.ui-input-root.rfv-restricted-input.d4-disabled {\n pointer-events: all;\n cursor: pointer!important;\n}\n\n/* Hide all state icons by default */\n.ui-input-root > .ui-input-options .rfv-icon-lock,\n.ui-input-root > .ui-input-options .rfv-icon-unlock,\n.ui-input-root > .ui-input-options .rfv-icon-undo,\n.ui-input-root > .ui-input-options .rfv-icon-warning {\n display: none;\n}\n\n/* Show warning icon if input is on warning state */\n.ui-input-root.rfv-inconsistent-input > .ui-input-options .rfv-icon-warning {\n display: inherit;\n}\n\n/* Show undo icon if input is on inconstent state and hovered */\n.ui-input-root.rfv-restricted-unlocked-input:hover .rfv-icon-undo, .ui-input-root.rfv-inconsistent-input:hover .rfv-icon-undo {\n display: inherit;\n}\n\n/* Show/hide lock-unlock icons on input hover */\n.ui-input-root.rfv-restricted-input:hover .rfv-icon-lock {\n display: none;\n}\n.ui-input-root.rfv-restricted-input .rfv-icon-lock {\n display: inherit;\n}\n.ui-input-root.rfv-restricted-input .rfv-icon-unlock {\n display: none;\n}\n.ui-input-root.rfv-restricted-input:hover .rfv-icon-unlock {\n display: inherit;\n}\n\n.ui-form-condensed .rfv-buttons > .ui-label {\n margin-right: 0px!important;\n}\n\n.rfv-form .ui-form .rfv-buttons > .ui-input-editor {\n gap: 5px;\n justify-content: flex-end;\n}\n\ndiv.ui-box > div.ui-box.rfv-form > div.ui-div {\n overflow: visible!important;\n}\n\n.rfv-scalar-table {\n border-collapse: collapse;\n margin: 10px;\n}\n\n.rfv-scalar-table td {\n width: max-content;\n white-space: nowrap;\n}\n\n.rfv-scalar-table tr{\n min-height: 30px;\n border-bottom: 1pt solid var(--grey-12);\n}\n\n.rfv-scalar-table tr:nth-child(odd) {\n background-color: var(--grey-1);\n}\n\n.rfv-scalar-table td:last-child {\n width: 100%;\n}","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/function-views/css/rich-function-view.css"],names:[],mappings:"AAAA;IACI,eAAe;IACf,gBAAgB;AACpB;;AAEA;IACI,eAAe;AACnB;;AAEA;IACI,mBAAmB;IACnB,yBAAyB;AAC7B;;AAEA,oCAAoC;AACpC;;;;IAII,aAAa;AACjB;;AAEA,mDAAmD;AACnD;IACI,gBAAgB;AACpB;;AAEA,+DAA+D;AAC/D;IACI,gBAAgB;AACpB;;AAEA,+CAA+C;AAC/C;IACI,aAAa;AACjB;AACA;IACI,gBAAgB;AACpB;AACA;IACI,aAAa;AACjB;AACA;IACI,gBAAgB;AACpB;;AAEA;IACI,2BAA2B;AAC/B;;AAEA;IACI,QAAQ;IACR,yBAAyB;AAC7B;;AAEA;IACI,2BAA2B;AAC/B;;AAEA;IACI,yBAAyB;IACzB,YAAY;AAChB;;AAEA;IACI,kBAAkB;IAClB,mBAAmB;AACvB;;AAEA;IACI,gBAAgB;IAChB,uCAAuC;AAC3C;;AAEA;IACI,+BAA+B;AACnC;;AAEA;IACI,WAAW;AACf",sourcesContent:[".ui-form .ui-input-buttons.rfv-buttons {\n margin-top: 0px;\n position: sticky;\n}\n\n.ui-form .ui-input-buttons.rfv-buttons .ui-input-editor {\n flex-wrap: wrap;\n}\n\n.ui-input-root.rfv-restricted-input.d4-disabled {\n pointer-events: all;\n cursor: pointer!important;\n}\n\n/* Hide all state icons by default */\n.ui-input-root > .ui-input-options .rfv-icon-lock,\n.ui-input-root > .ui-input-options .rfv-icon-unlock,\n.ui-input-root > .ui-input-options .rfv-icon-undo,\n.ui-input-root > .ui-input-options .rfv-icon-warning {\n display: none;\n}\n\n/* Show warning icon if input is on warning state */\n.ui-input-root.rfv-inconsistent-input > .ui-input-options .rfv-icon-warning {\n display: inherit;\n}\n\n/* Show undo icon if input is on inconstent state and hovered */\n.ui-input-root.rfv-restricted-unlocked-input:hover .rfv-icon-undo, .ui-input-root.rfv-inconsistent-input:hover .rfv-icon-undo {\n display: inherit;\n}\n\n/* Show/hide lock-unlock icons on input hover */\n.ui-input-root.rfv-restricted-input:hover .rfv-icon-lock {\n display: none;\n}\n.ui-input-root.rfv-restricted-input .rfv-icon-lock {\n display: inherit;\n}\n.ui-input-root.rfv-restricted-input .rfv-icon-unlock {\n display: none;\n}\n.ui-input-root.rfv-restricted-input:hover .rfv-icon-unlock {\n display: inherit;\n}\n\n.ui-form-condensed .rfv-buttons > .ui-label {\n margin-right: 0px!important;\n}\n\n.rfv-form .ui-form .rfv-buttons > .ui-input-editor {\n gap: 5px;\n justify-content: flex-end;\n}\n\ndiv.ui-box > div.ui-box.rfv-form > div.ui-div {\n overflow: visible!important;\n}\n\n.rfv-scalar-table {\n border-collapse: collapse;\n margin: 10px;\n}\n\n.rfv-scalar-table td {\n width: max-content;\n white-space: nowrap;\n}\n\n.rfv-scalar-table tr{\n min-height: 30px;\n border-bottom: 1pt solid var(--grey-12);\n}\n\n.rfv-scalar-table tr:nth-child(odd) {\n background-color: var(--grey-1);\n}\n\n.rfv-scalar-table td:last-child {\n width: 100%;\n}"],sourceRoot:""}]);const a=o},993:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(354),i=r.n(n),s=r(314),o=r.n(s)()(i());o.push([t.id,".ui-form .ui-input-root .sa-switch-input {\n max-width: 50px;\n min-width: 50px;\n}\n\n.ui-form.ui-form-condensed .ui-input-root .sa-switch-input {\n order: -3;\n top: -5px;\n position: relative;\n}\n\n.ui-form.ui-form-condensed .ui-input-root > .sa-switch-input + label.ui-input-label:not(:empty) {\n width: unset;\n}\n\n.ui-form.ui-form-condensed .ui-input-root > .sa-switch-input ~ .ui-input-editor {\n margin-left: 50px;\n}","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/function-views/css/sens-analysis.css"],names:[],mappings:"AAAA;IACI,eAAe;IACf,eAAe;AACnB;;AAEA;IACI,SAAS;IACT,SAAS;IACT,kBAAkB;AACtB;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,iBAAiB;AACrB",sourcesContent:[".ui-form .ui-input-root .sa-switch-input {\n max-width: 50px;\n min-width: 50px;\n}\n\n.ui-form.ui-form-condensed .ui-input-root .sa-switch-input {\n order: -3;\n top: -5px;\n position: relative;\n}\n\n.ui-form.ui-form-condensed .ui-input-root > .sa-switch-input + label.ui-input-label:not(:empty) {\n width: unset;\n}\n\n.ui-form.ui-form-condensed .ui-input-root > .sa-switch-input ~ .ui-input-editor {\n margin-left: 50px;\n}"],sourceRoot:""}]);const a=o},847:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(354),i=r.n(n),s=r(314),o=r.n(s)()(i());o.push([t.id,'.model-catalog-view .d4-gallery-card.entity-model i.grok-icon {\n height: 64px;\n width: 64px;\n position: initial;\n flex-shrink: 0;\n}\n\n.model-catalog-view .d4-gallery-card.entity-model .d4-link-label i.grok-icon + label {\n margin-left: 6px;\n align-items: center;\n display: inline-flex;\n white-space: normal;\n}\n\n.model-catalog-view .d4-gallery-card.entity-model {\n padding: 0 8px;\n align-items: center;\n display: flex;\n margin: 0;\n height: 94px;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .grok-gallery-grid {\n flex-direction: row!important;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .d4-link-label i.grok-icon {\n width: 32px;\n height: 32px;\n position: initial;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .d4-link-label label {\n margin-left: 8px;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .grok-gallery-grid .d4-link-label {\n min-width: 250px;\n margin-bottom: 9px;\n color: var(--grey-6);\n padding: 10px;\n width: initial;\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-node {\n font-size: 20px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-node {\n font-size: 16px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group .d4-tree-view-node {\n font-size: 14px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-video {\n width: 80%;\n height: 0;\n padding-bottom: 50%;\n margin: 10px 10px 0 0;\n border: 1px solid var(--grey-2);\n position: relative;\n background-size: cover;\n background-repeat: no-repeat;\n}\n\n.model-catalog-video i {\n position: absolute;\n right: 0;\n left: 0;\n bottom: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n color: var(--grey-2);\n font-size: 42px;\n}\n\n.model-catalog-video i:hover {\n color: var(--grey-1);\n}\n\n.model-catalog-description {\n padding: 10px 0 0 0;\n}',"",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/model-catalog/css/model-card.css"],names:[],mappings:"AAAA;IACI,YAAY;IACZ,WAAW;IACX,iBAAiB;IACjB,cAAc;AAClB;;AAEA;IACI,gBAAgB;IAChB,mBAAmB;IACnB,oBAAoB;IACpB,mBAAmB;AACvB;;AAEA;IACI,cAAc;IACd,mBAAmB;IACnB,aAAa;IACb,SAAS;IACT,YAAY;AAChB;;AAEA;IACI,6BAA6B;AACjC;;AAEA;IACI,WAAW;IACX,YAAY;IACZ,iBAAiB;AACrB;;AAEA;IACI,gBAAgB;AACpB;;AAEA;IACI,gBAAgB;IAChB,kBAAkB;IAClB,oBAAoB;IACpB,aAAa;IACb,cAAc;AAClB;;AAEA;IACI,eAAe;IACf,cAAc;IACd,oBAAoB;AACxB;;AAEA;IACI,eAAe;IACf,cAAc;IACd,oBAAoB;AACxB;;AAEA;IACI,eAAe;IACf,cAAc;IACd,oBAAoB;AACxB;;AAEA;IACI,UAAU;IACV,SAAS;IACT,mBAAmB;IACnB,qBAAqB;IACrB,+BAA+B;IAC/B,kBAAkB;IAClB,sBAAsB;IACtB,4BAA4B;AAChC;;AAEA;IACI,kBAAkB;IAClB,QAAQ;IACR,OAAO;IACP,SAAS;IACT,MAAM;IACN,aAAa;IACb,mBAAmB;IACnB,uBAAuB;IACvB,gBAAgB;IAChB,oBAAoB;IACpB,eAAe;AACnB;;AAEA;IACI,oBAAoB;AACxB;;AAEA;IACI,mBAAmB;AACvB",sourcesContent:['.model-catalog-view .d4-gallery-card.entity-model i.grok-icon {\n height: 64px;\n width: 64px;\n position: initial;\n flex-shrink: 0;\n}\n\n.model-catalog-view .d4-gallery-card.entity-model .d4-link-label i.grok-icon + label {\n margin-left: 6px;\n align-items: center;\n display: inline-flex;\n white-space: normal;\n}\n\n.model-catalog-view .d4-gallery-card.entity-model {\n padding: 0 8px;\n align-items: center;\n display: flex;\n margin: 0;\n height: 94px;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .grok-gallery-grid {\n flex-direction: row!important;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .d4-link-label i.grok-icon {\n width: 32px;\n height: 32px;\n position: initial;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .d4-link-label label {\n margin-left: 8px;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .grok-gallery-grid .d4-link-label {\n min-width: 250px;\n margin-bottom: 9px;\n color: var(--grey-6);\n padding: 10px;\n width: initial;\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-node {\n font-size: 20px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-node {\n font-size: 16px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group .d4-tree-view-node {\n font-size: 14px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-video {\n width: 80%;\n height: 0;\n padding-bottom: 50%;\n margin: 10px 10px 0 0;\n border: 1px solid var(--grey-2);\n position: relative;\n background-size: cover;\n background-repeat: no-repeat;\n}\n\n.model-catalog-video i {\n position: absolute;\n right: 0;\n left: 0;\n bottom: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n color: var(--grey-2);\n font-size: 42px;\n}\n\n.model-catalog-video i:hover {\n color: var(--grey-1);\n}\n\n.model-catalog-description {\n padding: 10px 0 0 0;\n}'],sourceRoot:""}]);const a=o},911:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(354),i=r.n(n),s=r(314),o=r.n(s)()(i());o.push([t.id,".fi-drop-area {\n position: relative;\n}\n\n.fi-drop-area .default {\n color: var(--grey-2);\n}\n\n.fi-drop-area .drag-n-dropping {\n background-color: var(--steel-1);\n border: 1px dashed var(--blue-1);\n color: var(--grey-3);\n}\n\n.fi-drop-area .error {\n color: var(--red-3);\n}\n\n.fi-drop-area .success {\n color: var(--grey-6);\n}\n","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/shared-components/css/file-input.css"],names:[],mappings:"AAAA;EACE,kBAAkB;AACpB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,gCAAgC;EAChC,gCAAgC;EAChC,oBAAoB;AACtB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,oBAAoB;AACtB",sourcesContent:[".fi-drop-area {\n position: relative;\n}\n\n.fi-drop-area .default {\n color: var(--grey-2);\n}\n\n.fi-drop-area .drag-n-dropping {\n background-color: var(--steel-1);\n border: 1px dashed var(--blue-1);\n color: var(--grey-3);\n}\n\n.fi-drop-area .error {\n color: var(--red-3);\n}\n\n.fi-drop-area .success {\n color: var(--grey-6);\n}\n"],sourceRoot:""}]);const a=o},703:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(354),i=r.n(n),s=r(314),o=r.n(s)()(i());o.push([t.id,"","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]);const a=o},565:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(354),i=r.n(n),s=r(314),o=r.n(s)()(i());o.push([t.id,".hp-no-elements-label {\n margin: 12px;\n}\n\n.grok-icon.hp-disabled {\n pointer-events: none;\n opacity: 0.6;\n}\n\n.hp-funccall-card-hover-icon {\n display: none;\n}\n\n.hp-funccall-card:hover .hp-funccall-card-hover-icon {\n display: flex;\n margin: 0px 0px 0px 5px;\n}\n\n.hp-funccall-card {\n margin: 2px 1px;\n padding: 5px;\n justify-content: space-between;\n}\n\n.hp-funccall-card .hp-card-content {\n justify-content: space-around;\n margin-left: 5px;\n}\n\n.hp-funccall-card .hp-card-content * {\n margin-bottom: 3px;\n}\n\n.hp-funccall-card .description {\n margin-bottom: 2px;\n color: var(--grey-3);\n}\n\n.hp-funccall-card .date {\n color: var(--grey-3);\n margin-left: 5px;\n}\n","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/shared-components/css/history-panel.css"],names:[],mappings:"AAAA;IACI,YAAY;AAChB;;AAEA;IACI,oBAAoB;IACpB,YAAY;AAChB;;AAEA;IACI,aAAa;AACjB;;AAEA;IACI,aAAa;IACb,uBAAuB;AAC3B;;AAEA;IACI,eAAe;IACf,YAAY;IACZ,8BAA8B;AAClC;;AAEA;IACI,6BAA6B;IAC7B,gBAAgB;AACpB;;AAEA;IACI,kBAAkB;AACtB;;AAEA;IACI,kBAAkB;IAClB,oBAAoB;AACxB;;AAEA;IACI,oBAAoB;IACpB,gBAAgB;AACpB",sourcesContent:[".hp-no-elements-label {\n margin: 12px;\n}\n\n.grok-icon.hp-disabled {\n pointer-events: none;\n opacity: 0.6;\n}\n\n.hp-funccall-card-hover-icon {\n display: none;\n}\n\n.hp-funccall-card:hover .hp-funccall-card-hover-icon {\n display: flex;\n margin: 0px 0px 0px 5px;\n}\n\n.hp-funccall-card {\n margin: 2px 1px;\n padding: 5px;\n justify-content: space-between;\n}\n\n.hp-funccall-card .hp-card-content {\n justify-content: space-around;\n margin-left: 5px;\n}\n\n.hp-funccall-card .hp-card-content * {\n margin-bottom: 3px;\n}\n\n.hp-funccall-card .description {\n margin-bottom: 2px;\n color: var(--grey-3);\n}\n\n.hp-funccall-card .date {\n color: var(--grey-3);\n margin-left: 5px;\n}\n"],sourceRoot:""}]);const a=o},314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,i,s){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(o[l]=!0)}for(var u=0;u<t.length;u++){var c=[].concat(t[u]);n&&o[c[0]]||(void 0!==s&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),r&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=r):c[2]=r),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),e.push(c))}},e}},354:t=>{"use strict";t.exports=function(t){var e=t[1],r=t[3];if(!r)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),s="/*# ".concat(i," */");return[e].concat([s]).join("\n")}return[e].join("\n")}},974:(t,e,r)=>{t.exports=function t(e,r,n){function i(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return i(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var s=void 0,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){"use strict";const n=t("fs"),i=t("fast-csv"),s=t("dayjs/plugin/customParseFormat"),o=t("dayjs/plugin/utc"),a=t("dayjs").extend(s).extend(o),l=t("../utils/stream-buf"),{fs:{exists:u}}=t("../utils/utils"),c={true:!0,false:!1,"#N/A":{error:"#N/A"},"#REF!":{error:"#REF!"},"#NAME?":{error:"#NAME?"},"#DIV/0!":{error:"#DIV/0!"},"#NULL!":{error:"#NULL!"},"#VALUE!":{error:"#VALUE!"},"#NUM!":{error:"#NUM!"}};e.exports=class{constructor(t){this.workbook=t,this.worksheet=null}async readFile(t,e){if(e=e||{},!await u(t))throw new Error("File not found: "+t);const r=n.createReadStream(t),i=await this.read(r,e);return r.close(),i}read(t,e){return e=e||{},new Promise(((r,n)=>{const s=this.workbook.addWorksheet(e.sheetName),o=e.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],l=e.map||function(t){if(""===t)return null;const e=Number(t);if(!Number.isNaN(e)&&e!==1/0)return e;const r=o.reduce(((e,r)=>{if(e)return e;const n=a(t,r,!0);return n.isValid()?n:null}),null);if(r)return new Date(r.valueOf());const n=c[t];return void 0!==n?n:t},u=i.parse(e.parserOptions).on("data",(t=>{s.addRow(t.map(l))})).on("end",(()=>{u.emit("worksheet",s)}));u.on("worksheet",r).on("error",n),t.pipe(u)}))}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(t,e){return new Promise(((r,n)=>{e=e||{};const s=this.workbook.getWorksheet(e.sheetName||e.sheetId),o=i.format(e.formatterOptions);t.on("finish",(()=>{r()})),o.on("error",n),o.pipe(t);const{dateFormat:l,dateUTC:u}=e,c=e.map||(t=>{if(t){if(t.text||t.hyperlink)return t.hyperlink||t.text||"";if(t.formula||t.result)return t.result||"";if(t instanceof Date)return l?u?a.utc(t).format(l):a(t).format(l):u?a.utc(t).format():a(t).format();if(t.error)return t.error;if("object"==typeof t)return JSON.stringify(t)}return t}),h=void 0===e.includeEmptyRows||e.includeEmptyRows;let d=1;s&&s.eachRow(((t,e)=>{if(h)for(;d++<e-1;)o.write([]);const{values:r}=t;r.shift(),o.write(r.map(c)),d=e})),o.end()}))}writeFile(t,e){const r={encoding:(e=e||{}).encoding||"utf8"},i=n.createWriteStream(t,r);return this.write(i,e)}async writeBuffer(t){const e=new l;return await this.write(e,t),e.read()}}},{"../utils/stream-buf":24,"../utils/utils":27,dayjs:391,"dayjs/plugin/customParseFormat":392,"dayjs/plugin/utc":393,"fast-csv":424,fs:216}],2:[function(t,e,r){"use strict";const n=t("../utils/col-cache");class i{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(this.worksheet=t,e)if("string"==typeof e){const t=n.decodeAddress(e);this.nativeCol=t.col+r,this.nativeColOff=0,this.nativeRow=t.row+r,this.nativeRowOff=0}else void 0!==e.nativeCol?(this.nativeCol=e.nativeCol||0,this.nativeColOff=e.nativeColOff||0,this.nativeRow=e.nativeRow||0,this.nativeRowOff=e.nativeRowOff||0):void 0!==e.col?(this.col=e.col+r,this.row=e.row+r):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(t){return t instanceof i||null==t?t:new i(t)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(t){this.nativeCol=Math.floor(t),this.nativeColOff=Math.floor((t-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(t){this.nativeRow=Math.floor(t),this.nativeRowOff=Math.floor((t-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(t){this.nativeCol=t.nativeCol,this.nativeColOff=t.nativeColOff,this.nativeRow=t.nativeRow,this.nativeRowOff=t.nativeRowOff}}e.exports=i},{"../utils/col-cache":19}],3:[function(t,e,r){"use strict";const n=t("../utils/col-cache"),i=t("../utils/under-dash"),s=t("./enums"),{slideFormula:o}=t("../utils/shared-formula"),a=t("./note");class l{constructor(t,e,r){if(!t||!e)throw new Error("A Cell needs a Row");this._row=t,this._column=e,n.validateAddress(r),this._address=r,this._value=u.create(l.Types.Null,this),this.style=this._mergeStyle(t.style,e.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(t){this.style.numFmt=t}get font(){return this.style.font}set font(t){this.style.font=t}get alignment(){return this.style.alignment}set alignment(t){this.style.alignment=t}get border(){return this.style.border}set border(t){this.style.border=t}get fill(){return this.style.fill}set fill(t){this.style.fill=t}get protection(){return this.style.protection}set protection(t){this.style.protection=t}_mergeStyle(t,e,r){const n=t&&t.numFmt||e&&e.numFmt;n&&(r.numFmt=n);const i=t&&t.font||e&&e.font;i&&(r.font=i);const s=t&&t.alignment||e&&e.alignment;s&&(r.alignment=s);const o=t&&t.border||e&&e.border;o&&(r.border=o);const a=t&&t.fill||e&&e.fill;a&&(r.fill=a);const l=t&&t.protection||e&&e.protection;return l&&(r.protection=l),r}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===l.Types.Merge}merge(t,e){this._value.release(),this._value=u.create(l.Types.Merge,this,t),e||(this.style=t.style)}unmerge(){this.type===l.Types.Merge&&(this._value.release(),this._value=u.create(l.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(t){return this._value.type===l.Types.Merge&&this._value.isMergedTo(t)}get master(){return this.type===l.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===l.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(t){this.type!==l.Types.Merge?(this._value.release(),this._value=u.create(u.getType(t),this,t)):this._value.master.value=t}get note(){return this._comment&&this._comment.note}set note(t){this._comment=new a(t)}get text(){return this._value.toString()}get html(){return i.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(t){this.type===l.Types.String&&(this._value=u.create(l.Types.Hyperlink,this,{text:this._value.value,hyperlink:t}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:t}=this._row;return{sheetName:t.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(t){this.names=[t]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(t){const{definedNames:e}=this.workbook;e.removeAllNames(this.fullAddress),t.forEach((t=>{e.addEx(this.fullAddress,t)}))}addName(t){this.workbook.definedNames.addEx(this.fullAddress,t)}removeName(t){this.workbook.definedNames.removeEx(this.fullAddress,t)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(t){this._dataValidations.add(this.address,t)}get model(){const{model:t}=this._value;return t.style=this.style,this._comment&&(t.comment=this._comment.model),t}set model(t){this._value.release(),this._value=u.create(t.type,this),this._value.model=t,t.comment&&"note"===t.comment.type&&(this._comment=a.fromModel(t.comment)),t.style?this.style=t.style:this.style={}}}l.Types=s.ValueType;const u={getType:t=>null==t?l.Types.Null:t instanceof String||"string"==typeof t?l.Types.String:"number"==typeof t?l.Types.Number:"boolean"==typeof t?l.Types.Boolean:t instanceof Date?l.Types.Date:t.text&&t.hyperlink?l.Types.Hyperlink:t.formula||t.sharedFormula?l.Types.Formula:t.richText?l.Types.RichText:t.sharedString?l.Types.SharedString:t.error?l.Types.Error:l.Types.JSON,types:[{t:l.Types.Null,f:class{constructor(t){this.model={address:t.address,type:l.Types.Null}}get value(){return null}set value(t){}get type(){return l.Types.Null}get effectiveType(){return l.Types.Null}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return""}release(){}toString(){return""}}},{t:l.Types.Number,f:class{constructor(t,e){this.model={address:t.address,type:l.Types.Number,value:e}}get value(){return this.model.value}set value(t){this.model.value=t}get type(){return l.Types.Number}get effectiveType(){return l.Types.Number}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:l.Types.String,f:class{constructor(t,e){this.model={address:t.address,type:l.Types.String,value:e}}get value(){return this.model.value}set value(t){this.model.value=t}get type(){return l.Types.String}get effectiveType(){return l.Types.String}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:l.Types.Date,f:class{constructor(t,e){this.model={address:t.address,type:l.Types.Date,value:e}}get value(){return this.model.value}set value(t){this.model.value=t}get type(){return l.Types.Date}get effectiveType(){return l.Types.Date}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:l.Types.Hyperlink,f:class{constructor(t,e){this.model={address:t.address,type:l.Types.Hyperlink,text:e?e.text:void 0,hyperlink:e?e.hyperlink:void 0},e&&e.tooltip&&(this.model.tooltip=e.tooltip)}get value(){const t={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(t.tooltip=this.model.tooltip),t}set value(t){this.model={text:t.text,hyperlink:t.hyperlink},t.tooltip&&(this.model.tooltip=t.tooltip)}get text(){return this.model.text}set text(t){this.model.text=t}get hyperlink(){return this.model.hyperlink}set hyperlink(t){this.model.hyperlink=t}get type(){return l.Types.Hyperlink}get effectiveType(){return l.Types.Hyperlink}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:l.Types.Formula,f:class{constructor(t,e){this.cell=t,this.model={address:t.address,type:l.Types.Formula,shareType:e?e.shareType:void 0,ref:e?e.ref:void 0,formula:e?e.formula:void 0,sharedFormula:e?e.sharedFormula:void 0,result:e?e.result:void 0}}_copyModel(t){const e={},r=r=>{const n=t[r];n&&(e[r]=n)};return r("formula"),r("result"),r("ref"),r("shareType"),r("sharedFormula"),e}get value(){return this._copyModel(this.model)}set value(t){this.model=this._copyModel(t)}validate(t){switch(u.getType(t)){case l.Types.Null:case l.Types.String:case l.Types.Number:case l.Types.Date:break;case l.Types.Hyperlink:case l.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(t){this.model.formula=t}get formulaType(){return this.model.formula?s.FormulaType.Master:this.model.sharedFormula?s.FormulaType.Shared:s.FormulaType.None}get result(){return this.model.result}set result(t){this.model.result=t}get type(){return l.Types.Formula}get effectiveType(){const t=this.model.result;return null==t?s.ValueType.Null:t instanceof String||"string"==typeof t?s.ValueType.String:"number"==typeof t?s.ValueType.Number:t instanceof Date?s.ValueType.Date:t.text&&t.hyperlink?s.ValueType.Hyperlink:t.formula?s.ValueType.Formula:s.ValueType.Null}get address(){return this.model.address}set address(t){this.model.address=t}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:t}=this.cell,e=t.findCell(this.model.sharedFormula);this._translatedFormula=e&&o(e.formula,e.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:l.Types.Merge,f:class{constructor(t,e){this.model={address:t.address,type:l.Types.Merge,master:e?e.address:void 0},this._master=e,e&&e.addMergeRef()}get value(){return this._master.value}set value(t){t instanceof l?(this._master&&this._master.releaseMergeRef(),t.addMergeRef(),this._master=t):this._master.value=t}isMergedTo(t){return t===this._master}get master(){return this._master}get type(){return l.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:l.Types.JSON,f:class{constructor(t,e){this.model={address:t.address,type:l.Types.String,value:JSON.stringify(e),rawValue:e}}get value(){return this.model.rawValue}set value(t){this.model.rawValue=t,this.model.value=JSON.stringify(t)}get type(){return l.Types.String}get effectiveType(){return l.Types.String}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:l.Types.SharedString,f:class{constructor(t,e){this.model={address:t.address,type:l.Types.SharedString,value:e}}get value(){return this.model.value}set value(t){this.model.value=t}get type(){return l.Types.SharedString}get effectiveType(){return l.Types.SharedString}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:l.Types.RichText,f:class{constructor(t,e){this.model={address:t.address,type:l.Types.String,value:e}}get value(){return this.model.value}set value(t){this.model.value=t}toString(){return this.model.value.richText.map((t=>t.text)).join("")}get type(){return l.Types.RichText}get effectiveType(){return l.Types.RichText}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:l.Types.Boolean,f:class{constructor(t,e){this.model={address:t.address,type:l.Types.Boolean,value:e}}get value(){return this.model.value}set value(t){this.model.value=t}get type(){return l.Types.Boolean}get effectiveType(){return l.Types.Boolean}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:l.Types.Error,f:class{constructor(t,e){this.model={address:t.address,type:l.Types.Error,value:e}}get value(){return this.model.value}set value(t){this.model.value=t}get type(){return l.Types.Error}get effectiveType(){return l.Types.Error}get address(){return this.model.address}set address(t){this.model.address=t}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce(((t,e)=>(t[e.t]=e.f,t)),[]),create(t,e,r){const n=this.types[t];if(!n)throw new Error("Could not create Value of type "+t);return new n(e,r)}};e.exports=l},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(t,e,r){"use strict";const n=t("../utils/under-dash"),i=t("./enums"),s=t("../utils/col-cache");class o{constructor(t,e,r){this._worksheet=t,this._number=e,!1!==r&&(this.defn=r)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return s.n2l(this._number)}get isCustomWidth(){return void 0!==this.width&&9!==this.width}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(t){t?(this.key=t.key,this.width=void 0!==t.width?t.width:9,this.outlineLevel=t.outlineLevel,t.style?this.style=t.style:this.style={},this.header=t.header,this._hidden=!!t.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(t){void 0!==t?(this._header=t,this.headers.forEach(((t,e)=>{this._worksheet.getCell(e+1,this.number).value=t}))):this._header=void 0}get key(){return this._key}set key(t){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=t,t&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(t){this._hidden=t}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(t){this._outlineLevel=t}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(t){return this.width===t.width&&this.hidden===t.hidden&&this.outlineLevel===t.outlineLevel&&n.isEqual(this.style,t.style)}get isDefault(){if(this.isCustomWidth)return!1;if(this.hidden)return!1;if(this.outlineLevel)return!1;const t=this.style;return!t||!(t.font||t.numFmt||t.alignment||t.border||t.fill||t.protection)}get headerCount(){return this.headers.length}eachCell(t,e){const r=this.number;e||(e=t,t=null),this._worksheet.eachRow(t,((t,n)=>{e(t.getCell(r),n)}))}get values(){const t=[];return this.eachCell(((e,r)=>{e&&e.type!==i.ValueType.Null&&(t[r]=e.value)})),t}set values(t){if(!t)return;const e=this.number;let r=0;t.hasOwnProperty("0")&&(r=1),t.forEach(((t,n)=>{this._worksheet.getCell(n+r,e).value=t}))}_applyStyle(t,e){return this.style[t]=e,this.eachCell((r=>{r[t]=e})),e}get numFmt(){return this.style.numFmt}set numFmt(t){this._applyStyle("numFmt",t)}get font(){return this.style.font}set font(t){this._applyStyle("font",t)}get alignment(){return this.style.alignment}set alignment(t){this._applyStyle("alignment",t)}get protection(){return this.style.protection}set protection(t){this._applyStyle("protection",t)}get border(){return this.style.border}set border(t){this._applyStyle("border",t)}get fill(){return this.style.fill}set fill(t){this._applyStyle("fill",t)}static toModel(t){const e=[];let r=null;return t&&t.forEach(((t,n)=>{t.isDefault?r&&(r=null):r&&t.equivalentTo(r)?r.max=n+1:(r={min:n+1,max:n+1,width:void 0!==t.width?t.width:9,style:t.style,isCustomWidth:t.isCustomWidth,hidden:t.hidden,outlineLevel:t.outlineLevel,collapsed:t.collapsed},e.push(r))})),e.length?e:void 0}static fromModel(t,e){const r=[];let n=1,i=0;for(e=(e=e||[]).sort((function(t,e){return t.min-e.min}));i<e.length;){const s=e[i++];for(;n<s.min;)r.push(new o(t,n++));for(;n<=s.max;)r.push(new o(t,n++,s))}return r.length?r:null}}e.exports=o},{"../utils/col-cache":19,"../utils/under-dash":26,"./enums":7}],5:[function(t,e,r){"use strict";e.exports=class{constructor(t){this.model=t||{}}add(t,e){return this.model[t]=e}find(t){return this.model[t]}remove(t){this.model[t]=void 0}}},{}],6:[function(t,e,r){"use strict";const n=t("../utils/under-dash"),i=t("../utils/col-cache"),s=t("../utils/cell-matrix"),o=t("./range"),a=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;e.exports=class{constructor(){this.matrixMap={}}getMatrix(t){return this.matrixMap[t]||(this.matrixMap[t]=new s)}add(t,e){const r=i.decodeEx(t);this.addEx(r,e)}addEx(t,e){const r=this.getMatrix(e);if(t.top)for(let e=t.left;e<=t.right;e++)for(let n=t.top;n<=t.bottom;n++){const s={sheetName:t.sheetName,address:i.n2l(e)+n,row:n,col:e};r.addCellEx(s)}else r.addCellEx(t)}remove(t,e){const r=i.decodeEx(t);this.removeEx(r,e)}removeEx(t,e){this.getMatrix(e).removeCellEx(t)}removeAllNames(t){n.each(this.matrixMap,(e=>{e.removeCellEx(t)}))}forEach(t){n.each(this.matrixMap,((e,r)=>{e.forEach((e=>{t(r,e)}))}))}getNames(t){return this.getNamesEx(i.decodeEx(t))}getNamesEx(t){return n.map(this.matrixMap,((e,r)=>e.findCellEx(t)&&r)).filter(Boolean)}_explore(t,e){e.mark=!1;const{sheetName:r}=e,n=new o(e.row,e.col,e.row,e.col,r);let i,s;function a(i,s){const o=t.findCellAt(r,i,e.col);return!(!o||!o.mark||(n[s]=i,o.mark=!1,0))}for(s=e.row-1;a(s,"top");s--);for(s=e.row+1;a(s,"bottom");s++);function l(e,i){const o=[];for(s=n.top;s<=n.bottom;s++){const n=t.findCellAt(r,s,e);if(!n||!n.mark)return!1;o.push(n)}n[i]=e;for(let t=0;t<o.length;t++)o[t].mark=!1;return!0}for(i=e.col-1;l(i,"left");i--);for(i=e.col+1;l(i,"right");i++);return n}getRanges(t,e){return(e=e||this.matrixMap[t])?(e.forEach((t=>{t.mark=!0})),{name:t,ranges:e.map((t=>t.mark&&this._explore(e,t))).filter(Boolean).map((t=>t.$shortRange))}):{name:t,ranges:[]}}normaliseMatrix(t,e){t.forEachInSheet(e,((t,e,r)=>{t&&(t.row===e&&t.col===r||(t.row=e,t.col=r,t.address=i.n2l(r)+e))}))}spliceRows(t,e,r,i){n.each(this.matrixMap,(n=>{n.spliceRows(t,e,r,i),this.normaliseMatrix(n,t)}))}spliceColumns(t,e,r,i){n.each(this.matrixMap,(n=>{n.spliceColumns(t,e,r,i),this.normaliseMatrix(n,t)}))}get model(){return n.map(this.matrixMap,((t,e)=>this.getRanges(e,t))).filter((t=>t.ranges.length))}set model(t){const e=this.matrixMap={};t.forEach((t=>{const r=e[t.name]=new s;t.ranges.forEach((t=>{a.test(t.split("!").pop()||"")&&r.addCell(t)}))}))}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(t,e,r){"use strict";e.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(t,e,r){"use strict";const n=t("../utils/col-cache"),i=t("./anchor");e.exports=class{constructor(t,e){this.worksheet=t,this.model=e}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(t){let{type:e,imageId:r,range:s,hyperlinks:o}=t;if(this.type=e,this.imageId=r,"image"===e)if("string"==typeof s){const t=n.decode(s);this.range={tl:new i(this.worksheet,{col:t.left,row:t.top},-1),br:new i(this.worksheet,{col:t.right,row:t.bottom},0),editAs:"oneCell"}}else this.range={tl:new i(this.worksheet,s.tl,0),br:s.br&&new i(this.worksheet,s.br,0),ext:s.ext,editAs:s.editAs,hyperlinks:o||s.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(t,e,r){"use strict";const n=t("../utils/under-dash");class i{constructor(t){this.note=t}get model(){let t=null;return t="string"==typeof this.note?{type:"note",note:{texts:[{text:this.note}]}}:{type:"note",note:this.note},n.deepMerge({},i.DEFAULT_CONFIGS,t)}set model(t){const{note:e}=t,{texts:r}=e;1===r.length&&1===Object.keys(r[0]).length?this.note=r[0].text:this.note=e}static fromModel(t){const e=new i;return e.model=t,e}}i.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},e.exports=i},{"../utils/under-dash":26}],10:[function(t,e,r){"use strict";const n=t("../utils/col-cache");class i{constructor(){this.decode(arguments)}setTLBR(t,e,r,i,s){if(arguments.length<4){const i=n.decodeAddress(t),o=n.decodeAddress(e);this.model={top:Math.min(i.row,o.row),left:Math.min(i.col,o.col),bottom:Math.max(i.row,o.row),right:Math.max(i.col,o.col),sheetName:r},this.setTLBR(i.row,i.col,o.row,o.col,s)}else this.model={top:Math.min(t,r),left:Math.min(e,i),bottom:Math.max(t,r),right:Math.max(e,i),sheetName:s}}decode(t){switch(t.length){case 5:this.setTLBR(t[0],t[1],t[2],t[3],t[4]);break;case 4:this.setTLBR(t[0],t[1],t[2],t[3]);break;case 3:this.setTLBR(t[0],t[1],t[2]);break;case 2:this.setTLBR(t[0],t[1]);break;case 1:{const e=t[0];if(e instanceof i)this.model={top:e.model.top,left:e.model.left,bottom:e.model.bottom,right:e.model.right,sheetName:e.sheetName};else if(e instanceof Array)this.decode(e);else if(e.top&&e.left&&e.bottom&&e.right)this.model={top:e.top,left:e.left,bottom:e.bottom,right:e.right,sheetName:e.sheetName};else{const t=n.decodeEx(e);t.top?this.model={top:t.top,left:t.left,bottom:t.bottom,right:t.right,sheetName:t.sheetName}:this.model={top:t.row,left:t.col,bottom:t.row,right:t.col,sheetName:t.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error("Invalid number of arguments to _getDimensions() - "+t.length)}}get top(){return this.model.top||1}set top(t){this.model.top=t}get left(){return this.model.left||1}set left(t){this.model.left=t}get bottom(){return this.model.bottom||1}set bottom(t){this.model.bottom=t}get right(){return this.model.right||1}set right(t){this.model.right=t}get sheetName(){return this.model.sheetName}set sheetName(t){this.model.sheetName=t}get _serialisedSheetName(){const{sheetName:t}=this.model;return t?/^[a-zA-Z0-9]*$/.test(t)?t+"!":`'${t}'!`:""}expand(t,e,r,n){(!this.model.top||t<this.top)&&(this.top=t),(!this.model.left||e<this.left)&&(this.left=e),(!this.model.bottom||r>this.bottom)&&(this.bottom=r),(!this.model.right||n>this.right)&&(this.right=n)}expandRow(t){if(t){const{dimensions:e,number:r}=t;e&&this.expand(r,e.min,r,e.max)}}expandToAddress(t){const e=n.decodeEx(t);this.expand(e.row,e.col,e.row,e.col)}get tl(){return n.n2l(this.left)+this.top}get $t$l(){return`$${n.n2l(this.left)}$${this.top}`}get br(){return n.n2l(this.right)+this.bottom}get $b$r(){return`$${n.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(t){return!(t.sheetName&&this.sheetName&&t.sheetName!==this.sheetName||t.bottom<this.top||t.top>this.bottom||t.right<this.left||t.left>this.right)}contains(t){const e=n.decodeEx(t);return this.containsEx(e)}containsEx(t){return(!t.sheetName||!this.sheetName||t.sheetName===this.sheetName)&&t.row>=this.top&&t.row<=this.bottom&&t.col>=this.left&&t.col<=this.right}forEachAddress(t){for(let e=this.left;e<=this.right;e++)for(let r=this.top;r<=this.bottom;r++)t(n.encodeAddress(r,e),r,e)}}e.exports=i},{"../utils/col-cache":19}],11:[function(t,e,r){"use strict";const n=t("../utils/under-dash"),i=t("./enums"),s=t("../utils/col-cache"),o=t("./cell");e.exports=class{constructor(t,e){this._worksheet=t,this._number=e,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(t){return this._cells[t-1]}getCellEx(t){let e=this._cells[t.col-1];if(!e){const r=this._worksheet.getColumn(t.col);e=new o(this,r,t.address),this._cells[t.col-1]=e}return e}getCell(t){if("string"==typeof t){const e=this._worksheet.getColumnKey(t);t=e?e.number:s.l2n(t)}return this._cells[t-1]||this.getCellEx({address:s.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,e){const r=t+e;for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];const o=i.length-e,a=this._cells.length;let l,u,c;if(o<0)for(l=t+i.length;l<=a;l++)c=this._cells[l-1],u=this._cells[l-o-1],u?(c=this.getCell(l),c.value=u.value,c.style=u.style,c._comment=u._comment):c&&(c.value=null,c.style={},c._comment=void 0);else if(o>0)for(l=a;l>=r;l--)u=this._cells[l-1],u?(c=this.getCell(l+o),c.value=u.value,c.style=u.style,c._comment=u._comment):this._cells[l+o-1]=void 0;for(l=0;l<i.length;l++)c=this.getCell(t+l),c.value=i[l],c.style={},c._comment=void 0}eachCell(t,e){if(e||(e=t,t=null),t&&t.includeEmpty){const t=this._cells.length;for(let r=1;r<=t;r++)e(this.getCell(r),r)}else this._cells.forEach(((t,r)=>{t&&t.type!==i.ValueType.Null&&e(t,r+1)}))}addPageBreak(t,e){const r=this._worksheet,n=Math.max(0,t-1)||0,i=Math.max(0,e-1)||16838,s={id:this._number,max:i,man:1};n&&(s.min=n),r.rowBreaks.push(s)}get values(){const t=[];return this._cells.forEach((e=>{e&&e.type!==i.ValueType.Null&&(t[e.col]=e.value)})),t}set values(t){if(this._cells=[],t)if(t instanceof Array){let e=0;t.hasOwnProperty("0")&&(e=1),t.forEach(((t,r)=>{void 0!==t&&(this.getCellEx({address:s.encodeAddress(this._number,r+e),row:this._number,col:r+e}).value=t)}))}else this._worksheet.eachColumnKey(((e,r)=>{void 0!==t[r]&&(this.getCellEx({address:s.encodeAddress(this._number,e.number),row:this._number,col:e.number}).value=t[r])}))}get hasValues(){return n.some(this._cells,(t=>t&&t.type!==i.ValueType.Null))}get cellCount(){return this._cells.length}get actualCellCount(){let t=0;return this.eachCell((()=>{t++})),t}get dimensions(){let t=0,e=0;return this._cells.forEach((r=>{r&&r.type!==i.ValueType.Null&&((!t||t>r.col)&&(t=r.col),e<r.col&&(e=r.col))})),t>0?{min:t,max:e}:null}_applyStyle(t,e){return this.style[t]=e,this._cells.forEach((r=>{r&&(r[t]=e)})),e}get numFmt(){return this.style.numFmt}set numFmt(t){this._applyStyle("numFmt",t)}get font(){return this.style.font}set font(t){this._applyStyle("font",t)}get alignment(){return this.style.alignment}set alignment(t){this._applyStyle("alignment",t)}get protection(){return this.style.protection}set protection(t){this._applyStyle("protection",t)}get border(){return this.style.border}set border(t){this._applyStyle("border",t)}get fill(){return this.style.fill}set fill(t){this._applyStyle("fill",t)}get hidden(){return!!this._hidden}set hidden(t){this._hidden=t}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(t){this._outlineLevel=t}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const t=[];let e=0,r=0;return this._cells.forEach((n=>{if(n){const i=n.model;i&&((!e||e>n.col)&&(e=n.col),r<n.col&&(r=n.col),t.push(i))}})),this.height||t.length?{cells:t,number:this.number,min:e,max:r,height:this.height,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed}:null}set model(t){if(t.number!==this._number)throw new Error("Invalid row number in model");let e;this._cells=[],t.cells.forEach((t=>{switch(t.type){case o.Types.Merge:break;default:{let r;if(t.address)r=s.decodeAddress(t.address);else if(e){const{row:t}=e,n=e.col+1;r={row:t,col:n,address:s.encodeAddress(t,n),$col$row:`$${s.n2l(n)}$${t}`}}e=r,this.getCellEx(r).model=t;break}}})),t.height?this.height=t.height:delete this.height,this.hidden=t.hidden,this.outlineLevel=t.outlineLevel||0,this.style=t.style&&JSON.parse(JSON.stringify(t.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(t,e,r){"use strict";const n=t("../utils/col-cache");class i{constructor(t,e,r){this.table=t,this.column=e,this.index=r}_set(t,e){this.table.cacheState(),this.column[t]=e}get name(){return this.column.name}set name(t){this._set("name",t)}get filterButton(){return this.column.filterButton}set filterButton(t){this.column.filterButton=t}get style(){return this.column.style}set style(t){this.column.style=t}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(t){this._set("totalsRowLabel",t)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(t){this._set("totalsRowFunction",t)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(t){this._set("totalsRowResult",t)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(t){this._set("totalsRowFormula",t)}}e.exports=class{constructor(t,e){this.worksheet=t,e&&(this.table=e,this.validate(),this.store())}getFormula(t){switch(t.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${t.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${t.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${t.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${t.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${t.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${t.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${t.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${t.name}])`;case"custom":return t.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+t.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:t}=this,e=(t,e,r)=>{void 0===t[e]&&(t[e]=r)};e(t,"headerRow",!0),e(t,"totalsRow",!1),e(t,"style",{}),e(t.style,"theme","TableStyleMedium2"),e(t.style,"showFirstColumn",!1),e(t.style,"showLastColumn",!1),e(t.style,"showRowStripes",!1),e(t.style,"showColumnStripes",!1);const r=(t,e)=>{if(!t)throw new Error(e)};r(t.ref,"Table must have ref"),r(t.columns,"Table must have column definitions"),r(t.rows,"Table must have row definitions"),t.tl=n.decodeAddress(t.ref);const{row:i,col:s}=t.tl;r(i>0,"Table must be on valid row"),r(s>0,"Table must be on valid col");const{width:o,filterHeight:a,tableHeight:l}=this;t.autoFilterRef=n.encode(i,s,i+a-1,s+o-1),t.tableRef=n.encode(i,s,i+l-1,s+o-1),t.columns.forEach(((t,n)=>{r(t.name,`Column ${n} must have a name`),0===n?e(t,"totalsRowLabel","Total"):(e(t,"totalsRowFunction","none"),t.totalsRowFormula=this.getFormula(t))}))}store(){const t=(t,e)=>{e&&Object.keys(e).forEach((r=>{t[r]=e[r]}))},{worksheet:e,table:r}=this,{row:n,col:i}=r.tl;let s=0;if(r.headerRow){const o=e.getRow(n+s++);r.columns.forEach(((e,r)=>{const{style:n,name:s}=e,a=o.getCell(i+r);a.value=s,t(a,n)}))}if(r.rows.forEach((o=>{const a=e.getRow(n+s++);o.forEach(((e,n)=>{const s=a.getCell(i+n);s.value=e,t(s,r.columns[n].style)}))})),r.totalsRow){const o=e.getRow(n+s++);r.columns.forEach(((e,r)=>{const n=o.getCell(i+r);if(0===r)n.value=e.totalsRowLabel;else{const t=this.getFormula(e);n.value=t?{formula:e.totalsRowFormula,result:e.totalsRowResult}:null}t(n,e.style)}))}}load(t){const{table:e}=this,{row:r,col:n}=e.tl;let i=0;if(e.headerRow){const s=t.getRow(r+i++);e.columns.forEach(((t,e)=>{s.getCell(n+e).value=t.name}))}if(e.rows.forEach((e=>{const s=t.getRow(r+i++);e.forEach(((t,e)=>{s.getCell(n+e).value=t}))})),e.totalsRow){const s=t.getRow(r+i++);e.columns.forEach(((t,e)=>{const r=s.getCell(n+e);0===e?r.value=t.totalsRowLabel:this.getFormula(t)&&(r.value={formula:t.totalsRowFormula,result:t.totalsRowResult})}))}}get model(){return this.table}set model(t){this.table=t}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const t=n.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let e=0;e<this._cache.tableHeight;e++){const r=this.worksheet.getRow(t.row+e);for(let e=0;e<this._cache.width;e++)r.getCell(t.col+e).value=null}else{for(let e=this.tableHeight;e<this._cache.tableHeight;e++){const r=this.worksheet.getRow(t.row+e);for(let e=0;e<this._cache.width;e++)r.getCell(t.col+e).value=null}for(let e=0;e<this.tableHeight;e++){const r=this.worksheet.getRow(t.row+e);for(let e=this.width;e<this._cache.width;e++)r.getCell(t.col+e).value=null}}this.store()}addRow(t,e){this.cacheState(),void 0===e?this.table.rows.push(t):this.table.rows.splice(e,0,t)}removeRows(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cacheState(),this.table.rows.splice(t,e)}getColumn(t){const e=this.table.columns[t];return new i(this,e,t)}addColumn(t,e,r){this.cacheState(),void 0===r?(this.table.columns.push(t),this.table.rows.forEach(((t,r)=>{t.push(e[r])}))):(this.table.columns.splice(r,0,t),this.table.rows.forEach(((t,n)=>{t.splice(r,0,e[n])})))}removeColumns(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cacheState(),this.table.columns.splice(t,e),this.table.rows.forEach((r=>{r.splice(t,e)}))}_assign(t,e,r){this.cacheState(),t[e]=r}get ref(){return this.table.ref}set ref(t){this._assign(this.table,"ref",t)}get name(){return this.table.name}set name(t){this.table.name=t}get displayName(){return this.table.displyName||this.table.name}set displayNamename(t){this.table.displayName=t}get headerRow(){return this.table.headerRow}set headerRow(t){this._assign(this.table,"headerRow",t)}get totalsRow(){return this.table.totalsRow}set totalsRow(t){this._assign(this.table,"totalsRow",t)}get theme(){return this.table.style.name}set theme(t){this.table.style.name=t}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(t){this.table.style.showFirstColumn=t}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(t){this.table.style.showLastColumn=t}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(t){this.table.style.showRowStripes=t}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(t){this.table.style.showColumnStripes=t}}},{"../utils/col-cache":19}],13:[function(t,e,r){"use strict";const n=t("./worksheet"),i=t("./defined-names"),s=t("../xlsx/xlsx"),o=t("../csv/csv");e.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new i}get xlsx(){return this._xlsx||(this._xlsx=new s(this)),this._xlsx}get csv(){return this._csv||(this._csv=new o(this)),this._csv}get nextId(){for(let t=1;t<this._worksheets.length;t++)if(!this._worksheets[t])return t;return this._worksheets.length||1}addWorksheet(t,e){const r=this.nextId;e&&("string"==typeof e?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),e={properties:{tabColor:{argb:e}}}):(e.argb||e.theme||e.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),e={properties:{tabColor:e}}));const i=this._worksheets.reduce(((t,e)=>(e&&e.orderNo)>t?e.orderNo:t),0),s=Object.assign({},e,{id:r,name:t,orderNo:i+1,workbook:this}),o=new n(s);return this._worksheets[r]=o,o}removeWorksheetEx(t){delete this._worksheets[t.id]}removeWorksheet(t){const e=this.getWorksheet(t);e&&e.destroy()}getWorksheet(t){return void 0===t?this._worksheets.find(Boolean):"number"==typeof t?this._worksheets[t]:"string"==typeof t?this._worksheets.find((e=>e&&e.name===t)):void 0}get worksheets(){return this._worksheets.slice(1).sort(((t,e)=>t.orderNo-e.orderNo)).filter(Boolean)}eachSheet(t){this.worksheets.forEach((e=>{t(e,e.id)}))}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(t){const e=this.media.length;return this.media.push(Object.assign({},t,{type:"image"})),e}getImage(t){return this.media[t]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map((t=>t.model)),sheets:this.worksheets.map((t=>t.model)).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(t){this.creator=t.creator,this.lastModifiedBy=t.lastModifiedBy,this.lastPrinted=t.lastPrinted,this.created=t.created,this.modified=t.modified,this.company=t.company,this.manager=t.manager,this.title=t.title,this.subject=t.subject,this.keywords=t.keywords,this.category=t.category,this.description=t.description,this.language=t.language,this.revision=t.revision,this.contentStatus=t.contentStatus,this.properties=t.properties,this.calcProperties=t.calcProperties,this._worksheets=[],t.worksheets.forEach((e=>{const{id:r,name:i,state:s}=e,o=t.sheets&&t.sheets.findIndex((t=>t.id===r));(this._worksheets[r]=new n({id:r,name:i,orderNo:o,state:s,workbook:this})).model=e})),this._definedNames.model=t.definedNames,this.views=t.views,this._themes=t.themes,this.media=t.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(t,e,r){"use strict";const n=t("../utils/under-dash"),i=t("../utils/col-cache"),s=t("./range"),o=t("./row"),a=t("./column"),l=t("./enums"),u=t("./image"),c=t("./table"),h=t("./data-validations"),d=t("../utils/encryptor"),{copyStyle:f}=t("../utils/copy-style");e.exports=class{constructor(t){t=t||{},this._workbook=t.workbook,this.id=t.id,this.orderNo=t.orderNo,this.name=t.name,this.state=t.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},t.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!t.pageSetup||!t.pageSetup.fitToWidth&&!t.pageSetup.fitToHeight||t.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},t.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},t.headerFooter),this.dataValidations=new h,this.views=t.views||[],this.autoFilter=t.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(t){if(void 0===t&&(t="sheet"+this.id),this._name!==t){if("string"!=typeof t)throw new Error("The name has to be a string.");if(""===t)throw new Error("The name can't be empty.");if("History"===t)throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(t))throw new Error(`Worksheet name ${t} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(t))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+t);if(t&&t.length>31&&(console.warn(`Worksheet name ${t} exceeds 31 chars. This will be truncated`),t=t.substring(0,31)),this._workbook._worksheets.find((e=>e&&e.name.toLowerCase()===t.toLowerCase())))throw new Error("Worksheet name already exists: "+t);this._name=t}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const t=new s;return this._rows.forEach((e=>{if(e){const r=e.dimensions;r&&t.expand(e.number,r.min,e.number,r.max)}})),t}get columns(){return this._columns}set columns(t){this._headerRowCount=t.reduce(((t,e)=>{const r=(e.header?1:e.headers&&e.headers.length)||0;return Math.max(t,r)}),0);let e=1;const r=this._columns=[];t.forEach((t=>{const n=new a(this,e++,!1);r.push(n),n.defn=t}))}getColumnKey(t){return this._keys[t]}setColumnKey(t,e){this._keys[t]=e}deleteColumnKey(t){delete this._keys[t]}eachColumnKey(t){n.each(this._keys,t)}getColumn(t){if("string"==typeof t){const e=this._keys[t];if(e)return e;t=i.l2n(t)}if(this._columns||(this._columns=[]),t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new a(this,e++))}return this._columns[t-1]}spliceColumns(t,e){const r=this._rows.length;for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];if(i.length>0)for(let n=0;n<r;n++){const r=[t,e];i.forEach((t=>{r.push(t[n]||null)}));const s=this.getRow(n+1);s.splice.apply(s,r)}else this._rows.forEach((r=>{r&&r.splice(t,e)}));const o=i.length-e,a=t+e,l=this._columns.length;if(o<0)for(let e=t+i.length;e<=l;e++)this.getColumn(e).defn=this.getColumn(e-o).defn;else if(o>0)for(let t=l;t>=a;t--)this.getColumn(t+o).defn=this.getColumn(t).defn;for(let e=t;e<t+i.length;e++)this.getColumn(e).defn=null;this.workbook.definedNames.spliceColumns(this.name,t,e,i.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let t=0;return this.eachRow((e=>{t=Math.max(t,e.cellCount)})),t}get actualColumnCount(){const t=[];let e=0;return this.eachRow((r=>{r.eachCell((r=>{let{col:n}=r;t[n]||(t[n]=!0,e++)}))})),e}_commitRow(){}get _lastRowNumber(){const t=this._rows;let e=t.length;for(;e>0&&void 0===t[e-1];)e--;return e}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(t){return this._rows[t-1]}findRows(t,e){return this._rows.slice(t-1,t-1+e)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let t=0;return this.eachRow((()=>{t++})),t}getRow(t){let e=this._rows[t-1];return e||(e=this._rows[t-1]=new o(this,t)),e}getRows(t,e){if(e<1)return;const r=[];for(let n=t;n<t+e;n++)r.push(this.getRow(n));return r}addRow(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n";const r=this._nextRow,n=this.getRow(r);return n.values=t,this._setStyleOption(r,"i"===e[0]?e:"n"),n}addRows(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n";const r=[];return t.forEach((t=>{r.push(this.addRow(t,e))})),r}insertRow(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"n";return this.spliceRows(t,0,e),this._setStyleOption(t,r),this.getRow(t)}insertRows(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"n";if(this.spliceRows(t,0,...e),"n"!==r)for(let n=0;n<e.length;n++)"o"===r[0]&&void 0!==this.findRow(e.length+t+n)?this._copyStyle(e.length+t+n,t+n,"+"===r[1]):"i"===r[0]&&void 0!==this.findRow(t-1)&&this._copyStyle(t-1,t+n,"+"===r[1]);return this.getRows(t,e.length)}_setStyleOption(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n";"o"===e[0]&&void 0!==this.findRow(t+1)?this._copyStyle(t+1,t,"+"===e[1]):"i"===e[0]&&void 0!==this.findRow(t-1)&&this._copyStyle(t-1,t,"+"===e[1])}_copyStyle(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=this.getRow(t),i=this.getRow(e);i.style=f(n.style),n.eachCell({includeEmpty:r},((t,e)=>{i.getCell(e).style=f(t.style)})),i.height=n.height}duplicateRow(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=this._rows[t-1],i=new Array(e).fill(n.values);this.spliceRows(t+1,r?0:e,...i);for(let r=0;r<e;r++){const e=this._rows[t+r];e.style=n.style,e.height=n.height,n.eachCell({includeEmpty:!0},((t,r)=>{e.getCell(r).style=t.style}))}}spliceRows(t,e){const r=t+e;for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];const o=i.length,a=o-e,l=this._rows.length;let u,c;if(a<0)for(t===l&&(this._rows[l-1]=void 0),u=r;u<=l;u++)if(c=this._rows[u-1],c){const t=this.getRow(u+a);t.values=c.values,t.style=c.style,t.height=c.height,c.eachCell({includeEmpty:!0},((e,r)=>{t.getCell(r).style=e.style})),this._rows[u-1]=void 0}else this._rows[u+a-1]=void 0;else if(a>0)for(u=l;u>=r;u--)if(c=this._rows[u-1],c){const t=this.getRow(u+a);t.values=c.values,t.style=c.style,t.height=c.height,c.eachCell({includeEmpty:!0},((e,r)=>{if(t.getCell(r).style=e.style,"MergeValue"===e._value.constructor.name){const t=this.getRow(e._row._number+o).getCell(r),n=e._value._master,i=this.getRow(n._row._number+o).getCell(n._column._number);t.merge(i)}}))}else this._rows[u+a-1]=void 0;for(u=0;u<o;u++){const e=this.getRow(t+u);e.style={},e.values=i[u]}this.workbook.definedNames.spliceRows(this.name,t,e,o)}eachRow(t,e){if(e||(e=t,t=void 0),t&&t.includeEmpty){const t=this._rows.length;for(let r=1;r<=t;r++)e(this.getRow(r),r)}else this._rows.forEach((t=>{t&&t.hasValues&&e(t,t.number)}))}getSheetValues(){const t=[];return this._rows.forEach((e=>{e&&(t[e.number]=e.values)})),t}findCell(t,e){const r=i.getAddress(t,e),n=this._rows[r.row-1];return n?n.findCell(r.col):void 0}getCell(t,e){const r=i.getAddress(t,e);return this.getRow(r.row).getCellEx(r)}mergeCells(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=new s(e);this._mergeCellsInternal(n)}mergeCellsWithoutStyle(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=new s(e);this._mergeCellsInternal(n,!0)}_mergeCellsInternal(t,e){n.each(this._merges,(e=>{if(e.intersects(t))throw new Error("Cannot merge already merged cells")}));const r=this.getCell(t.top,t.left);for(let n=t.top;n<=t.bottom;n++)for(let i=t.left;i<=t.right;i++)(n>t.top||i>t.left)&&this.getCell(n,i).merge(r,e);this._merges[r.address]=t}_unMergeMaster(t){const e=this._merges[t.address];if(e){for(let t=e.top;t<=e.bottom;t++)for(let r=e.left;r<=e.right;r++)this.getCell(t,r).unmerge();delete this._merges[t.address]}}get hasMerges(){return n.some(this._merges,Boolean)}unMergeCells(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=new s(e);for(let t=n.top;t<=n.bottom;t++)for(let e=n.left;e<=n.right;e++){const r=this.findCell(t,e);r&&(r.type===l.ValueType.Merge?this._unMergeMaster(r.master):this._merges[r.address]&&this._unMergeMaster(r))}}fillFormula(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"shared";const s=i.decode(t),{top:o,left:a,bottom:l,right:u}=s,c=u-a+1,h=i.encodeAddress(o,a),d="shared"===n;let f;f="function"==typeof r?r:Array.isArray(r)?Array.isArray(r[0])?(t,e)=>r[t-o][e-a]:(t,e)=>r[(t-o)*c+(e-a)]:()=>{};let p=!0;for(let r=o;r<=l;r++)for(let i=a;i<=u;i++)p?(this.getCell(r,i).value={shareType:n,formula:e,ref:t,result:f(r,i)},p=!1):this.getCell(r,i).value=d?{sharedFormula:h,result:f(r,i)}:f(r,i)}addImage(t,e){const r={type:"image",imageId:t,range:e};this._media.push(new u(this,r))}getImages(){return this._media.filter((t=>"image"===t.type))}addBackgroundImage(t){const e={type:"background",imageId:t};this._media.push(new u(this,e))}getBackgroundImageId(){const t=this._media.find((t=>"background"===t.type));return t&&t.imageId}protect(t,e){return new Promise((r=>{this.sheetProtection={sheet:!0},e&&"spinCount"in e&&(e.spinCount=Number.isFinite(e.spinCount)?Math.round(Math.max(0,e.spinCount)):1e5),t&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=d.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=e&&"spinCount"in e?e.spinCount:1e5,this.sheetProtection.hashValue=d.convertPasswordToHash(t,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),e&&(this.sheetProtection=Object.assign(this.sheetProtection,e),!t&&"spinCount"in e&&delete this.sheetProtection.spinCount),r()}))}unprotect(){this.sheetProtection=null}addTable(t){const e=new c(this,t);return this.tables[t.name]=e,e}getTable(t){return this.tables[t]}removeTable(t){delete this.tables[t]}getTables(){return Object.values(this.tables)}addConditionalFormatting(t){this.conditionalFormattings.push(t)}removeConditionalFormatting(t){"number"==typeof t?this.conditionalFormattings.splice(t,1):this.conditionalFormattings=t instanceof Function?this.conditionalFormattings.filter(t):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(t){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=t}get model(){const t={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map((t=>t.model)),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map((t=>t.model)),conditionalFormattings:this.conditionalFormattings};t.cols=a.toModel(this.columns);const e=t.rows=[],r=t.dimensions=new s;return this._rows.forEach((t=>{const n=t&&t.model;n&&(r.expand(n.number,n.min,n.number,n.max),e.push(n))})),t.merges=[],n.each(this._merges,(e=>{t.merges.push(e.range)})),t}_parseRows(t){this._rows=[],t.rows.forEach((t=>{const e=new o(this,t.number);this._rows[e.number-1]=e,e.model=t}))}_parseMergeCells(t){n.each(t.mergeCells,(t=>{this.mergeCellsWithoutStyle(t)}))}set model(t){this.name=t.name,this._columns=a.fromModel(this,t.cols),this._parseRows(t),this._parseMergeCells(t),this.dataValidations=new h(t.dataValidations),this.properties=t.properties,this.pageSetup=t.pageSetup,this.headerFooter=t.headerFooter,this.views=t.views,this.autoFilter=t.autoFilter,this._media=t.media.map((t=>new u(this,t))),this.sheetProtection=t.sheetProtection,this.tables=t.tables.reduce(((t,e)=>{const r=new c;return r.model=e,t[e.name]=r,t}),{}),this.conditionalFormattings=t.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(t,e,r){"use strict";t("core-js/modules/es.promise"),t("core-js/modules/es.promise.finally"),t("core-js/modules/es.object.assign"),t("core-js/modules/es.object.keys"),t("core-js/modules/es.object.values"),t("core-js/modules/es.symbol"),t("core-js/modules/es.symbol.async-iterator"),t("core-js/modules/es.array.iterator"),t("core-js/modules/es.array.includes"),t("core-js/modules/es.array.find-index"),t("core-js/modules/es.array.find"),t("core-js/modules/es.string.from-code-point"),t("core-js/modules/es.string.includes"),t("core-js/modules/es.number.is-nan"),t("regenerator-runtime/runtime");const n={Workbook:t("./doc/workbook")},i=t("./doc/enums");Object.keys(i).forEach((t=>{n[t]=i[t]})),e.exports=n},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(t,e,r){"use strict";const n="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");r.bufferToString=function(t){return"string"==typeof t?t:n?n.decode(t):t.toString()}},{}],17:[function(t,e,r){"use strict";const n="undefined"==typeof TextEncoder?null:new TextEncoder("utf-8"),{Buffer:i}=t("buffer");r.stringToBuffer=function(t){return"string"!=typeof t?t:n?i.from(n.encode(t).buffer):i.from(t)}},{buffer:220}],18:[function(t,e,r){"use strict";const n=t("./under-dash"),i=t("./col-cache");e.exports=class{constructor(t){this.template=t,this.sheets={}}addCell(t){this.addCellEx(i.decodeEx(t))}getCell(t){return this.findCellEx(i.decodeEx(t),!0)}findCell(t){return this.findCellEx(i.decodeEx(t),!1)}findCellAt(t,e,r){const n=this.sheets[t],i=n&&n[e];return i&&i[r]}addCellEx(t){if(t.top)for(let e=t.top;e<=t.bottom;e++)for(let r=t.left;r<=t.right;r++)this.getCellAt(t.sheetName,e,r);else this.findCellEx(t,!0)}getCellEx(t){return this.findCellEx(t,!0)}findCellEx(t,e){const r=this.findSheet(t,e),n=this.findSheetRow(r,t,e);return this.findRowCell(n,t,e)}getCellAt(t,e,r){const n=this.sheets[t]||(this.sheets[t]=[]),s=n[e]||(n[e]=[]);return s[r]||(s[r]={sheetName:t,address:i.n2l(r)+e,row:e,col:r})}removeCellEx(t){const e=this.findSheet(t);if(!e)return;const r=this.findSheetRow(e,t);r&&delete r[t.col]}forEachInSheet(t,e){const r=this.sheets[t];r&&r.forEach(((t,r)=>{t&&t.forEach(((t,n)=>{t&&e(t,r,n)}))}))}forEach(t){n.each(this.sheets,((e,r)=>{this.forEachInSheet(r,t)}))}map(t){const e=[];return this.forEach((r=>{e.push(t(r))})),e}findSheet(t,e){const r=t.sheetName;return this.sheets[r]?this.sheets[r]:e?this.sheets[r]=[]:void 0}findSheetRow(t,e,r){const{row:n}=e;return t&&t[n]?t[n]:r?t[n]=[]:void 0}findRowCell(t,e,r){const{col:n}=e;return t&&t[n]?t[n]:r?t[n]=this.template?Object.assign(e,JSON.parse(JSON.stringify(this.template))):e:void 0}spliceRows(t,e,r,n){const i=this.sheets[t];if(i){const t=[];for(let e=0;e<n;e++)t.push([]);i.splice(e,r,...t)}}spliceColumns(t,e,r,i){const s=this.sheets[t];if(s){const t=[];for(let e=0;e<i;e++)t.push(null);n.each(s,(n=>{n.splice(e,r,...t)}))}}}},{"./col-cache":19,"./under-dash":26}],19:[function(t,e,r){"use strict";const n=/^[A-Z]+\d+$/,i={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:t=>t<=26?1:t<=676?2:3,_fill(t){let e,r,n,i,s,o=1;if(t>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&t>=1){for(;o<=26;)e=this._dictionary[o-1],this._n2l[o]=e,this._l2n[e]=o,o++;this._l2nFill=1}if(this._l2nFill<2&&t>=2){for(o=27;o<=702;)r=o-27,n=r%26,i=Math.floor(r/26),e=this._dictionary[i]+this._dictionary[n],this._n2l[o]=e,this._l2n[e]=o,o++;this._l2nFill=2}if(this._l2nFill<3&&t>=3){for(o=703;o<=16384;)r=o-703,n=r%26,i=Math.floor(r/26)%26,s=Math.floor(r/676),e=this._dictionary[s]+this._dictionary[i]+this._dictionary[n],this._n2l[o]=e,this._l2n[e]=o,o++;this._l2nFill=3}},l2n(t){if(this._l2n[t]||this._fill(t.length),!this._l2n[t])throw new Error("Out of bounds. Invalid column letter: "+t);return this._l2n[t]},n2l(t){if(t<1||t>16384)throw new Error(t+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[t]||this._fill(this._level(t)),this._n2l[t]},_hash:{},validateAddress(t){if(!n.test(t))throw new Error("Invalid Address: "+t);return!0},decodeAddress(t){const e=t.length<5&&this._hash[t];if(e)return e;let r=!1,n="",i=0,s=!1,o="",a=0;for(let e,l=0;l<t.length;l++)if(e=t.charCodeAt(l),!s&&e>=65&&e<=90)r=!0,n+=t[l],i=26*i+e-64;else if(e>=48&&e<=57)s=!0,o+=t[l],a=10*a+e-48;else if(s&&r&&36!==e)break;if(r){if(i>16384)throw new Error("Out of bounds. Invalid column letter: "+n)}else i=void 0;s||(a=void 0);const l={address:t=n+o,col:i,row:a,$col$row:`$${n}$${o}`};return i<=100&&a<=100&&(this._hash[t]=l,this._hash[l.$col$row]=l),l},getAddress(t,e){if(e){const r=this.n2l(e)+t;return this.decodeAddress(r)}return this.decodeAddress(t)},decode(t){const e=t.split(":");if(2===e.length){const t=this.decodeAddress(e[0]),r=this.decodeAddress(e[1]),n={top:Math.min(t.row,r.row),left:Math.min(t.col,r.col),bottom:Math.max(t.row,r.row),right:Math.max(t.col,r.col)};return n.tl=this.n2l(n.left)+n.top,n.br=this.n2l(n.right)+n.bottom,n.dimensions=`${n.tl}:${n.br}`,n}return this.decodeAddress(t)},decodeEx(t){const e=t.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),r=e[1]||e[2],n=e[3],i=n.split(":");if(i.length>1){let t=this.decodeAddress(i[0]),e=this.decodeAddress(i[1]);const n=Math.min(t.row,e.row),s=Math.min(t.col,e.col),o=Math.max(t.row,e.row),a=Math.max(t.col,e.col);return t=this.n2l(s)+n,e=this.n2l(a)+o,{top:n,left:s,bottom:o,right:a,sheetName:r,tl:{address:t,col:s,row:n,$col$row:`$${this.n2l(s)}$${n}`,sheetName:r},br:{address:e,col:a,row:o,$col$row:`$${this.n2l(a)}$${o}`,sheetName:r},dimensions:`${t}:${e}`}}if(n.startsWith("#"))return r?{sheetName:r,error:n}:{error:n};const s=this.decodeAddress(n);return r?{sheetName:r,...s}:s},encodeAddress:(t,e)=>i.n2l(e)+t,encode(){switch(arguments.length){case 2:return i.encodeAddress(arguments[0],arguments[1]);case 4:return`${i.encodeAddress(arguments[0],arguments[1])}:${i.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(t,e){const[r,n,,i,s]=t,[o,a]=e;return o>=r&&o<=i&&a>=n&&a<=s}};e.exports=i},{}],20:[function(t,e,r){"use strict";const n=(t,e)=>({...t,...e.reduce(((e,r)=>(t[r]&&(e[r]={...t[r]}),e)),{})}),i=function(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];t[r]&&(e[r]=n(t[r],i))};r.copyStyle=t=>{if(!t)return t;if(e=t,0===Object.keys(e).length)return{};var e;const r={...t};return i(t,r,"font",["color"]),i(t,r,"alignment"),i(t,r,"protection"),t.border&&(i(t,r,"border"),i(t.border,r.border,"top",["color"]),i(t.border,r.border,"left",["color"]),i(t.border,r.border,"bottom",["color"]),i(t.border,r.border,"right",["color"]),i(t.border,r.border,"diagonal",["color"])),t.fill&&(i(t,r,"fill",["fgColor","bgColor","center"]),t.fill.stops&&(r.fill.stops=t.fill.stops.map((t=>n(t,["color"]))))),r}},{}],21:[function(t,e,r){(function(r){(function(){"use strict";const n=t("crypto"),i={hash(t){const e=n.createHash(t);for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return e.update(r.concat(s)),e.digest()},convertPasswordToHash(t,e,i,s){if(e=e.toLowerCase(),n.getHashes().indexOf(e)<0)throw new Error(`Hash algorithm '${e}' not supported!`);const o=r.from(t,"utf16le");let a=this.hash(e,r.from(i,"base64"),o);for(let t=0;t<s;t++){const n=r.alloc(4);n.writeUInt32LE(t,0),a=this.hash(e,a,n)}return a.toString("base64")},randomBytes:t=>n.randomBytes(t)};e.exports=i}).call(this)}).call(this,t("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(t,e,r){"use strict";const{SaxesParser:n}=t("saxes"),{PassThrough:i}=t("readable-stream"),{bufferToString:s}=t("./browser-buffer-decode");e.exports=async function*(t){t.pipe&&!t[Symbol.asyncIterator]&&(t=t.pipe(new i));const e=new n;let r;e.on("error",(t=>{r=t}));let o=[];e.on("opentag",(t=>o.push({eventType:"opentag",value:t}))),e.on("text",(t=>o.push({eventType:"text",value:t}))),e.on("closetag",(t=>o.push({eventType:"closetag",value:t})));for await(const n of t){if(e.write(s(n)),r)throw r;yield o,o=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(t,e,r){"use strict";const n=t("./col-cache"),i=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,s=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;e.exports={slideFormula:function(t,e,r){const o=n.decode(e),a=n.decode(r);return t.replace(i,((t,e,r,i,l)=>{if(l)return t;const u=s.exec(i);if(u){const r=u[1],i=u[2].toUpperCase(),s=u[3],l=u[4];if(i.length>3||3===i.length&&i>"XFD")return t;let c=n.l2n(i),h=parseInt(l,10);return r||(c+=a.col-o.col),s||(h+=a.row-o.row),(e||"")+(r||"")+n.n2l(c)+(s||"")+h}return t}))}}},{"./col-cache":19}],24:[function(t,e,r){(function(r,n){(function(){"use strict";const i=t("readable-stream"),s=t("./utils"),o=t("./string-buf");class a{constructor(t,e){this._data=t,this._encoding=e}get length(){return this.toBuffer().length}copy(t,e,r,n){return this.toBuffer().copy(t,e,r,n)}toBuffer(){return this._buffer||(this._buffer=n.from(this._data,this._encoding)),this._buffer}}class l{constructor(t){this._data=t}get length(){return this._data.length}copy(t,e,r,n){return this._data._buf.copy(t,e,r,n)}toBuffer(){return this._data.toBuffer()}}class u{constructor(t){this._data=t}get length(){return this._data.length}copy(t,e,r,n){this._data.copy(t,e,r,n)}toBuffer(){return this._data}}class c{constructor(t){this.size=t,this.buffer=n.alloc(t),this.iRead=0,this.iWrite=0}toBuffer(){if(0===this.iRead&&this.iWrite===this.size)return this.buffer;const t=n.alloc(this.iWrite-this.iRead);return this.buffer.copy(t,0,this.iRead,this.iWrite),t}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(t){let e;return 0===t?null:void 0===t||t>=this.length?(e=this.toBuffer(),this.iRead=this.iWrite,e):(e=n.alloc(t),this.buffer.copy(e,0,this.iRead,t),this.iRead+=t,e)}write(t,e,r){const n=Math.min(r,this.size-this.iWrite);return t.copy(this.buffer,this.iWrite,e,e+n),this.iWrite+=n,n}}const h=function(t){t=t||{},this.bufSize=t.bufSize||1048576,this.buffers=[],this.batch=t.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};s.inherits(h,i.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return n.concat(this.buffers.map((t=>t.toBuffer())))}},_getWritableBuffer(){if(this.buffers.length){const t=this.buffers[this.buffers.length-1];if(!t.full)return t}const t=new c(this.bufSize);return this.buffers.push(t),t},async _pipe(t){await Promise.all(this.pipes.map((function(e){return new Promise((r=>{e.write(t.toBuffer(),(()=>{r()}))}))})))},_writeToBuffers(t){let e=0;const r=t.length;for(;e<r;)e+=this._getWritableBuffer().write(t,e,r-e)},async write(t,e,i){let c;if(e instanceof Function&&(i=e,e="utf8"),i=i||s.nop,t instanceof o)c=new l(t);else if(t instanceof n)c=new u(t);else{if(!("string"==typeof t||t instanceof String||t instanceof ArrayBuffer))throw new Error("Chunk must be one of type String, Buffer or StringBuf.");c=new a(t,e)}if(this.pipes.length)if(this.batch)for(this._writeToBuffers(c);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(c),r.nextTick(i)):(await this._pipe(c),i());else this.paused||this.emit("data",c.toBuffer()),this._writeToBuffers(c),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(t,e,r){const n=t=>{t?r(t):(this._flush(),this.pipes.forEach((t=>{t.end()})),this.emit("finish"))};t?this.write(t,e,n):n()},read(t){let e;if(t){for(e=[];t&&this.buffers.length&&!this.buffers[0].eod;){const r=this.buffers[0],n=r.read(t);t-=n.length,e.push(n),r.eod&&r.full&&this.buffers.shift()}return n.concat(e)}return e=this.buffers.map((t=>t.toBuffer())).filter(Boolean),this.buffers=[],n.concat(e)},setEncoding(t){this.encoding=t},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(t){this.pipes.push(t),!this.paused&&this.buffers.length&&this.end()},unpipe(t){this.pipes=this.pipes.filter((e=>e!==t))},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),e.exports=h}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(t,e,r){(function(t){(function(){"use strict";e.exports=class{constructor(e){this._buf=t.alloc(e&&e.size||16384),this._encoding=e&&e.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=t.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(t){t=t||0,this._buffer=void 0,this._inPos=t}_grow(e){let r=2*this._buf.length;for(;r<e;)r*=2;const n=t.alloc(r);this._buf.copy(n,0),this._buf=n}addText(t){this._buffer=void 0;let e=this._inPos+this._buf.write(t,this._inPos,this._encoding);for(;e>=this._buf.length-4;)this._grow(this._inPos+t.length),e=this._inPos+this._buf.write(t,this._inPos,this._encoding);this._inPos=e}addStringBuf(t){t.length&&(this._buffer=void 0,this.length+t.length>this.capacity&&this._grow(this.length+t.length),t._buf.copy(this._buf,this._inPos,0,t.length),this._inPos+=t.length)}}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:220}],26:[function(t,e,r){"use strict";const{toString:n}=Object.prototype,i=/["&<>]/,s={each:function(t,e){t&&(Array.isArray(t)?t.forEach(e):Object.keys(t).forEach((r=>{e(t[r],r)})))},some:function(t,e){return!!t&&(Array.isArray(t)?t.some(e):Object.keys(t).some((r=>e(t[r],r))))},every:function(t,e){return!t||(Array.isArray(t)?t.every(e):Object.keys(t).every((r=>e(t[r],r))))},map:function(t,e){return t?Array.isArray(t)?t.map(e):Object.keys(t).map((r=>e(t[r],r))):[]},keyBy:(t,e)=>t.reduce(((t,r)=>(t[r[e]]=r,t)),{}),isEqual:function(t,e){const r=typeof t,n=typeof e,i=Array.isArray(t),o=Array.isArray(e);let a;if(r!==n)return!1;if("object"==typeof t){if(i||o)return!(!i||!o)&&t.length===e.length&&t.every(((t,r)=>{const n=e[r];return s.isEqual(t,n)}));if(null===t||null===e)return t===e;if(a=Object.keys(t),Object.keys(e).length!==a.length)return!1;for(const t of a)if(!e.hasOwnProperty(t))return!1;return s.every(t,((t,r)=>{const n=e[r];return s.isEqual(t,n)}))}return t===e},escapeHtml(t){const e=i.exec(t);if(!e)return t;let r="",n="",s=0,o=e.index;for(;o<t.length;o++){switch(t.charAt(o)){case'"':n=""";break;case"&":n="&";break;case"'":n="'";break;case"<":n="<";break;case">":n=">";break;default:continue}s!==o&&(r+=t.substring(s,o)),s=o+1,r+=n}return s!==o?r+t.substring(s,o):r},strcmp:(t,e)=>t<e?-1:t>e?1:0,isUndefined:t=>"[object Undefined]"===n.call(t),isObject:t=>"[object Object]"===n.call(t),deepMerge(){const t=arguments[0]||{},{length:e}=arguments;let r,n,i;function o(e,o){r=t[o],i=Array.isArray(e),s.isObject(e)||i?(i?(i=!1,n=r&&Array.isArray(r)?r:[]):n=r&&s.isObject(r)?r:{},t[o]=s.deepMerge(n,e)):s.isUndefined(e)||(t[o]=e)}for(let t=0;t<e;t++)s.each(arguments[t],o);return t}};e.exports=s},{}],27:[function(t,e,n){(function(r,n){(function(){"use strict";const i=t("fs"),s=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,o={nop(){},promiseImmediate:t=>new Promise((e=>{r.setImmediate?n((()=>{e(t)})):setTimeout((()=>{e(t)}),1)})),inherits:function(t,e,r,n){t.super_=e,n||(n=r,r=null),r&&Object.keys(r).forEach((e=>{Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}));const i={constructor:{value:t,enumerable:!1,writable:!1,configurable:!0}};n&&Object.keys(n).forEach((t=>{i[t]=Object.getOwnPropertyDescriptor(n,t)})),t.prototype=Object.create(e.prototype,i)},dateToExcel:(t,e)=>25569+t.getTime()/864e5-(e?1462:0),excelToDate(t,e){const r=Math.round(24*(t-25569+(e?1462:0))*3600*1e3);return new Date(r)},parsePath(t){const e=t.lastIndexOf("/");return{path:t.substring(0,e),name:t.substring(e+1)}},getRelsPath(t){const e=o.parsePath(t);return`${e.path}/_rels/${e.name}.rels`},xmlEncode(t){const e=s.exec(t);if(!e)return t;let r="",n="",i=0,o=e.index;for(;o<t.length;o++){const e=t.charCodeAt(o);switch(e){case 34:n=""";break;case 38:n="&";break;case 39:n="'";break;case 60:n="<";break;case 62:n=">";break;case 127:n="";break;default:if(e<=31&&(e<=8||e>=11&&13!==e)){n="";break}continue}i!==o&&(r+=t.substring(i,o)),i=o+1,n&&(r+=n)}return i!==o?r+t.substring(i,o):r},xmlDecode:t=>t.replace(/&([a-z]*);/g,(t=>{switch(t){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return t}})),validInt(t){const e=parseInt(t,10);return Number.isNaN(e)?0:e},isDateFmt:t=>!!t&&null!==(t=(t=t.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/),fs:{exists:t=>new Promise((e=>{i.access(t,i.constants.F_OK,(t=>{e(!t)}))}))},toIsoDateString:t=>t.toIsoString().subsstr(0,10),parseBoolean:t=>!0===t||"true"===t||1===t||"1"===t};e.exports=o}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{fs:216,timers:523}],28:[function(t,e,r){"use strict";const n=t("./under-dash"),i=t("./utils");function s(t,e,r){t.push(` ${e}="${i.xmlEncode(r.toString())}"`)}function o(t,e){if(e){const r=[];n.each(e,((t,e)=>{void 0!==t&&s(r,e,t)})),t.push(r.join(""))}}class a{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(t){const e=this._xml;e.push("<?xml"),o(e,t),e.push("?>\n")}openNode(t,e){const r=this.tos,n=this._xml;r&&this.open&&n.push(">"),this._stack.push(t),n.push("<"),n.push(t),o(n,e),this.leaf=!0,this.open=!0}addAttribute(t,e){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");void 0!==e&&s(this._xml,t,e)}addAttributes(t){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");o(this._xml,t)}writeText(t){const e=this._xml;this.open&&(e.push(">"),this.open=!1),this.leaf=!1,e.push(i.xmlEncode(t.toString()))}writeXml(t){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(t)}closeNode(){const t=this._stack.pop(),e=this._xml;this.leaf?e.push("/>"):(e.push("</"),e.push(t),e.push(">")),this.open=!1,this.leaf=!1}leafNode(t,e,r){this.openNode(t,e),void 0!==r&&this.writeText(r),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){const t=this._rollbacks.pop();this._xml.length>t.xml&&this._xml.splice(t.xml,this._xml.length-t.xml),this._stack.length>t.stack&&this._stack.splice(t.stack,this._stack.length-t.stack),this.leaf=t.leaf,this.open=t.open}get xml(){return this.closeAll(),this._xml.join("")}}a.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},e.exports=a},{"./under-dash":26,"./utils":27}],29:[function(t,e,r){(function(r){(function(){"use strict";const n=t("events"),i=t("jszip"),s=t("./stream-buf"),{stringToBuffer:o}=t("./browser-buffer-encode");class a extends n.EventEmitter{constructor(t){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},t),this.zip=new i,this.stream=new s}append(t,e){e.hasOwnProperty("base64")&&e.base64?this.zip.file(e.name,t,{base64:!0}):(r.browser&&"string"==typeof t&&(t=o(t)),this.zip.file(e.name,t))}async finalize(){const t=await this.zip.generateAsync(this.options);this.stream.end(t),this.emit("finish")}read(t){return this.stream.read(t)}setEncoding(t){return this.stream.setEncoding(t)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(t,e){return this.stream.pipe(t,e)}unpipe(t){return this.stream.unpipe(t)}unshift(t){return this.stream.unshift(t)}wrap(t){return this.stream.wrap(t)}}e.exports={ZipWriter:a}}).call(this)}).call(this,t("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(t,e,r){"use strict";e.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},28:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"年"m"月"d"日"',"zh-cn":'yyyy"年"m"月"d"日"',"ja-jp":'yyyy"年"m"月"d"日"',"ko-kr":'yyyy"년" mm"월" dd"일"'},32:{"zh-tw":'hh"時"mm"分"',"zh-cn":'h"时"mm"分"',"ja-jp":'h"時"mm"分"',"ko-kr":'h"시" mm"분"'},33:{"zh-tw":'hh"時"mm"分"ss"秒"',"zh-cn":'h"时"mm"分"ss"秒"',"ja-jp":'h"時"mm"分"ss"秒"',"ko-kr":'h"시" mm"분" ss"초"'},34:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},51:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},52:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'yyyy"年"m"月"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'m"月"d"日"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},55:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},58:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],31:[function(t,e,r){"use strict";e.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],32:[function(t,e,r){"use strict";const n=t("../../utils/parse-sax"),i=t("../../utils/xml-stream");class s{prepare(){}render(){}parseOpen(t){}parseText(t){}parseClose(t){}reconcile(t,e){}reset(){this.model=null,this.map&&Object.values(this.map).forEach((t=>{t instanceof s?t.reset():t.xform&&t.xform.reset()}))}mergeModel(t){this.model=Object.assign(this.model||{},t)}async parse(t){for await(const e of t)for(const{eventType:t,value:r}of e)if("opentag"===t)this.parseOpen(r);else if("text"===t)this.parseText(r);else if("closetag"===t&&!this.parseClose(r.name))return this.model;return this.model}async parseStream(t){return this.parse(n(t))}get xml(){return this.toXml(this.model)}toXml(t){const e=new i;return this.render(e,t),e.xml}static toAttribute(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===t){if(r)return e}else if(r||t!==e)return t.toString()}static toStringAttribute(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return s.toAttribute(t,e,r)}static toStringValue(t,e){return void 0===t?e:t}static toBoolAttribute(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0===t){if(r)return e}else if(r||t!==e)return t?"1":"0"}static toBoolValue(t,e){return void 0===t?e:"1"===t}static toIntAttribute(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return s.toAttribute(t,e,r)}static toIntValue(t,e){return void 0===t?e:parseInt(t,10)}static toFloatAttribute(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return s.toAttribute(t,e,r)}static toFloatValue(t,e){return void 0===t?e:parseFloat(t)}}e.exports=s},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("../../../utils/col-cache");function s(t){try{return i.decodeEx(t),!0}catch(t){return!1}}function o(t){const e=[];let r=!1,n="";return t.split(",").forEach((t=>{if(!t)return;const i=(t.match(/'/g)||[]).length;if(!i)return void(r?n+=t+",":s(t)&&e.push(t));const o=i%2==0;!r&&o&&s(t)?e.push(t):r&&!o?(r=!1,s(n+t)&&e.push(n+t),n=""):(r=!0,n+=t+",")})),e}e.exports=class extends n{render(t,e){t.openNode("definedName",{name:e.name,localSheetId:e.localSheetId}),t.writeText(e.ranges.join(",")),t.closeNode()}parseOpen(t){return"definedName"===t.name&&(this._parsedName=t.attributes.name,this._parsedLocalSheetId=t.attributes.localSheetId,this._parsedText=[],!0)}parseText(t){this._parsedText.push(t)}parseClose(){return this.model={name:this._parsedName,ranges:o(this._parsedText.join(""))},void 0!==this._parsedLocalSheetId&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(t,e,r){"use strict";const n=t("../../../utils/utils"),i=t("../base-xform");e.exports=class extends i{render(t,e){t.leafNode("sheet",{sheetId:e.id,name:e.name,state:e.state,"r:id":e.rId})}parseOpen(t){return"sheet"===t.name&&(this.model={name:n.xmlDecode(t.attributes.name),id:parseInt(t.attributes.sheetId,10),state:t.attributes.state,rId:t.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{render(t,e){t.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:e.fullCalcOnLoad?1:void 0})}parseOpen(t){return"calcPr"===t.name&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{render(t,e){t.leafNode("workbookPr",{date1904:e.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(t){return"workbookPr"===t.name&&(this.model={date1904:"1"===t.attributes.date1904},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{render(t,e){const r={xWindow:e.x||0,yWindow:e.y||0,windowWidth:e.width||12e3,windowHeight:e.height||24e3,firstSheet:e.firstSheet,activeTab:e.activeTab};e.visibility&&"visible"!==e.visibility&&(r.visibility=e.visibility),t.leafNode("workbookView",r)}parseOpen(t){if("workbookView"===t.name){const e=this.model={},r=function(t,r,n){const i=void 0!==r?e[t]=r:n;void 0!==i&&(e[t]=i)},n=function(t,r,n){const i=void 0!==r?e[t]=parseInt(r,10):n;void 0!==i&&(e[t]=i)};return n("x",t.attributes.xWindow,0),n("y",t.attributes.yWindow,0),n("width",t.attributes.windowWidth,25e3),n("height",t.attributes.windowHeight,1e4),r("visibility",t.attributes.visibility,"visible"),n("activeTab",t.attributes.activeTab,void 0),n("firstSheet",t.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(t,e,r){"use strict";const n=t("../../../utils/under-dash"),i=t("../../../utils/col-cache"),s=t("../../../utils/xml-stream"),o=t("../base-xform"),a=t("../static-xform"),l=t("../list-xform"),u=t("./defined-name-xform"),c=t("./sheet-xform"),h=t("./workbook-view-xform"),d=t("./workbook-properties-xform"),f=t("./workbook-calc-properties-xform");class p extends o{constructor(){super(),this.map={fileVersion:p.STATIC_XFORMS.fileVersion,workbookPr:new d,bookViews:new l({tag:"bookViews",count:!1,childXform:new h}),sheets:new l({tag:"sheets",count:!1,childXform:new c}),definedNames:new l({tag:"definedNames",count:!1,childXform:new u}),calcPr:new f}}prepare(t){t.sheets=t.worksheets;const e=[];let r=0;t.sheets.forEach((t=>{if(t.pageSetup&&t.pageSetup.printArea&&t.pageSetup.printArea.split("&&").forEach((n=>{const i=n.split(":"),s={name:"_xlnm.Print_Area",ranges:[`'${t.name}'!$${i[0]}:$${i[1]}`],localSheetId:r};e.push(s)})),t.pageSetup&&(t.pageSetup.printTitlesRow||t.pageSetup.printTitlesColumn)){const n=[];if(t.pageSetup.printTitlesColumn){const e=t.pageSetup.printTitlesColumn.split(":");n.push(`'${t.name}'!$${e[0]}:$${e[1]}`)}if(t.pageSetup.printTitlesRow){const e=t.pageSetup.printTitlesRow.split(":");n.push(`'${t.name}'!$${e[0]}:$${e[1]}`)}const i={name:"_xlnm.Print_Titles",ranges:n,localSheetId:r};e.push(i)}r++})),e.length&&(t.definedNames=t.definedNames.concat(e)),(t.media||[]).forEach(((t,e)=>{t.name=t.type+(e+1)}))}render(t,e){t.openXml(s.StdDocAttributes),t.openNode("workbook",p.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(t),this.map.workbookPr.render(t,e.properties),this.map.bookViews.render(t,e.views),this.map.sheets.render(t,e.sheets),this.map.definedNames.render(t,e.definedNames),this.map.calcPr.render(t,e.calcProperties),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):("workbook"===t.name||(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):"workbook"!==t||(this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1)}reconcile(t){const e=(t.workbookRels||[]).reduce(((t,e)=>(t[e.Id]=e,t)),{}),r=[];let s,o=0;(t.sheets||[]).forEach((n=>{const i=e[n.rId];i&&(s=t.worksheetHash["xl/"+i.Target.replace(/^(\s|\/xl\/)+/,"")],s&&(s.name=n.name,s.id=n.id,s.state=n.state,r[o++]=s))}));const a=[];n.each(t.definedNames,(t=>{if("_xlnm.Print_Area"===t.name){if(s=r[t.localSheetId],s){s.pageSetup||(s.pageSetup={});const e=i.decodeEx(t.ranges[0]);s.pageSetup.printArea=s.pageSetup.printArea?`${s.pageSetup.printArea}&&${e.dimensions}`:e.dimensions}}else if("_xlnm.Print_Titles"===t.name){if(s=r[t.localSheetId],s){s.pageSetup||(s.pageSetup={});const e=t.ranges.join(","),r=/\$/g,n=/\$\d+:\$\d+/,i=e.match(n);if(i&&i.length){const t=i[0];s.pageSetup.printTitlesRow=t.replace(r,"")}const o=/\$[A-Z]+:\$[A-Z]+/,a=e.match(o);if(a&&a.length){const t=a[0];s.pageSetup.printTitlesColumn=t.replace(r,"")}}}else a.push(t)})),t.definedNames=a,t.media.forEach(((t,e)=>{t.index=e}))}}p.WORKBOOK_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x15","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},p.STATIC_XFORMS={fileVersion:new a({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},e.exports=p},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(t,e,r){"use strict";const n=t("../strings/rich-text-xform"),i=t("../../../utils/utils"),s=t("../base-xform"),o=e.exports=function(t){this.model=t};i.inherits(o,s,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new n),this._richTextXform},render(t,e){e=e||this.model,t.openNode("comment",{ref:e.ref,authorId:0}),t.openNode("text"),e&&e.note&&e.note.texts&&e.note.texts.forEach((e=>{this.richTextXform.render(t,e)})),t.closeNode(),t.closeNode()},parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"comment":return this.model={type:"note",note:{texts:[]},...t.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(t),!0;default:return!1}},parseText(t){this.parser&&this.parser.parseText(t)},parseClose(t){switch(t){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(t),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(t,e,r){"use strict";const n=t("../../../utils/xml-stream"),i=t("../../../utils/utils"),s=t("../base-xform"),o=t("./comment-xform"),a=e.exports=function(){this.map={comment:new o}};i.inherits(a,s,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(t,e){e=e||this.model,t.openXml(n.StdDocAttributes),t.openNode("comments",a.COMMENTS_ATTRIBUTES),t.openNode("authors"),t.leafNode("author",null,"Author"),t.closeNode(),t.openNode("commentList"),e.comments.forEach((e=>{this.map.comment.render(t,e)})),t.closeNode(),t.closeNode()},parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(t),!0;default:return!1}},parseText(t){this.parser&&this.parser.parseText(t)},parseClose(t){switch(t){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(t),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(t,e,r){"use strict";const n=t("../../base-xform");e.exports=class extends n{constructor(t){super(),this._model=t}get tag(){return this._model&&this._model.tag}render(t,e,r){(e===r[2]||"x:SizeWithCells"===this.tag&&e===r[1])&&t.leafNode(this.tag)}parseOpen(t){return t.name===this.tag&&(this.model={},this.model[this.tag]=!0,!0)}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(t,e,r){"use strict";const n=t("../../base-xform");e.exports=class extends n{constructor(t){super(),this._model=t}get tag(){return this._model&&this._model.tag}render(t,e){t.leafNode(this.tag,null,e)}parseOpen(t){return t.name===this.tag&&(this.text="",!0)}parseText(t){this.text=t}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"x:Anchor"}getAnchorRect(t){const e=Math.floor(t.left),r=Math.floor(68*(t.left-e)),n=Math.floor(t.top),i=Math.floor(18*(t.top-n)),s=Math.floor(t.right),o=Math.floor(68*(t.right-s)),a=Math.floor(t.bottom);return[e,r,n,i,s,o,a,Math.floor(18*(t.bottom-a))]}getDefaultRect(t){const e=t.col,r=Math.max(t.row-2,0);return[e,6,r,14,e+2,2,r+4,16]}render(t,e){const r=e.anchor?this.getAnchorRect(e.anchor):this.getDefaultRect(e.refAddress);t.leafNode("x:Anchor",null,r.join(", "))}parseOpen(t){return t.name===this.tag&&(this.text="",!0)}parseText(t){this.text=t}parseClose(){return!1}}},{"../base-xform":32}],44:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("./vml-anchor-xform"),s=t("./style/vml-protection-xform"),o=t("./style/vml-position-xform"),a=["twoCells","oneCells","absolute"];e.exports=class extends n{constructor(){super(),this.map={"x:Anchor":new i,"x:Locked":new s({tag:"x:Locked"}),"x:LockText":new s({tag:"x:LockText"}),"x:SizeWithCells":new o({tag:"x:SizeWithCells"}),"x:MoveWithCells":new o({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(t,e){const{protection:r,editAs:n}=e.note;t.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(t,n,a),this.map["x:SizeWithCells"].render(t,n,a),this.map["x:Anchor"].render(t,e),this.map["x:Locked"].render(t,r.locked),t.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(t,r.lockText),t.leafNode("x:Row",null,e.refAddress.row-1),t.leafNode("x:Column",null,e.refAddress.col-1),t.closeNode()}parseOpen(t){return t.name===this.tag?(this.reset(),this.model={anchor:[],protection:{},editAs:""}):(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.normalizeModel(),!1)}normalizeModel(){const t=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),e=Object.keys(t).length;this.model.editAs=a[e],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(t,e,r){"use strict";const n=t("../../../utils/xml-stream"),i=t("../base-xform"),s=t("./vml-shape-xform");class o extends i{constructor(){super(),this.map={"v:shape":new s}}get tag(){return"xml"}render(t,e){t.openXml(n.StdDocAttributes),t.openNode(this.tag,o.DRAWING_ATTRIBUTES),t.openNode("o:shapelayout",{"v:ext":"edit"}),t.leafNode("o:idmap",{"v:ext":"edit",data:1}),t.closeNode(),t.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),t.leafNode("v:stroke",{joinstyle:"miter"}),t.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),t.closeNode(),e.comments.forEach(((e,r)=>{this.map["v:shape"].render(t,e,r)})),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):(t.name===this.tag?(this.reset(),this.model={comments:[]}):(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0):t!==this.tag}reconcile(t,e){t.anchors.forEach((t=>{t.br?this.map["xdr:twoCellAnchor"].reconcile(t,e):this.map["xdr:oneCellAnchor"].reconcile(t,e)}))}}o.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"},e.exports=o},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("./vml-textbox-xform"),s=t("./vml-client-data-xform");class o extends n{constructor(){super(),this.map={"v:textbox":new i,"x:ClientData":new s}}get tag(){return"v:shape"}render(t,e,r){t.openNode("v:shape",o.V_SHAPE_ATTRIBUTES(e,r)),t.leafNode("v:fill",{color2:"infoBackground [80]"}),t.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),t.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(t,e),this.map["x:ClientData"].render(t,e),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):(t.name===this.tag?(this.reset(),this.model={margins:{insetmode:t.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}}):(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1)}}o.V_SHAPE_ATTRIBUTES=(t,e)=>({id:"_x0000_s"+(1025+e),type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":t.note.margins&&t.note.margins.insetmode}),e.exports=o},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"v:textbox"}conversionUnit(t,e,r){return`${parseFloat(t)*e.toFixed(2)}${r}`}reverseConversionUnit(t){return(t||"").split(",").map((t=>Number(parseFloat(this.conversionUnit(parseFloat(t),.1,"")).toFixed(2))))}render(t,e){const r={style:"mso-direction-alt:auto"};if(e&&e.note){let{inset:t}=e.note&&e.note.margins;Array.isArray(t)&&(t=t.map((t=>this.conversionUnit(t,10,"mm"))).join(",")),t&&(r.inset=t)}t.openNode("v:textbox",r),t.leafNode("div",{style:"text-align:left"}),t.closeNode()}parseOpen(t){return t.name!==this.tag||(this.model={inset:this.reverseConversionUnit(t.attributes.inset)},!0)}parseText(){}parseClose(t){return t!==this.tag}}},{"../base-xform":32}],48:[function(t,e,r){"use strict";const n=t("./base-xform");e.exports=class extends n{createNewModel(t){return{}}parseOpen(t){return this.parser=this.parser||this.map[t.name],this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag&&(this.model=this.createNewModel(t),!0)}parseText(t){this.parser&&this.parser.parseText(t)}onParserClose(t,e){this.model[t]=e.model}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.onParserClose(t,this.parser),this.parser=void 0),!0):t!==this.tag}}},{"./base-xform":32}],49:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{render(t,e){t.openNode("HeadingPairs"),t.openNode("vt:vector",{size:2,baseType:"variant"}),t.openNode("vt:variant"),t.leafNode("vt:lpstr",void 0,"Worksheets"),t.closeNode(),t.openNode("vt:variant"),t.leafNode("vt:i4",void 0,e.length),t.closeNode(),t.closeNode(),t.closeNode()}parseOpen(t){return"HeadingPairs"===t.name}parseText(){}parseClose(t){return"HeadingPairs"!==t}}},{"../base-xform":32}],50:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{render(t,e){t.openNode("TitlesOfParts"),t.openNode("vt:vector",{size:e.length,baseType:"lpstr"}),e.forEach((e=>{t.leafNode("vt:lpstr",void 0,e.name)})),t.closeNode(),t.closeNode()}parseOpen(t){return"TitlesOfParts"===t.name}parseText(){}parseClose(t){return"TitlesOfParts"!==t}}},{"../base-xform":32}],51:[function(t,e,r){"use strict";const n=t("../../../utils/xml-stream"),i=t("../base-xform"),s=t("../simple/string-xform"),o=t("./app-heading-pairs-xform"),a=t("./app-titles-of-parts-xform");class l extends i{constructor(){super(),this.map={Company:new s({tag:"Company"}),Manager:new s({tag:"Manager"}),HeadingPairs:new o,TitleOfParts:new a}}render(t,e){t.openXml(n.StdDocAttributes),t.openNode("Properties",l.PROPERTY_ATTRIBUTES),t.leafNode("Application",void 0,"Microsoft Excel"),t.leafNode("DocSecurity",void 0,"0"),t.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(t,e.worksheets),this.map.TitleOfParts.render(t,e.worksheets),this.map.Company.render(t,e.company||""),this.map.Manager.render(t,e.manager),t.leafNode("LinksUpToDate",void 0,"false"),t.leafNode("SharedDoc",void 0,"false"),t.leafNode("HyperlinksChanged",void 0,"false"),t.leafNode("AppVersion",void 0,"16.0300"),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):"Properties"===t.name||(this.parser=this.map[t.name],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):"Properties"!==t||(this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1)}}l.DateFormat=function(t){return t.toISOString().replace(/[.]\d{3,6}/,"")},l.DateAttrs={"xsi:type":"dcterms:W3CDTF"},l.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},e.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(t,e,r){"use strict";const n=t("../../../utils/xml-stream"),i=t("../base-xform");class s extends i{render(t,e){t.openXml(n.StdDocAttributes),t.openNode("Types",s.PROPERTY_ATTRIBUTES);const r={};(e.media||[]).forEach((e=>{if("image"===e.type){const n=e.extension;r[n]||(r[n]=!0,t.leafNode("Default",{Extension:n,ContentType:"image/"+n}))}})),t.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),t.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),t.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),e.worksheets.forEach((e=>{const r=`/xl/worksheets/sheet${e.id}.xml`;t.leafNode("Override",{PartName:r,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})})),t.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),t.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),e.sharedStrings&&e.sharedStrings.count&&t.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),e.tables&&e.tables.forEach((e=>{t.leafNode("Override",{PartName:"/xl/tables/"+e.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})})),e.drawings&&e.drawings.forEach((e=>{t.leafNode("Override",{PartName:`/xl/drawings/${e.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})})),e.commentRefs&&(t.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),e.commentRefs.forEach((e=>{let{commentName:r}=e;t.leafNode("Override",{PartName:`/xl/${r}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})}))),t.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),t.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}s.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},e.exports=s},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(t,e,r){"use strict";const n=t("../../../utils/xml-stream"),i=t("../base-xform"),s=t("../simple/date-xform"),o=t("../simple/string-xform"),a=t("../simple/integer-xform");class l extends i{constructor(){super(),this.map={"dc:creator":new o({tag:"dc:creator"}),"dc:title":new o({tag:"dc:title"}),"dc:subject":new o({tag:"dc:subject"}),"dc:description":new o({tag:"dc:description"}),"dc:identifier":new o({tag:"dc:identifier"}),"dc:language":new o({tag:"dc:language"}),"cp:keywords":new o({tag:"cp:keywords"}),"cp:category":new o({tag:"cp:category"}),"cp:lastModifiedBy":new o({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new s({tag:"cp:lastPrinted",format:l.DateFormat}),"cp:revision":new a({tag:"cp:revision"}),"cp:version":new o({tag:"cp:version"}),"cp:contentStatus":new o({tag:"cp:contentStatus"}),"cp:contentType":new o({tag:"cp:contentType"}),"dcterms:created":new s({tag:"dcterms:created",attrs:l.DateAttrs,format:l.DateFormat}),"dcterms:modified":new s({tag:"dcterms:modified",attrs:l.DateAttrs,format:l.DateFormat})}}render(t,e){t.openXml(n.StdDocAttributes),t.openNode("cp:coreProperties",l.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(t,e.creator),this.map["dc:title"].render(t,e.title),this.map["dc:subject"].render(t,e.subject),this.map["dc:description"].render(t,e.description),this.map["dc:identifier"].render(t,e.identifier),this.map["dc:language"].render(t,e.language),this.map["cp:keywords"].render(t,e.keywords),this.map["cp:category"].render(t,e.category),this.map["cp:lastModifiedBy"].render(t,e.lastModifiedBy),this.map["cp:lastPrinted"].render(t,e.lastPrinted),this.map["cp:revision"].render(t,e.revision),this.map["cp:version"].render(t,e.version),this.map["cp:contentStatus"].render(t,e.contentStatus),this.map["cp:contentType"].render(t,e.contentType),this.map["dcterms:created"].render(t,e.created),this.map["dcterms:modified"].render(t,e.modified),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[t.name],this.parser)return this.parser.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;switch(t){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+t)}}}l.DateFormat=function(t){return t.toISOString().replace(/[.]\d{3}/,"")},l.DateAttrs={"xsi:type":"dcterms:W3CDTF"},l.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},e.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{render(t,e){t.leafNode("Relationship",e)}parseOpen(t){return"Relationship"===t.name&&(this.model=t.attributes,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(t,e,r){"use strict";const n=t("../../../utils/xml-stream"),i=t("../base-xform"),s=t("./relationship-xform");class o extends i{constructor(){super(),this.map={Relationship:new s}}render(t,e){e=e||this._values,t.openXml(n.StdDocAttributes),t.openNode("Relationships",o.RELATIONSHIPS_ATTRIBUTES),e.forEach((e=>{this.map.Relationship.render(t,e)})),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;if("Relationships"===t.name)return this.model=[],!0;if(this.parser=this.map[t.name],this.parser)return this.parser.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.model.push(this.parser.model),this.parser=void 0),!0;if("Relationships"===t)return!1;throw new Error("Unexpected xml node in parseClose: "+t)}}o.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},e.exports=o},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):(t.name===this.tag?(this.reset(),this.model={range:{editAs:t.attributes.editAs||"oneCell"}}):(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0)}parseText(t){this.parser&&this.parser.parseText(t)}reconcilePicture(t,e){if(t&&t.rId){const r=e.rels[t.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){const t=r[1],n=e.mediaIndex[t];return e.media[n]}}}}},{"../base-xform":32}],57:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("./blip-xform");e.exports=class extends n{constructor(){super(),this.map={"a:blip":new i}}get tag(){return"xdr:blipFill"}render(t,e){t.openNode(this.tag),this.map["a:blip"].render(t,e),t.openNode("a:stretch"),t.leafNode("a:fillRect"),t.closeNode(),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):(t.name===this.tag?this.reset():(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0)}parseText(){}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.model=this.map["a:blip"].model,!1)}}},{"../base-xform":32,"./blip-xform":58}],58:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"a:blip"}render(t,e){t.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":e.rId,cstate:"print"})}parseOpen(t){return t.name!==this.tag||(this.model={rId:t.attributes["r:embed"]},!0)}parseText(){}parseClose(t){return t!==this.tag}}},{"../base-xform":32}],59:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"xdr:cNvPicPr"}render(t){t.openNode(this.tag),t.leafNode("a:picLocks",{noChangeAspect:"1"}),t.closeNode()}parseOpen(t){return t.name,this.tag,!0}parseText(){}parseClose(t){return t!==this.tag}}},{"../base-xform":32}],60:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("./hlink-click-xform"),s=t("./ext-lst-xform");e.exports=class extends n{constructor(){super(),this.map={"a:hlinkClick":new i,"a:extLst":new s}}get tag(){return"xdr:cNvPr"}render(t,e){t.openNode(this.tag,{id:e.index,name:"Picture "+e.index}),this.map["a:hlinkClick"].render(t,e),this.map["a:extLst"].render(t,e),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):(t.name===this.tag?this.reset():(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0)}parseText(){}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.model=this.map["a:hlinkClick"].model,!1)}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("../simple/integer-xform");e.exports=class extends n{constructor(t){super(),this.tag=t.tag,this.map={"xdr:col":new i({tag:"xdr:col",zero:!0}),"xdr:colOff":new i({tag:"xdr:colOff",zero:!0}),"xdr:row":new i({tag:"xdr:row",zero:!0}),"xdr:rowOff":new i({tag:"xdr:rowOff",zero:!0})}}render(t,e){t.openNode(this.tag),this.map["xdr:col"].render(t,e.nativeCol),this.map["xdr:colOff"].render(t,e.nativeColOff),this.map["xdr:row"].render(t,e.nativeRow),this.map["xdr:rowOff"].render(t,e.nativeRowOff),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):(t.name===this.tag?this.reset():(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1)}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(t,e,r){"use strict";const n=t("../../../utils/col-cache"),i=t("../../../utils/xml-stream"),s=t("../base-xform"),o=t("./two-cell-anchor-xform"),a=t("./one-cell-anchor-xform");class l extends s{constructor(){super(),this.map={"xdr:twoCellAnchor":new o,"xdr:oneCellAnchor":new a}}prepare(t){t.anchors.forEach(((t,e)=>{t.anchorType=function(t){return("string"==typeof t.range?n.decode(t.range):t.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"}(t),this.map[t.anchorType].prepare(t,{index:e})}))}get tag(){return"xdr:wsDr"}render(t,e){t.openXml(i.StdDocAttributes),t.openNode(this.tag,l.DRAWING_ATTRIBUTES),e.anchors.forEach((e=>{this.map[e.anchorType].render(t,e)})),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):(t.name===this.tag?(this.reset(),this.model={anchors:[]}):(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0):t!==this.tag}reconcile(t,e){t.anchors.forEach((t=>{t.br?this.map["xdr:twoCellAnchor"].reconcile(t,e):this.map["xdr:oneCellAnchor"].reconcile(t,e)}))}}l.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},e.exports=l},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"a:extLst"}render(t){t.openNode(this.tag),t.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),t.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),t.closeNode(),t.closeNode()}parseOpen(t){return t.name,this.tag,!0}parseText(){}parseClose(t){return t!==this.tag}}},{"../base-xform":32}],64:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{constructor(t){super(),this.tag=t.tag,this.map={}}render(t,e){t.openNode(this.tag);const r=Math.floor(9525*e.width),n=Math.floor(9525*e.height);t.addAttribute("cx",r),t.addAttribute("cy",n),t.closeNode()}parseOpen(t){return t.name===this.tag&&(this.model={width:parseInt(t.attributes.cx||"0",10)/9525,height:parseInt(t.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"a:hlinkClick"}render(t,e){e.hyperlinks&&e.hyperlinks.rId&&t.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":e.hyperlinks.rId,tooltip:e.hyperlinks.tooltip})}parseOpen(t){return t.name!==this.tag||(this.model={hyperlinks:{rId:t.attributes["r:id"],tooltip:t.attributes.tooltip}},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("./c-nv-pr-xform"),s=t("./c-nv-pic-pr-xform");e.exports=class extends n{constructor(){super(),this.map={"xdr:cNvPr":new i,"xdr:cNvPicPr":new s}}get tag(){return"xdr:nvPicPr"}render(t,e){t.openNode(this.tag),this.map["xdr:cNvPr"].render(t,e),this.map["xdr:cNvPicPr"].render(t,e),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):(t.name===this.tag?this.reset():(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0)}parseText(){}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.model=this.map["xdr:cNvPr"].model,!1)}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(t,e,r){"use strict";const n=t("./base-cell-anchor-xform"),i=t("../static-xform"),s=t("./cell-position-xform"),o=t("./ext-xform"),a=t("./pic-xform");e.exports=class extends n{constructor(){super(),this.map={"xdr:from":new s({tag:"xdr:from"}),"xdr:ext":new o({tag:"xdr:ext"}),"xdr:pic":new a,"xdr:clientData":new i({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(t,e){this.map["xdr:pic"].prepare(t.picture,e)}render(t,e){t.openNode(this.tag,{editAs:e.range.editAs||"oneCell"}),this.map["xdr:from"].render(t,e.range.tl),this.map["xdr:ext"].render(t,e.range.ext),this.map["xdr:pic"].render(t,e.picture),this.map["xdr:clientData"].render(t,{}),t.closeNode()}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1)}reconcile(t,e){t.medium=this.reconcilePicture(t.picture,e)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("../static-xform"),s=t("./blip-fill-xform"),o=t("./nv-pic-pr-xform"),a=t("./sp-pr");e.exports=class extends n{constructor(){super(),this.map={"xdr:nvPicPr":new o,"xdr:blipFill":new s,"xdr:spPr":new i(a)}}get tag(){return"xdr:pic"}prepare(t,e){t.index=e.index+1}render(t,e){t.openNode(this.tag),this.map["xdr:nvPicPr"].render(t,e),this.map["xdr:blipFill"].render(t,e),this.map["xdr:spPr"].render(t,e),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):(t.name===this.tag?this.reset():(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0)}parseText(){}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.mergeModel(this.parser.model),this.parser=void 0),!0):t!==this.tag}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(t,e,r){"use strict";e.exports={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]}},{}],70:[function(t,e,r){"use strict";const n=t("./base-cell-anchor-xform"),i=t("../static-xform"),s=t("./cell-position-xform"),o=t("./pic-xform");e.exports=class extends n{constructor(){super(),this.map={"xdr:from":new s({tag:"xdr:from"}),"xdr:to":new s({tag:"xdr:to"}),"xdr:pic":new o,"xdr:clientData":new i({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(t,e){this.map["xdr:pic"].prepare(t.picture,e)}render(t,e){t.openNode(this.tag,{editAs:e.range.editAs||"oneCell"}),this.map["xdr:from"].render(t,e.range.tl),this.map["xdr:to"].render(t,e.range.br),this.map["xdr:pic"].render(t,e.picture),this.map["xdr:clientData"].render(t,{}),t.closeNode()}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.model.range.tl=this.map["xdr:from"].model,this.model.range.br=this.map["xdr:to"].model,this.model.picture=this.map["xdr:pic"].model,!1)}reconcile(t,e){t.medium=this.reconcilePicture(t.picture,e)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(t,e,r){"use strict";const n=t("./base-xform");e.exports=class extends n{constructor(t){super(),this.tag=t.tag,this.always=!!t.always,this.count=t.count,this.empty=t.empty,this.$count=t.$count||"count",this.$=t.$,this.childXform=t.childXform,this.maxItems=t.maxItems}prepare(t,e){const{childXform:r}=this;t&&t.forEach(((t,n)=>{e.index=n,r.prepare(t,e)}))}render(t,e){if(this.always||e&&e.length){t.openNode(this.tag,this.$),this.count&&t.addAttribute(this.$count,e&&e.length||0);const{childXform:r}=this;(e||[]).forEach(((e,n)=>{r.render(t,e,n)})),t.closeNode()}else this.empty&&t.leafNode(this.tag)}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.model=[],!0):!!this.childXform.parseOpen(t)&&(this.parser=this.childXform,!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(t,e){if(t){const{childXform:r}=this;t.forEach((t=>{r.reconcile(t,e)}))}}}},{"./base-xform":32}],72:[function(t,e,r){"use strict";const n=t("../../../utils/col-cache"),i=t("../base-xform");e.exports=class extends i{get tag(){return"autoFilter"}render(t,e){if(e)if("string"==typeof e)t.leafNode("autoFilter",{ref:e});else{const r=function(t){return"string"==typeof t?t:n.getAddress(t.row,t.column).address},i=r(e.from),s=r(e.to);i&&s&&t.leafNode("autoFilter",{ref:`${i}:${s}`})}}parseOpen(t){"autoFilter"===t.name&&(this.model=t.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(t,e,r){"use strict";const n=t("../../../utils/utils"),i=t("../base-xform"),s=t("../../../doc/range"),o=t("../../../doc/enums"),a=t("../strings/rich-text-xform");function l(t){if(null==t)return o.ValueType.Null;if(t instanceof String||"string"==typeof t)return o.ValueType.String;if("number"==typeof t)return o.ValueType.Number;if("boolean"==typeof t)return o.ValueType.Boolean;if(t instanceof Date)return o.ValueType.Date;if(t.text&&t.hyperlink)return o.ValueType.Hyperlink;if(t.formula)return o.ValueType.Formula;if(t.error)return o.ValueType.Error;throw new Error("I could not understand type of value")}e.exports=class extends i{constructor(){super(),this.richTextXForm=new a}get tag(){return"c"}prepare(t,e){const r=e.styles.addStyleModel(t.style||{},function(t){return t.type===o.ValueType.Formula?l(t.result):t.type}(t));switch(r&&(t.styleId=r),t.comment&&e.comments.push({...t.comment,ref:t.address}),t.type){case o.ValueType.String:case o.ValueType.RichText:e.sharedStrings&&(t.ssId=e.sharedStrings.add(t.value));break;case o.ValueType.Date:e.date1904&&(t.date1904=!0);break;case o.ValueType.Hyperlink:e.sharedStrings&&void 0!==t.text&&null!==t.text&&(t.ssId=e.sharedStrings.add(t.text)),e.hyperlinks.push({address:t.address,target:t.hyperlink,tooltip:t.tooltip});break;case o.ValueType.Merge:e.merges.add(t);break;case o.ValueType.Formula:if(e.date1904&&(t.date1904=!0),"shared"===t.shareType&&(t.si=e.siFormulae++),t.formula)e.formulae[t.address]=t;else if(t.sharedFormula){const r=e.formulae[t.sharedFormula];if(!r)throw new Error("Shared Formula master must exist above and or left of clone for cell "+t.address);void 0===r.si?(r.shareType="shared",r.si=e.siFormulae++,r.range=new s(r.address,t.address)):r.range&&r.range.expandToAddress(t.address),t.si=r.si}}}renderFormula(t,e){let r=null;switch(e.shareType){case"shared":r={t:"shared",ref:e.ref||e.range.range,si:e.si};break;case"array":r={t:"array",ref:e.ref};break;default:void 0!==e.si&&(r={t:"shared",si:e.si})}switch(l(e.result)){case o.ValueType.Null:t.leafNode("f",r,e.formula);break;case o.ValueType.String:t.addAttribute("t","str"),t.leafNode("f",r,e.formula),t.leafNode("v",null,e.result);break;case o.ValueType.Number:t.leafNode("f",r,e.formula),t.leafNode("v",null,e.result);break;case o.ValueType.Boolean:t.addAttribute("t","b"),t.leafNode("f",r,e.formula),t.leafNode("v",null,e.result?1:0);break;case o.ValueType.Error:t.addAttribute("t","e"),t.leafNode("f",r,e.formula),t.leafNode("v",null,e.result.error);break;case o.ValueType.Date:t.leafNode("f",r,e.formula),t.leafNode("v",null,n.dateToExcel(e.result,e.date1904));break;default:throw new Error("I could not understand type of value")}}render(t,e){if(e.type!==o.ValueType.Null||e.styleId){switch(t.openNode("c"),t.addAttribute("r",e.address),e.styleId&&t.addAttribute("s",e.styleId),e.type){case o.ValueType.Null:break;case o.ValueType.Number:t.leafNode("v",null,e.value);break;case o.ValueType.Boolean:t.addAttribute("t","b"),t.leafNode("v",null,e.value?"1":"0");break;case o.ValueType.Error:t.addAttribute("t","e"),t.leafNode("v",null,e.value.error);break;case o.ValueType.String:case o.ValueType.RichText:void 0!==e.ssId?(t.addAttribute("t","s"),t.leafNode("v",null,e.ssId)):e.value&&e.value.richText?(t.addAttribute("t","inlineStr"),t.openNode("is"),e.value.richText.forEach((e=>{this.richTextXForm.render(t,e)})),t.closeNode("is")):(t.addAttribute("t","str"),t.leafNode("v",null,e.value));break;case o.ValueType.Date:t.leafNode("v",null,n.dateToExcel(e.value,e.date1904));break;case o.ValueType.Hyperlink:void 0!==e.ssId?(t.addAttribute("t","s"),t.leafNode("v",null,e.ssId)):(t.addAttribute("t","str"),t.leafNode("v",null,e.text));break;case o.ValueType.Formula:this.renderFormula(t,e);case o.ValueType.Merge:}t.closeNode()}}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"c":return this.model={address:t.attributes.r},this.t=t.attributes.t,t.attributes.s&&(this.model.styleId=parseInt(t.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=t.attributes.si,this.model.shareType=t.attributes.t,this.model.ref=t.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(t),!0;default:return!1}}parseText(t){if(this.parser)this.parser.parseText(t);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+t:t;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+t:t:this.model.value=this.model.value?this.model.value+t:t}}parseClose(t){switch(t){case"c":{const{model:t}=this;if(t.formula||t.shareType)t.type=o.ValueType.Formula,t.value&&("str"===this.t?t.result=n.xmlDecode(t.value):"b"===this.t?t.result=0!==parseInt(t.value,10):"e"===this.t?t.result={error:t.value}:t.result=parseFloat(t.value),t.value=void 0);else if(void 0!==t.value)switch(this.t){case"s":t.type=o.ValueType.String,t.value=parseInt(t.value,10);break;case"str":t.type=o.ValueType.String,t.value=n.xmlDecode(t.value);break;case"inlineStr":t.type=o.ValueType.String;break;case"b":t.type=o.ValueType.Boolean,t.value=0!==parseInt(t.value,10);break;case"e":t.type=o.ValueType.Error,t.value={error:t.value};break;default:t.type=o.ValueType.Number,t.value=parseFloat(t.value)}else t.styleId?t.type=o.ValueType.Null:t.type=o.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(t),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(t),!0)}}reconcile(t,e){const r=t.styleId&&e.styles&&e.styles.getStyleModel(t.styleId);switch(r&&(t.style=r),void 0!==t.styleId&&(t.styleId=void 0),t.type){case o.ValueType.String:"number"==typeof t.value&&e.sharedStrings&&(t.value=e.sharedStrings.getString(t.value)),t.value.richText&&(t.type=o.ValueType.RichText);break;case o.ValueType.Number:r&&n.isDateFmt(r.numFmt)&&(t.type=o.ValueType.Date,t.value=n.excelToDate(t.value,e.date1904));break;case o.ValueType.Formula:void 0!==t.result&&r&&n.isDateFmt(r.numFmt)&&(t.result=n.excelToDate(t.result,e.date1904)),"shared"===t.shareType&&(t.ref?e.formulae[t.si]=t.address:(t.sharedFormula=e.formulae[t.si],delete t.shareType),delete t.si)}const i=e.hyperlinkMap[t.address];i&&(t.type===o.ValueType.Formula?(t.text=t.result,t.result=void 0):(t.text=t.value,t.value=void 0),t.type=o.ValueType.Hyperlink,t.hyperlink=i);const s=e.commentsMap&&e.commentsMap[t.address];s&&(t.comment=s)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(t,e,r){"use strict";const n=t("../../base-xform");e.exports=class extends n{get tag(){return"x14:cfIcon"}render(t,e){t.leafNode(this.tag,{iconSet:e.iconSet,iconId:e.iconId})}parseOpen(t){let{attributes:e}=t;this.model={iconSet:e.iconSet,iconId:n.toIntValue(e.iconId)}}parseClose(t){return t!==this.tag}}},{"../../base-xform":32}],75:[function(t,e,r){"use strict";const{v4:n}=t("uuid"),i=t("../../base-xform"),s=t("../../composite-xform"),o=t("./databar-ext-xform"),a=t("./icon-set-ext-xform"),l={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class u extends s{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new o,"x14:iconSet":this.iconSetXform=new a}}get tag(){return"x14:cfRule"}static isExt(t){return"dataBar"===t.type?o.isExt(t):!("iconSet"!==t.type||!t.custom&&!l[t.iconSet])}prepare(t){u.isExt(t)&&(t.x14Id=`{${n()}}`.toUpperCase())}render(t,e){if(u.isExt(e))switch(e.type){case"dataBar":this.renderDataBar(t,e);break;case"iconSet":this.renderIconSet(t,e)}}renderDataBar(t,e){t.openNode(this.tag,{type:"dataBar",id:e.x14Id}),this.databarXform.render(t,e),t.closeNode()}renderIconSet(t,e){t.openNode(this.tag,{type:"iconSet",priority:e.priority,id:e.x14Id||`{${n()}}`}),this.iconSetXform.render(t,e),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{type:e.type,x14Id:e.id,priority:i.toIntValue(e.priority)}}onParserClose(t,e){Object.assign(this.model,e.model)}}e.exports=u},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(t,e,r){"use strict";const n=t("../../composite-xform"),i=t("./f-ext-xform");e.exports=class extends n{constructor(){super(),this.map={"xm:f":this.fExtXform=new i}}get tag(){return"x14:cfvo"}render(t,e){t.openNode(this.tag,{type:e.type}),void 0!==e.value&&this.fExtXform.render(t,e.value),t.closeNode()}createNewModel(t){return{type:t.attributes.type}}onParserClose(t,e){"xm:f"===t&&(this.model.value=e.model?parseFloat(e.model):0)}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(t,e,r){"use strict";const n=t("../../composite-xform"),i=t("./sqref-ext-xform"),s=t("./cf-rule-ext-xform");e.exports=class extends n{constructor(){super(),this.map={"xm:sqref":this.sqRef=new i,"x14:cfRule":this.cfRule=new s}}get tag(){return"x14:conditionalFormatting"}prepare(t,e){t.rules.forEach((t=>{this.cfRule.prepare(t,e)}))}render(t,e){e.rules.some(s.isExt)&&(t.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),e.rules.filter(s.isExt).forEach((e=>this.cfRule.render(t,e))),this.sqRef.render(t,e.ref),t.closeNode())}createNewModel(){return{rules:[]}}onParserClose(t,e){switch(t){case"xm:sqref":this.model.ref=e.model;break;case"x14:cfRule":this.model.rules.push(e.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(t,e,r){"use strict";const n=t("../../composite-xform"),i=t("./cf-rule-ext-xform"),s=t("./conditional-formatting-ext-xform");e.exports=class extends n{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new s}}get tag(){return"x14:conditionalFormattings"}hasContent(t){return void 0===t.hasExtContent&&(t.hasExtContent=t.some((t=>t.rules.some(i.isExt)))),t.hasExtContent}prepare(t,e){t.forEach((t=>{this.cfXform.prepare(t,e)}))}render(t,e){this.hasContent(e)&&(t.openNode(this.tag),e.forEach((e=>this.cfXform.render(t,e))),t.closeNode())}createNewModel(){return[]}onParserClose(t,e){this.model.push(e.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(t,e,r){"use strict";const n=t("../../base-xform"),i=t("../../composite-xform"),s=t("../../style/color-xform"),o=t("./cfvo-ext-xform");e.exports=class extends i{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new o,"x14:borderColor":this.borderColorXform=new s("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new s("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new s("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new s("x14:axisColor")}}static isExt(t){return!t.gradient}get tag(){return"x14:dataBar"}render(t,e){t.openNode(this.tag,{minLength:n.toIntAttribute(e.minLength,0,!0),maxLength:n.toIntAttribute(e.maxLength,100,!0),border:n.toBoolAttribute(e.border,!1),gradient:n.toBoolAttribute(e.gradient,!0),negativeBarColorSameAsPositive:n.toBoolAttribute(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:n.toBoolAttribute(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:n.toAttribute(e.axisPosition,"auto"),direction:n.toAttribute(e.direction,"leftToRight")}),e.cfvo.forEach((e=>{this.cfvoXform.render(t,e)})),this.borderColorXform.render(t,e.borderColor),this.negativeBorderColorXform.render(t,e.negativeBorderColor),this.negativeFillColorXform.render(t,e.negativeFillColor),this.axisColorXform.render(t,e.axisColor),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],minLength:n.toIntValue(e.minLength,0),maxLength:n.toIntValue(e.maxLength,100),border:n.toBoolValue(e.border,!1),gradient:n.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:n.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:n.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:n.toStringValue(e.axisPosition,"auto"),direction:n.toStringValue(e.direction,"leftToRight")}}onParserClose(t,e){const[,r]=t.split(":");"cfvo"===r?this.model.cfvo.push(e.model):this.model[r]=e.model}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(t,e,r){"use strict";const n=t("../../base-xform");e.exports=class extends n{get tag(){return"xm:f"}render(t,e){t.leafNode(this.tag,null,e)}parseOpen(){this.model=""}parseText(t){this.model+=t}parseClose(t){return t!==this.tag}}},{"../../base-xform":32}],81:[function(t,e,r){"use strict";const n=t("../../base-xform"),i=t("../../composite-xform"),s=t("./cfvo-ext-xform"),o=t("./cf-icon-ext-xform");e.exports=class extends i{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new s,"x14:cfIcon":this.cfIconXform=new o}}get tag(){return"x14:iconSet"}render(t,e){t.openNode(this.tag,{iconSet:n.toStringAttribute(e.iconSet),reverse:n.toBoolAttribute(e.reverse,!1),showValue:n.toBoolAttribute(e.showValue,!0),custom:n.toBoolAttribute(e.icons,!1)}),e.cfvo.forEach((e=>{this.cfvoXform.render(t,e)})),e.icons&&e.icons.forEach(((e,r)=>{e.iconId=r,this.cfIconXform.render(t,e)})),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{cfvo:[],iconSet:n.toStringValue(e.iconSet,"3TrafficLights"),reverse:n.toBoolValue(e.reverse,!1),showValue:n.toBoolValue(e.showValue,!0)}}onParserClose(t,e){const[,r]=t.split(":");switch(r){case"cfvo":this.model.cfvo.push(e.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(e.model);break;default:this.model[r]=e.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(t,e,r){"use strict";const n=t("../../base-xform");e.exports=class extends n{get tag(){return"xm:sqref"}render(t,e){t.leafNode(this.tag,null,e)}parseOpen(){this.model=""}parseText(t){this.model+=t}parseClose(t){return t!==this.tag}}},{"../../base-xform":32}],83:[function(t,e,r){"use strict";const n=t("../../base-xform"),i=t("../../composite-xform"),s=t("../../../../doc/range"),o=t("./databar-xform"),a=t("./ext-lst-ref-xform"),l=t("./formula-xform"),u=t("./color-scale-xform"),c=t("./icon-set-xform"),h={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},d=t=>{const{type:e,operator:r}=t;switch(e){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:e};default:return{type:e,operator:r}}};class f extends i{constructor(){super(),this.map={dataBar:this.databarXform=new o,extLst:this.extLstRefXform=new a,formula:this.formulaXform=new l,colorScale:this.colorScaleXform=new u,iconSet:this.iconSetXform=new c}}get tag(){return"cfRule"}static isPrimitive(t){return"iconSet"!==t.type||!t.custom&&!h[t.iconSet]}render(t,e){switch(e.type){case"expression":this.renderExpression(t,e);break;case"cellIs":this.renderCellIs(t,e);break;case"top10":this.renderTop10(t,e);break;case"aboveAverage":this.renderAboveAverage(t,e);break;case"dataBar":this.renderDataBar(t,e);break;case"colorScale":this.renderColorScale(t,e);break;case"iconSet":this.renderIconSet(t,e);break;case"containsText":this.renderText(t,e);break;case"timePeriod":this.renderTimePeriod(t,e)}}renderExpression(t,e){t.openNode(this.tag,{type:"expression",dxfId:e.dxfId,priority:e.priority}),this.formulaXform.render(t,e.formulae[0]),t.closeNode()}renderCellIs(t,e){t.openNode(this.tag,{type:"cellIs",dxfId:e.dxfId,priority:e.priority,operator:e.operator}),e.formulae.forEach((e=>{this.formulaXform.render(t,e)})),t.closeNode()}renderTop10(t,e){t.leafNode(this.tag,{type:"top10",dxfId:e.dxfId,priority:e.priority,percent:n.toBoolAttribute(e.percent,!1),bottom:n.toBoolAttribute(e.bottom,!1),rank:n.toIntValue(e.rank,10,!0)})}renderAboveAverage(t,e){t.leafNode(this.tag,{type:"aboveAverage",dxfId:e.dxfId,priority:e.priority,aboveAverage:n.toBoolAttribute(e.aboveAverage,!0)})}renderDataBar(t,e){t.openNode(this.tag,{type:"dataBar",priority:e.priority}),this.databarXform.render(t,e),this.extLstRefXform.render(t,e),t.closeNode()}renderColorScale(t,e){t.openNode(this.tag,{type:"colorScale",priority:e.priority}),this.colorScaleXform.render(t,e),t.closeNode()}renderIconSet(t,e){f.isPrimitive(e)&&(t.openNode(this.tag,{type:"iconSet",priority:e.priority}),this.iconSetXform.render(t,e),t.closeNode())}renderText(t,e){t.openNode(this.tag,{type:e.operator,dxfId:e.dxfId,priority:e.priority,operator:n.toStringAttribute(e.operator,"containsText")});const r=(t=>{if(t.formulae&&t.formulae[0])return t.formulae[0];const e=new s(t.ref),{tl:r}=e;switch(t.operator){case"containsText":return`NOT(ISERROR(SEARCH("${t.text}",${r})))`;case"containsBlanks":return`LEN(TRIM(${r}))=0`;case"notContainsBlanks":return`LEN(TRIM(${r}))>0`;case"containsErrors":return`ISERROR(${r})`;case"notContainsErrors":return`NOT(ISERROR(${r}))`;default:return}})(e);r&&this.formulaXform.render(t,r),t.closeNode()}renderTimePeriod(t,e){t.openNode(this.tag,{type:"timePeriod",dxfId:e.dxfId,priority:e.priority,timePeriod:e.timePeriod});const r=(t=>{if(t.formulae&&t.formulae[0])return t.formulae[0];const e=new s(t.ref),{tl:r}=e;switch(t.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${r},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${r},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${r},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${r},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${r},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${r},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${r},1)=TODAY()-1`;case"today":return`FLOOR(${r},1)=TODAY()`;case"tomorrow":return`FLOOR(${r},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${r},1)<=6,FLOOR(${r},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${r})=MONTH(EDATE(TODAY(),0-1)),YEAR(${r})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${r})=MONTH(TODAY()),YEAR(${r})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${r})=MONTH(EDATE(TODAY(),0+1)),YEAR(${r})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(e);r&&this.formulaXform.render(t,r),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{...d(e),dxfId:n.toIntValue(e.dxfId),priority:n.toIntValue(e.priority),timePeriod:e.timePeriod,percent:n.toBoolValue(e.percent),bottom:n.toBoolValue(e.bottom),rank:n.toIntValue(e.rank),aboveAverage:n.toBoolValue(e.aboveAverage)}}onParserClose(t,e){switch(t){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,e.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(e.model)}}}e.exports=f},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(t,e,r){"use strict";const n=t("../../base-xform");e.exports=class extends n{get tag(){return"cfvo"}render(t,e){t.leafNode(this.tag,{type:e.type,val:e.value})}parseOpen(t){this.model={type:t.attributes.type,value:n.toFloatValue(t.attributes.val)}}parseClose(t){return t!==this.tag}}},{"../../base-xform":32}],85:[function(t,e,r){"use strict";const n=t("../../composite-xform"),i=t("../../style/color-xform"),s=t("./cfvo-xform");e.exports=class extends n{constructor(){super(),this.map={cfvo:this.cfvoXform=new s,color:this.colorXform=new i}}get tag(){return"colorScale"}render(t,e){t.openNode(this.tag),e.cfvo.forEach((e=>{this.cfvoXform.render(t,e)})),e.color.forEach((e=>{this.colorXform.render(t,e)})),t.closeNode()}createNewModel(t){return{cfvo:[],color:[]}}onParserClose(t,e){this.model[t].push(e.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(t,e,r){"use strict";const n=t("../../composite-xform"),i=t("./cf-rule-xform");e.exports=class extends n{constructor(){super(),this.map={cfRule:new i}}get tag(){return"conditionalFormatting"}render(t,e){e.rules.some(i.isPrimitive)&&(t.openNode(this.tag,{sqref:e.ref}),e.rules.forEach((r=>{i.isPrimitive(r)&&(r.ref=e.ref,this.map.cfRule.render(t,r))})),t.closeNode())}createNewModel(t){let{attributes:e}=t;return{ref:e.sqref,rules:[]}}onParserClose(t,e){this.model.rules.push(e.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(t,e,r){"use strict";const n=t("../../base-xform"),i=t("./conditional-formatting-xform");e.exports=class extends n{constructor(){super(),this.cfXform=new i}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(t,e){let r=t.reduce(((t,e)=>Math.max(t,...e.rules.map((t=>t.priority||0)))),1);t.forEach((t=>{t.rules.forEach((t=>{t.priority||(t.priority=r++),t.style&&(t.dxfId=e.styles.addDxfStyle(t.style))}))}))}render(t,e){e.forEach((e=>{this.cfXform.render(t,e)}))}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):"conditionalFormatting"===t.name&&(this.parser=this.cfXform,this.parser.parseOpen(t),!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return!(!this.parser||!this.parser.parseClose(t)&&(this.model.push(this.parser.model),this.parser=void 0,1))}reconcile(t,e){t.forEach((t=>{t.rules.forEach((t=>{void 0!==t.dxfId&&(t.style=e.styles.getDxfStyle(t.dxfId),delete t.dxfId)}))}))}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(t,e,r){"use strict";const n=t("../../composite-xform"),i=t("../../style/color-xform"),s=t("./cfvo-xform");e.exports=class extends n{constructor(){super(),this.map={cfvo:this.cfvoXform=new s,color:this.colorXform=new i}}get tag(){return"dataBar"}render(t,e){t.openNode(this.tag),e.cfvo.forEach((e=>{this.cfvoXform.render(t,e)})),this.colorXform.render(t,e.color),t.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(t,e){switch(t){case"cfvo":this.model.cfvo.push(e.model);break;case"color":this.model.color=e.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(t,e,r){"use strict";const n=t("../../base-xform"),i=t("../../composite-xform");class s extends n{get tag(){return"x14:id"}render(t,e){t.leafNode(this.tag,null,e)}parseOpen(){this.model=""}parseText(t){this.model+=t}parseClose(t){return t!==this.tag}}class o extends i{constructor(){super(),this.map={"x14:id":this.idXform=new s}}get tag(){return"ext"}render(t,e){t.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(t,e.x14Id),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){this.model.x14Id=e.model}}e.exports=class extends i{constructor(){super(),this.map={ext:new o}}get tag(){return"extLst"}render(t,e){t.openNode(this.tag),this.map.ext.render(t,e),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){Object.assign(this.model,e.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(t,e,r){"use strict";const n=t("../../base-xform");e.exports=class extends n{get tag(){return"formula"}render(t,e){t.leafNode(this.tag,null,e)}parseOpen(){this.model=""}parseText(t){this.model+=t}parseClose(t){return t!==this.tag}}},{"../../base-xform":32}],91:[function(t,e,r){"use strict";const n=t("../../base-xform"),i=t("../../composite-xform"),s=t("./cfvo-xform");e.exports=class extends i{constructor(){super(),this.map={cfvo:this.cfvoXform=new s}}get tag(){return"iconSet"}render(t,e){t.openNode(this.tag,{iconSet:n.toStringAttribute(e.iconSet,"3TrafficLights"),reverse:n.toBoolAttribute(e.reverse,!1),showValue:n.toBoolAttribute(e.showValue,!0)}),e.cfvo.forEach((e=>{this.cfvoXform.render(t,e)})),t.closeNode()}createNewModel(t){let{attributes:e}=t;return{iconSet:n.toStringValue(e.iconSet,"3TrafficLights"),reverse:n.toBoolValue(e.reverse),showValue:n.toBoolValue(e.showValue),cfvo:[]}}onParserClose(t,e){this.model[t].push(e.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(t,e,r){"use strict";const n=t("../../../utils/utils"),i=t("../base-xform");e.exports=class extends i{get tag(){return"col"}prepare(t,e){const r=e.styles.addStyleModel(t.style||{});r&&(t.styleId=r)}render(t,e){t.openNode("col"),t.addAttribute("min",e.min),t.addAttribute("max",e.max),e.width&&t.addAttribute("width",e.width),e.styleId&&t.addAttribute("style",e.styleId),e.hidden&&t.addAttribute("hidden","1"),e.bestFit&&t.addAttribute("bestFit","1"),e.outlineLevel&&t.addAttribute("outlineLevel",e.outlineLevel),e.collapsed&&t.addAttribute("collapsed","1"),t.addAttribute("customWidth","1"),t.closeNode()}parseOpen(t){if("col"===t.name){const e=this.model={min:parseInt(t.attributes.min||"0",10),max:parseInt(t.attributes.max||"0",10),width:void 0===t.attributes.width?void 0:parseFloat(t.attributes.width||"0")};return t.attributes.style&&(e.styleId=parseInt(t.attributes.style,10)),n.parseBoolean(t.attributes.hidden)&&(e.hidden=!0),n.parseBoolean(t.attributes.bestFit)&&(e.bestFit=!0),t.attributes.outlineLevel&&(e.outlineLevel=parseInt(t.attributes.outlineLevel,10)),n.parseBoolean(t.attributes.collapsed)&&(e.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(t,e){t.styleId&&(t.style=e.styles.getStyleModel(t.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(t,e,r){"use strict";const n=t("../../../utils/under-dash"),i=t("../../../utils/utils"),s=t("../../../utils/col-cache"),o=t("../base-xform"),a=t("../../../doc/range");function l(t,e,r,n){const i=e[r];void 0!==i?t[r]=i:void 0!==n&&(t[r]=n)}function u(t,e,r,n){const s=e[r];void 0!==s?t[r]=i.parseBoolean(s):void 0!==n&&(t[r]=n)}e.exports=class extends o{get tag(){return"dataValidations"}render(t,e){const r=function(t){const e=n.map(t,((t,e)=>({address:e,dataValidation:t,marked:!1}))).sort(((t,e)=>n.strcmp(t.address,e.address))),r=n.keyBy(e,"address"),i=(e,r,i)=>{for(let o=0;o<r;o++){const r=s.encodeAddress(e.row+o,i);if(!t[r]||!n.isEqual(t[e.address],t[r]))return!1}return!0};return e.map((e=>{if(!e.marked){const o=s.decodeEx(e.address);if(o.dimensions)return r[o.dimensions].marked=!0,{...e.dataValidation,sqref:e.address};let a=1,l=s.encodeAddress(o.row+a,o.col);for(;t[l]&&n.isEqual(e.dataValidation,t[l]);)a++,l=s.encodeAddress(o.row+a,o.col);let u=1;for(;i(o,a,o.col+u);)u++;for(let t=0;t<a;t++)for(let e=0;e<u;e++)l=s.encodeAddress(o.row+t,o.col+e),r[l].marked=!0;if(a>1||u>1){const t=o.row+(a-1),r=o.col+(u-1);return{...e.dataValidation,sqref:`${e.address}:${s.encodeAddress(t,r)}`}}return{...e.dataValidation,sqref:e.address}}return null})).filter(Boolean)}(e);r.length&&(t.openNode("dataValidations",{count:r.length}),r.forEach((e=>{t.openNode("dataValidation"),"any"!==e.type&&(t.addAttribute("type",e.type),e.operator&&"list"!==e.type&&"between"!==e.operator&&t.addAttribute("operator",e.operator),e.allowBlank&&t.addAttribute("allowBlank","1")),e.showInputMessage&&t.addAttribute("showInputMessage","1"),e.promptTitle&&t.addAttribute("promptTitle",e.promptTitle),e.prompt&&t.addAttribute("prompt",e.prompt),e.showErrorMessage&&t.addAttribute("showErrorMessage","1"),e.errorStyle&&t.addAttribute("errorStyle",e.errorStyle),e.errorTitle&&t.addAttribute("errorTitle",e.errorTitle),e.error&&t.addAttribute("error",e.error),t.addAttribute("sqref",e.sqref),(e.formulae||[]).forEach(((r,n)=>{t.openNode("formula"+(n+1)),"date"===e.type?t.writeText(i.dateToExcel(new Date(r))):t.writeText(r),t.closeNode()})),t.closeNode()})),t.closeNode())}parseOpen(t){switch(t.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=t.attributes.sqref;const e={type:t.attributes.type||"any",formulae:[]};switch(t.attributes.type&&u(e,t.attributes,"allowBlank"),u(e,t.attributes,"showInputMessage"),u(e,t.attributes,"showErrorMessage"),e.type){case"any":case"list":case"custom":break;default:l(e,t.attributes,"operator","between")}return l(e,t.attributes,"promptTitle"),l(e,t.attributes,"prompt"),l(e,t.attributes,"errorStyle"),l(e,t.attributes,"errorTitle"),l(e,t.attributes,"error"),this._dataValidation=e,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(t){this._formula&&this._formula.push(t)}parseClose(t){switch(t){case"dataValidations":return!1;case"dataValidation":return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach((t=>{t.includes(":")?new a(t).forEachAddress((t=>{this.model[t]=this._dataValidation})):this.model[t]=this._dataValidation})),!0;case"formula1":case"formula2":{let t=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":t=parseInt(t,10);break;case"decimal":t=parseFloat(t);break;case"date":t=i.excelToDate(parseFloat(t))}return this._dataValidation.formulae.push(t),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"dimension"}render(t,e){e&&t.leafNode("dimension",{ref:e})}parseOpen(t){return"dimension"===t.name&&(this.model=t.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"drawing"}render(t,e){e&&t.leafNode(this.tag,{"r:id":e.rId})}parseOpen(t){return t.name===this.tag&&(this.model={rId:t.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(t,e,r){"use strict";const n=t("../composite-xform"),i=t("./cf-ext/conditional-formattings-ext-xform");class s extends n{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new i}}get tag(){return"ext"}hasContent(t){return this.conditionalFormattings.hasContent(t.conditionalFormattings)}prepare(t,e){this.conditionalFormattings.prepare(t.conditionalFormattings,e)}render(t,e){t.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(t,e.conditionalFormattings),t.closeNode()}createNewModel(){return{}}onParserClose(t,e){this.model[t]=e.model}}e.exports=class extends n{constructor(){super(),this.map={ext:this.ext=new s}}get tag(){return"extLst"}prepare(t,e){this.ext.prepare(t,e)}hasContent(t){return this.ext.hasContent(t)}render(t,e){this.hasContent(e)&&(t.openNode("extLst"),this.ext.render(t,e),t.closeNode())}createNewModel(){return{}}onParserClose(t,e){Object.assign(this.model,e.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"headerFooter"}render(t,e){if(e){t.addRollback();let r=!1;t.openNode("headerFooter"),e.differentFirst&&(t.addAttribute("differentFirst","1"),r=!0),e.differentOddEven&&(t.addAttribute("differentOddEven","1"),r=!0),e.oddHeader&&"string"==typeof e.oddHeader&&(t.leafNode("oddHeader",null,e.oddHeader),r=!0),e.oddFooter&&"string"==typeof e.oddFooter&&(t.leafNode("oddFooter",null,e.oddFooter),r=!0),e.evenHeader&&"string"==typeof e.evenHeader&&(t.leafNode("evenHeader",null,e.evenHeader),r=!0),e.evenFooter&&"string"==typeof e.evenFooter&&(t.leafNode("evenFooter",null,e.evenFooter),r=!0),e.firstHeader&&"string"==typeof e.firstHeader&&(t.leafNode("firstHeader",null,e.firstHeader),r=!0),e.firstFooter&&"string"==typeof e.firstFooter&&(t.leafNode("firstFooter",null,e.firstFooter),r=!0),r?(t.closeNode(),t.commit()):t.rollback()}}parseOpen(t){switch(t.name){case"headerFooter":return this.model={},t.attributes.differentFirst&&(this.model.differentFirst=1===parseInt(t.attributes.differentFirst,0)),t.attributes.differentOddEven&&(this.model.differentOddEven=1===parseInt(t.attributes.differentOddEven,0)),!0;case"oddHeader":return this.currentNode="oddHeader",!0;case"oddFooter":return this.currentNode="oddFooter",!0;case"evenHeader":return this.currentNode="evenHeader",!0;case"evenFooter":return this.currentNode="evenFooter",!0;case"firstHeader":return this.currentNode="firstHeader",!0;case"firstFooter":return this.currentNode="firstFooter",!0;default:return!1}}parseText(t){switch(this.currentNode){case"oddHeader":this.model.oddHeader=t;break;case"oddFooter":this.model.oddFooter=t;break;case"evenHeader":this.model.evenHeader=t;break;case"evenFooter":this.model.evenFooter=t;break;case"firstHeader":this.model.firstHeader=t;break;case"firstFooter":this.model.firstFooter=t}}parseClose(){switch(this.currentNode){case"oddHeader":case"oddFooter":case"evenHeader":case"evenFooter":case"firstHeader":case"firstFooter":return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"hyperlink"}render(t,e){this.isInternalLink(e)?t.leafNode("hyperlink",{ref:e.address,"r:id":e.rId,tooltip:e.tooltip,location:e.target}):t.leafNode("hyperlink",{ref:e.address,"r:id":e.rId,tooltip:e.tooltip})}parseOpen(t){return"hyperlink"===t.name&&(this.model={address:t.attributes.ref,rId:t.attributes["r:id"],tooltip:t.attributes.tooltip},t.attributes.location&&(this.model.target=t.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(t){return t.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(t.target)}}},{"../base-xform":32}],99:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"mergeCell"}render(t,e){t.leafNode("mergeCell",{ref:e})}parseOpen(t){return"mergeCell"===t.name&&(this.model=t.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(t,e,r){"use strict";const n=t("../../../utils/under-dash"),i=t("../../../doc/range"),s=t("../../../utils/col-cache"),o=t("../../../doc/enums");e.exports=class{constructor(){this.merges={}}add(t){if(this.merges[t.master])this.merges[t.master].expandToAddress(t.address);else{const e=`${t.master}:${t.address}`;this.merges[t.master]=new i(e)}}get mergeCells(){return n.map(this.merges,(t=>t.range))}reconcile(t,e){n.each(t,(t=>{const r=s.decode(t);for(let t=r.top;t<=r.bottom;t++){const n=e[t-1];for(let e=r.left;e<=r.right;e++){const i=n.cells[e-1];i?i.type===o.ValueType.Merge&&(i.master=r.tl):n.cells[e]={type:o.ValueType.Null,address:s.encodeAddress(t,e)}}}}))}getMasterAddress(t){const e=this.hash[t];return e&&e.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t=>void 0!==t;e.exports=class extends n{get tag(){return"outlinePr"}render(t,e){return!(!e||!i(e.summaryBelow)&&!i(e.summaryRight)||(t.leafNode(this.tag,{summaryBelow:i(e.summaryBelow)?Number(e.summaryBelow):void 0,summaryRight:i(e.summaryRight)?Number(e.summaryRight):void 0}),0))}parseOpen(t){return t.name===this.tag&&(this.model={summaryBelow:i(t.attributes.summaryBelow)?Boolean(Number(t.attributes.summaryBelow)):void 0,summaryRight:i(t.attributes.summaryRight)?Boolean(Number(t.attributes.summaryRight)):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"brk"}render(t,e){t.leafNode("brk",e)}parseOpen(t){return"brk"===t.name&&(this.model=t.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(t,e,r){"use strict";const n=t("../../../utils/under-dash"),i=t("../base-xform");e.exports=class extends i{get tag(){return"pageMargins"}render(t,e){if(e){const r={left:e.left,right:e.right,top:e.top,bottom:e.bottom,header:e.header,footer:e.footer};n.some(r,(t=>void 0!==t))&&t.leafNode(this.tag,r)}}parseOpen(t){return t.name===this.tag&&(this.model={left:parseFloat(t.attributes.left||.7),right:parseFloat(t.attributes.right||.7),top:parseFloat(t.attributes.top||.75),bottom:parseFloat(t.attributes.bottom||.75),header:parseFloat(t.attributes.header||.3),footer:parseFloat(t.attributes.footer||.3)},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"pageSetUpPr"}render(t,e){return!(!e||!e.fitToPage||(t.leafNode(this.tag,{fitToPage:e.fitToPage?"1":void 0}),0))}parseOpen(t){return t.name===this.tag&&(this.model={fitToPage:"1"===t.attributes.fitToPage},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(t,e,r){"use strict";const n=t("../../../utils/under-dash"),i=t("../base-xform");function s(t){return t?"1":void 0}function o(t){if("overThenDown"===t)return t}function a(t){switch(t){case"atEnd":case"asDisplyed":return t;default:return}}function l(t){switch(t){case"dash":case"blank":case"NA":return t;default:return}}e.exports=class extends i{get tag(){return"pageSetup"}render(t,e){if(e){const r={paperSize:e.paperSize,orientation:e.orientation,horizontalDpi:e.horizontalDpi,verticalDpi:e.verticalDpi,pageOrder:o(e.pageOrder),blackAndWhite:s(e.blackAndWhite),draft:s(e.draft),cellComments:a(e.cellComments),errors:l(e.errors),scale:e.scale,fitToWidth:e.fitToWidth,fitToHeight:e.fitToHeight,firstPageNumber:e.firstPageNumber,useFirstPageNumber:s(e.firstPageNumber),usePrinterDefaults:s(e.usePrinterDefaults),copies:e.copies};n.some(r,(t=>void 0!==t))&&t.leafNode(this.tag,r)}}parseOpen(t){return t.name===this.tag&&(this.model={paperSize:(e=t.attributes.paperSize,void 0!==e?parseInt(e,10):void 0),orientation:t.attributes.orientation||"portrait",horizontalDpi:parseInt(t.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(t.attributes.verticalDpi||"4294967295",10),pageOrder:t.attributes.pageOrder||"downThenOver",blackAndWhite:"1"===t.attributes.blackAndWhite,draft:"1"===t.attributes.draft,cellComments:t.attributes.cellComments||"None",errors:t.attributes.errors||"displayed",scale:parseInt(t.attributes.scale||"100",10),fitToWidth:parseInt(t.attributes.fitToWidth||"1",10),fitToHeight:parseInt(t.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(t.attributes.firstPageNumber||"1",10),useFirstPageNumber:"1"===t.attributes.useFirstPageNumber,usePrinterDefaults:"1"===t.attributes.usePrinterDefaults,copies:parseInt(t.attributes.copies||"1",10)},!0);var e}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"picture"}render(t,e){e&&t.leafNode(this.tag,{"r:id":e.rId})}parseOpen(t){return t.name===this.tag&&(this.model={rId:t.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(t,e,r){"use strict";const n=t("../../../utils/under-dash"),i=t("../base-xform");function s(t){return t?"1":void 0}e.exports=class extends i{get tag(){return"printOptions"}render(t,e){if(e){const r={headings:s(e.showRowColHeaders),gridLines:s(e.showGridLines),horizontalCentered:s(e.horizontalCentered),verticalCentered:s(e.verticalCentered)};n.some(r,(t=>void 0!==t))&&t.leafNode(this.tag,r)}}parseOpen(t){return t.name===this.tag&&(this.model={showRowColHeaders:"1"===t.attributes.headings,showGridLines:"1"===t.attributes.gridLines,horizontalCentered:"1"===t.attributes.horizontalCentered,verticalCentered:"1"===t.attributes.verticalCentered},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(t,e,r){"use strict";const n=t("./page-breaks-xform"),i=t("../list-xform");e.exports=class extends i{constructor(){super({tag:"rowBreaks",count:!0,childXform:new n})}render(t,e){if(e&&e.length){t.openNode(this.tag,this.$),this.count&&(t.addAttribute(this.$count,e.length),t.addAttribute("manualBreakCount",e.length));const{childXform:r}=this;e.forEach((e=>{r.render(t,e)})),t.closeNode()}else this.empty&&t.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("../../../utils/utils"),s=t("./cell-xform");e.exports=class extends n{constructor(t){super(),this.maxItems=t&&t.maxItems,this.map={c:new s}}get tag(){return"row"}prepare(t,e){const r=e.styles.addStyleModel(t.style);r&&(t.styleId=r);const n=this.map.c;t.cells.forEach((t=>{n.prepare(t,e)}))}render(t,e,r){t.openNode("row"),t.addAttribute("r",e.number),e.height&&(t.addAttribute("ht",e.height),t.addAttribute("customHeight","1")),e.hidden&&t.addAttribute("hidden","1"),e.min>0&&e.max>0&&e.min<=e.max&&t.addAttribute("spans",`${e.min}:${e.max}`),e.styleId&&(t.addAttribute("s",e.styleId),t.addAttribute("customFormat","1")),t.addAttribute("x14ac:dyDescent","0.25"),e.outlineLevel&&t.addAttribute("outlineLevel",e.outlineLevel),e.collapsed&&t.addAttribute("collapsed","1");const n=this.map.c;e.cells.forEach((e=>{n.render(t,e,r)})),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;if("row"===t.name){this.numRowsSeen+=1;const e=t.attributes.spans?t.attributes.spans.split(":").map((t=>parseInt(t,10))):[void 0,void 0],r=this.model={number:parseInt(t.attributes.r,10),min:e[0],max:e[1],cells:[]};return t.attributes.s&&(r.styleId=parseInt(t.attributes.s,10)),i.parseBoolean(t.attributes.hidden)&&(r.hidden=!0),i.parseBoolean(t.attributes.bestFit)&&(r.bestFit=!0),t.attributes.ht&&(r.height=parseFloat(t.attributes.ht)),t.attributes.outlineLevel&&(r.outlineLevel=parseInt(t.attributes.outlineLevel,10)),i.parseBoolean(t.attributes.collapsed)&&(r.collapsed=!0),!0}return this.parser=this.map[t.name],!!this.parser&&(this.parser.parseOpen(t),!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(t,e){t.style=t.styleId?e.styles.getStyleModel(t.styleId):{},void 0!==t.styleId&&(t.styleId=void 0);const r=this.map.c;t.cells.forEach((t=>{r.reconcile(t,e)}))}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(t,e,r){"use strict";const n=t("../../../utils/under-dash"),i=t("../base-xform");e.exports=class extends i{get tag(){return"sheetFormatPr"}render(t,e){if(e){const r={defaultRowHeight:e.defaultRowHeight,outlineLevelRow:e.outlineLevelRow,outlineLevelCol:e.outlineLevelCol,"x14ac:dyDescent":e.dyDescent};e.defaultColWidth&&(r.defaultColWidth=e.defaultColWidth),e.defaultRowHeight&&15===e.defaultRowHeight||(r.customHeight="1"),n.some(r,(t=>void 0!==t))&&t.leafNode("sheetFormatPr",r)}}parseOpen(t){return"sheetFormatPr"===t.name&&(this.model={defaultRowHeight:parseFloat(t.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(t.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(t.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(t.attributes.outlineLevelCol||"0",10)},t.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(t.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("../style/color-xform"),s=t("./page-setup-properties-xform"),o=t("./outline-properties-xform");e.exports=class extends n{constructor(){super(),this.map={tabColor:new i("tabColor"),pageSetUpPr:new s,outlinePr:new o}}get tag(){return"sheetPr"}render(t,e){if(e){t.addRollback(),t.openNode("sheetPr");let r=!1;r=this.map.tabColor.render(t,e.tabColor)||r,r=this.map.pageSetUpPr.render(t,e.pageSetup)||r,r=this.map.outlinePr.render(t,e.outlineProperties)||r,r?(t.closeNode(),t.commit()):t.rollback()}}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.reset(),!0):!!this.map[t.name]&&(this.parser=this.map[t.name],this.parser.parseOpen(t),!0)}parseText(t){return!!this.parser&&(this.parser.parseText(t),!0)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(t,e,r){"use strict";const n=t("../../../utils/under-dash"),i=t("../base-xform");function s(t,e){return t?e:void 0}function o(t,e){return t===e||void 0}e.exports=class extends i{get tag(){return"sheetProtection"}render(t,e){if(e){const r={sheet:s(e.sheet,"1"),selectLockedCells:!1===e.selectLockedCells?"1":void 0,selectUnlockedCells:!1===e.selectUnlockedCells?"1":void 0,formatCells:s(e.formatCells,"0"),formatColumns:s(e.formatColumns,"0"),formatRows:s(e.formatRows,"0"),insertColumns:s(e.insertColumns,"0"),insertRows:s(e.insertRows,"0"),insertHyperlinks:s(e.insertHyperlinks,"0"),deleteColumns:s(e.deleteColumns,"0"),deleteRows:s(e.deleteRows,"0"),sort:s(e.sort,"0"),autoFilter:s(e.autoFilter,"0"),pivotTables:s(e.pivotTables,"0")};e.sheet&&(r.algorithmName=e.algorithmName,r.hashValue=e.hashValue,r.saltValue=e.saltValue,r.spinCount=e.spinCount,r.objects=s(!1===e.objects,"1"),r.scenarios=s(!1===e.scenarios,"1")),n.some(r,(t=>void 0!==t))&&t.leafNode(this.tag,r)}}parseOpen(t){return t.name===this.tag&&(this.model={sheet:o(t.attributes.sheet,"1"),objects:"1"!==t.attributes.objects&&void 0,scenarios:"1"!==t.attributes.scenarios&&void 0,selectLockedCells:"1"!==t.attributes.selectLockedCells&&void 0,selectUnlockedCells:"1"!==t.attributes.selectUnlockedCells&&void 0,formatCells:o(t.attributes.formatCells,"0"),formatColumns:o(t.attributes.formatColumns,"0"),formatRows:o(t.attributes.formatRows,"0"),insertColumns:o(t.attributes.insertColumns,"0"),insertRows:o(t.attributes.insertRows,"0"),insertHyperlinks:o(t.attributes.insertHyperlinks,"0"),deleteColumns:o(t.attributes.deleteColumns,"0"),deleteRows:o(t.attributes.deleteRows,"0"),sort:o(t.attributes.sort,"0"),autoFilter:o(t.attributes.autoFilter,"0"),pivotTables:o(t.attributes.pivotTables,"0")},t.attributes.algorithmName&&(this.model.algorithmName=t.attributes.algorithmName,this.model.hashValue=t.attributes.hashValue,this.model.saltValue=t.attributes.saltValue,this.model.spinCount=parseInt(t.attributes.spinCount,10)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(t,e,r){"use strict";const n=t("../../../utils/col-cache"),i=t("../base-xform"),s={frozen:"frozen",frozenSplit:"frozen",split:"split"};e.exports=class extends i{get tag(){return"sheetView"}prepare(t){switch(t.state){case"frozen":case"split":break;default:t.state="normal"}}render(t,e){t.openNode("sheetView",{workbookViewId:e.workbookViewId||0});const r=function(e,r,n){n&&t.addAttribute(e,r)};let i,s,o,a;switch(r("rightToLeft","1",!0===e.rightToLeft),r("tabSelected","1",e.tabSelected),r("showRuler","0",!1===e.showRuler),r("showRowColHeaders","0",!1===e.showRowColHeaders),r("showGridLines","0",!1===e.showGridLines),r("zoomScale",e.zoomScale,e.zoomScale),r("zoomScaleNormal",e.zoomScaleNormal,e.zoomScaleNormal),r("view",e.style,e.style),e.state){case"frozen":s=e.xSplit||0,o=e.ySplit||0,i=e.topLeftCell||n.getAddress(o+1,s+1).address,a=(e.xSplit&&e.ySplit?"bottomRight":e.xSplit&&"topRight")||"bottomLeft",t.leafNode("pane",{xSplit:e.xSplit||void 0,ySplit:e.ySplit||void 0,topLeftCell:i,activePane:a,state:"frozen"}),t.leafNode("selection",{pane:a,activeCell:e.activeCell,sqref:e.activeCell});break;case"split":"topLeft"===e.activePane&&(e.activePane=void 0),t.leafNode("pane",{xSplit:e.xSplit||void 0,ySplit:e.ySplit||void 0,topLeftCell:e.topLeftCell,activePane:e.activePane}),t.leafNode("selection",{pane:e.activePane,activeCell:e.activeCell,sqref:e.activeCell});break;case"normal":e.activeCell&&t.leafNode("selection",{activeCell:e.activeCell,sqref:e.activeCell})}t.closeNode()}parseOpen(t){switch(t.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(t.attributes.workbookViewId,10),rightToLeft:"1"===t.attributes.rightToLeft,tabSelected:"1"===t.attributes.tabSelected,showRuler:!("0"===t.attributes.showRuler),showRowColHeaders:!("0"===t.attributes.showRowColHeaders),showGridLines:!("0"===t.attributes.showGridLines),zoomScale:parseInt(t.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(t.attributes.zoomScaleNormal||"100",10),style:t.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(t.attributes.xSplit||"0",10),ySplit:parseInt(t.attributes.ySplit||"0",10),topLeftCell:t.attributes.topLeftCell,activePane:t.attributes.activePane||"topLeft",state:t.attributes.state},!0;case"selection":{const e=t.attributes.pane||"topLeft";return this.selections[e]={pane:e,activeCell:t.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(t){let e,r;return"sheetView"!==t||(this.sheetView&&this.pane?(e=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:s[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},"split"===this.model.state&&(e.activePane=this.pane.activePane),r=this.selections[this.pane.activePane],r&&r.activeCell&&(e.activeCell=r.activeCell),this.sheetView.style&&(e.style=this.sheetView.style)):(e=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},r=this.selections.topLeft,r&&r.activeCell&&(e.activeCell=r.activeCell),this.sheetView.style&&(e.style=this.sheetView.style)),!1)}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"tablePart"}render(t,e){e&&t.leafNode(this.tag,{"r:id":e.rId})}parseOpen(t){return t.name===this.tag&&(this.model={rId:t.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(t,e,r){"use strict";const n=t("../../../utils/under-dash"),i=t("../../../utils/col-cache"),s=t("../../../utils/xml-stream"),o=t("../../rel-type"),a=t("./merges"),l=t("../base-xform"),u=t("../list-xform"),c=t("./row-xform"),h=t("./col-xform"),d=t("./dimension-xform"),f=t("./hyperlink-xform"),p=t("./merge-cell-xform"),m=t("./data-validations-xform"),b=t("./sheet-properties-xform"),g=t("./sheet-format-properties-xform"),y=t("./sheet-view-xform"),v=t("./sheet-protection-xform"),w=t("./page-margins-xform"),_=t("./page-setup-xform"),x=t("./print-options-xform"),S=t("./auto-filter-xform"),C=t("./picture-xform"),A=t("./drawing-xform"),k=t("./table-part-xform"),T=t("./row-breaks-xform"),E=t("./header-footer-xform"),M=t("./cf/conditional-formattings-xform"),R=t("./ext-lst-xform");class I extends l{constructor(t){super();const{maxRows:e,maxCols:r,ignoreNodes:n}=t||{};this.ignoreNodes=n||[],this.map={sheetPr:new b,dimension:new d,sheetViews:new u({tag:"sheetViews",count:!1,childXform:new y}),sheetFormatPr:new g,cols:new u({tag:"cols",count:!1,childXform:new h}),sheetData:new u({tag:"sheetData",count:!1,empty:!0,childXform:new c({maxItems:r}),maxItems:e}),autoFilter:new S,mergeCells:new u({tag:"mergeCells",count:!0,childXform:new p}),rowBreaks:new T,hyperlinks:new u({tag:"hyperlinks",count:!1,childXform:new f}),pageMargins:new w,dataValidations:new m,pageSetup:new _,headerFooter:new E,printOptions:new x,picture:new C,drawing:new A,sheetProtection:new v,tableParts:new u({tag:"tableParts",count:!0,childXform:new k}),conditionalFormatting:new M,extLst:new R}}prepare(t,e){e.merges=new a,t.hyperlinks=e.hyperlinks=[],t.comments=e.comments=[],e.formulae={},e.siFormulae=0,this.map.cols.prepare(t.cols,e),this.map.sheetData.prepare(t.rows,e),this.map.conditionalFormatting.prepare(t.conditionalFormattings,e),t.mergeCells=e.merges.mergeCells;const r=t.rels=[];function n(t){return"rId"+(t.length+1)}if(t.hyperlinks.forEach((t=>{const e=n(r);t.rId=e,r.push({Id:e,Type:o.Hyperlink,Target:t.target,TargetMode:"External"})})),t.comments.length>0){const s={Id:n(r),Type:o.Comments,Target:`../comments${t.id}.xml`};r.push(s);const a={Id:n(r),Type:o.VmlDrawing,Target:`../drawings/vmlDrawing${t.id}.vml`};r.push(a),t.comments.forEach((t=>{t.refAddress=i.decodeAddress(t.ref)})),e.commentRefs.push({commentName:"comments"+t.id,vmlDrawing:"vmlDrawing"+t.id})}const s=[];let l;t.media.forEach((i=>{if("background"===i.type){const s=n(r);l=e.media[i.imageId],r.push({Id:s,Type:o.Image,Target:`../media/${l.name}.${l.extension}`}),t.background={rId:s},t.image=e.media[i.imageId]}else if("image"===i.type){let{drawing:a}=t;l=e.media[i.imageId],a||(a=t.drawing={rId:n(r),name:"drawing"+ ++e.drawingsCount,anchors:[],rels:[]},e.drawings.push(a),r.push({Id:a.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${a.name}.xml`}));let u=this.preImageId===i.imageId?s[i.imageId]:s[a.rels.length];u||(u=n(a.rels),s[a.rels.length]=u,a.rels.push({Id:u,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${l.name}.${l.extension}`}));const c={picture:{rId:u},range:i.range};if(i.hyperlinks&&i.hyperlinks.hyperlink){const t=n(a.rels);s[a.rels.length]=t,c.picture.hyperlinks={tooltip:i.hyperlinks.tooltip,rId:t},a.rels.push({Id:t,Type:o.Hyperlink,Target:i.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=i.imageId,a.anchors.push(c)}})),t.tables.forEach((t=>{const i=n(r);t.rId=i,r.push({Id:i,Type:o.Table,Target:"../tables/"+t.target}),t.columns.forEach((t=>{const{style:r}=t;r&&(t.dxfId=e.styles.addDxfStyle(r))}))})),this.map.extLst.prepare(t,e)}render(t,e){t.openXml(s.StdDocAttributes),t.openNode("worksheet",I.WORKSHEET_ATTRIBUTES);const r=e.properties?{defaultRowHeight:e.properties.defaultRowHeight,dyDescent:e.properties.dyDescent,outlineLevelCol:e.properties.outlineLevelCol,outlineLevelRow:e.properties.outlineLevelRow}:void 0;e.properties&&e.properties.defaultColWidth&&(r.defaultColWidth=e.properties.defaultColWidth);const n={outlineProperties:e.properties&&e.properties.outlineProperties,tabColor:e.properties&&e.properties.tabColor,pageSetup:e.pageSetup&&e.pageSetup.fitToPage?{fitToPage:e.pageSetup.fitToPage}:void 0},i=e.pageSetup&&e.pageSetup.margins,a={showRowColHeaders:e.pageSetup&&e.pageSetup.showRowColHeaders,showGridLines:e.pageSetup&&e.pageSetup.showGridLines,horizontalCentered:e.pageSetup&&e.pageSetup.horizontalCentered,verticalCentered:e.pageSetup&&e.pageSetup.verticalCentered},l=e.sheetProtection;this.map.sheetPr.render(t,n),this.map.dimension.render(t,e.dimensions),this.map.sheetViews.render(t,e.views),this.map.sheetFormatPr.render(t,r),this.map.cols.render(t,e.cols),this.map.sheetData.render(t,e.rows),this.map.sheetProtection.render(t,l),this.map.autoFilter.render(t,e.autoFilter),this.map.mergeCells.render(t,e.mergeCells),this.map.conditionalFormatting.render(t,e.conditionalFormattings),this.map.dataValidations.render(t,e.dataValidations),this.map.hyperlinks.render(t,e.hyperlinks),this.map.printOptions.render(t,a),this.map.pageMargins.render(t,i),this.map.pageSetup.render(t,e.pageSetup),this.map.headerFooter.render(t,e.headerFooter),this.map.rowBreaks.render(t,e.rowBreaks),this.map.drawing.render(t,e.drawing),this.map.picture.render(t,e.background),this.map.tableParts.render(t,e.tables),this.map.extLst.render(t,e),e.rels&&e.rels.forEach((e=>{e.Type===o.VmlDrawing&&t.leafNode("legacyDrawing",{"r:id":e.Id})})),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):"worksheet"===t.name?(n.each(this.map,(t=>{t.reset()})),!0):(this.map[t.name]&&!this.ignoreNodes.includes(t.name)&&(this.parser=this.map[t.name],this.parser.parseOpen(t)),!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;if("worksheet"===t){const t=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(t.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(t.outlineProperties=this.map.sheetPr.model.outlineProperties);const e={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},r=Object.assign(e,this.map.pageSetup.model,this.map.printOptions.model),n=((t,e)=>{if(!e||!e.length)return t;if(!t||!t.length)return e;const r={},n={};return t.forEach((t=>{r[t.ref]=t,t.rules.forEach((t=>{const{x14Id:e}=t;e&&(n[e]=t)}))})),e.forEach((e=>{e.rules.forEach((i=>{const s=n[i.x14Id];s?((t,e)=>{Object.keys(e).forEach((r=>{const n=t[r],i=e[r];void 0===n&&void 0!==i&&(t[r]=i)}))})(s,i):r[e.ref]?r[e.ref].rules.push(i):t.push({ref:e.ref,rules:[i]})}))})),t})(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model["x14:conditionalFormattings"]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:t,views:this.map.sheetViews.model,pageSetup:r,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:n},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}return!0}reconcile(t,e){const r=(t.relationships||[]).reduce(((r,n)=>{if(r[n.Id]=n,n.Type===o.Comments&&(t.comments=e.comments[n.Target].comments),n.Type===o.VmlDrawing&&t.comments&&t.comments.length){const r=e.vmlDrawings[n.Target].comments;t.comments.forEach(((t,e)=>{t.note=Object.assign({},t.note,r[e])}))}return r}),{});if(e.commentsMap=(t.comments||[]).reduce(((t,e)=>(e.ref&&(t[e.ref]=e),t)),{}),e.hyperlinkMap=(t.hyperlinks||[]).reduce(((t,e)=>(e.rId&&(t[e.address]=r[e.rId].Target),t)),{}),e.formulae={},t.rows=t.rows&&t.rows.filter(Boolean)||[],t.rows.forEach((t=>{t.cells=t.cells&&t.cells.filter(Boolean)||[]})),this.map.cols.reconcile(t.cols,e),this.map.sheetData.reconcile(t.rows,e),this.map.conditionalFormatting.reconcile(t.conditionalFormattings,e),t.media=[],t.drawing){const n=r[t.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(n){const r=n[1];e.drawings[r].anchors.forEach((e=>{if(e.medium){const r={type:"image",imageId:e.medium.index,range:e.range,hyperlinks:e.picture.hyperlinks};t.media.push(r)}}))}}const n=t.background&&r[t.background.rId];if(n){const r=n.Target.split("/media/")[1],i=e.mediaIndex&&e.mediaIndex[r];void 0!==i&&t.media.push({type:"background",imageId:i})}t.tables=(t.tables||[]).map((t=>{const n=r[t.rId];return e.tables[n.Target]})),delete t.relationships,delete t.hyperlinks,delete t.comments}}I.WORKSHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"},e.exports=I},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{constructor(t){super(),this.tag=t.tag,this.attr=t.attr}render(t,e){e&&(t.openNode(this.tag),t.closeNode())}parseOpen(t){t.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{constructor(t){super(),this.tag=t.tag,this.attr=t.attr,this.attrs=t.attrs,this._format=t.format||function(t){try{return Number.isNaN(t.getTime())?"":t.toISOString()}catch(t){return""}},this._parse=t.parse||function(t){return new Date(t)}}render(t,e){e&&(t.openNode(this.tag),this.attrs&&t.addAttributes(this.attrs),this.attr?t.addAttribute(this.attr,this._format(e)):t.writeText(this._format(e)),t.closeNode())}parseOpen(t){t.name===this.tag&&(this.attr?this.model=this._parse(t.attributes[this.attr]):this.text=[])}parseText(t){this.attr||this.text.push(t)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{constructor(t){super(),this.tag=t.tag,this.attr=t.attr,this.attrs=t.attrs,this.zero=t.zero}render(t,e){(e||this.zero)&&(t.openNode(this.tag),this.attrs&&t.addAttributes(this.attrs),this.attr?t.addAttribute(this.attr,e):t.writeText(e),t.closeNode())}parseOpen(t){return t.name===this.tag&&(this.attr?this.model=parseInt(t.attributes[this.attr],10):this.text=[],!0)}parseText(t){this.attr||this.text.push(t)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{constructor(t){super(),this.tag=t.tag,this.attr=t.attr,this.attrs=t.attrs}render(t,e){void 0!==e&&(t.openNode(this.tag),this.attrs&&t.addAttributes(this.attrs),this.attr?t.addAttribute(this.attr,e):t.writeText(e),t.closeNode())}parseOpen(t){t.name===this.tag&&(this.attr?this.model=t.attributes[this.attr]:this.text=[])}parseText(t){this.attr||this.text.push(t)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(t,e,r){"use strict";const n=t("./base-xform"),i=t("../../utils/xml-stream");e.exports=class extends n{constructor(t){super(),this._model=t}render(t){if(!this._xml){const t=new i;!function t(e,r){e.openNode(r.tag,r.$),r.c&&r.c.forEach((r=>{t(e,r)})),r.t&&e.writeText(r.t),e.closeNode()}(t,this._model),this._xml=t.xml}t.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(t){return t!==this._model.tag}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(t,e,r){"use strict";const n=t("./text-xform"),i=t("./rich-text-xform"),s=t("../base-xform");e.exports=class extends s{constructor(){super(),this.map={r:new i,t:new n}}get tag(){return"rPh"}render(t,e){if(t.openNode(this.tag,{sb:e.sb||0,eb:e.eb||0}),e&&e.hasOwnProperty("richText")&&e.richText){const{r}=this.map;e.richText.forEach((e=>{r.render(t,e)}))}else e&&this.map.t.render(t,e.text);t.closeNode()}parseOpen(t){const{name:e}=t;return this.parser?(this.parser.parseOpen(t),!0):e===this.tag?(this.model={sb:parseInt(t.attributes.sb,10),eb:parseInt(t.attributes.eb,10)},!0):(this.parser=this.map[e],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)){switch(t){case"r":{let t=this.model.richText;t||(t=this.model.richText=[]),t.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}return t!==this.tag}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(t,e,r){"use strict";const n=t("./text-xform"),i=t("../style/font-xform"),s=t("../base-xform");class o extends s{constructor(t){super(),this.model=t}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new n)}get fontXform(){return this._fontXform||(this._fontXform=new i(o.FONT_OPTIONS))}render(t,e){e=e||this.model,t.openNode("r"),e.font&&this.fontXform.render(t,e.font),this.textXform.render(t,e.text),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(t),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(t),!0;default:return!1}}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){switch(t){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(t),!0}}}o.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},e.exports=o},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(t,e,r){"use strict";const n=t("./text-xform"),i=t("./rich-text-xform"),s=t("./phonetic-text-xform"),o=t("../base-xform");e.exports=class extends o{constructor(t){super(),this.model=t,this.map={r:new i,t:new n,rPh:new s}}get tag(){return"si"}render(t,e){t.openNode(this.tag),e&&e.hasOwnProperty("richText")&&e.richText?e.richText.length?e.richText.forEach((e=>{this.map.r.render(t,e)})):this.map.t.render(t,""):null!=e&&this.map.t.render(t,e),t.closeNode()}parseOpen(t){const{name:e}=t;return this.parser?(this.parser.parseOpen(t),!0):e===this.tag?(this.model={},!0):(this.parser=this.map[e],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)){switch(t){case"r":{let t=this.model.richText;t||(t=this.model.richText=[]),t.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}return t!==this.tag}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(t,e,r){"use strict";const n=t("../../../utils/xml-stream"),i=t("../base-xform"),s=t("./shared-string-xform");e.exports=class extends i{constructor(t){super(),this.model=t||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new s)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(t){return this.model.values[t]}add(t){return t.richText?this.addRichText(t):this.addText(t)}addText(t){let e=this.hash[t];return void 0===e&&(e=this.hash[t]=this.model.values.length,this.model.values.push(t)),this.model.count++,e}addRichText(t){const e=this.sharedStringXform.toXml(t);let r=this.rich[e];return void 0===r&&(r=this.rich[e]=this.model.values.length,this.model.values.push(t)),this.model.count++,r}render(t,e){e=e||this._values,t.openXml(n.StdDocAttributes),t.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.count,uniqueCount:e.values.length});const r=this.sharedStringXform;e.values.forEach((e=>{r.render(t,e)})),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(t),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;if("sst"===t)return!1;throw new Error("Unexpected xml node in parseClose: "+t)}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"t"}render(t,e){t.openNode("t"),/^\s|\n|\s$/.test(e)&&t.addAttribute("xml:space","preserve"),t.writeText(e),t.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,((t,e)=>String.fromCharCode(parseInt(e,16))))}parseOpen(t){return"t"===t.name&&(this._text=[],!0)}parseText(t){this._text.push(t)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(t,e,r){"use strict";const n=t("../../../doc/enums"),i=t("../../../utils/utils"),s=t("../base-xform"),o={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce(((t,e)=>(t[e]=!0,t)),{}),horizontal(t){return this.horizontalValues[t]?t:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce(((t,e)=>(t[e]=!0,t)),{}),vertical(t){return"middle"===t?"center":this.verticalValues[t]?t:void 0},wrapText:t=>!!t||void 0,shrinkToFit:t=>!!t||void 0,textRotation:t=>"vertical"===t||(t=i.validInt(t))>=-90&&t<=90?t:void 0,indent:t=>(t=i.validInt(t),Math.max(0,t)),readingOrder(t){switch(t){case"ltr":return n.ReadingOrder.LeftToRight;case"rtl":return n.ReadingOrder.RightToLeft;default:return}}},a={toXml(t){if(t=o.textRotation(t)){if("vertical"===t)return 255;const e=Math.round(t);if(e>=0&&e<=90)return e;if(e<0&&e>=-90)return 90-e}},toModel(t){const e=i.validInt(t);if(void 0!==e){if(255===e)return"vertical";if(e>=0&&e<=90)return e;if(e>90&&e<=180)return 90-e}}};e.exports=class extends s{get tag(){return"alignment"}render(t,e){t.addRollback(),t.openNode("alignment");let r=!1;function n(e,n){n&&(t.addAttribute(e,n),r=!0)}n("horizontal",o.horizontal(e.horizontal)),n("vertical",o.vertical(e.vertical)),n("wrapText",!!o.wrapText(e.wrapText)&&"1"),n("shrinkToFit",!!o.shrinkToFit(e.shrinkToFit)&&"1"),n("indent",o.indent(e.indent)),n("textRotation",a.toXml(e.textRotation)),n("readingOrder",o.readingOrder(e.readingOrder)),t.closeNode(),r?t.commit():t.rollback()}parseOpen(t){const e={};let r=!1;function n(t,n,i){t&&(e[n]=i,r=!0)}n(t.attributes.horizontal,"horizontal",t.attributes.horizontal),n(t.attributes.vertical,"vertical","center"===t.attributes.vertical?"middle":t.attributes.vertical),n(t.attributes.wrapText,"wrapText",i.parseBoolean(t.attributes.wrapText)),n(t.attributes.shrinkToFit,"shrinkToFit",i.parseBoolean(t.attributes.shrinkToFit)),n(t.attributes.indent,"indent",parseInt(t.attributes.indent,10)),n(t.attributes.textRotation,"textRotation",a.toModel(t.attributes.textRotation)),n(t.attributes.readingOrder,"readingOrder","2"===t.attributes.readingOrder?"rtl":"ltr"),this.model=r?e:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("../../../utils/utils"),s=t("./color-xform");class o extends n{constructor(t){super(),this.name=t,this.map={color:new s}}get tag(){return this.name}render(t,e,r){const n=e&&e.color||r||this.defaultColor;t.openNode(this.name),e&&e.style&&(t.addAttribute("style",e.style),n&&this.map.color.render(t,n)),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case this.name:{const{style:e}=t.attributes;return this.model=e?{style:e}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(t),!0;default:return!1}}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):(t===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(t){return o.validStyleValues[t]}}o.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce(((t,e)=>(t[e]=!0,t)),{}),e.exports=class extends n{constructor(){super(),this.map={top:new o("top"),left:new o("left"),bottom:new o("bottom"),right:new o("right"),diagonal:new o("diagonal")}}render(t,e){const{color:r}=e;function n(n,i){n&&!n.color&&e.color&&(n={...n,color:e.color}),i.render(t,n,r)}t.openNode("border"),e.diagonal&&e.diagonal.style&&(e.diagonal.up&&t.addAttribute("diagonalUp","1"),e.diagonal.down&&t.addAttribute("diagonalDown","1")),n(e.left,this.map.left),n(e.right,this.map.right),n(e.top,this.map.top),n(e.bottom,this.map.bottom),n(e.diagonal,this.map.diagonal),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):"border"===t.name?(this.reset(),this.diagonalUp=i.parseBoolean(t.attributes.diagonalUp),this.diagonalDown=i.parseBoolean(t.attributes.diagonalDown),!0):(this.parser=this.map[t.name],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;if("border"===t){const t=this.model={},e=function(e,r,n){r&&(n&&Object.assign(r,n),t[e]=r)};e("left",this.map.left.model),e("right",this.map.right.model),e("top",this.map.top.model),e("bottom",this.map.bottom.model),e("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{constructor(t){super(),this.name=t||"color"}get tag(){return this.name}render(t,e){return!!e&&(t.openNode(this.name),e.argb?t.addAttribute("rgb",e.argb):void 0!==e.theme?(t.addAttribute("theme",e.theme),void 0!==e.tint&&t.addAttribute("tint",e.tint)):void 0!==e.indexed?t.addAttribute("indexed",e.indexed):t.addAttribute("auto","1"),t.closeNode(),!0)}parseOpen(t){return t.name===this.name&&(t.attributes.rgb?this.model={argb:t.attributes.rgb}:t.attributes.theme?(this.model={theme:parseInt(t.attributes.theme,10)},t.attributes.tint&&(this.model.tint=parseFloat(t.attributes.tint))):t.attributes.indexed?this.model={indexed:parseInt(t.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("./alignment-xform"),s=t("./border-xform"),o=t("./fill-xform"),a=t("./font-xform"),l=t("./numfmt-xform"),u=t("./protection-xform");e.exports=class extends n{constructor(){super(),this.map={alignment:new i,border:new s,fill:new o,font:new a,numFmt:new l,protection:new u}}get tag(){return"dxf"}render(t,e){if(t.openNode(this.tag),e.font&&this.map.font.render(t,e.font),e.numFmt&&e.numFmtId){const r={id:e.numFmtId,formatCode:e.numFmt};this.map.numFmt.render(t,r)}e.fill&&this.map.fill.render(t,e.fill),e.alignment&&this.map.alignment.render(t,e.alignment),e.border&&this.map.border.render(t,e.border),e.protection&&this.map.protection.render(t,e.protection),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.reset(),!0):(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t),!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("./color-xform");class s extends n{constructor(){super(),this.map={color:new i}}get tag(){return"stop"}render(t,e){t.openNode("stop"),t.addAttribute("position",e.position),this.map.color.render(t,e.color),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"stop":return this.model={position:parseFloat(t.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(t),!0;default:return!1}}parseText(){}parseClose(t){return!!this.parser&&(this.parser.parseClose(t)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class o extends n{constructor(){super(),this.map={fgColor:new i("fgColor"),bgColor:new i("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(t,e){t.openNode("patternFill"),t.addAttribute("patternType",e.pattern),e.fgColor&&this.map.fgColor.render(t,e.fgColor),e.bgColor&&this.map.bgColor.render(t,e.bgColor),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):"patternFill"===t.name?(this.model={type:"pattern",pattern:t.attributes.patternType},!0):(this.parser=this.map[t.name],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return!!this.parser&&(this.parser.parseClose(t)||(this.parser.model&&(this.model[t]=this.parser.model),this.parser=void 0),!0)}}class a extends n{constructor(){super(),this.map={stop:new s}}get name(){return"gradient"}get tag(){return"gradientFill"}render(t,e){switch(t.openNode("gradientFill"),e.gradient){case"angle":t.addAttribute("degree",e.degree);break;case"path":t.addAttribute("type","path"),e.center.left&&(t.addAttribute("left",e.center.left),void 0===e.center.right&&t.addAttribute("right",e.center.left)),e.center.right&&t.addAttribute("right",e.center.right),e.center.top&&(t.addAttribute("top",e.center.top),void 0===e.center.bottom&&t.addAttribute("bottom",e.center.top)),e.center.bottom&&t.addAttribute("bottom",e.center.bottom)}const r=this.map.stop;e.stops.forEach((e=>{r.render(t,e)})),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"gradientFill":{const e=this.model={stops:[]};return t.attributes.degree?(e.gradient="angle",e.degree=parseInt(t.attributes.degree,10)):"path"===t.attributes.type&&(e.gradient="path",e.center={left:t.attributes.left?parseFloat(t.attributes.left):0,top:t.attributes.top?parseFloat(t.attributes.top):0},t.attributes.right!==t.attributes.left&&(e.center.right=t.attributes.right?parseFloat(t.attributes.right):0),t.attributes.bottom!==t.attributes.top&&(e.center.bottom=t.attributes.bottom?parseFloat(t.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(t),!0;default:return!1}}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return!!this.parser&&(this.parser.parseClose(t)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class l extends n{constructor(){super(),this.map={patternFill:new o,gradientFill:new a}}get tag(){return"fill"}render(t,e){switch(t.addRollback(),t.openNode("fill"),e.type){case"pattern":this.map.patternFill.render(t,e);break;case"gradient":this.map.gradientFill.render(t,e);break;default:return void t.rollback()}t.closeNode(),t.commit()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):"fill"===t.name?(this.model={},!0):(this.parser=this.map[t.name],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return!!this.parser&&(this.parser.parseClose(t)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(t){return l.validPatternValues[t]}}l.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce(((t,e)=>(t[e]=!0,t)),{}),l.StopXform=s,l.PatternFillXform=o,l.GradientFillXform=a,e.exports=l},{"../base-xform":32,"./color-xform":128}],131:[function(t,e,r){"use strict";const n=t("./color-xform"),i=t("../simple/boolean-xform"),s=t("../simple/integer-xform"),o=t("../simple/string-xform"),a=t("./underline-xform"),l=t("../../../utils/under-dash"),u=t("../base-xform");class c extends u{constructor(t){super(),this.options=t||c.OPTIONS,this.map={b:{prop:"bold",xform:new i({tag:"b",attr:"val"})},i:{prop:"italic",xform:new i({tag:"i",attr:"val"})},u:{prop:"underline",xform:new a},charset:{prop:"charset",xform:new s({tag:"charset",attr:"val"})},color:{prop:"color",xform:new n},condense:{prop:"condense",xform:new i({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new i({tag:"extend",attr:"val"})},family:{prop:"family",xform:new s({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new i({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new o({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new o({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new i({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new i({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new s({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new o({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(t,e){const{map:r}=this;t.openNode(this.options.tagName),l.each(this.map,((n,i)=>{r[i].xform.render(t,e[n.prop])})),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):this.map[t.name]?(this.parser=this.map[t.name].xform,this.parser.parseOpen(t)):t.name===this.options.tagName&&(this.model={},!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser&&!this.parser.parseClose(t)){const e=this.map[t];return this.parser.model&&(this.model[e.prop]=this.parser.model),this.parser=void 0,!0}return t!==this.options.tagName}}c.OPTIONS={tagName:"font",fontNameTag:"name"},e.exports=c},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(t,e,r){"use strict";const n=t("../../../utils/under-dash"),i=t("../../defaultnumformats"),s=t("../base-xform"),o=function(){const t={};return n.each(i,((e,r)=>{e.f&&(t[e.f]=parseInt(r,10))})),t}();class a extends s{constructor(t,e){super(),this.id=t,this.formatCode=e}get tag(){return"numFmt"}render(t,e){t.leafNode("numFmt",{numFmtId:e.id,formatCode:e.formatCode})}parseOpen(t){return"numFmt"===t.name&&(this.model={id:parseInt(t.attributes.numFmtId,10),formatCode:t.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0)}parseText(){}parseClose(){return!1}}a.getDefaultFmtId=function(t){return o[t]},a.getDefaultFmtCode=function(t){return i[t]&&i[t].f},e.exports=a},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(t,e,r){"use strict";const n=t("../base-xform"),i=(t,e)=>void 0===t?e:t;e.exports=class extends n{get tag(){return"protection"}render(t,e){t.addRollback(),t.openNode("protection");let r=!1;function n(e,n){void 0!==n&&(t.addAttribute(e,n),r=!0)}n("locked",i(e.locked,!0)?void 0:"0"),n("hidden",i(e.hidden,!1)?"1":void 0),t.closeNode(),r?t.commit():t.rollback()}parseOpen(t){const e={locked:!("0"===t.attributes.locked),hidden:"1"===t.attributes.hidden},r=!e.locked||e.hidden;this.model=r?e:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("./alignment-xform"),s=t("./protection-xform");e.exports=class extends n{constructor(t){super(),this.xfId=!(!t||!t.xfId),this.map={alignment:new i,protection:new s}}get tag(){return"xf"}render(t,e){t.openNode("xf",{numFmtId:e.numFmtId||0,fontId:e.fontId||0,fillId:e.fillId||0,borderId:e.borderId||0}),this.xfId&&t.addAttribute("xfId",e.xfId||0),e.numFmtId&&t.addAttribute("applyNumberFormat","1"),e.fontId&&t.addAttribute("applyFont","1"),e.fillId&&t.addAttribute("applyFill","1"),e.borderId&&t.addAttribute("applyBorder","1"),e.alignment&&t.addAttribute("applyAlignment","1"),e.protection&&t.addAttribute("applyProtection","1"),e.alignment&&this.map.alignment.render(t,e.alignment),e.protection&&this.map.protection.render(t,e.protection),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"xf":return this.model={numFmtId:parseInt(t.attributes.numFmtId,10),fontId:parseInt(t.attributes.fontId,10),fillId:parseInt(t.attributes.fillId,10),borderId:parseInt(t.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(t.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(t),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(t),!0;default:return!1}}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):"xf"!==t}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(t,e,r){"use strict";const n=t("../../../doc/enums"),i=t("../../../utils/xml-stream"),s=t("../base-xform"),o=t("../static-xform"),a=t("../list-xform"),l=t("./font-xform"),u=t("./fill-xform"),c=t("./border-xform"),h=t("./numfmt-xform"),d=t("./style-xform"),f=t("./dxf-xform");class p extends s{constructor(t){super(),this.map={numFmts:new a({tag:"numFmts",count:!0,childXform:new h}),fonts:new a({tag:"fonts",count:!0,childXform:new l,$:{"x14ac:knownFonts":1}}),fills:new a({tag:"fills",count:!0,childXform:new u}),borders:new a({tag:"borders",count:!0,childXform:new c}),cellStyleXfs:new a({tag:"cellStyleXfs",count:!0,childXform:new d}),cellXfs:new a({tag:"cellXfs",count:!0,childXform:new d({xfId:!0})}),dxfs:new a({tag:"dxfs",always:!0,count:!0,childXform:new f}),numFmt:new h,font:new l,fill:new u,border:new c,style:new d({xfId:!0}),cellStyles:p.STATIC_XFORMS.cellStyles,tableStyles:p.STATIC_XFORMS.tableStyles,extLst:p.STATIC_XFORMS.extLst},t&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:"pattern",pattern:"none"}),this._addFill({type:"pattern",pattern:"gray125"}),this.weakMap=new WeakMap}render(t,e){e=e||this.model,t.openXml(i.StdDocAttributes),t.openNode("styleSheet",p.STYLESHEET_ATTRIBUTES),this.index?(e.numFmts&&e.numFmts.length&&(t.openNode("numFmts",{count:e.numFmts.length}),e.numFmts.forEach((e=>{t.writeXml(e)})),t.closeNode()),e.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),t.openNode("fonts",{count:e.fonts.length,"x14ac:knownFonts":1}),e.fonts.forEach((e=>{t.writeXml(e)})),t.closeNode(),t.openNode("fills",{count:e.fills.length}),e.fills.forEach((e=>{t.writeXml(e)})),t.closeNode(),t.openNode("borders",{count:e.borders.length}),e.borders.forEach((e=>{t.writeXml(e)})),t.closeNode(),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),t.openNode("cellXfs",{count:e.styles.length}),e.styles.forEach((e=>{t.writeXml(e)})),t.closeNode()):(this.map.numFmts.render(t,e.numFmts),this.map.fonts.render(t,e.fonts),this.map.fills.render(t,e.fills),this.map.borders.render(t,e.borders),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(t,e.styles)),p.STATIC_XFORMS.cellStyles.render(t),this.map.dxfs.render(t,e.dxfs),p.STATIC_XFORMS.tableStyles.render(t),p.STATIC_XFORMS.extLst.render(t),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):"styleSheet"===t.name?(this.initIndex(),!0):(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t),!0)}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;if("styleSheet"===t){this.model={};const t=(t,e)=>{e.model&&e.model.length&&(this.model[t]=e.model)};if(t("numFmts",this.map.numFmts),t("fonts",this.map.fonts),t("fills",this.map.fills),t("borders",this.map.borders),t("styles",this.map.cellXfs),t("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const t=this.index.numFmt;this.model.numFmts.forEach((e=>{t[e.id]=e.formatCode}))}return!1}return!0}addStyleModel(t,e){if(!t)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),this.weakMap&&this.weakMap.has(t))return this.weakMap.get(t);const r={};if(e=e||n.ValueType.Number,t.numFmt)r.numFmtId=this._addNumFmtStr(t.numFmt);else switch(e){case n.ValueType.Number:r.numFmtId=this._addNumFmtStr("General");break;case n.ValueType.Date:r.numFmtId=this._addNumFmtStr("mm-dd-yy")}t.font&&(r.fontId=this._addFont(t.font)),t.border&&(r.borderId=this._addBorder(t.border)),t.fill&&(r.fillId=this._addFill(t.fill)),t.alignment&&(r.alignment=t.alignment),t.protection&&(r.protection=t.protection);const i=this._addStyle(r);return this.weakMap&&this.weakMap.set(t,i),i}getStyleModel(t){const e=this.model.styles[t];if(!e)return null;let r=this.index.model[t];if(r)return r;if(r=this.index.model[t]={},e.numFmtId){const t=this.index.numFmt[e.numFmtId]||h.getDefaultFmtCode(e.numFmtId);t&&(r.numFmt=t)}function n(t,e,n){if(n||0===n){const i=e[n];i&&(r[t]=i)}}return n("font",this.model.fonts,e.fontId),n("border",this.model.borders,e.borderId),n("fill",this.model.fills,e.fillId),e.alignment&&(r.alignment=e.alignment),e.protection&&(r.protection=e.protection),r}addDxfStyle(t){return t.numFmt&&(t.numFmtId=this._addNumFmtStr(t.numFmt)),this.model.dxfs.push(t),this.model.dxfs.length-1}getDxfStyle(t){return this.model.dxfs[t]}_addStyle(t){const e=this.map.style.toXml(t);let r=this.index.style[e];return void 0===r&&(r=this.index.style[e]=this.model.styles.length,this.model.styles.push(e)),r}_addNumFmtStr(t){let e=h.getDefaultFmtId(t);if(void 0!==e)return e;if(e=this.index.numFmt[t],void 0!==e)return e;e=this.index.numFmt[t]=164+this.model.numFmts.length;const r=this.map.numFmt.toXml({id:e,formatCode:t});return this.model.numFmts.push(r),e}_addFont(t){const e=this.map.font.toXml(t);let r=this.index.font[e];return void 0===r&&(r=this.index.font[e]=this.model.fonts.length,this.model.fonts.push(e)),r}_addBorder(t){const e=this.map.border.toXml(t);let r=this.index.border[e];return void 0===r&&(r=this.index.border[e]=this.model.borders.length,this.model.borders.push(e)),r}_addFill(t){const e=this.map.fill.toXml(t);let r=this.index.fill[e];return void 0===r&&(r=this.index.fill[e]=this.model.fills.length,this.model.fills.push(e)),r}}p.STYLESHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac x16r2","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"},p.STATIC_XFORMS={cellStyles:new o({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new o({tag:"dxfs",$:{count:0}}),tableStyles:new o({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new o({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})},p.Mock=class extends p{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}],borders:[{}],fills:[{type:"pattern",pattern:"none"},{type:"pattern",pattern:"gray125"}]}}parseStream(t){return t.autodrain(),Promise.resolve()}addStyleModel(t,e){return e===n.ValueType.Date?this.dateStyleId:0}get dateStyleId(){if(!this._dateStyleId){const t={numFmtId:h.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(t)}return this._dateStyleId}getStyleModel(){return{}}},e.exports=p},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(t,e,r){"use strict";const n=t("../base-xform");class i extends n{constructor(t){super(),this.model=t}get tag(){return"u"}render(t,e){if(!0===(e=e||this.model))t.leafNode("u");else{const r=i.Attributes[e];r&&t.leafNode("u",r)}}parseOpen(t){"u"===t.name&&(this.model=t.attributes.val||!0)}parseText(){}parseClose(){return!1}}i.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},e.exports=i},{"../base-xform":32}],137:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("./filter-column-xform");e.exports=class extends n{constructor(){super(),this.map={filterColumn:new i}}get tag(){return"autoFilter"}prepare(t){t.columns.forEach(((t,e)=>{this.map.filterColumn.prepare(t,{index:e})}))}render(t,e){return t.openNode(this.tag,{ref:e.autoFilterRef}),e.columns.forEach((e=>{this.map.filterColumn.render(t,e)})),t.closeNode(),!0}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;if(t.name===this.tag)return this.model={autoFilterRef:t.attributes.ref,columns:[]},!0;if(this.parser=this.map[t.name],this.parser)return this.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;if(t===this.tag)return!1;throw new Error("Unexpected xml node in parseClose: "+t)}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"customFilter"}render(t,e){t.leafNode(this.tag,{val:e.val,operator:e.operator})}parseOpen(t){return t.name===this.tag&&(this.model={val:t.attributes.val,operator:t.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(t,e,r){"use strict";const n=t("../base-xform"),i=t("../list-xform"),s=t("./custom-filter-xform"),o=t("./filter-xform");e.exports=class extends n{constructor(){super(),this.map={customFilters:new i({tag:"customFilters",count:!1,empty:!0,childXform:new s}),filters:new i({tag:"filters",count:!1,empty:!0,childXform:new o})}}get tag(){return"filterColumn"}prepare(t,e){t.colId=e.index.toString()}render(t,e){return e.customFilters?(t.openNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),this.map.customFilters.render(t,e.customFilters),t.closeNode(),!0):(t.leafNode(this.tag,{colId:e.colId,hiddenButton:e.filterButton?"0":"1"}),!0)}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;const{attributes:e}=t;if(t.name===this.tag)return this.model={filterButton:"0"===e.hiddenButton},!0;if(this.parser=this.map[t.name],this.parser)return this.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}parseText(){}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.model.customFilters=this.map.customFilters.model,!1)}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"filter"}render(t,e){t.leafNode(this.tag,{val:e.val})}parseOpen(t){return t.name===this.tag&&(this.model={val:t.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"tableColumn"}prepare(t,e){t.id=e.index+1}render(t,e){return t.leafNode(this.tag,{id:e.id.toString(),name:e.name,totalsRowLabel:e.totalsRowLabel,totalsRowFunction:e.totalsRowFunction,dxfId:e.dxfId}),!0}parseOpen(t){if(t.name===this.tag){const{attributes:e}=t;return this.model={name:e.name,totalsRowLabel:e.totalsRowLabel,totalsRowFunction:e.totalsRowFunction,dxfId:e.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(t,e,r){"use strict";const n=t("../base-xform");e.exports=class extends n{get tag(){return"tableStyleInfo"}render(t,e){return t.leafNode(this.tag,{name:e.theme?e.theme:void 0,showFirstColumn:e.showFirstColumn?"1":"0",showLastColumn:e.showLastColumn?"1":"0",showRowStripes:e.showRowStripes?"1":"0",showColumnStripes:e.showColumnStripes?"1":"0"}),!0}parseOpen(t){if(t.name===this.tag){const{attributes:e}=t;return this.model={theme:e.name?e.name:null,showFirstColumn:"1"===e.showFirstColumn,showLastColumn:"1"===e.showLastColumn,showRowStripes:"1"===e.showRowStripes,showColumnStripes:"1"===e.showColumnStripes},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(t,e,r){"use strict";const n=t("../../../utils/xml-stream"),i=t("../base-xform"),s=t("../list-xform"),o=t("./auto-filter-xform"),a=t("./table-column-xform"),l=t("./table-style-info-xform");class u extends i{constructor(){super(),this.map={autoFilter:new o,tableColumns:new s({tag:"tableColumns",count:!0,empty:!0,childXform:new a}),tableStyleInfo:new l}}prepare(t,e){this.map.autoFilter.prepare(t),this.map.tableColumns.prepare(t.columns,e)}get tag(){return"table"}render(t,e){t.openXml(n.StdDocAttributes),t.openNode(this.tag,{...u.TABLE_ATTRIBUTES,id:e.id,name:e.name,displayName:e.displayName||e.name,ref:e.tableRef,totalsRowCount:e.totalsRow?"1":void 0,totalsRowShown:e.totalsRow?void 0:"1",headerRowCount:e.headerRow?"1":"0"}),this.map.autoFilter.render(t,e),this.map.tableColumns.render(t,e.columns),this.map.tableStyleInfo.render(t,e.style),t.closeNode()}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;const{name:e,attributes:r}=t;return e===this.tag?(this.reset(),this.model={name:r.name,displayName:r.displayName||r.name,tableRef:r.ref,totalsRow:"1"===r.totalsRowCount,headerRow:"1"===r.headerRowCount}):(this.parser=this.map[t.name],this.parser&&this.parser.parseOpen(t)),!0}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t!==this.tag||(this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach(((t,e)=>{this.model.columns[e].filterButton=t.filterButton}))),this.model.style=this.map.tableStyleInfo.model,!1)}reconcile(t,e){t.columns.forEach((t=>{void 0!==t.dxfId&&(t.style=e.styles.getDxfStyle(t.dxfId))}))}}u.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"},e.exports=u},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(t,e,r){(function(r,n){(function(){"use strict";const i=t("fs"),s=t("jszip"),{PassThrough:o}=t("readable-stream"),a=t("../utils/zip-stream"),l=t("../utils/stream-buf"),u=t("../utils/utils"),c=t("../utils/xml-stream"),{bufferToString:h}=t("../utils/browser-buffer-decode"),d=t("./xform/style/styles-xform"),f=t("./xform/core/core-xform"),p=t("./xform/strings/shared-strings-xform"),m=t("./xform/core/relationships-xform"),b=t("./xform/core/content-types-xform"),g=t("./xform/core/app-xform"),y=t("./xform/book/workbook-xform"),v=t("./xform/sheet/worksheet-xform"),w=t("./xform/drawing/drawing-xform"),_=t("./xform/table/table-xform"),x=t("./xform/comment/comments-xform"),S=t("./xform/comment/vml-notes-xform"),C=t("./xml/theme1");class A{constructor(t){this.workbook=t}async readFile(t,e){if(!await u.fs.exists(t))throw new Error("File not found: "+t);const r=i.createReadStream(t);try{const t=await this.read(r,e);return r.close(),t}catch(t){throw r.close(),t}}parseRels(t){return(new m).parseStream(t)}parseWorkbook(t){return(new y).parseStream(t)}parseSharedStrings(t){return(new p).parseStream(t)}reconcile(t,e){const r=new y,n=new v(e),i=new w,s=new _;r.reconcile(t);const o={media:t.media,mediaIndex:t.mediaIndex};Object.keys(t.drawings).forEach((e=>{const r=t.drawings[e],n=t.drawingRels[e];n&&(o.rels=n.reduce(((t,e)=>(t[e.Id]=e,t)),{}),(r.anchors||[]).forEach((t=>{const e=t.picture&&t.picture.hyperlinks;e&&o.rels[e.rId]&&(e.hyperlink=o.rels[e.rId].Target,delete e.rId)})),i.reconcile(r,o))}));const a={styles:t.styles};Object.values(t.tables).forEach((t=>{s.reconcile(t,a)}));const l={styles:t.styles,sharedStrings:t.sharedStrings,media:t.media,mediaIndex:t.mediaIndex,date1904:t.properties&&t.properties.date1904,drawings:t.drawings,comments:t.comments,tables:t.tables,vmlDrawings:t.vmlDrawings};t.worksheets.forEach((e=>{e.relationships=t.worksheetRels[e.sheetNo],n.reconcile(e,l)})),delete t.worksheetHash,delete t.worksheetRels,delete t.globalRels,delete t.sharedStrings,delete t.workbookRels,delete t.sheetDefs,delete t.styles,delete t.mediaIndex,delete t.drawings,delete t.drawingRels,delete t.vmlDrawings}async _processWorksheetEntry(t,e,r,n,i){const s=new v(n),o=await s.parseStream(t);o.sheetNo=r,e.worksheetHash[i]=o,e.worksheets.push(o)}async _processCommentEntry(t,e,r){const n=new x,i=await n.parseStream(t);e.comments[`../${r}.xml`]=i}async _processTableEntry(t,e,r){const n=new _,i=await n.parseStream(t);e.tables[`../tables/${r}.xml`]=i}async _processWorksheetRelsEntry(t,e,r){const n=new m,i=await n.parseStream(t);e.worksheetRels[r]=i}async _processMediaEntry(t,e,r){const n=r.lastIndexOf(".");if(n>=1){const i=r.substr(n+1),s=r.substr(0,n);await new Promise(((n,o)=>{const a=new l;a.on("finish",(()=>{e.mediaIndex[r]=e.media.length,e.mediaIndex[s]=e.media.length;const t={type:"image",name:s,extension:i,buffer:a.toBuffer()};e.media.push(t),n()})),t.on("error",(t=>{o(t)})),t.pipe(a)}))}}async _processDrawingEntry(t,e,r){const n=new w,i=await n.parseStream(t);e.drawings[r]=i}async _processDrawingRelsEntry(t,e,r){const n=new m,i=await n.parseStream(t);e.drawingRels[r]=i}async _processVmlDrawingEntry(t,e,r){const n=new S,i=await n.parseStream(t);e.vmlDrawings[`../drawings/${r}.vml`]=i}async _processThemeEntry(t,e,r){await new Promise(((n,i)=>{const s=new l;t.on("error",i),s.on("error",i),s.on("finish",(()=>{e.themes[r]=s.read().toString(),n()})),t.pipe(s)}))}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(t,e){!t[Symbol.asyncIterator]&&t.pipe&&(t=t.pipe(new o));const r=[];for await(const e of t)r.push(e);return this.load(n.concat(r),e)}async load(t,e){let i;i=e&&e.base64?n.from(t.toString(),"base64"):t;const a={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},l=await s.loadAsync(i);for(const t of Object.values(l.files))if(!t.dir){let n,i=t.name;if("/"===i[0]&&(i=i.substr(1)),i.match(/xl\/media\//)||i.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))n=new o,n.write(await t.async("nodebuffer"));else{let e;n=new o({writableObjectMode:!0,readableObjectMode:!0}),e=r.browser?h(await t.async("nodebuffer")):await t.async("string");const i=16384;for(let t=0;t<e.length;t+=i)n.write(e.substring(t,t+i))}switch(n.end(),i){case"_rels/.rels":a.globalRels=await this.parseRels(n);break;case"xl/workbook.xml":{const t=await this.parseWorkbook(n);a.sheets=t.sheets,a.definedNames=t.definedNames,a.views=t.views,a.properties=t.properties,a.calcProperties=t.calcProperties;break}case"xl/_rels/workbook.xml.rels":a.workbookRels=await this.parseRels(n);break;case"xl/sharedStrings.xml":a.sharedStrings=new p,await a.sharedStrings.parseStream(n);break;case"xl/styles.xml":a.styles=new d,await a.styles.parseStream(n);break;case"docProps/app.xml":{const t=new g,e=await t.parseStream(n);a.company=e.company,a.manager=e.manager;break}case"docProps/core.xml":{const t=new f,e=await t.parseStream(n);Object.assign(a,e);break}default:{let t=i.match(/xl\/worksheets\/sheet(\d+)[.]xml/);if(t){await this._processWorksheetEntry(n,a,t[1],e,i);break}if(t=i.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml.rels/),t){await this._processWorksheetRelsEntry(n,a,t[1]);break}if(t=i.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),t){await this._processThemeEntry(n,a,t[1]);break}if(t=i.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),t){await this._processMediaEntry(n,a,t[1]);break}if(t=i.match(/xl\/drawings\/([a-zA-Z0-9]+)[.]xml/),t){await this._processDrawingEntry(n,a,t[1]);break}if(t=i.match(/xl\/(comments\d+)[.]xml/),t){await this._processCommentEntry(n,a,t[1]);break}if(t=i.match(/xl\/tables\/(table\d+)[.]xml/),t){await this._processTableEntry(n,a,t[1]);break}if(t=i.match(/xl\/drawings\/_rels\/([a-zA-Z0-9]+)[.]xml[.]rels/),t){await this._processDrawingRelsEntry(n,a,t[1]);break}if(t=i.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),t){await this._processVmlDrawingEntry(n,a,t[1]);break}}}}return this.reconcile(a,e),this.workbook.model=a,this.workbook}async addMedia(t,e){await Promise.all(e.media.map((async e=>{if("image"===e.type){const r=`xl/media/${e.name}.${e.extension}`;if(e.filename){const n=await function(t,e){return new Promise(((e,r)=>{i.readFile(t,undefined,((t,n)=>{t?r(t):e(n)}))}))}(e.filename);return t.append(n,{name:r})}if(e.buffer)return t.append(e.buffer,{name:r});if(e.base64){const n=e.base64,i=n.substring(n.indexOf(",")+1);return t.append(i,{name:r,base64:!0})}}throw new Error("Unsupported media")})))}addDrawings(t,e){const r=new w,n=new m;e.worksheets.forEach((e=>{const{drawing:i}=e;if(i){r.prepare(i,{});let e=r.toXml(i);t.append(e,{name:`xl/drawings/${i.name}.xml`}),e=n.toXml(i.rels),t.append(e,{name:`xl/drawings/_rels/${i.name}.xml.rels`})}}))}addTables(t,e){const r=new _;e.worksheets.forEach((e=>{const{tables:n}=e;n.forEach((e=>{r.prepare(e,{});const n=r.toXml(e);t.append(n,{name:"xl/tables/"+e.target})}))}))}async addContentTypes(t,e){const r=(new b).toXml(e);t.append(r,{name:"[Content_Types].xml"})}async addApp(t,e){const r=(new g).toXml(e);t.append(r,{name:"docProps/app.xml"})}async addCore(t,e){const r=new f;t.append(r.toXml(e),{name:"docProps/core.xml"})}async addThemes(t,e){const r=e.themes||{theme1:C};Object.keys(r).forEach((e=>{const n=r[e],i=`xl/theme/${e}.xml`;t.append(n,{name:i})}))}async addOfficeRels(t){const e=(new m).toXml([{Id:"rId1",Type:A.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:A.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:A.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);t.append(e,{name:"_rels/.rels"})}async addWorkbookRels(t,e){let r=1;const n=[{Id:"rId"+r++,Type:A.RelType.Styles,Target:"styles.xml"},{Id:"rId"+r++,Type:A.RelType.Theme,Target:"theme/theme1.xml"}];e.sharedStrings.count&&n.push({Id:"rId"+r++,Type:A.RelType.SharedStrings,Target:"sharedStrings.xml"}),e.worksheets.forEach((t=>{t.rId="rId"+r++,n.push({Id:t.rId,Type:A.RelType.Worksheet,Target:`worksheets/sheet${t.id}.xml`})}));const i=(new m).toXml(n);t.append(i,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(t,e){e.sharedStrings&&e.sharedStrings.count&&t.append(e.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(t,e){const{xml:r}=e.styles;r&&t.append(r,{name:"xl/styles.xml"})}async addWorkbook(t,e){const r=new y;t.append(r.toXml(e),{name:"xl/workbook.xml"})}async addWorksheets(t,e){const r=new v,n=new m,i=new x,s=new S;e.worksheets.forEach((e=>{let o=new c;r.render(o,e),t.append(o.xml,{name:`xl/worksheets/sheet${e.id}.xml`}),e.rels&&e.rels.length&&(o=new c,n.render(o,e.rels),t.append(o.xml,{name:`xl/worksheets/_rels/sheet${e.id}.xml.rels`})),e.comments.length>0&&(o=new c,i.render(o,e),t.append(o.xml,{name:`xl/comments${e.id}.xml`}),o=new c,s.render(o,e),t.append(o.xml,{name:`xl/drawings/vmlDrawing${e.id}.vml`}))}))}_finalize(t){return new Promise(((e,r)=>{t.on("finish",(()=>{e(this)})),t.on("error",r),t.finalize()}))}prepareModel(t,e){t.creator=t.creator||"ExcelJS",t.lastModifiedBy=t.lastModifiedBy||"ExcelJS",t.created=t.created||new Date,t.modified=t.modified||new Date,t.useSharedStrings=void 0===e.useSharedStrings||e.useSharedStrings,t.useStyles=void 0===e.useStyles||e.useStyles,t.sharedStrings=new p,t.styles=t.useStyles?new d(!0):new d.Mock;const r=new y,n=new v;r.prepare(t);const i={sharedStrings:t.sharedStrings,styles:t.styles,date1904:t.properties.date1904,drawingsCount:0,media:t.media};i.drawings=t.drawings=[],i.commentRefs=t.commentRefs=[];let s=0;t.tables=[],t.worksheets.forEach((e=>{e.tables.forEach((e=>{s++,e.target=`table${s}.xml`,e.id=s,t.tables.push(e)})),n.prepare(e,i)}))}async write(t,e){e=e||{};const{model:r}=this.workbook,n=new a.ZipWriter(e.zip);return n.pipe(t),this.prepareModel(r,e),await this.addContentTypes(n,r),await this.addOfficeRels(n,r),await this.addWorkbookRels(n,r),await this.addWorksheets(n,r),await this.addSharedStrings(n,r),await this.addDrawings(n,r),await this.addTables(n,r),await Promise.all([this.addThemes(n,r),this.addStyles(n,r)]),await this.addMedia(n,r),await Promise.all([this.addApp(n,r),this.addCore(n,r)]),await this.addWorkbook(n,r),this._finalize(n)}writeFile(t,e){const r=i.createWriteStream(t);return new Promise(((t,n)=>{r.on("finish",(()=>{t()})),r.on("error",(t=>{n(t)})),this.write(r,e).then((()=>{r.end()})).catch((t=>{n(t)}))}))}async writeBuffer(t){const e=new l;return await this.write(e,t),e.read()}}A.RelType=t("./rel-type"),e.exports=A}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(t,e,r){"use strict";e.exports='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>'},{}],146:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.CsvFormatterStream=void 0;const n=t("stream"),i=t("./formatter");class s extends n.Transform{constructor(t){super({writableObjectMode:t.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=t,this.rowFormatter=new i.RowFormatter(t),this.hasWrittenBOM=!t.writeBOM}transform(t){return this.rowFormatter.rowTransform=t,this}_transform(t,r,n){let i=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(t,((t,r)=>t?(i=!0,n(t)):(r&&r.forEach((t=>{this.push(e.from(t,"utf8"))})),i=!0,n())))}catch(t){if(i)throw t;n(t)}}_flush(t){this.rowFormatter.finish(((r,n)=>r?t(r):(n&&n.forEach((t=>{this.push(e.from(t,"utf8"))})),t())))}}r.CsvFormatterStream=s}).call(this)}).call(this,t("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.FormatterOptions=void 0,r.FormatterOptions=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;this.objectMode=!0,this.delimiter=",",this.rowDelimiter="\n",this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\ufeff",this.alwaysWriteHeaders=!1,Object.assign(this,t||{}),void 0===(null==t?void 0:t.quoteHeaders)&&(this.quoteHeaders=this.quoteColumns),!0===(null==t?void 0:t.quote)?this.quote='"':!1===(null==t?void 0:t.quote)&&(this.quote=""),"string"!=typeof(null==t?void 0:t.escape)&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&(null===(e=t.writeHeaders)||void 0===e||e),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(t,e,r){"use strict";var n=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.FieldFormatter=void 0;const i=n(t("lodash.isboolean")),s=n(t("lodash.isnil")),o=n(t("lodash.escaperegexp"));r.FieldFormatter=class{constructor(t){this._headers=null,this.formatterOptions=t,null!==t.headers&&(this.headers=t.headers),this.REPLACE_REGEXP=new RegExp(t.quote,"g");const e=`[${t.delimiter}${o.default(t.rowDelimiter)}|\r|\n]`;this.ESCAPE_REGEXP=new RegExp(e)}set headers(t){this._headers=t}shouldQuote(t,e){const r=e?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return i.default(r)?r:Array.isArray(r)?r[t]:null!==this._headers&&r[this._headers[t]]}format(t,e,r){const n=(""+(s.default(t)?"":t)).replace(/\0/g,""),{formatterOptions:i}=this;return""!==i.quote&&-1!==n.indexOf(i.quote)?this.quoteField(n.replace(this.REPLACE_REGEXP,i.escapedQuote)):-1!==n.search(this.ESCAPE_REGEXP)||this.shouldQuote(e,r)?this.quoteField(n):n}quoteField(t){const{quote:e}=this.formatterOptions;return`${e}${t}${e}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(t,e,r){"use strict";var n=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.RowFormatter=void 0;const i=n(t("lodash.isfunction")),s=n(t("lodash.isequal")),o=t("./FieldFormatter"),a=t("../types");class l{constructor(t){this.rowCount=0,this.formatterOptions=t,this.fieldFormatter=new o.FieldFormatter(t),this.headers=t.headers,this.shouldWriteHeaders=t.shouldWriteHeaders,this.hasWrittenHeaders=!1,null!==this.headers&&(this.fieldFormatter.headers=this.headers),t.transform&&(this.rowTransform=t.transform)}static isRowHashArray(t){return!!Array.isArray(t)&&Array.isArray(t[0])&&2===t[0].length}static isRowArray(t){return Array.isArray(t)&&!this.isRowHashArray(t)}static gatherHeaders(t){return l.isRowHashArray(t)?t.map((t=>t[0])):Array.isArray(t)?t:Object.keys(t)}static createTransform(t){return a.isSyncTransform(t)?(e,r)=>{let n=null;try{n=t(e)}catch(t){return r(t)}return r(null,n)}:(e,r)=>{t(e,r)}}set rowTransform(t){if(!i.default(t))throw new TypeError("The transform should be a function");this._rowTransform=l.createTransform(t)}format(t,e){this.callTransformer(t,((r,n)=>{if(r)return e(r);if(!t)return e(null);const i=[];if(n){const{shouldFormatColumns:t,headers:e}=this.checkHeaders(n);if(this.shouldWriteHeaders&&e&&!this.hasWrittenHeaders&&(i.push(this.formatColumns(e,!0)),this.hasWrittenHeaders=!0),t){const t=this.gatherColumns(n);i.push(this.formatColumns(t,!1))}}return e(null,i)}))}finish(t){const e=[];if(this.formatterOptions.alwaysWriteHeaders&&0===this.rowCount){if(!this.headers)return t(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));e.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&e.push(this.formatterOptions.rowDelimiter),t(null,e)}checkHeaders(t){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const e=l.gatherHeaders(t);return this.headers=e,this.fieldFormatter.headers=e,this.shouldWriteHeaders?{shouldFormatColumns:!s.default(e,t),headers:e}:{shouldFormatColumns:!0,headers:null}}gatherColumns(t){if(null===this.headers)throw new Error("Headers is currently null");return Array.isArray(t)?l.isRowHashArray(t)?this.headers.map(((e,r)=>{const n=t[r];return n?n[1]:""})):l.isRowArray(t)&&!this.shouldWriteHeaders?t:this.headers.map(((e,r)=>t[r])):this.headers.map((e=>t[e]))}callTransformer(t,e){return this._rowTransform?this._rowTransform(t,e):e(null,t)}formatColumns(t,e){const r=t.map(((t,r)=>this.fieldFormatter.format(t,r,e))).join(this.formatterOptions.delimiter),{rowCount:n}=this;return this.rowCount+=1,n?[this.formatterOptions.rowDelimiter,r].join(""):r}}r.RowFormatter=l},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.FieldFormatter=r.RowFormatter=void 0;var n=t("./RowFormatter");Object.defineProperty(r,"RowFormatter",{enumerable:!0,get:function(){return n.RowFormatter}});var i=t("./FieldFormatter");Object.defineProperty(r,"FieldFormatter",{enumerable:!0,get:function(){return i.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(t,e,r){(function(e){(function(){"use strict";var n=Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]},i=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};Object.defineProperty(r,"__esModule",{value:!0}),r.writeToPath=r.writeToString=r.writeToBuffer=r.writeToStream=r.write=r.format=r.FormatterOptions=r.CsvFormatterStream=void 0;const s=t("util"),o=t("stream"),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e}(t("fs")),l=t("./FormatterOptions"),u=t("./CsvFormatterStream");!function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)}(t("./types"),r);var c=t("./CsvFormatterStream");Object.defineProperty(r,"CsvFormatterStream",{enumerable:!0,get:function(){return c.CsvFormatterStream}});var h=t("./FormatterOptions");Object.defineProperty(r,"FormatterOptions",{enumerable:!0,get:function(){return h.FormatterOptions}}),r.format=t=>new u.CsvFormatterStream(new l.FormatterOptions(t)),r.write=(t,e)=>{const n=r.format(e),i=s.promisify(((t,e)=>{n.write(t,void 0,e)}));return t.reduce(((t,e)=>t.then((()=>i(e)))),Promise.resolve()).then((()=>n.end())).catch((t=>{n.emit("error",t)})),n},r.writeToStream=(t,e,n)=>r.write(e,n).pipe(t),r.writeToBuffer=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=[],s=new o.Writable({write(t,e,r){i.push(t),r()}});return new Promise(((o,a)=>{s.on("error",a).on("finish",(()=>o(e.concat(i)))),r.write(t,n).pipe(s)}))},r.writeToString=(t,e)=>r.writeToBuffer(t,e).then((t=>t.toString())),r.writeToPath=(t,e,n)=>{const i=a.createWriteStream(t,{encoding:"utf8"});return r.write(e,n).pipe(i)}}).call(this)}).call(this,t("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isSyncTransform=void 0,r.isSyncTransform=t=>1===t.length},{}],153:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.CsvParserStream=void 0;const n=t("string_decoder"),i=t("stream"),s=t("./transforms"),o=t("./parser");class a extends i.Transform{constructor(t){super({objectMode:t.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=t,this.parser=new o.Parser(t),this.headerTransformer=new s.HeaderTransformer(t),this.decoder=new n.StringDecoder(t.encoding),this.rowTransformerValidator=new s.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(t){return this.rowTransformerValidator.rowTransform=t,this}validate(t){return this.rowTransformerValidator.rowValidator=t,this}emit(t){if("end"===t)return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return super.emit(t,...r)}_transform(t,e,r){if(this.hasHitRowLimit)return r();const n=a.wrapDoneCallback(r);try{const{lines:e}=this,r=e+this.decoder.write(t),i=this.parse(r,!0);return this.processRows(i,n)}catch(t){return n(t)}}_flush(t){const e=a.wrapDoneCallback(t);if(this.hasHitRowLimit)return e();try{const t=this.lines+this.decoder.end(),r=this.parse(t,!1);return this.processRows(r,e)}catch(t){return e(t)}}parse(t,e){if(!t)return[];const{line:r,rows:n}=this.parser.parse(t,e);return this.lines=r,n}processRows(t,r){const n=t.length,i=s=>{const o=t=>t?r(t):s%100!=0?i(s+1):void e((()=>i(s+1)));if(this.checkAndEmitHeaders(),s>=n||this.hasHitRowLimit)return r();if(this.parsedLineCount+=1,this.shouldSkipLine)return o();const a=t[s];this.rowCount+=1,this.parsedRowCount+=1;const l=this.rowCount;return this.transformRow(a,((t,e)=>{if(t)return this.rowCount-=1,o(t);if(!e)return o(new Error("expected transform result"));if(e.isValid){if(e.row)return this.pushRow(e.row,o)}else this.emit("data-invalid",e.row,l,e.reason);return o()}))};i(0)}transformRow(t,e){try{this.headerTransformer.transform(t,((r,n)=>r?e(r):n?n.isValid?n.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(n.row,e):this.skipRow(e):(this.rowCount-=1,this.parsedRowCount-=1,e(null,{row:null,isValid:!0})):this.shouldEmitRows?e(null,{isValid:!1,row:t}):this.skipRow(e):e(new Error("Expected result from header transform"))))}catch(t){e(t)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(t){return this.rowCount-=1,t(null,{row:null,isValid:!0})}pushRow(t,e){try{this.parserOptions.objectMode?this.push(t):this.push(JSON.stringify(t)),e()}catch(t){e(t)}}static wrapDoneCallback(t){let e=!1;return function(r){if(r){if(e)throw r;return e=!0,void t(r)}for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];t(...i)}}}r.CsvParserStream=a}).call(this)}).call(this,t("timers").setImmediate)},{"./parser":165,"./transforms":168,stream:505,string_decoder:218,timers:523}],154:[function(t,e,r){"use strict";var n=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.ParserOptions=void 0;const i=n(t("lodash.escaperegexp")),s=n(t("lodash.isnil"));r.ParserOptions=class{constructor(t){var e;if(this.objectMode=!0,this.delimiter=",",this.ignoreEmpty=!1,this.quote='"',this.escape=null,this.escapeChar=this.quote,this.comment=null,this.supportsComments=!1,this.ltrim=!1,this.rtrim=!1,this.trim=!1,this.headers=null,this.renameHeaders=!1,this.strictColumnHandling=!1,this.discardUnmappedColumns=!1,this.carriageReturn="\r",this.encoding="utf8",this.limitRows=!1,this.maxRows=0,this.skipLines=0,this.skipRows=0,Object.assign(this,t||{}),this.delimiter.length>1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=i.default(this.delimiter),this.escapeChar=null!==(e=this.escape)&&void 0!==e?e:this.quote,this.supportsComments=!s.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(t,e,r){"use strict";var n=Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]},i=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};Object.defineProperty(r,"__esModule",{value:!0}),r.parseString=r.parseFile=r.parseStream=r.parse=r.ParserOptions=r.CsvParserStream=void 0;const s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e}(t("fs")),o=t("stream"),a=t("./ParserOptions"),l=t("./CsvParserStream");!function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)}(t("./types"),r);var u=t("./CsvParserStream");Object.defineProperty(r,"CsvParserStream",{enumerable:!0,get:function(){return u.CsvParserStream}});var c=t("./ParserOptions");Object.defineProperty(r,"ParserOptions",{enumerable:!0,get:function(){return c.ParserOptions}}),r.parse=t=>new l.CsvParserStream(new a.ParserOptions(t)),r.parseStream=(t,e)=>t.pipe(new l.CsvParserStream(new a.ParserOptions(e))),r.parseFile=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.createReadStream(t).pipe(new l.CsvParserStream(new a.ParserOptions(e)))},r.parseString=(t,e)=>{const r=new o.Readable;return r.push(t),r.push(null),r.pipe(new l.CsvParserStream(new a.ParserOptions(e)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Parser=void 0;const n=t("./Scanner"),i=t("./RowParser"),s=t("./Token");class o{constructor(t){this.parserOptions=t,this.rowParser=new i.RowParser(this.parserOptions)}static removeBOM(t){return t&&65279===t.charCodeAt(0)?t.slice(1):t}parse(t,e){const r=new n.Scanner({line:o.removeBOM(t),parserOptions:this.parserOptions,hasMoreData:e});return this.parserOptions.supportsComments?this.parseWithComments(r):this.parseWithoutComments(r)}parseWithoutComments(t){const e=[];let r=!0;for(;r;)r=this.parseRow(t,e);return{line:t.line,rows:e}}parseWithComments(t){const{parserOptions:e}=this,r=[];for(let n=t.nextCharacterToken;null!==n;n=t.nextCharacterToken)if(s.Token.isTokenComment(n,e)){if(null===t.advancePastLine())return{line:t.lineFromCursor,rows:r};if(!t.hasMoreCharacters)return{line:t.lineFromCursor,rows:r};t.truncateToCursor()}else if(!this.parseRow(t,r))break;return{line:t.line,rows:r}}parseRow(t,e){if(!t.nextNonSpaceToken)return!1;const r=this.rowParser.parse(t);return null!==r&&(this.parserOptions.ignoreEmpty&&i.RowParser.isEmptyRow(r)||e.push(r),!0)}}r.Parser=o},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.RowParser=void 0;const n=t("./column"),i=t("./Token");r.RowParser=class{constructor(t){this.parserOptions=t,this.columnParser=new n.ColumnParser(t)}static isEmptyRow(t){return""===t.join("").replace(/\s+/g,"")}parse(t){const{parserOptions:e}=this,{hasMoreData:r}=t,n=t,s=[];let o=this.getStartToken(n,s);for(;o;){if(i.Token.isTokenRowDelimiter(o))return n.advancePastToken(o),!n.hasMoreCharacters&&i.Token.isTokenCarriageReturn(o,e)&&r?null:(n.truncateToCursor(),s);if(!this.shouldSkipColumnParse(n,o,s)){const t=this.columnParser.parse(n);if(null===t)return null;s.push(t)}o=n.nextNonSpaceToken}return r?null:(n.truncateToCursor(),s)}getStartToken(t,e){const r=t.nextNonSpaceToken;return null!==r&&i.Token.isTokenDelimiter(r,this.parserOptions)?(e.push(""),t.nextNonSpaceToken):r}shouldSkipColumnParse(t,e,r){const{parserOptions:n}=this;if(i.Token.isTokenDelimiter(e,n)){t.advancePastToken(e);const s=t.nextCharacterToken;if(!t.hasMoreCharacters||null!==s&&i.Token.isTokenRowDelimiter(s))return r.push(""),!0;if(null!==s&&i.Token.isTokenDelimiter(s,n))return r.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Scanner=void 0;const n=t("./Token"),i=/((?:\r\n)|\n|\r)/;r.Scanner=class{constructor(t){this.cursor=0,this.line=t.line,this.lineLength=this.line.length,this.parserOptions=t.parserOptions,this.hasMoreData=t.hasMoreData,this.cursor=t.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:t}=this,e=this.parserOptions.NEXT_TOKEN_REGEXP;if(-1===t.search(e))return null;const r=e.exec(t);if(null==r)return null;const i=r[1],s=this.cursor+(r.index||0);return new n.Token({token:i,startCursor:s,endCursor:s+i.length-1})}get nextCharacterToken(){const{cursor:t,lineLength:e}=this;return e<=t?null:new n.Token({token:this.line[t],startCursor:t,endCursor:t})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const t=i.exec(this.lineFromCursor);return t?(this.cursor+=(t.index||0)+t[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(t){return this.cursor=t,this}advanceToToken(t){return this.cursor=t.startCursor,this}advancePastToken(t){return this.cursor=t.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Token=void 0,r.Token=class{constructor(t){this.token=t.token,this.startCursor=t.startCursor,this.endCursor=t.endCursor}static isTokenRowDelimiter(t){const e=t.token;return"\r"===e||"\n"===e||"\r\n"===e}static isTokenCarriageReturn(t,e){return t.token===e.carriageReturn}static isTokenComment(t,e){return e.supportsComments&&!!t&&t.token===e.comment}static isTokenEscapeCharacter(t,e){return t.token===e.escapeChar}static isTokenQuote(t,e){return t.token===e.quote}static isTokenDelimiter(t,e){return t.token===e.delimiter}}},{}],160:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ColumnFormatter=void 0,r.ColumnFormatter=class{constructor(t){t.trim?this.format=t=>t.trim():t.ltrim?this.format=t=>t.trimLeft():t.rtrim?this.format=t=>t.trimRight():this.format=t=>t}}},{}],161:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ColumnParser=void 0;const n=t("./NonQuotedColumnParser"),i=t("./QuotedColumnParser"),s=t("../Token");r.ColumnParser=class{constructor(t){this.parserOptions=t,this.quotedColumnParser=new i.QuotedColumnParser(t),this.nonQuotedColumnParser=new n.NonQuotedColumnParser(t)}parse(t){const{nextNonSpaceToken:e}=t;return null!==e&&s.Token.isTokenQuote(e,this.parserOptions)?(t.advanceToToken(e),this.quotedColumnParser.parse(t)):this.nonQuotedColumnParser.parse(t)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.NonQuotedColumnParser=void 0;const n=t("./ColumnFormatter"),i=t("../Token");r.NonQuotedColumnParser=class{constructor(t){this.parserOptions=t,this.columnFormatter=new n.ColumnFormatter(t)}parse(t){if(!t.hasMoreCharacters)return null;const{parserOptions:e}=this,r=[];let n=t.nextCharacterToken;for(;n&&!i.Token.isTokenDelimiter(n,e)&&!i.Token.isTokenRowDelimiter(n);n=t.nextCharacterToken)r.push(n.token),t.advancePastToken(n);return this.columnFormatter.format(r.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.QuotedColumnParser=void 0;const n=t("./ColumnFormatter"),i=t("../Token");r.QuotedColumnParser=class{constructor(t){this.parserOptions=t,this.columnFormatter=new n.ColumnFormatter(t)}parse(t){if(!t.hasMoreCharacters)return null;const e=t.cursor,{foundClosingQuote:r,col:n}=this.gatherDataBetweenQuotes(t);if(!r){if(t.advanceTo(e),!t.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${t.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(t),n}gatherDataBetweenQuotes(t){const{parserOptions:e}=this;let r=!1,n=!1;const s=[];let o=t.nextCharacterToken;for(;!n&&null!==o;o=t.nextCharacterToken){const a=i.Token.isTokenQuote(o,e);if(!r&&a)r=!0;else if(r)if(i.Token.isTokenEscapeCharacter(o,e)){t.advancePastToken(o);const r=t.nextCharacterToken;null!==r&&(i.Token.isTokenQuote(r,e)||i.Token.isTokenEscapeCharacter(r,e))?(s.push(r.token),o=r):a?n=!0:s.push(o.token)}else a?n=!0:s.push(o.token);t.advancePastToken(o)}return{col:this.columnFormatter.format(s.join("")),foundClosingQuote:n}}checkForMalformedColumn(t){const{parserOptions:e}=this,{nextNonSpaceToken:r}=t;if(r){const n=i.Token.isTokenDelimiter(r,e),s=i.Token.isTokenRowDelimiter(r);if(!n&&!s){const n=t.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${e.escapedDelimiter}' OR new line got: '${r.token}'. at '${n}`)}t.advanceToToken(r)}else t.hasMoreData||t.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ColumnFormatter=r.QuotedColumnParser=r.NonQuotedColumnParser=r.ColumnParser=void 0;var n=t("./ColumnParser");Object.defineProperty(r,"ColumnParser",{enumerable:!0,get:function(){return n.ColumnParser}});var i=t("./NonQuotedColumnParser");Object.defineProperty(r,"NonQuotedColumnParser",{enumerable:!0,get:function(){return i.NonQuotedColumnParser}});var s=t("./QuotedColumnParser");Object.defineProperty(r,"QuotedColumnParser",{enumerable:!0,get:function(){return s.QuotedColumnParser}});var o=t("./ColumnFormatter");Object.defineProperty(r,"ColumnFormatter",{enumerable:!0,get:function(){return o.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.QuotedColumnParser=r.NonQuotedColumnParser=r.ColumnParser=r.Token=r.Scanner=r.RowParser=r.Parser=void 0;var n=t("./Parser");Object.defineProperty(r,"Parser",{enumerable:!0,get:function(){return n.Parser}});var i=t("./RowParser");Object.defineProperty(r,"RowParser",{enumerable:!0,get:function(){return i.RowParser}});var s=t("./Scanner");Object.defineProperty(r,"Scanner",{enumerable:!0,get:function(){return s.Scanner}});var o=t("./Token");Object.defineProperty(r,"Token",{enumerable:!0,get:function(){return o.Token}});var a=t("./column");Object.defineProperty(r,"ColumnParser",{enumerable:!0,get:function(){return a.ColumnParser}}),Object.defineProperty(r,"NonQuotedColumnParser",{enumerable:!0,get:function(){return a.NonQuotedColumnParser}}),Object.defineProperty(r,"QuotedColumnParser",{enumerable:!0,get:function(){return a.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(t,e,r){"use strict";var n=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.HeaderTransformer=void 0;const i=n(t("lodash.isundefined")),s=n(t("lodash.isfunction")),o=n(t("lodash.uniq")),a=n(t("lodash.groupby"));r.HeaderTransformer=class{constructor(t){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=t,!0===t.headers?this.shouldUseFirstRow=!0:Array.isArray(t.headers)?this.setHeaders(t.headers):s.default(t.headers)&&(this.headersTransform=t.headers)}transform(t,e){return this.shouldMapRow(t)?e(null,this.processRow(t)):e(null,{row:null,isValid:!0})}shouldMapRow(t){const{parserOptions:e}=this;if(!this.headersTransform&&e.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(t)){if(this.headersTransform)this.setHeaders(this.headersTransform(t));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(t)}return!1}return!0}processRow(t){if(!this.headers)return{row:t,isValid:!0};const{parserOptions:e}=this;if(!e.discardUnmappedColumns&&t.length>this.headersLength){if(!e.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${t.length}`);return{row:t,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${t.length}`}}return e.strictColumnHandling&&t.length<this.headersLength?{row:t,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${t.length}`}:{row:this.mapHeaders(t),isValid:!0}}mapHeaders(t){const e={},{headers:r,headersLength:n}=this;for(let s=0;s<n;s+=1){const n=r[s];if(!i.default(n)){const r=t[s];i.default(r)?e[n]="":e[n]=r}}return e}setHeaders(t){var e;const r=t.filter((t=>!!t));if(o.default(r).length!==r.length){const t=a.default(r),e=Object.keys(t).filter((e=>t[e].length>1));throw new Error("Duplicate headers found "+JSON.stringify(e))}this.headers=t,this.receivedHeaders=!0,this.headersLength=(null===(e=this.headers)||void 0===e?void 0:e.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.RowTransformerValidator=void 0;const n=function(t){return t&&t.__esModule?t:{default:t}}(t("lodash.isfunction")),i=t("../types");class s{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(t){return i.isSyncTransform(t)?(e,r)=>{let n=null;try{n=t(e)}catch(t){return r(t)}return r(null,n)}:t}static createValidator(t){return i.isSyncValidate(t)?(e,r)=>{r(null,{row:e,isValid:t(e)})}:(e,r)=>{t(e,((t,n,i)=>t?r(t):r(null,n?{row:e,isValid:n,reason:i}:{row:e,isValid:!1,reason:i})))}}set rowTransform(t){if(!n.default(t))throw new TypeError("The transform should be a function");this._rowTransform=s.createTransform(t)}set rowValidator(t){if(!n.default(t))throw new TypeError("The validate should be a function");this._rowValidator=s.createValidator(t)}transformAndValidate(t,e){return this.callTransformer(t,((t,r)=>t?e(t):r?this.callValidator(r,((t,n)=>t?e(t):n&&!n.isValid?e(null,{row:r,isValid:!1,reason:n.reason}):e(null,{row:r,isValid:!0}))):e(null,{row:null,isValid:!0})))}callTransformer(t,e){return this._rowTransform?this._rowTransform(t,e):e(null,t)}callValidator(t,e){return this._rowValidator?this._rowValidator(t,e):e(null,{row:t,isValid:!0})}}r.RowTransformerValidator=s},{"../types":169,"lodash.isfunction":446}],168:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.HeaderTransformer=r.RowTransformerValidator=void 0;var n=t("./RowTransformerValidator");Object.defineProperty(r,"RowTransformerValidator",{enumerable:!0,get:function(){return n.RowTransformerValidator}});var i=t("./HeaderTransformer");Object.defineProperty(r,"HeaderTransformer",{enumerable:!0,get:function(){return i.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isSyncValidate=r.isSyncTransform=void 0,r.isSyncTransform=t=>1===t.length,r.isSyncValidate=t=>1===t.length},{}],170:[function(t,e,r){"use strict";const n=r;n.bignum=t("bn.js"),n.define=t("./asn1/api").define,n.base=t("./asn1/base"),n.constants=t("./asn1/constants"),n.decoders=t("./asn1/decoders"),n.encoders=t("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(t,e,r){"use strict";const n=t("./encoders"),i=t("./decoders"),s=t("inherits");function o(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}r.define=function(t,e){return new o(t,e)},o.prototype._createNamed=function(t){const e=this.name;function r(t){this._initNamed(t,e)}return s(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},o.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},o.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},o.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},o.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(t,e,r){"use strict";const n=t("inherits"),i=t("../base/reporter").Reporter,s=t("safer-buffer").Buffer;function o(t,e){i.call(this,e),s.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=s.byteLength(t);else{if(!s.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}n(o,i),r.DecoderBuffer=o,o.isDecoderBuffer=function(t){return t instanceof o||"object"==typeof t&&s.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},o.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},o.prototype.restore=function(t){const e=new o(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),e},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},o.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const r=new o(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},o.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},r.EncoderBuffer=a,a.isEncoderBuffer=function(t){return t instanceof a||"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},a.prototype.join=function(t,e){return t||(t=s.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):s.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(t,e,r){"use strict";const n=r;n.Reporter=t("./reporter").Reporter,n.DecoderBuffer=t("./buffer").DecoderBuffer,n.EncoderBuffer=t("./buffer").EncoderBuffer,n.Node=t("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(t,e,r){"use strict";const n=t("../base/reporter").Reporter,i=t("../base/buffer").EncoderBuffer,s=t("../base/buffer").DecoderBuffer,o=t("minimalistic-assert"),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],l=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function u(t,e,r){const n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=u;const c=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){const t=this._baseState,e={};c.forEach((function(r){e[r]=t[r]}));const r=new this.constructor(e.parent);return r._baseState=e,r},u.prototype._wrap=function(){const t=this._baseState;l.forEach((function(e){this[e]=function(){const r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},u.prototype._init=function(t){const e=this._baseState;o(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),o.equal(e.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(t){const e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(o(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(o(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);const n=t[r];e[n]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){u.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){u.prototype[t]=function(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return o(null===e.tag),e.tag=t,this._useArgs(r),this}})),u.prototype.use=function(t){o(t);const e=this._baseState;return o(null===e.use),e.use=t,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(t){const e=this._baseState;return o(null===e.default),e.default=t,e.optional=!0,this},u.prototype.explicit=function(t){const e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.explicit=t,this},u.prototype.implicit=function(t){const e=this._baseState;return o(null===e.explicit&&null===e.implicit),e.implicit=t,this},u.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},u.prototype.key=function(t){const e=this._baseState;return o(null===e.key),e.key=t,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(t){const e=this._baseState;return o(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},u.prototype.contains=function(t){const e=this._baseState;return o(null===e.use),e.contains=t,this},u.prototype._decode=function(t,e){const r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));let n,i=r.default,o=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(o=this._peekTag(t,n,r.any),t.isError(o))return o}else{const n=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),o=!0}catch(t){o=!1}t.restore(n)}}if(r.obj&&o&&(n=t.enterObject()),o){if(null!==r.explicit){const e=this._decodeTag(t,r.explicit);if(t.isError(e))return e;t=e}const n=t.offset;if(null===r.use&&null===r.choice){let e;r.any&&(e=t.save());const n=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(n))return n;r.any?i=t.raw(e):t=n}if(e&&e.track&&null!==r.tag&&e.track(t.path(),n,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new s(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(n,e)}}return r.obj&&o&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==o?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,i),i},u.prototype._decodeGeneric=function(t,e,r){const n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},u.prototype._getUse=function(t,e){const r=this._baseState;return r.useDecoder=this._use(t,e),o(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},u.prototype._decodeChoice=function(t,e){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(s){const o=t.save(),a=r.choice[s];try{const r=a._decode(t,e);if(t.isError(r))return!1;n={type:s,value:r},i=!0}catch(e){return t.restore(o),!1}return!0}),this),i?n:t.error("Choice not matched")},u.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},u.prototype._encode=function(t,e,r){const n=this._baseState;if(null!==n.default&&n.default===t)return;const i=this._encodeValue(t,e,r);return void 0===i||this._skipDefault(i,e,r)?void 0:i},u.prototype._encodeValue=function(t,e,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new n);let s=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(t);else if(i.choice)s=this._encodeChoice(t,e);else if(i.contains)o=this._getUse(i.contains,r)._encode(t,e),a=!0;else if(i.children)o=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");const n=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i}),this).filter((function(t){return t})),o=this._createEncoderBuffer(o);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,o=this._createEncoderBuffer(t.map((function(r){const n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)}),r))}else null!==i.use?s=this._getUse(i.use,r)._encode(t,e):(o=this._encodePrimitive(i.tag,t),a=!0);if(!i.any&&null===i.choice){const t=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===t?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(s=this._encodeComposite(t,a,r,o))}return null!==i.explicit&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s},u.prototype._encodeChoice=function(t,e){const r=this._baseState,n=r.choice[t.type];return n||o(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},u.prototype._encodePrimitive=function(t,e){const r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},u.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},u.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(t,e,r){"use strict";const n=t("inherits");function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function s(t,e){this.path=t,this.rethrow(e)}r.Reporter=i,i.prototype.isError=function(t){return t instanceof s},i.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){const n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){const e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){let e;const r=this._reporterState,n=t instanceof s;if(e=n?t:new s(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(s,Error),s.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,s),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:440}],176:[function(t,e,r){"use strict";function n(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e}r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=n(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=n(r.tag)},{}],177:[function(t,e,r){"use strict";const n=r;n._reverse=function(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e},n.der=t("./der")},{"./der":176}],178:[function(t,e,r){"use strict";const n=t("inherits"),i=t("bn.js"),s=t("../base/buffer").DecoderBuffer,o=t("../base/node"),a=t("../constants/der");function l(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.call(this,"der",t)}function c(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;const n=a.tagClass[r>>6],i=!(32&r);if(31&~r)r&=31;else{let n=r;for(r=0;!(128&~n);){if(n=t.readUInt8(e),t.isError(n))return n;r<<=7,r|=127&n}}return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function h(t,e,r){let n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(!(128&n))return n;const i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(let e=0;e<i;e++){n<<=8;const e=t.readUInt8(r);if(t.isError(e))return e;n|=e}return n}e.exports=l,l.prototype.decode=function(t,e){return s.isDecoderBuffer(t)||(t=new s(t,e)),this.tree._decode(t,e)},n(u,o),u.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;const n=t.save(),i=c(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},u.prototype._decodeTag=function(t,e,r){const n=c(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;let i=h(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');const s=t.save(),o=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(o)?o:(i=t.offset-s.offset,t.restore(s),t.skip(i,'Failed to match body of: "'+e+'"'))},u.prototype._skipUntilEnd=function(t,e){for(;;){const r=c(t,e);if(t.isError(r))return r;const n=h(t,r.primitive,e);if(t.isError(n))return n;let i;if(i=r.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===r.tagStr)break}},u.prototype._decodeList=function(t,e,r,n){const i=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const s=r.decode(t,"der",n);if(t.isError(s)&&e)break;i.push(s)}return i},u.prototype._decodeStr=function(t,e){if("bitstr"===e){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===e){const e=t.raw();if(e.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");let r="";for(let t=0;t<e.length/2;t++)r+=String.fromCharCode(e.readUInt16BE(2*t));return r}if("numstr"===e){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},u.prototype._decodeObjid=function(t,e,r){let n;const i=[];let s=0,o=0;for(;!t.isEmpty();)o=t.readUInt8(),s<<=7,s|=127&o,!(128&o)&&(i.push(s),s=0);128&o&&i.push(s);const a=i[0]/40|0,l=i[0]%40;if(n=r?i:[a,l].concat(i.slice(1)),e){let t=e[n.join(" ")];void 0===t&&(t=e[n.join(".")]),void 0!==t&&(n=t)}return n},u.prototype._decodeTime=function(t,e){const r=t.raw().toString();let n,i,s,o,a,l;if("gentime"===e)n=0|r.slice(0,4),i=0|r.slice(4,6),s=0|r.slice(6,8),o=0|r.slice(8,10),a=0|r.slice(10,12),l=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),s=0|r.slice(4,6),o=0|r.slice(6,8),a=0|r.slice(8,10),l=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,s,o,a,l,0)},u.prototype._decodeNull=function(){return null},u.prototype._decodeBool=function(t){const e=t.readUInt8();return t.isError(e)?e:0!==e},u.prototype._decodeInt=function(t,e){const r=t.raw();let n=new i(r);return e&&(n=e[n.toString(10)]||n),n},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},{"../base/buffer":172,"../base/node":174,"../constants/der":176,"bn.js":184,inherits:440}],179:[function(t,e,r){"use strict";const n=r;n.der=t("./der"),n.pem=t("./pem")},{"./der":178,"./pem":180}],180:[function(t,e,r){"use strict";const n=t("inherits"),i=t("safer-buffer").Buffer,s=t("./der");function o(t){s.call(this,t),this.enc="pem"}n(o,s),e.exports=o,o.prototype.decode=function(t,e){const r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,l=-1;for(let t=0;t<r.length;t++){const e=r[t].match(o);if(null!==e&&e[2]===n){if(-1!==a){if("END"!==e[1])break;l=t;break}if("BEGIN"!==e[1])break;a=t}}if(-1===a||-1===l)throw new Error("PEM section not found for: "+n);const u=r.slice(a+1,l).join("");u.replace(/[^a-z0-9+/=]+/gi,"");const c=i.from(u,"base64");return s.prototype.decode.call(this,c,e)}},{"./der":178,inherits:440,"safer-buffer":495}],181:[function(t,e,r){"use strict";const n=t("inherits"),i=t("safer-buffer").Buffer,s=t("../base/node"),o=t("../constants/der");function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new l,this.tree._init(t.body)}function l(t){s.call(this,"der",t)}function u(t){return t<10?"0"+t:t}e.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(l,s),l.prototype._encodeComposite=function(t,e,r,n){const s=function(t,e,r,n){let i;if("seqof"===t?t="seq":"setof"===t&&(t="set"),o.tagByName.hasOwnProperty(t))i=o.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=o.tagClassByName[r||"universal"]<<6,i)}(t,e,r,this.reporter);if(n.length<128){const t=i.alloc(2);return t[0]=s,t[1]=n.length,this._createEncoderBuffer([t,n])}let a=1;for(let t=n.length;t>=256;t>>=8)a++;const l=i.alloc(2+a);l[0]=s,l[1]=128|a;for(let t=1+a,e=n.length;e>0;t--,e>>=8)l[t]=255&e;return this._createEncoderBuffer([l,n])},l.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=i.alloc(2*t.length);for(let r=0;r<t.length;r++)e.writeUInt16BE(t.charCodeAt(r),2*r);return this._createEncoderBuffer(e)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},l.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let n=0;for(let e=0;e<t.length;e++){let r=t[e];for(n++;r>=128;r>>=7)n++}const s=i.alloc(n);let o=s.length-1;for(let e=t.length-1;e>=0;e--){let r=t[e];for(s[o--]=127&r;(r>>=7)>0;)s[o--]=128|127&r}return this._createEncoderBuffer(s)},l.prototype._encodeTime=function(t,e){let r;const n=new Date(t);return"gentime"===e?r=[u(n.getUTCFullYear()),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[u(n.getUTCFullYear()%100),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},l.prototype._encodeNull=function(){return this._createEncoderBuffer("")},l.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=i.from(e)}if(i.isBuffer(t)){let e=t.length;0===t.length&&e++;const r=i.alloc(e);return t.copy(r),0===t.length&&(r[0]=0),this._createEncoderBuffer(r)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let e=t;e>=256;e>>=8)r++;const n=new Array(r);for(let e=n.length-1;e>=0;e--)n[e]=255&t,t>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},l.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},l.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},l.prototype._skipDefault=function(t,e,r){const n=this._baseState;let i;if(null===n.default)return!1;const s=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),s.length!==n.defaultBuffer.length)return!1;for(i=0;i<s.length;i++)if(s[i]!==n.defaultBuffer[i])return!1;return!0}},{"../base/node":174,"../constants/der":176,inherits:440,"safer-buffer":495}],182:[function(t,e,r){"use strict";const n=r;n.der=t("./der"),n.pem=t("./pem")},{"./der":181,"./pem":183}],183:[function(t,e,r){"use strict";const n=t("inherits"),i=t("./der");function s(t){i.call(this,t),this.enc="pem"}n(s,i),e.exports=s,s.prototype.encode=function(t,e){const r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"];for(let t=0;t<r.length;t+=64)n.push(r.slice(t,t+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},{"./der":181,inherits:440}],184:[function(t,e,r){"use strict";!function(e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=s:(void 0).BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t("buffer").Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,s=Math.min(t.length,r),o=e;o<s;o++){var a=t.charCodeAt(o)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var s,o,a=0;if("be"===r)for(i=t.length-1,s=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(i=0,s=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,s=0,o=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=l(t,e,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=l(t,e,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var s=t.length-r,o=s%n,a=Math.min(s,s-o)+r,l=0,c=r;c<a;c+=n)l=u(t,c,c+n,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var h=1;for(l=u(t,c,t.length,e),c=0;c<o;c++)h*=e;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,a=67108863&o,l=o/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var c=l>>>26,h=67108863&l,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;c+=(o=(i=0|t.words[p])*(s=0|e.words[f])+h)/67108864|0,h=67108863&o}r.words[u]=0|h,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,s=0,o=0;o<this.length;o++){var a=this.words[o],l=(16777215&(a<<i|s)).toString(16);r=0!=(s=a>>>24-i&16777215)||o!==this.length-1?c[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:c[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0"),this.strip();var o,a,l="le"===e,u=new t(s),c=this.clone();if(l){for(a=0;!c.isZero();a++)o=c.andln(255),c.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-i;a++)u[a]=0;for(a=0;!c.isZero();a++)o=c.andln(255),c.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return!(8191&e)&&(r+=13,e>>>=13),!(127&e)&&(r+=7,e>>>=7),!(15&e)&&(r+=4,e>>>=4),!(3&e)&&(r+=2,e>>>=2),!(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return n(!(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return n(!(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return n(!(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,s=0;s<n.length;s++)e=(0|r.words[s])+(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<r.length;s++)e=(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var s=0,o=0;o<n.length;o++)s=(e=(0|r.words[o])-(0|n.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<r.length;o++)s=(e=(0|r.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,s,o=t.words,a=e.words,l=r.words,u=0,c=0|o[0],h=8191&c,d=c>>>13,f=0|o[1],p=8191&f,m=f>>>13,b=0|o[2],g=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,x=0|o[4],S=8191&x,C=x>>>13,A=0|o[5],k=8191&A,T=A>>>13,E=0|o[6],M=8191&E,R=E>>>13,I=0|o[7],O=8191&I,j=I>>>13,P=0|o[8],N=8191&P,B=P>>>13,F=0|o[9],D=8191&F,L=F>>>13,V=0|a[0],z=8191&V,U=V>>>13,$=0|a[1],H=8191&$,W=$>>>13,q=0|a[2],Y=8191&q,X=q>>>13,G=0|a[3],K=8191&G,Z=G>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],st=8191&it,ot=it>>>13,at=0|a[7],lt=8191&at,ut=at>>>13,ct=0|a[8],ht=8191&ct,dt=ct>>>13,ft=0|a[9],pt=8191&ft,mt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(u+(n=Math.imul(h,z))|0)+((8191&(i=(i=Math.imul(h,U))+Math.imul(d,z)|0))<<13)|0;u=((s=Math.imul(d,U))+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,U))+Math.imul(m,z)|0,s=Math.imul(m,U);var gt=(u+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,H)|0))<<13)|0;u=((s=s+Math.imul(d,W)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,z),i=(i=Math.imul(g,U))+Math.imul(y,z)|0,s=Math.imul(y,U),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,s=s+Math.imul(m,W)|0;var yt=(u+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,Y)|0))<<13)|0;u=((s=s+Math.imul(d,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,U))+Math.imul(_,z)|0,s=Math.imul(_,U),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(y,H)|0,s=s+Math.imul(y,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,X)|0;var vt=(u+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,K)|0))<<13)|0;u=((s=s+Math.imul(d,Z)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,U))+Math.imul(C,z)|0,s=Math.imul(C,U),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,H)|0,s=s+Math.imul(_,W)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,X)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,Z)|0;var wt=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,z),i=(i=Math.imul(k,U))+Math.imul(T,z)|0,s=Math.imul(T,U),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(C,H)|0,s=s+Math.imul(C,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,X)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,tt)|0;var _t=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;u=((s=s+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(M,z),i=(i=Math.imul(M,U))+Math.imul(R,z)|0,s=Math.imul(R,U),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(T,H)|0,s=s+Math.imul(T,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(C,Y)|0,s=s+Math.imul(C,X)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,Z)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,s=s+Math.imul(m,nt)|0;var xt=(u+(n=n+Math.imul(h,st)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(O,z),i=(i=Math.imul(O,U))+Math.imul(j,z)|0,s=Math.imul(j,U),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(R,H)|0,s=s+Math.imul(R,W)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,X)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(C,K)|0,s=s+Math.imul(C,Z)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,s=s+Math.imul(y,nt)|0,n=n+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var St=(u+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(d,lt)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,U))+Math.imul(B,z)|0,s=Math.imul(B,U),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(j,H)|0,s=s+Math.imul(j,W)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(R,Y)|0,s=s+Math.imul(R,X)|0,n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(T,K)|0,s=s+Math.imul(T,Z)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,s=s+Math.imul(_,nt)|0,n=n+Math.imul(g,st)|0,i=(i=i+Math.imul(g,ot)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(m,lt)|0,s=s+Math.imul(m,ut)|0;var Ct=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(D,z),i=(i=Math.imul(D,U))+Math.imul(L,z)|0,s=Math.imul(L,U),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(B,H)|0,s=s+Math.imul(B,W)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(j,Y)|0,s=s+Math.imul(j,X)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(R,K)|0,s=s+Math.imul(R,Z)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(C,rt)|0,s=s+Math.imul(C,nt)|0,n=n+Math.imul(w,st)|0,i=(i=i+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ut)|0)+Math.imul(y,lt)|0,s=s+Math.imul(y,ut)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,dt)|0;var At=(u+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((s=s+Math.imul(d,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,W))+Math.imul(L,H)|0,s=Math.imul(L,W),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,X)|0,n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(j,K)|0,s=s+Math.imul(j,Z)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(R,Q)|0,s=s+Math.imul(R,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(T,rt)|0,s=s+Math.imul(T,nt)|0,n=n+Math.imul(S,st)|0,i=(i=i+Math.imul(S,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(_,lt)|0,s=s+Math.imul(_,ut)|0,n=n+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(y,ht)|0,s=s+Math.imul(y,dt)|0;var kt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,X))+Math.imul(L,Y)|0,s=Math.imul(L,X),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,Z)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(j,Q)|0,s=s+Math.imul(j,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(R,rt)|0,s=s+Math.imul(R,nt)|0,n=n+Math.imul(k,st)|0,i=(i=i+Math.imul(k,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,n=n+Math.imul(S,lt)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(C,lt)|0,s=s+Math.imul(C,ut)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,dt)|0;var Tt=(u+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((s=s+Math.imul(y,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,Z))+Math.imul(L,K)|0,s=Math.imul(L,Z),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(j,rt)|0,s=s+Math.imul(j,nt)|0,n=n+Math.imul(M,st)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(R,st)|0,s=s+Math.imul(R,ot)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ut)|0)+Math.imul(T,lt)|0,s=s+Math.imul(T,ut)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,dt)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,dt)|0;var Et=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(L,Q)|0,s=Math.imul(L,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(B,rt)|0,s=s+Math.imul(B,nt)|0,n=n+Math.imul(O,st)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(j,st)|0,s=s+Math.imul(j,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(R,lt)|0,s=s+Math.imul(R,ut)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,dt)|0;var Mt=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((s=s+Math.imul(C,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(L,rt)|0,s=Math.imul(L,nt),n=n+Math.imul(N,st)|0,i=(i=i+Math.imul(N,ot)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,ot)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(j,lt)|0,s=s+Math.imul(j,ut)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(R,ht)|0,s=s+Math.imul(R,dt)|0;var Rt=(u+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,st),i=(i=Math.imul(D,ot))+Math.imul(L,st)|0,s=Math.imul(L,ot),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ut)|0)+Math.imul(B,lt)|0,s=s+Math.imul(B,ut)|0,n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(j,ht)|0,s=s+Math.imul(j,dt)|0;var It=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((s=s+Math.imul(R,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ut))+Math.imul(L,lt)|0,s=Math.imul(L,ut),n=n+Math.imul(N,ht)|0,i=(i=i+Math.imul(N,dt)|0)+Math.imul(B,ht)|0,s=s+Math.imul(B,dt)|0;var Ot=(u+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((s=s+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,ht),i=(i=Math.imul(D,dt))+Math.imul(L,ht)|0,s=Math.imul(L,dt);var jt=(u+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(B,pt)|0))<<13)|0;u=((s=s+Math.imul(B,mt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Pt=(u+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(L,pt)|0))<<13)|0;return u=((s=Math.imul(L,mt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=bt,l[1]=gt,l[2]=yt,l[3]=vt,l[4]=wt,l[5]=_t,l[6]=xt,l[7]=St,l[8]=Ct,l[9]=At,l[10]=kt,l[11]=Tt,l[12]=Et,l[13]=Mt,l[14]=Rt,l[15]=It,l[16]=Ot,l[17]=jt,l[18]=Pt,0!==u&&(l[19]=u,r.length++),r};function m(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(p=f),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,s=0;s<r.length-1;s++){var o=i;i=0;for(var a=67108863&n,l=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=l;u++){var c=s-u,h=(0|t.words[c])*(0|e.words[u]),d=67108863&h;a=67108863&(d=d+a|0),i+=(o=(o=o+(h/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[s]=a,n=o,o=i}return 0!==n?r.words[s]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,s){for(var o=0;o<s;o++)n[o]=e[t[o]],i[o]=r[t[o]]},b.prototype.transform=function(t,e,r,n,i,s){this.permute(s,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var a=o<<1,l=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var h=l,d=u,f=0;f<o;f++){var p=r[c+f],m=n[c+f],b=r[c+f+o],g=n[c+f+o],y=h*b-d*g;g=h*g+d*b,b=y,r[c+f]=p+b,n[c+f]=m+g,r[c+f+o]=p-b,n[c+f+o]=m-g,f!==a&&(y=l*h-u*d,d=l*d+u*h,h=y)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,i){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===s),n(!(-8192&s))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),s=this.stub(n),o=new Array(n),a=new Array(n),l=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,s,a,l,n,i),this.transform(u,s,c,h,n,i);for(var f=0;f<n;f++){var p=a[f]*c[f]-l[f]*h[f];l[f]=a[f]*h[f]+l[f]*c[f],a[f]=p}return this.conjugate(a,l,n),this.transform(a,l,d,s,n,i),this.conjugate(d,s,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),m(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,s=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=s>>>26,this.words[r]=67108863&s}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,l=(0|this.words[e])-a<<r;this.words[e]=l|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},s.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,l=r;if(i-=o,i=Math.max(0,i),l){for(var u=0;u<o;u++)l.words[u]=this.words[u];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-s|h>>>s,c=h&a}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},s.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var i,s,o=t.length+r;this._expand(o);var a=0;for(i=0;i<t.length;i++){s=(0|this.words[i+r])+a;var l=(0|t.words[i])*e;a=((s-=67108863&l)>>26)-(l/67108864|0),this.words[i+r]=67108863&s}for(;i<this.length-r;i++)a=(s=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&s;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(s=-(0|this.words[i])+a)>>26,this.words[i]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,l=n.length-i.length;if("mod"!==e){(a=new s(null)).length=l+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,l);0===c.negative&&(n=c,a&&(a.words[l]=1));for(var h=l-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=d)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),s=r.cmp(n);return s<0||1===i&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},s.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new s(1),o=new s(0),a=new s(0),l=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;!(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;!(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||l.isOdd())&&(a.iadd(c),l.isub(h)),a.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),o.isub(l)):(r.isub(e),a.isub(i),l.isub(o))}return{a,b:l,gcd:r.iushln(u)}},s.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new s(1),a=new s(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;!(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,d=1;!(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(i=0===e.cmpn(1)?o:a).cmpn(0)<0&&i.iadd(t),i},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var s=e;e=r,r=s}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var s=i,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new S(t)},s.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function C(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(4194303&s)<<4|i>>>22,i=s}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(_,y),i(x,y),x.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return g[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(!(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var a=new s(1).toRed(this),l=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=o;0!==f.cmp(a);){for(var m=f,b=0;0!==m.cmp(a);b++)m=m.redSqr();n(b<p);var g=this.pow(h,new s(1).iushln(p-b-1));d=d.redMul(g),h=g.redSqr(),f=f.redMul(h),p=b}return d},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}l=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new C(t)},i(C,S),C.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},C.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},C.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},C.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},C.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e)},{buffer:188}],185:[function(t,e,r){"use strict";r.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=l(t),o=n[0],a=n[1],u=new s(function(t,e,r){return 3*(e+r)/4-r}(0,o,a)),c=0,h=a>0?o-4:o;for(r=0;r<h;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(u(t,o,o+16383>a?a:o+16383));return 1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var i,s,o=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],186:[function(t,e,r){"use strict";!function(e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=s:(void 0).BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t("buffer").Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function l(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function u(t,e,r,i){for(var s=0,o=0,a=Math.min(t.length,r),l=e;l<a;l++){var u=t.charCodeAt(l)-48;s*=i,o=u>=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&o<i,"Invalid character"),s+=o}return s}function c(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var s,o,a=0;if("be"===r)for(i=t.length-1,s=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(i=0,s=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,s=0,o=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=l(t,e,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=l(t,e,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this._strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var s=t.length-r,o=s%n,a=Math.min(s,s-o)+r,l=0,c=r;c<a;c+=n)l=u(t,c,c+n,e),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var h=1;for(l=u(t,c,t.length,e),c=0;c<o;c++)h*=e;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype._move=function(t){c(t,this)},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){s.prototype.inspect=h}else s.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,a=67108863&o,l=o/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var c=l>>>26,h=67108863&l,d=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=d;f++){var p=u-f|0;c+=(o=(i=0|t.words[p])*(s=0|e.words[f])+h)/67108864|0,h=67108863&o}r.words[u]=0|h,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r._strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,s=0,o=0;o<this.length;o++){var a=this.words[o],l=(16777215&(a<<i|s)).toString(16);s=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==s||o!==this.length-1?d[6-l.length]+l+r:l+r}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],c=p[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modrn(c).toString(t);r=(h=h.idivn(c)).isZero()?m+r:d[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(t,e){return this.toArrayLike(o,t,e)}),s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,i),o},s.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,s=0;i<this.length;i++){var o=this.words[i]<<s|n;t[r++]=255&o,r<t.length&&(t[r++]=o>>8&255),r<t.length&&(t[r++]=o>>16&255),6===s?(r<t.length&&(t[r++]=o>>24&255),n=0,s=0):(n=o>>>24,s+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},s.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,s=0;i<this.length;i++){var o=this.words[i]<<s|n;t[r--]=255&o,r>=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===s?(r>=0&&(t[r--]=o>>24&255),n=0,s=0):(n=o>>>24,s+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return!(8191&e)&&(r+=13,e>>>=13),!(127&e)&&(r+=7,e>>>=7),!(15&e)&&(r+=4,e>>>=4),!(3&e)&&(r+=2,e>>>=2),!(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},s.prototype.ior=function(t){return n(!(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},s.prototype.iand=function(t){return n(!(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},s.prototype.ixor=function(t){return n(!(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,s=0;s<n.length;s++)e=(0|r.words[s])+(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<r.length;s++)e=(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var s=0,o=0;o<n.length;o++)s=(e=(0|r.words[o])-(0|n.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<r.length;o++)s=(e=(0|r.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var b=function(t,e,r){var n,i,s,o=t.words,a=e.words,l=r.words,u=0,c=0|o[0],h=8191&c,d=c>>>13,f=0|o[1],p=8191&f,m=f>>>13,b=0|o[2],g=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,x=0|o[4],S=8191&x,C=x>>>13,A=0|o[5],k=8191&A,T=A>>>13,E=0|o[6],M=8191&E,R=E>>>13,I=0|o[7],O=8191&I,j=I>>>13,P=0|o[8],N=8191&P,B=P>>>13,F=0|o[9],D=8191&F,L=F>>>13,V=0|a[0],z=8191&V,U=V>>>13,$=0|a[1],H=8191&$,W=$>>>13,q=0|a[2],Y=8191&q,X=q>>>13,G=0|a[3],K=8191&G,Z=G>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],st=8191&it,ot=it>>>13,at=0|a[7],lt=8191&at,ut=at>>>13,ct=0|a[8],ht=8191&ct,dt=ct>>>13,ft=0|a[9],pt=8191&ft,mt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(u+(n=Math.imul(h,z))|0)+((8191&(i=(i=Math.imul(h,U))+Math.imul(d,z)|0))<<13)|0;u=((s=Math.imul(d,U))+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,U))+Math.imul(m,z)|0,s=Math.imul(m,U);var gt=(u+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,H)|0))<<13)|0;u=((s=s+Math.imul(d,W)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,z),i=(i=Math.imul(g,U))+Math.imul(y,z)|0,s=Math.imul(y,U),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,s=s+Math.imul(m,W)|0;var yt=(u+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,Y)|0))<<13)|0;u=((s=s+Math.imul(d,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,U))+Math.imul(_,z)|0,s=Math.imul(_,U),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(y,H)|0,s=s+Math.imul(y,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,X)|0;var vt=(u+(n=n+Math.imul(h,K)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,K)|0))<<13)|0;u=((s=s+Math.imul(d,Z)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,U))+Math.imul(C,z)|0,s=Math.imul(C,U),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,H)|0,s=s+Math.imul(_,W)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,X)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,Z)|0;var wt=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,z),i=(i=Math.imul(k,U))+Math.imul(T,z)|0,s=Math.imul(T,U),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(C,H)|0,s=s+Math.imul(C,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,X)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,tt)|0;var _t=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;u=((s=s+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(M,z),i=(i=Math.imul(M,U))+Math.imul(R,z)|0,s=Math.imul(R,U),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(T,H)|0,s=s+Math.imul(T,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(C,Y)|0,s=s+Math.imul(C,X)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,Z)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,s=s+Math.imul(m,nt)|0;var xt=(u+(n=n+Math.imul(h,st)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(O,z),i=(i=Math.imul(O,U))+Math.imul(j,z)|0,s=Math.imul(j,U),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(R,H)|0,s=s+Math.imul(R,W)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,X)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(C,K)|0,s=s+Math.imul(C,Z)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,s=s+Math.imul(y,nt)|0,n=n+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0;var St=(u+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(d,lt)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,U))+Math.imul(B,z)|0,s=Math.imul(B,U),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(j,H)|0,s=s+Math.imul(j,W)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(R,Y)|0,s=s+Math.imul(R,X)|0,n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(T,K)|0,s=s+Math.imul(T,Z)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(C,Q)|0,s=s+Math.imul(C,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,s=s+Math.imul(_,nt)|0,n=n+Math.imul(g,st)|0,i=(i=i+Math.imul(g,ot)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(m,lt)|0,s=s+Math.imul(m,ut)|0;var Ct=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(D,z),i=(i=Math.imul(D,U))+Math.imul(L,z)|0,s=Math.imul(L,U),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(B,H)|0,s=s+Math.imul(B,W)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(j,Y)|0,s=s+Math.imul(j,X)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(R,K)|0,s=s+Math.imul(R,Z)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(C,rt)|0,s=s+Math.imul(C,nt)|0,n=n+Math.imul(w,st)|0,i=(i=i+Math.imul(w,ot)|0)+Math.imul(_,st)|0,s=s+Math.imul(_,ot)|0,n=n+Math.imul(g,lt)|0,i=(i=i+Math.imul(g,ut)|0)+Math.imul(y,lt)|0,s=s+Math.imul(y,ut)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,dt)|0;var At=(u+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((s=s+Math.imul(d,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,W))+Math.imul(L,H)|0,s=Math.imul(L,W),n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,X)|0,n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(j,K)|0,s=s+Math.imul(j,Z)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(R,Q)|0,s=s+Math.imul(R,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(T,rt)|0,s=s+Math.imul(T,nt)|0,n=n+Math.imul(S,st)|0,i=(i=i+Math.imul(S,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(_,lt)|0,s=s+Math.imul(_,ut)|0,n=n+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(y,ht)|0,s=s+Math.imul(y,dt)|0;var kt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((s=s+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,X))+Math.imul(L,Y)|0,s=Math.imul(L,X),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,Z)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(j,Q)|0,s=s+Math.imul(j,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(R,rt)|0,s=s+Math.imul(R,nt)|0,n=n+Math.imul(k,st)|0,i=(i=i+Math.imul(k,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,n=n+Math.imul(S,lt)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(C,lt)|0,s=s+Math.imul(C,ut)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,s=s+Math.imul(_,dt)|0;var Tt=(u+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((s=s+Math.imul(y,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,Z))+Math.imul(L,K)|0,s=Math.imul(L,Z),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(j,rt)|0,s=s+Math.imul(j,nt)|0,n=n+Math.imul(M,st)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(R,st)|0,s=s+Math.imul(R,ot)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ut)|0)+Math.imul(T,lt)|0,s=s+Math.imul(T,ut)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,dt)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,dt)|0;var Et=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((s=s+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(L,Q)|0,s=Math.imul(L,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(B,rt)|0,s=s+Math.imul(B,nt)|0,n=n+Math.imul(O,st)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(j,st)|0,s=s+Math.imul(j,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(R,lt)|0,s=s+Math.imul(R,ut)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,dt)|0;var Mt=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((s=s+Math.imul(C,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(L,rt)|0,s=Math.imul(L,nt),n=n+Math.imul(N,st)|0,i=(i=i+Math.imul(N,ot)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,ot)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(j,lt)|0,s=s+Math.imul(j,ut)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(R,ht)|0,s=s+Math.imul(R,dt)|0;var Rt=(u+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((s=s+Math.imul(T,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,st),i=(i=Math.imul(D,ot))+Math.imul(L,st)|0,s=Math.imul(L,ot),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ut)|0)+Math.imul(B,lt)|0,s=s+Math.imul(B,ut)|0,n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(j,ht)|0,s=s+Math.imul(j,dt)|0;var It=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((s=s+Math.imul(R,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ut))+Math.imul(L,lt)|0,s=Math.imul(L,ut),n=n+Math.imul(N,ht)|0,i=(i=i+Math.imul(N,dt)|0)+Math.imul(B,ht)|0,s=s+Math.imul(B,dt)|0;var Ot=(u+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((s=s+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,ht),i=(i=Math.imul(D,dt))+Math.imul(L,ht)|0,s=Math.imul(L,dt);var jt=(u+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(B,pt)|0))<<13)|0;u=((s=s+Math.imul(B,mt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Pt=(u+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(L,pt)|0))<<13)|0;return u=((s=Math.imul(L,mt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=bt,l[1]=gt,l[2]=yt,l[3]=vt,l[4]=wt,l[5]=_t,l[6]=xt,l[7]=St,l[8]=Ct,l[9]=At,l[10]=kt,l[11]=Tt,l[12]=Et,l[13]=Mt,l[14]=Rt,l[15]=It,l[16]=Ot,l[17]=jt,l[18]=Pt,0!==u&&(l[19]=u,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,s=0;s<r.length-1;s++){var o=i;i=0;for(var a=67108863&n,l=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=l;u++){var c=s-u,h=(0|t.words[c])*(0|e.words[u]),d=67108863&h;a=67108863&(d=d+a|0),i+=(o=(o=o+(h/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[s]=a,n=o,o=i}return 0!==n?r.words[s]=n:r.length--,r._strip()}function y(t,e,r){return g(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(b=m),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):r<63?m(this,t,e):r<1024?g(this,t,e):y(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,s){for(var o=0;o<s;o++)n[o]=e[t[o]],i[o]=r[t[o]]},v.prototype.transform=function(t,e,r,n,i,s){this.permute(s,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var a=o<<1,l=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var h=l,d=u,f=0;f<o;f++){var p=r[c+f],m=n[c+f],b=r[c+f+o],g=n[c+f+o],y=h*b-d*g;g=h*g+d*b,b=y,r[c+f]=p+b,n[c+f]=m+g,r[c+f+o]=p-b,n[c+f+o]=m-g,f!==a&&(y=l*h-u*d,d=l*d+u*h,h=y)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===s),n(!(-8192&s))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),s=this.stub(n),o=new Array(n),a=new Array(n),l=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,s,a,l,n,i),this.transform(u,s,c,h,n,i);for(var f=0;f<n;f++){var p=a[f]*c[f]-l[f]*h[f];l[f]=a[f]*h[f]+l[f]*c[f],a[f]=p}return this.conjugate(a,l,n),this.transform(a,l,d,s,n,i),this.conjugate(d,s,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),y(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var s=(0|this.words[i])*t,o=(67108863&s)+(67108863&r);r>>=26,r+=s/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new s(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},s.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,l=(0|this.words[e])-a<<r;this.words[e]=l|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},s.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,l=r;if(i-=o,i=Math.max(0,i),l){for(var u=0;u<o;u++)l.words[u]=this.words[u];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-s|h>>>s,c=h&a}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},s.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var i,s,o=t.length+r;this._expand(o);var a=0;for(i=0;i<t.length;i++){s=(0|this.words[i+r])+a;var l=(0|t.words[i])*e;a=((s-=67108863&l)>>26)-(l/67108864|0),this.words[i+r]=67108863&s}for(;i<this.length-r;i++)a=(s=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&s;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(s=-(0|this.words[i])+a)>>26,this.words[i]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var a,l=n.length-i.length;if("mod"!==e){(a=new s(null)).length=l+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,l);0===c.negative&&(n=c,a&&(a.words[l]=1));for(var h=l-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=d)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},s.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,o,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),s=r.cmp(n);return s<0||1===i&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,s=this.length-1;s>=0;s--)i=(r*i+(0|this.words[s]))%t;return e?-i:i},s.prototype.modn=function(t){return this.modrn(t)},s.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var s=(0|this.words[i])+67108864*r;this.words[i]=s/t|0,r=s%t}return this._strip(),e?this.ineg():this},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new s(1),o=new s(0),a=new s(0),l=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;!(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;!(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||l.isOdd())&&(a.iadd(c),l.isub(h)),a.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),o.isub(l)):(r.isub(e),a.isub(i),l.isub(o))}return{a,b:l,gcd:r.iushln(u)}},s.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new s(1),a=new s(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;!(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,d=1;!(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(i=0===e.cmpn(1)?o:a).cmpn(0)<0&&i.iadd(t),i},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var s=e;e=r,r=s}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return!(1&this.words[0])},s.prototype.isOdd=function(){return!(1&~this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var s=i,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new k(t)},s.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function C(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(x,_),x.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var s=0|t.words[n];t.words[n-10]=(4194303&s)<<4|i>>>22,i=s}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(S,_),i(C,_),i(A,_),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new S;else if("p192"===t)e=new C;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return w[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(!(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new s(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var a=new s(1).toRed(this),l=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=o;0!==f.cmp(a);){for(var m=f,b=0;0!==m.cmp(a);b++)m=m.redSqr();n(b<p);var g=this.pow(h,new s(1).iushln(p-b-1));d=d.redMul(g),h=g.redSqr(),f=f.redMul(h),p=b}return d},k.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},k.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[o]),a=0,o=0)):a=0}l=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new T(t)},i(T,k),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e)},{buffer:188}],187:[function(t,e,r){"use strict";var n;function i(t){this.rand=t}if(e.exports=function(t){return n||(n=new i(null)),n.generate(t)},e.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=t("crypto");if("function"!=typeof s.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return s.randomBytes(t)}}catch(t){}},{crypto:188}],188:[function(t,e,r){},{}],189:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i<e;i++)r[i]=t.readUInt32BE(4*i);return r}function s(t){for(;0<t.length;t++)t[0]=0}function o(t,e,r,n,i){for(var s,o,a,l,u=r[0],c=r[1],h=r[2],d=r[3],f=t[0]^e[0],p=t[1]^e[1],m=t[2]^e[2],b=t[3]^e[3],g=4,y=1;y<i;y++)s=u[f>>>24]^c[p>>>16&255]^h[m>>>8&255]^d[255&b]^e[g++],o=u[p>>>24]^c[m>>>16&255]^h[b>>>8&255]^d[255&f]^e[g++],a=u[m>>>24]^c[b>>>16&255]^h[f>>>8&255]^d[255&p]^e[g++],l=u[b>>>24]^c[f>>>16&255]^h[p>>>8&255]^d[255&m]^e[g++],f=s,p=o,m=a,b=l;return s=(n[f>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&b])^e[g++],o=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[b>>>8&255]<<8|n[255&f])^e[g++],a=(n[m>>>24]<<24|n[b>>>16&255]<<16|n[f>>>8&255]<<8|n[255&p])^e[g++],l=(n[b>>>24]<<24|n[f>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^e[g++],[s>>>=0,o>>>=0,a>>>=0,l>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],l=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],s=[[],[],[],[]],o=0,a=0,l=0;l<256;++l){var u=a^a<<1^a<<2^a<<3^a<<4;u=u>>>8^255&u^99,r[o]=u,n[u]=o;var c=t[o],h=t[c],d=t[h],f=257*t[u]^16843008*u;i[0][o]=f<<24|f>>>8,i[1][o]=f<<16|f>>>16,i[2][o]=f<<8|f>>>24,i[3][o]=f,f=16843009*d^65537*h^257*c^16843008*o,s[0][u]=f<<24|f>>>8,s[1][u]=f<<16|f>>>16,s[2][u]=f<<8|f>>>24,s[3][u]=f,0===o?o=a=1:(o=c^t[t[t[d^c]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:s}}();function u(t){this._key=i(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],s=0;s<e;s++)i[s]=t[s];for(s=e;s<n;s++){var o=i[s-1];s%e==0?(o=o<<8|o>>>24,o=l.SBOX[o>>>24]<<24|l.SBOX[o>>>16&255]<<16|l.SBOX[o>>>8&255]<<8|l.SBOX[255&o],o^=a[s/e|0]<<24):e>6&&s%e==4&&(o=l.SBOX[o>>>24]<<24|l.SBOX[o>>>16&255]<<16|l.SBOX[o>>>8&255]<<8|l.SBOX[255&o]),i[s]=i[s-e]^o}for(var u=[],c=0;c<n;c++){var h=n-c,d=i[h-(c%4?0:4)];u[c]=c<4||h<=4?d:l.INV_SUB_MIX[0][l.SBOX[d>>>24]]^l.INV_SUB_MIX[1][l.SBOX[d>>>16&255]]^l.INV_SUB_MIX[2][l.SBOX[d>>>8&255]]^l.INV_SUB_MIX[3][l.SBOX[255&d]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return o(t=i(t),this._keySchedule,l.SUB_MIX,l.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=o(t,this._invKeySchedule,l.INV_SUB_MIX,l.INV_SBOX,this._nRounds),s=n.allocUnsafe(16);return s.writeUInt32BE(r[0],0),s.writeUInt32BE(r[3],4),s.writeUInt32BE(r[2],8),s.writeUInt32BE(r[1],12),s},u.prototype.scrub=function(){s(this._keySchedule),s(this._invKeySchedule),s(this._key)},e.exports.AES=u},{"safe-buffer":494}],190:[function(t,e,r){"use strict";var n=t("./aes"),i=t("safe-buffer").Buffer,s=t("cipher-base"),o=t("inherits"),a=t("./ghash"),l=t("buffer-xor"),u=t("./incr32");function c(t,e,r,o){s.call(this);var l=i.alloc(4,0);this._cipher=new n.AES(e);var c=this._cipher.encryptBlock(l);this._ghash=new a(c),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),s=e.length,o=s%16;n.update(e),o&&(o=16-o,n.update(i.alloc(o,0))),n.update(i.alloc(8,0));var l=8*s,c=i.alloc(8);c.writeUIntBE(l,0,8),n.update(c),t._finID=n.state;var h=i.from(t._finID);return u(h),h}(this,r,c),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}o(c,s),c.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},c.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=l(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i<n;++i)r+=t[i]^e[i];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},c.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},c.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},c.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},e.exports=c},{"./aes":189,"./ghash":194,"./incr32":195,"buffer-xor":219,"cipher-base":221,inherits:440,"safe-buffer":494}],191:[function(t,e,r){"use strict";var n=t("./encrypter"),i=t("./decrypter"),s=t("./modes/list.json");r.createCipher=r.Cipher=n.createCipher,r.createCipheriv=r.Cipheriv=n.createCipheriv,r.createDecipher=r.Decipher=i.createDecipher,r.createDecipheriv=r.Decipheriv=i.createDecipheriv,r.listCiphers=r.getCiphers=function(){return Object.keys(s)}},{"./decrypter":192,"./encrypter":193,"./modes/list.json":203}],192:[function(t,e,r){"use strict";var n=t("./authCipher"),i=t("safe-buffer").Buffer,s=t("./modes"),o=t("./streamCipher"),a=t("cipher-base"),l=t("./aes"),u=t("evp_bytestokey");function c(t,e,r){a.call(this),this._cache=new h,this._last=void 0,this._cipher=new l.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function h(){this.cache=i.allocUnsafe(0)}function d(t,e,r){var a=s[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new o(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new c(a.module,e,r)}t("inherits")(c,a),c.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},c.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=i.concat([this.cache,t])},h.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(t,e){var r=s[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(e,!1,r.key,r.iv);return d(t,n.key,n.iv)},r.createDecipheriv=d},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(t,e,r){"use strict";var n=t("./modes"),i=t("./authCipher"),s=t("safe-buffer").Buffer,o=t("./streamCipher"),a=t("cipher-base"),l=t("./aes"),u=t("evp_bytestokey");function c(t,e,r){a.call(this),this._cache=new d,this._cipher=new l.AES(e),this._prev=s.from(r),this._mode=t,this._autopadding=!0}t("inherits")(c,a),c.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return s.concat(n)};var h=s.alloc(16,16);function d(){this.cache=s.allocUnsafe(0)}function f(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=s.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=s.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new o(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new c(a.module,e,r)}c.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(h))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},d.prototype.add=function(t){this.cache=s.concat([this.cache,t])},d.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},d.prototype.flush=function(){for(var t=16-this.cache.length,e=s.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return s.concat([this.cache,e])},r.createCipheriv=f,r.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(e,!1,r.key,r.iv);return f(t,i.key,i.iv)}},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],194:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.alloc(16,0);function s(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function o(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}o.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},o.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],o=-1;++o<128;){for(!!(this.state[~~(o/8)]&1<<7-o%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=!!(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=s(i)},o.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},o.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(s([0,t,0,e])),this.state},e.exports=o},{"safe-buffer":494}],195:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},{}],196:[function(t,e,r){"use strict";var n=t("buffer-xor");r.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},r.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},{"buffer-xor":219}],197:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("buffer-xor");function s(t,e,r){var s=e.length,o=i(e,t._cache);return t._cache=t._cache.slice(s),t._prev=n.concat([t._prev,r?e:o]),o}r.encrypt=function(t,e,r){for(var i,o=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){o=n.concat([o,s(t,e,r)]);break}i=t._cache.length,o=n.concat([o,s(t,e.slice(0,i),r)]),e=e.slice(i)}return o}},{"buffer-xor":219,"safe-buffer":494}],198:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer;function i(t,e,r){for(var n,i,o=-1,a=0;++o<8;)n=e&1<<7-o?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>o%8,t._prev=s(t._prev,r?n:i);return a}function s(t,e){var r=t.length,i=-1,s=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)s[i]=t[i]<<1|t[i+1]>>7;return s}r.encrypt=function(t,e,r){for(var s=e.length,o=n.allocUnsafe(s),a=-1;++a<s;)o[a]=i(t,e[a],r);return o}},{"safe-buffer":494}],199:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}r.encrypt=function(t,e,r){for(var s=e.length,o=n.allocUnsafe(s),a=-1;++a<s;)o[a]=i(t,e[a],r);return o}},{"safe-buffer":494}],200:[function(t,e,r){"use strict";var n=t("buffer-xor"),i=t("safe-buffer").Buffer,s=t("../incr32");function o(t){var e=t._cipher.encryptBlockRaw(t._prev);return s(t._prev),e}r.encrypt=function(t,e){var r=Math.ceil(e.length/16),s=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var l=o(t),u=s+16*a;t._cache.writeUInt32BE(l[0],u+0),t._cache.writeUInt32BE(l[1],u+4),t._cache.writeUInt32BE(l[2],u+8),t._cache.writeUInt32BE(l[3],u+12)}var c=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,c)}},{"../incr32":195,"buffer-xor":219,"safe-buffer":494}],201:[function(t,e,r){"use strict";r.encrypt=function(t,e){return t._cipher.encryptBlock(e)},r.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},{}],202:[function(t,e,r){"use strict";var n={ECB:t("./ecb"),CBC:t("./cbc"),CFB:t("./cfb"),CFB8:t("./cfb8"),CFB1:t("./cfb1"),OFB:t("./ofb"),CTR:t("./ctr"),GCM:t("./ctr")},i=t("./list.json");for(var s in i)i[s].module=n[i[s].mode];e.exports=i},{"./cbc":196,"./cfb":197,"./cfb1":198,"./cfb8":199,"./ctr":200,"./ecb":201,"./list.json":203,"./ofb":204}],203:[function(t,e,r){e.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],204:[function(t,e,r){(function(e){(function(){"use strict";var n=t("buffer-xor");function i(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}r.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var s=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),n(r,s)}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:220,"buffer-xor":219}],205:[function(t,e,r){"use strict";var n=t("./aes"),i=t("safe-buffer").Buffer,s=t("cipher-base");function o(t,e,r,o){s.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=o,this._mode=t}t("inherits")(o,s),o.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},o.prototype._final=function(){this._cipher.scrub()},e.exports=o},{"./aes":189,"cipher-base":221,inherits:440,"safe-buffer":494}],206:[function(t,e,r){"use strict";var n=t("browserify-des"),i=t("browserify-aes/browser"),s=t("browserify-aes/modes"),o=t("browserify-des/modes"),a=t("evp_bytestokey");function l(t,e,r){if(t=t.toLowerCase(),s[t])return i.createCipheriv(t,e,r);if(o[t])return new n({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function u(t,e,r){if(t=t.toLowerCase(),s[t])return i.createDecipheriv(t,e,r);if(o[t])return new n({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}r.createCipher=r.Cipher=function(t,e){var r,n;if(t=t.toLowerCase(),s[t])r=s[t].key,n=s[t].iv;else{if(!o[t])throw new TypeError("invalid suite type");r=8*o[t].key,n=o[t].iv}var i=a(e,!1,r,n);return l(t,i.key,i.iv)},r.createCipheriv=r.Cipheriv=l,r.createDecipher=r.Decipher=function(t,e){var r,n;if(t=t.toLowerCase(),s[t])r=s[t].key,n=s[t].iv;else{if(!o[t])throw new TypeError("invalid suite type");r=8*o[t].key,n=o[t].iv}var i=a(e,!1,r,n);return u(t,i.key,i.iv)},r.createDecipheriv=r.Decipheriv=u,r.listCiphers=r.getCiphers=function(){return Object.keys(o).concat(i.getCiphers())}},{"browserify-aes/browser":191,"browserify-aes/modes":202,"browserify-des":207,"browserify-des/modes":208,evp_bytestokey:423}],207:[function(t,e,r){"use strict";var n=t("cipher-base"),i=t("des.js"),s=t("inherits"),o=t("safe-buffer").Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function l(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var s=t.key;o.isBuffer(s)||(s=o.from(s)),"des-ede"!==r&&"des-ede-cbc"!==r||(s=o.concat([s,s.slice(0,8)]));var l=t.iv;o.isBuffer(l)||(l=o.from(l)),this._des=i.create({key:s,iv:l,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],e.exports=l,s(l,n),l.prototype._update=function(t){return o.from(this._des.update(t))},l.prototype._final=function(){return o.from(this._des.final())}},{"cipher-base":221,"des.js":394,inherits:440,"safe-buffer":494}],208:[function(t,e,r){"use strict";r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}},{}],209:[function(t,e,r){(function(r){(function(){"use strict";var n=t("bn.js"),i=t("randombytes");function s(t){var e,r=t.modulus.byteLength();do{e=new n(i(r))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function o(t,e){var i=function(t){var e=s(t);return{blinder:e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),a=new n(t).mul(i.blinder).umod(e.modulus),l=a.toRed(n.mont(e.prime1)),u=a.toRed(n.mont(e.prime2)),c=e.coefficient,h=e.prime1,d=e.prime2,f=l.redPow(e.exponent1).fromRed(),p=u.redPow(e.exponent2).fromRed(),m=f.isub(p).imul(c).umod(h).imul(d);return p.iadd(m).imul(i.unblinder).umod(e.modulus).toArrayLike(r,"be",o)}o.getr=s,e.exports=o}).call(this)}).call(this,t("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(t,e,r){"use strict";e.exports=t("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(t,e,r){e.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],212:[function(t,e,r){e.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],213:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("create-hash"),s=t("readable-stream"),o=t("inherits"),a=t("./sign"),l=t("./verify"),u=t("./algorithms.json");function c(t){s.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){s.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function d(t){return new c(t)}function f(t){return new h(t)}Object.keys(u).forEach((function(t){u[t].id=n.from(u[t].id,"hex"),u[t.toLowerCase()]=u[t]})),o(c,s.Writable),c.prototype._write=function(t,e,r){this._hash.update(t),r()},c.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},c.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},o(h,s.Writable),h.prototype._write=function(t,e,r){this._hash.update(t),r()},h.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},h.prototype.verify=function(t,e,r){"string"==typeof e&&(e=n.from(e,r)),this.end();var i=this._hash.digest();return l(e,i,t,this._signType,this._tag)},e.exports={Sign:d,Verify:f,createSign:d,createVerify:f}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("create-hmac"),s=t("browserify-rsa"),o=t("elliptic").ec,a=t("bn.js"),l=t("parse-asn1"),u=t("./curves.json");function c(t,e,r,s){if((t=n.from(t.toArray())).length<e.byteLength()){var o=n.alloc(e.byteLength()-t.length);t=n.concat([o,t])}var a=r.length,l=function(t,e){t=(t=h(t,e)).mod(e);var r=n.from(t.toArray());if(r.length<e.byteLength()){var i=n.alloc(e.byteLength()-r.length);r=n.concat([i,r])}return r}(r,e),u=n.alloc(a);u.fill(1);var c=n.alloc(a);return c=i(s,c).update(u).update(n.from([0])).update(t).update(l).digest(),u=i(s,c).update(u).digest(),{k:c=i(s,c).update(u).update(n.from([1])).update(t).update(l).digest(),v:u=i(s,c).update(u).digest()}}function h(t,e){var r=new a(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function d(t,e,r){var s,o;do{for(s=n.alloc(0);8*s.length<t.bitLength();)e.v=i(r,e.k).update(e.v).digest(),s=n.concat([s,e.v]);o=h(s,t),e.k=i(r,e.k).update(e.v).update(n.from([0])).digest(),e.v=i(r,e.k).update(e.v).digest()}while(-1!==o.cmp(t));return o}function f(t,e,r,n){return t.toRed(a.mont(r)).redPow(e).fromRed().mod(n)}e.exports=function(t,e,r,i,p){var m=l(e);if(m.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(t,e){var r=u[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var i=new o(r).keyFromPrivate(e.privateKey).sign(t);return n.from(i.toDER())}(t,m)}if("dsa"===m.type){if("dsa"!==i)throw new Error("wrong private key type");return function(t,e,r){for(var i,s=e.params.priv_key,o=e.params.p,l=e.params.q,u=e.params.g,p=new a(0),m=h(t,l).mod(l),b=!1,g=c(s,l,t,r);!1===b;)p=f(u,i=d(l,g,r),o,l),0===(b=i.invm(l).imul(m.add(s.mul(p))).mod(l)).cmpn(0)&&(b=!1,p=new a(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),n.from(r)}(p,b)}(t,m,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");t=n.concat([p,t]);for(var b=m.modulus.byteLength(),g=[0,1];t.length+g.length+1<b;)g.push(255);g.push(0);for(var y=-1;++y<t.length;)g.push(t[y]);return s(g,m)},e.exports.getKey=c,e.exports.makeKey=d},{"./curves.json":212,"bn.js":186,"browserify-rsa":209,"create-hmac":388,elliptic:405,"parse-asn1":459,"safe-buffer":494}],215:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("bn.js"),s=t("elliptic").ec,o=t("parse-asn1"),a=t("./curves.json");function l(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}e.exports=function(t,e,r,u,c){var h=o(r);if("ec"===h.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new s(n),o=r.data.subjectPrivateKey.data;return i.verify(e,t,o)}(t,e,h)}if("dsa"===h.type){if("dsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,s=r.data.q,a=r.data.g,u=r.data.pub_key,c=o.signature.decode(t,"der"),h=c.s,d=c.r;l(h,s),l(d,s);var f=i.mont(n),p=h.invm(s);return 0===a.toRed(f).redPow(new i(e).mul(p).mod(s)).fromRed().mul(u.toRed(f).redPow(d.mul(p).mod(s)).fromRed()).mod(n).mod(s).cmp(d)}(t,e,h)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");e=n.concat([c,e]);for(var d=h.modulus.byteLength(),f=[1],p=0;e.length+f.length+2<d;)f.push(255),p++;f.push(0);for(var m=-1;++m<e.length;)f.push(e[m]);f=n.from(f);var b=i.mont(h.modulus);t=(t=new i(t).toRed(b)).redPow(new i(h.publicExponent)),t=n.from(t.fromRed().toArray());var g=p<8?1:0;for(d=Math.min(t.length,f.length),t.length!==f.length&&(g=1),m=-1;++m<d;)g|=t[m]^f[m];return 0===g}},{"./curves.json":212,"bn.js":186,elliptic:405,"parse-asn1":459,"safe-buffer":494}],216:[function(t,e,r){},{}],217:[function(t,e,r){"use strict";var n=t("buffer"),i=n.Buffer;function s(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(s(n,r),r.Buffer=o),s(i,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:220}],218:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=c,this.end=h,e=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}r.StringDecoder=s,s.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},s.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=o(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||-2===i?0:(i=o(e[n]))>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||-2===i?0:(i=o(e[n]))>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":217}],219:[function(t,e,r){(function(t){(function(){"use strict";e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),s=0;s<n;++s)i[s]=e[s]^r[s];return i}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:220}],220:[function(t,e,r){(function(e){(function(){"use strict";var e=t("base64-js"),n=t("ieee754");function i(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|h(t,e),n=i(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(D(t,ArrayBuffer)||t&&D(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r)).__proto__=s.prototype,n}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return s.from(n,e,r);var o=function(t){if(s.isBuffer(t)){var e=0|c(t.length),r=i(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||L(t.length)?i(0):u(t):"Buffer"===t.type&&Array.isArray(t.data)?u(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return a(t),i(t<0?0:0|c(t))}function u(t){for(var e=t.length<0?0:0|c(t.length),r=i(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function h(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||D(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(t).length;default:if(i)return n?-1:N(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function f(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),L(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var s,o=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-1;for(s=r;s<a;s++)if(u(t,s)===u(e,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===l)return c*o}else-1!==c&&(s-=s-c),c=-1}else for(r+l>a&&(r=a-l),s=r;s>=0;s--){for(var h=!0,d=0;d<l;d++)if(u(t,s+d)!==u(e,d)){h=!1;break}if(h)return s}return-1}function b(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=e.length;n>s/2&&(n=s/2);for(var o=0;o<n;++o){var a=parseInt(e.substr(2*o,2),16);if(L(a))return o;t[r+o]=a}return o}function g(t,e,r,n){return F(N(e,t.length-r),t,r,n)}function y(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function v(t,e,r,n){return y(t,e,r,n)}function w(t,e,r,n){return F(B(e),t,r,n)}function _(t,e,r,n){return F(function(t,e){for(var r,n,i,s=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function x(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var s,o,a,l,u=t[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(s=t[i+1]))&&(l=(31&u)<<6|63&s)>127&&(c=l);break;case 3:s=t[i+1],o=t[i+2],128==(192&s)&&128==(192&o)&&(l=(15&u)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:s=t[i+1],o=t[i+2],a=t[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&u)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=e;s<r;++s)i+=P(t[s]);return i}function T(t,e,r){for(var n=t.slice(e,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function E(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,i,s){return e=+e,r>>>=0,s||R(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function O(t,e,r,i,s){return e=+e,r>>>=0,s||R(t,0,r,8),n.write(t,e,r,i,52,8),r+8}r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=2147483647,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(t,e,r){return o(t,e,r)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(t,e,r){return function(t,e,r){return a(t),t<=0?i(t):void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)}(t,e,r)},s.allocUnsafe=function(t){return l(t)},s.allocUnsafeSlow=function(t){return l(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(D(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),D(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(D(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)f(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)f(this,e,e+3),f(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)f(this,e,e+7),f(this,e+1,e+6),f(this,e+2,e+5),f(this,e+3,e+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):d.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,i){if(D(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),l=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r),h=0;h<l;++h)if(u[h]!==c[h]){o=u[h],a=c[h];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return p(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return p(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=s.prototype,n},s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n},s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,i=1,s=this[t+--n];n>0&&(i*=256);)s+=this[t+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},s.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||E(t,4,this.length),n.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),n.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[e]=255&t;++s<r&&(i*=256);)this[e+s]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var s=0,o=1,a=0;for(this[e]=255&t;++s<r&&(o*=256);)t<0&&0===a&&0!==this[e+s-1]&&(a=1),this[e+s]=(t/o|0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o|0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return O(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return O(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=s.isBuffer(t)?t:s.from(t,n),l=a.length;if(0===l)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%l]}return this};var j=/[^+/0-9A-Za-z-_]/g;function P(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,i=null,s=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function B(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function D(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function L(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("stream").Transform,s=t("string_decoder").StringDecoder;function o(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t("inherits")(o,i),o.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},o.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},o.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},o.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new s(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},e.exports=o},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(t,e,r){"use strict";var n=t("../internals/is-callable"),i=t("../internals/try-to-string"),s=TypeError;e.exports=function(t){if(n(t))return t;throw new s(i(t)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(t,e,r){"use strict";var n=t("../internals/is-constructor"),i=t("../internals/try-to-string"),s=TypeError;e.exports=function(t){if(n(t))return t;throw new s(i(t)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(t,e,r){"use strict";var n=t("../internals/is-callable"),i=String,s=TypeError;e.exports=function(t){if("object"==typeof t||n(t))return t;throw new s("Can't set "+i(t)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(t,e,r){"use strict";var n=t("../internals/well-known-symbol"),i=t("../internals/object-create"),s=t("../internals/object-define-property").f,o=n("unscopables"),a=Array.prototype;void 0===a[o]&&s(a,o,{configurable:!0,value:i(null)}),e.exports=function(t){a[o][t]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(t,e,r){"use strict";var n=t("../internals/object-is-prototype-of"),i=TypeError;e.exports=function(t,e){if(n(e,t))return t;throw new i("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(t,e,r){"use strict";var n=t("../internals/is-object"),i=String,s=TypeError;e.exports=function(t){if(n(t))return t;throw new s(i(t)+" is not an object")}},{"../internals/is-object":289}],228:[function(t,e,r){"use strict";var n=t("../internals/to-indexed-object"),i=t("../internals/to-absolute-index"),s=t("../internals/length-of-array-like"),o=function(t){return function(e,r,o){var a,l=n(e),u=s(l),c=i(o,u);if(t&&r!=r){for(;u>c;)if((a=l[c++])!=a)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===r)return t||c||0;return!t&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(t,e,r){"use strict";var n=t("../internals/function-bind-context"),i=t("../internals/function-uncurry-this"),s=t("../internals/indexed-object"),o=t("../internals/to-object"),a=t("../internals/length-of-array-like"),l=t("../internals/array-species-create"),u=i([].push),c=function(t){var e=1===t,r=2===t,i=3===t,c=4===t,h=6===t,d=7===t,f=5===t||h;return function(p,m,b,g){for(var y,v,w=o(p),_=s(w),x=n(m,b),S=a(_),C=0,A=g||l,k=e?A(p,S):r||d?A(p,0):void 0;S>C;C++)if((f||C in _)&&(v=x(y=_[C],C,w),t))if(e)k[C]=v;else if(v)switch(t){case 3:return!0;case 5:return y;case 6:return C;case 2:u(k,y)}else switch(t){case 4:return!1;case 7:u(k,y)}return h?-1:i||c?c:k}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(t,e,r){"use strict";var n=t("../internals/to-absolute-index"),i=t("../internals/length-of-array-like"),s=t("../internals/create-property"),o=Array,a=Math.max;e.exports=function(t,e,r){for(var l=i(t),u=n(e,l),c=n(void 0===r?l:r,l),h=o(a(c-u,0)),d=0;u<c;u++,d++)s(h,d,t[u]);return h.length=d,h}},{"../internals/create-property":243,"../internals/length-of-array-like":299,"../internals/to-absolute-index":340}],231:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this");e.exports=n([].slice)},{"../internals/function-uncurry-this":268}],232:[function(t,e,r){"use strict";var n=t("../internals/is-array"),i=t("../internals/is-constructor"),s=t("../internals/is-object"),o=t("../internals/well-known-symbol")("species"),a=Array;e.exports=function(t){var e;return n(t)&&(e=t.constructor,(i(e)&&(e===a||n(e.prototype))||s(e)&&null===(e=e[o]))&&(e=void 0)),void 0===e?a:e}},{"../internals/is-array":284,"../internals/is-constructor":286,"../internals/is-object":289,"../internals/well-known-symbol":357}],233:[function(t,e,r){"use strict";var n=t("../internals/array-species-constructor");e.exports=function(t,e){return new(n(t))(0===e?0:e)}},{"../internals/array-species-constructor":232}],234:[function(t,e,r){"use strict";var n=t("../internals/well-known-symbol")("iterator"),i=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){i=!0}};o[n]=function(){return this},Array.from(o,(function(){throw 2}))}catch(t){}e.exports=function(t,e){try{if(!e&&!i)return!1}catch(t){return!1}var r=!1;try{var s={};s[n]=function(){return{next:function(){return{done:r=!0}}}},t(s)}catch(t){}return r}},{"../internals/well-known-symbol":357}],235:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this"),i=n({}.toString),s=n("".slice);e.exports=function(t){return s(i(t),8,-1)}},{"../internals/function-uncurry-this":268}],236:[function(t,e,r){"use strict";var n=t("../internals/to-string-tag-support"),i=t("../internals/is-callable"),s=t("../internals/classof-raw"),o=t("../internals/well-known-symbol")("toStringTag"),a=Object,l="Arguments"===s(function(){return arguments}());e.exports=n?s:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=a(t),o))?r:l?s(e):"Object"===(n=s(e))&&i(e.callee)?"Arguments":n}},{"../internals/classof-raw":235,"../internals/is-callable":285,"../internals/to-string-tag-support":347,"../internals/well-known-symbol":357}],237:[function(t,e,r){"use strict";var n=t("../internals/has-own-property"),i=t("../internals/own-keys"),s=t("../internals/object-get-own-property-descriptor"),o=t("../internals/object-define-property");e.exports=function(t,e,r){for(var a=i(e),l=o.f,u=s.f,c=0;c<a.length;c++){var h=a[c];n(t,h)||r&&n(r,h)||l(t,h,u(e,h))}}},{"../internals/has-own-property":275,"../internals/object-define-property":308,"../internals/object-get-own-property-descriptor":309,"../internals/own-keys":321}],238:[function(t,e,r){"use strict";var n=t("../internals/well-known-symbol")("match");e.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[n]=!1,"/./"[t](e)}catch(t){}}return!1}},{"../internals/well-known-symbol":357}],239:[function(t,e,r){"use strict";var n=t("../internals/fails");e.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},{"../internals/fails":260}],240:[function(t,e,r){"use strict";e.exports=function(t,e){return{value:t,done:e}}},{}],241:[function(t,e,r){"use strict";var n=t("../internals/descriptors"),i=t("../internals/object-define-property"),s=t("../internals/create-property-descriptor");e.exports=n?function(t,e,r){return i.f(t,e,s(1,r))}:function(t,e,r){return t[e]=r,t}},{"../internals/create-property-descriptor":242,"../internals/descriptors":247,"../internals/object-define-property":308}],242:[function(t,e,r){"use strict";e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},{}],243:[function(t,e,r){"use strict";var n=t("../internals/to-property-key"),i=t("../internals/object-define-property"),s=t("../internals/create-property-descriptor");e.exports=function(t,e,r){var o=n(e);o in t?i.f(t,o,s(0,r)):t[o]=r}},{"../internals/create-property-descriptor":242,"../internals/object-define-property":308,"../internals/to-property-key":346}],244:[function(t,e,r){"use strict";var n=t("../internals/make-built-in"),i=t("../internals/object-define-property");e.exports=function(t,e,r){return r.get&&n(r.get,e,{getter:!0}),r.set&&n(r.set,e,{setter:!0}),i.f(t,e,r)}},{"../internals/make-built-in":300,"../internals/object-define-property":308}],245:[function(t,e,r){"use strict";var n=t("../internals/is-callable"),i=t("../internals/object-define-property"),s=t("../internals/make-built-in"),o=t("../internals/define-global-property");e.exports=function(t,e,r,a){a||(a={});var l=a.enumerable,u=void 0!==a.name?a.name:e;if(n(r)&&s(r,u,a),a.global)l?t[e]=r:o(e,r);else{try{a.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=r:i.f(t,e,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},{"../internals/define-global-property":246,"../internals/is-callable":285,"../internals/make-built-in":300,"../internals/object-define-property":308}],246:[function(t,e,r){"use strict";var n=t("../internals/global"),i=Object.defineProperty;e.exports=function(t,e){try{i(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},{"../internals/global":274}],247:[function(t,e,r){"use strict";var n=t("../internals/fails");e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":260}],248:[function(t,e,r){"use strict";var n="object"==typeof document&&document.all,i=void 0===n&&void 0!==n;e.exports={all:n,IS_HTMLDDA:i}},{}],249:[function(t,e,r){"use strict";var n=t("../internals/global"),i=t("../internals/is-object"),s=n.document,o=i(s)&&i(s.createElement);e.exports=function(t){return o?s.createElement(t):{}}},{"../internals/global":274,"../internals/is-object":289}],250:[function(t,e,r){"use strict";var n=t("../internals/engine-is-deno"),i=t("../internals/engine-is-node");e.exports=!n&&!i&&"object"==typeof window&&"object"==typeof document},{"../internals/engine-is-deno":251,"../internals/engine-is-node":254}],251:[function(t,e,r){"use strict";e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},{}],252:[function(t,e,r){"use strict";var n=t("../internals/engine-user-agent");e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},{"../internals/engine-user-agent":256}],253:[function(t,e,r){"use strict";var n=t("../internals/engine-user-agent");e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},{"../internals/engine-user-agent":256}],254:[function(t,e,r){"use strict";var n=t("../internals/global"),i=t("../internals/classof-raw");e.exports="process"===i(n.process)},{"../internals/classof-raw":235,"../internals/global":274}],255:[function(t,e,r){"use strict";var n=t("../internals/engine-user-agent");e.exports=/web0s(?!.*chrome)/i.test(n)},{"../internals/engine-user-agent":256}],256:[function(t,e,r){"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},{}],257:[function(t,e,r){"use strict";var n,i,s=t("../internals/global"),o=t("../internals/engine-user-agent"),a=s.process,l=s.Deno,u=a&&a.versions||l&&l.version,c=u&&u.v8;c&&(i=(n=c.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(t,e,r){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(t,e,r){"use strict";var n=t("../internals/global"),i=t("../internals/object-get-own-property-descriptor").f,s=t("../internals/create-non-enumerable-property"),o=t("../internals/define-built-in"),a=t("../internals/define-global-property"),l=t("../internals/copy-constructor-properties"),u=t("../internals/is-forced");e.exports=function(t,e){var r,c,h,d,f,p=t.target,m=t.global,b=t.stat;if(r=m?n:b?n[p]||a(p,{}):(n[p]||{}).prototype)for(c in e){if(d=e[c],h=t.dontCallGetSet?(f=i(r,c))&&f.value:r[c],!u(m?c:p+(b?".":"#")+c,t.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(t.sham||h&&h.sham)&&s(d,"sham",!0),o(r,c,d,t)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(t,e,r){"use strict";e.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],261:[function(t,e,r){"use strict";var n=t("../internals/function-bind-native"),i=Function.prototype,s=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(s):function(){return o.apply(s,arguments)})},{"../internals/function-bind-native":263}],262:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this-clause"),i=t("../internals/a-callable"),s=t("../internals/function-bind-native"),o=n(n.bind);e.exports=function(t,e){return i(t),void 0===e?t:s?o(t,e):function(){return t.apply(e,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(t,e,r){"use strict";var n=t("../internals/fails");e.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},{"../internals/fails":260}],264:[function(t,e,r){"use strict";var n=t("../internals/function-bind-native"),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},{"../internals/function-bind-native":263}],265:[function(t,e,r){"use strict";var n=t("../internals/descriptors"),i=t("../internals/has-own-property"),s=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,a=i(s,"name"),l=a&&"something"===function(){}.name,u=a&&(!n||n&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:u}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this"),i=t("../internals/a-callable");e.exports=function(t,e,r){try{return n(i(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(t,e,r){"use strict";var n=t("../internals/classof-raw"),i=t("../internals/function-uncurry-this");e.exports=function(t){if("Function"===n(t))return i(t)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(t,e,r){"use strict";var n=t("../internals/function-bind-native"),i=Function.prototype,s=i.call,o=n&&i.bind.bind(s,s);e.exports=n?o:function(t){return function(){return s.apply(t,arguments)}}},{"../internals/function-bind-native":263}],269:[function(t,e,r){"use strict";var n=t("../internals/global"),i=t("../internals/is-callable");e.exports=function(t,e){return arguments.length<2?function(t){return i(t)?t:void 0}(n[t]):n[t]&&n[t][e]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(t,e,r){"use strict";var n=t("../internals/classof"),i=t("../internals/get-method"),s=t("../internals/is-null-or-undefined"),o=t("../internals/iterators"),a=t("../internals/well-known-symbol")("iterator");e.exports=function(t){if(!s(t))return i(t,a)||i(t,"@@iterator")||o[n(t)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(t,e,r){"use strict";var n=t("../internals/function-call"),i=t("../internals/a-callable"),s=t("../internals/an-object"),o=t("../internals/try-to-string"),a=t("../internals/get-iterator-method"),l=TypeError;e.exports=function(t,e){var r=arguments.length<2?a(t):e;if(i(r))return s(n(r,t));throw new l(o(t)+" is not iterable")}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this"),i=t("../internals/is-array"),s=t("../internals/is-callable"),o=t("../internals/classof-raw"),a=t("../internals/to-string"),l=n([].push);e.exports=function(t){if(s(t))return t;if(i(t)){for(var e=t.length,r=[],n=0;n<e;n++){var u=t[n];"string"==typeof u?l(r,u):"number"!=typeof u&&"Number"!==o(u)&&"String"!==o(u)||l(r,a(u))}var c=r.length,h=!0;return function(t,e){if(h)return h=!1,e;if(i(this))return e;for(var n=0;n<c;n++)if(r[n]===t)return e}}}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268,"../internals/is-array":284,"../internals/is-callable":285,"../internals/to-string":348}],273:[function(t,e,r){"use strict";var n=t("../internals/a-callable"),i=t("../internals/is-null-or-undefined");e.exports=function(t,e){var r=t[e];return i(r)?void 0:n(r)}},{"../internals/a-callable":222,"../internals/is-null-or-undefined":288}],274:[function(t,e,n){(function(t){(function(){"use strict";var r=function(t){return t&&t.Math===Math&&t};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||function(){return this}()||this||Function("return this")()}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],275:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this"),i=t("../internals/to-object"),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(t,e){return s(i(t),e)}},{"../internals/function-uncurry-this":268,"../internals/to-object":344}],276:[function(t,e,r){"use strict";e.exports={}},{}],277:[function(t,e,r){"use strict";e.exports=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}},{}],278:[function(t,e,r){"use strict";var n=t("../internals/get-built-in");e.exports=n("document","documentElement")},{"../internals/get-built-in":269}],279:[function(t,e,r){"use strict";var n=t("../internals/descriptors"),i=t("../internals/fails"),s=t("../internals/document-create-element");e.exports=!n&&!i((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},{"../internals/descriptors":247,"../internals/document-create-element":249,"../internals/fails":260}],280:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this"),i=t("../internals/fails"),s=t("../internals/classof-raw"),o=Object,a=n("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"===s(t)?a(t,""):o(t)}:o},{"../internals/classof-raw":235,"../internals/fails":260,"../internals/function-uncurry-this":268}],281:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this"),i=t("../internals/is-callable"),s=t("../internals/shared-store"),o=n(Function.toString);i(s.inspectSource)||(s.inspectSource=function(t){return o(t)}),e.exports=s.inspectSource},{"../internals/function-uncurry-this":268,"../internals/is-callable":285,"../internals/shared-store":333}],282:[function(t,e,r){"use strict";var n,i,s,o=t("../internals/weak-map-basic-detection"),a=t("../internals/global"),l=t("../internals/is-object"),u=t("../internals/create-non-enumerable-property"),c=t("../internals/has-own-property"),h=t("../internals/shared-store"),d=t("../internals/shared-key"),f=t("../internals/hidden-keys"),p=a.TypeError,m=a.WeakMap;if(o||h.state){var b=h.state||(h.state=new m);b.get=b.get,b.has=b.has,b.set=b.set,n=function(t,e){if(b.has(t))throw new p("Object already initialized");return e.facade=t,b.set(t,e),e},i=function(t){return b.get(t)||{}},s=function(t){return b.has(t)}}else{var g=d("state");f[g]=!0,n=function(t,e){if(c(t,g))throw new p("Object already initialized");return e.facade=t,u(t,g,e),e},i=function(t){return c(t,g)?t[g]:{}},s=function(t){return c(t,g)}}e.exports={set:n,get:i,has:s,enforce:function(t){return s(t)?i(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!l(e)||(r=i(e)).type!==t)throw new p("Incompatible receiver, "+t+" required");return r}}}},{"../internals/create-non-enumerable-property":241,"../internals/global":274,"../internals/has-own-property":275,"../internals/hidden-keys":276,"../internals/is-object":289,"../internals/shared-key":332,"../internals/shared-store":333,"../internals/weak-map-basic-detection":354}],283:[function(t,e,r){"use strict";var n=t("../internals/well-known-symbol"),i=t("../internals/iterators"),s=n("iterator"),o=Array.prototype;e.exports=function(t){return void 0!==t&&(i.Array===t||o[s]===t)}},{"../internals/iterators":298,"../internals/well-known-symbol":357}],284:[function(t,e,r){"use strict";var n=t("../internals/classof-raw");e.exports=Array.isArray||function(t){return"Array"===n(t)}},{"../internals/classof-raw":235}],285:[function(t,e,r){"use strict";var n=t("../internals/document-all"),i=n.all;e.exports=n.IS_HTMLDDA?function(t){return"function"==typeof t||t===i}:function(t){return"function"==typeof t}},{"../internals/document-all":248}],286:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this"),i=t("../internals/fails"),s=t("../internals/is-callable"),o=t("../internals/classof"),a=t("../internals/get-built-in"),l=t("../internals/inspect-source"),u=function(){},c=[],h=a("Reflect","construct"),d=/^\s*(?:class|function)\b/,f=n(d.exec),p=!d.test(u),m=function(t){if(!s(t))return!1;try{return h(u,c,t),!0}catch(t){return!1}},b=function(t){if(!s(t))return!1;switch(o(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!f(d,l(t))}catch(t){return!0}};b.sham=!0,e.exports=!h||i((function(){var t;return m(m.call)||!m(Object)||!m((function(){t=!0}))||t}))?b:m},{"../internals/classof":236,"../internals/fails":260,"../internals/function-uncurry-this":268,"../internals/get-built-in":269,"../internals/inspect-source":281,"../internals/is-callable":285}],287:[function(t,e,r){"use strict";var n=t("../internals/fails"),i=t("../internals/is-callable"),s=/#|\.prototype\./,o=function(t,e){var r=l[a(t)];return r===c||r!==u&&(i(e)?n(e):!!e)},a=o.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=o.data={},u=o.NATIVE="N",c=o.POLYFILL="P";e.exports=o},{"../internals/fails":260,"../internals/is-callable":285}],288:[function(t,e,r){"use strict";e.exports=function(t){return null==t}},{}],289:[function(t,e,r){"use strict";var n=t("../internals/is-callable"),i=t("../internals/document-all"),s=i.all;e.exports=i.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:n(t)||t===s}:function(t){return"object"==typeof t?null!==t:n(t)}},{"../internals/document-all":248,"../internals/is-callable":285}],290:[function(t,e,r){"use strict";e.exports=!1},{}],291:[function(t,e,r){"use strict";var n=t("../internals/is-object"),i=t("../internals/classof-raw"),s=t("../internals/well-known-symbol")("match");e.exports=function(t){var e;return n(t)&&(void 0!==(e=t[s])?!!e:"RegExp"===i(t))}},{"../internals/classof-raw":235,"../internals/is-object":289,"../internals/well-known-symbol":357}],292:[function(t,e,r){"use strict";var n=t("../internals/get-built-in"),i=t("../internals/is-callable"),s=t("../internals/object-is-prototype-of"),o=t("../internals/use-symbol-as-uid"),a=Object;e.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=n("Symbol");return i(e)&&s(e.prototype,a(t))}},{"../internals/get-built-in":269,"../internals/is-callable":285,"../internals/object-is-prototype-of":314,"../internals/use-symbol-as-uid":351}],293:[function(t,e,r){"use strict";var n=t("../internals/function-bind-context"),i=t("../internals/function-call"),s=t("../internals/an-object"),o=t("../internals/try-to-string"),a=t("../internals/is-array-iterator-method"),l=t("../internals/length-of-array-like"),u=t("../internals/object-is-prototype-of"),c=t("../internals/get-iterator"),h=t("../internals/get-iterator-method"),d=t("../internals/iterator-close"),f=TypeError,p=function(t,e){this.stopped=t,this.result=e},m=p.prototype;e.exports=function(t,e,r){var b,g,y,v,w,_,x,S=r&&r.that,C=!(!r||!r.AS_ENTRIES),A=!(!r||!r.IS_RECORD),k=!(!r||!r.IS_ITERATOR),T=!(!r||!r.INTERRUPTED),E=n(e,S),M=function(t){return b&&d(b,"normal",t),new p(!0,t)},R=function(t){return C?(s(t),T?E(t[0],t[1],M):E(t[0],t[1])):T?E(t,M):E(t)};if(A)b=t.iterator;else if(k)b=t;else{if(!(g=h(t)))throw new f(o(t)+" is not iterable");if(a(g)){for(y=0,v=l(t);v>y;y++)if((w=R(t[y]))&&u(m,w))return w;return new p(!1)}b=c(t,g)}for(_=A?t.next:b.next;!(x=i(_,b)).done;){try{w=R(x.value)}catch(t){d(b,"throw",t)}if("object"==typeof w&&w&&u(m,w))return w}return new p(!1)}},{"../internals/an-object":227,"../internals/function-bind-context":262,"../internals/function-call":264,"../internals/get-iterator":271,"../internals/get-iterator-method":270,"../internals/is-array-iterator-method":283,"../internals/iterator-close":294,"../internals/length-of-array-like":299,"../internals/object-is-prototype-of":314,"../internals/try-to-string":349}],294:[function(t,e,r){"use strict";var n=t("../internals/function-call"),i=t("../internals/an-object"),s=t("../internals/get-method");e.exports=function(t,e,r){var o,a;i(t);try{if(!(o=s(t,"return"))){if("throw"===e)throw r;return r}o=n(o,t)}catch(t){a=!0,o=t}if("throw"===e)throw r;if(a)throw o;return i(o),r}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(t,e,r){"use strict";var n=t("../internals/iterators-core").IteratorPrototype,i=t("../internals/object-create"),s=t("../internals/create-property-descriptor"),o=t("../internals/set-to-string-tag"),a=t("../internals/iterators"),l=function(){return this};e.exports=function(t,e,r,u){var c=e+" Iterator";return t.prototype=i(n,{next:s(+!u,r)}),o(t,c,!1,!0),a[c]=l,t}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/function-call"),s=t("../internals/is-pure"),o=t("../internals/function-name"),a=t("../internals/is-callable"),l=t("../internals/iterator-create-constructor"),u=t("../internals/object-get-prototype-of"),c=t("../internals/object-set-prototype-of"),h=t("../internals/set-to-string-tag"),d=t("../internals/create-non-enumerable-property"),f=t("../internals/define-built-in"),p=t("../internals/well-known-symbol"),m=t("../internals/iterators"),b=t("../internals/iterators-core"),g=o.PROPER,y=o.CONFIGURABLE,v=b.IteratorPrototype,w=b.BUGGY_SAFARI_ITERATORS,_=p("iterator"),x=function(){return this};e.exports=function(t,e,r,o,p,b,S){l(r,e,o);var C,A,k,T=function(t){if(t===p&&O)return O;if(!w&&t&&t in R)return R[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},E=e+" Iterator",M=!1,R=t.prototype,I=R[_]||R["@@iterator"]||p&&R[p],O=!w&&I||T(p),j="Array"===e&&R.entries||I;if(j&&(C=u(j.call(new t)))!==Object.prototype&&C.next&&(s||u(C)===v||(c?c(C,v):a(C[_])||f(C,_,x)),h(C,E,!0,!0),s&&(m[E]=x)),g&&"values"===p&&I&&"values"!==I.name&&(!s&&y?d(R,"name","values"):(M=!0,O=function(){return i(I,this)})),p)if(A={values:T("values"),keys:b?O:T("keys"),entries:T("entries")},S)for(k in A)(w||M||!(k in R))&&f(R,k,A[k]);else n({target:e,proto:!0,forced:w||M},A);return s&&!S||R[_]===O||f(R,_,O,{name:p}),m[e]=O,A}},{"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/export":259,"../internals/function-call":264,"../internals/function-name":265,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/iterator-create-constructor":295,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-get-prototype-of":313,"../internals/object-set-prototype-of":318,"../internals/set-to-string-tag":331,"../internals/well-known-symbol":357}],297:[function(t,e,r){"use strict";var n,i,s,o=t("../internals/fails"),a=t("../internals/is-callable"),l=t("../internals/is-object"),u=t("../internals/object-create"),c=t("../internals/object-get-prototype-of"),h=t("../internals/define-built-in"),d=t("../internals/well-known-symbol"),f=t("../internals/is-pure"),p=d("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(i=c(c(s)))!==Object.prototype&&(n=i):m=!0),!l(n)||o((function(){var t={};return n[p].call(t)!==t}))?n={}:f&&(n=u(n)),a(n[p])||h(n,p,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(t,e,r){arguments[4][276][0].apply(r,arguments)},{dup:276}],299:[function(t,e,r){"use strict";var n=t("../internals/to-length");e.exports=function(t){return n(t.length)}},{"../internals/to-length":343}],300:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this"),i=t("../internals/fails"),s=t("../internals/is-callable"),o=t("../internals/has-own-property"),a=t("../internals/descriptors"),l=t("../internals/function-name").CONFIGURABLE,u=t("../internals/inspect-source"),c=t("../internals/internal-state"),h=c.enforce,d=c.get,f=String,p=Object.defineProperty,m=n("".slice),b=n("".replace),g=n([].join),y=a&&!i((function(){return 8!==p((function(){}),"length",{value:8}).length})),v=String(String).split("String"),w=e.exports=function(t,e,r){"Symbol("===m(f(e),0,7)&&(e="["+b(f(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!o(t,"name")||l&&t.name!==e)&&(a?p(t,"name",{value:e,configurable:!0}):t.name=e),y&&r&&o(r,"arity")&&t.length!==r.arity&&p(t,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=h(t);return o(n,"source")||(n.source=g(v,"string"==typeof e?e:"")),t};Function.prototype.toString=w((function(){return s(this)&&d(this).source||u(this)}),"toString")},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(t,e,r){"use strict";var n=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(t){var e=+t;return(e>0?i:n)(e)}},{}],302:[function(t,e,r){"use strict";var n,i,s,o,a,l=t("../internals/global"),u=t("../internals/function-bind-context"),c=t("../internals/object-get-own-property-descriptor").f,h=t("../internals/task").set,d=t("../internals/queue"),f=t("../internals/engine-is-ios"),p=t("../internals/engine-is-ios-pebble"),m=t("../internals/engine-is-webos-webkit"),b=t("../internals/engine-is-node"),g=l.MutationObserver||l.WebKitMutationObserver,y=l.document,v=l.process,w=l.Promise,_=c(l,"queueMicrotask"),x=_&&_.value;if(!x){var S=new d,C=function(){var t,e;for(b&&(t=v.domain)&&t.exit();e=S.get();)try{e()}catch(t){throw S.head&&n(),t}t&&t.enter()};f||b||m||!g||!y?!p&&w&&w.resolve?((o=w.resolve(void 0)).constructor=w,a=u(o.then,o),n=function(){a(C)}):b?n=function(){v.nextTick(C)}:(h=u(h,l),n=function(){h(C)}):(i=!0,s=y.createTextNode(""),new g(C).observe(s,{characterData:!0}),n=function(){s.data=i=!i}),x=function(t){S.head||n(),S.add(t)}}e.exports=x},{"../internals/engine-is-ios":253,"../internals/engine-is-ios-pebble":252,"../internals/engine-is-node":254,"../internals/engine-is-webos-webkit":255,"../internals/function-bind-context":262,"../internals/global":274,"../internals/object-get-own-property-descriptor":309,"../internals/queue":328,"../internals/task":339}],303:[function(t,e,r){"use strict";var n=t("../internals/a-callable"),i=TypeError,s=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw new i("Bad Promise constructor");e=t,r=n})),this.resolve=n(e),this.reject=n(r)};e.exports.f=function(t){return new s(t)}},{"../internals/a-callable":222}],304:[function(t,e,r){"use strict";var n=t("../internals/is-regexp"),i=TypeError;e.exports=function(t){if(n(t))throw new i("The method doesn't accept regular expressions");return t}},{"../internals/is-regexp":291}],305:[function(t,e,r){"use strict";var n=t("../internals/descriptors"),i=t("../internals/function-uncurry-this"),s=t("../internals/function-call"),o=t("../internals/fails"),a=t("../internals/object-keys"),l=t("../internals/object-get-own-property-symbols"),u=t("../internals/object-property-is-enumerable"),c=t("../internals/to-object"),h=t("../internals/indexed-object"),d=Object.assign,f=Object.defineProperty,p=i([].concat);e.exports=!d||o((function(){if(n&&1!==d({b:1},d(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol("assign detection");return t[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!==d({},t)[r]||"abcdefghijklmnopqrst"!==a(d({},e)).join("")}))?function(t,e){for(var r=c(t),i=arguments.length,o=1,d=l.f,f=u.f;i>o;)for(var m,b=h(arguments[o++]),g=d?p(a(b),d(b)):a(b),y=g.length,v=0;y>v;)m=g[v++],n&&!s(f,b,m)||(r[m]=b[m]);return r}:d},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/object-get-own-property-symbols":312,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-object":344}],306:[function(t,e,r){"use strict";var n,i=t("../internals/an-object"),s=t("../internals/object-define-properties"),o=t("../internals/enum-bug-keys"),a=t("../internals/hidden-keys"),l=t("../internals/html"),u=t("../internals/document-create-element"),c=t("../internals/shared-key")("IE_PROTO"),h=function(){},d=function(t){return"<script>"+t+"<\/script>"},f=function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}var t,e;p="undefined"!=typeof document?document.domain&&n?f(n):((e=u("iframe")).style.display="none",l.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F):f(n);for(var r=o.length;r--;)delete p.prototype[o[r]];return p()};a[c]=!0,e.exports=Object.create||function(t,e){var r;return null!==t?(h.prototype=i(t),r=new h,h.prototype=null,r[c]=t):r=p(),void 0===e?r:s.f(r,e)}},{"../internals/an-object":227,"../internals/document-create-element":249,"../internals/enum-bug-keys":258,"../internals/hidden-keys":276,"../internals/html":278,"../internals/object-define-properties":307,"../internals/shared-key":332}],307:[function(t,e,r){"use strict";var n=t("../internals/descriptors"),i=t("../internals/v8-prototype-define-bug"),s=t("../internals/object-define-property"),o=t("../internals/an-object"),a=t("../internals/to-indexed-object"),l=t("../internals/object-keys");r.f=n&&!i?Object.defineProperties:function(t,e){o(t);for(var r,n=a(e),i=l(e),u=i.length,c=0;u>c;)s.f(t,r=i[c++],n[r]);return t}},{"../internals/an-object":227,"../internals/descriptors":247,"../internals/object-define-property":308,"../internals/object-keys":316,"../internals/to-indexed-object":341,"../internals/v8-prototype-define-bug":352}],308:[function(t,e,r){"use strict";var n=t("../internals/descriptors"),i=t("../internals/ie8-dom-define"),s=t("../internals/v8-prototype-define-bug"),o=t("../internals/an-object"),a=t("../internals/to-property-key"),l=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;r.f=n?s?function(t,e,r){if(o(t),e=a(e),o(r),"function"==typeof t&&"prototype"===e&&"value"in r&&"writable"in r&&!r.writable){var n=c(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return u(t,e,r)}:u:function(t,e,r){if(o(t),e=a(e),o(r),i)try{return u(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},{"../internals/an-object":227,"../internals/descriptors":247,"../internals/ie8-dom-define":279,"../internals/to-property-key":346,"../internals/v8-prototype-define-bug":352}],309:[function(t,e,r){"use strict";var n=t("../internals/descriptors"),i=t("../internals/function-call"),s=t("../internals/object-property-is-enumerable"),o=t("../internals/create-property-descriptor"),a=t("../internals/to-indexed-object"),l=t("../internals/to-property-key"),u=t("../internals/has-own-property"),c=t("../internals/ie8-dom-define"),h=Object.getOwnPropertyDescriptor;r.f=n?h:function(t,e){if(t=a(t),e=l(e),c)try{return h(t,e)}catch(t){}if(u(t,e))return o(!i(s.f,t,e),t[e])}},{"../internals/create-property-descriptor":242,"../internals/descriptors":247,"../internals/function-call":264,"../internals/has-own-property":275,"../internals/ie8-dom-define":279,"../internals/object-property-is-enumerable":317,"../internals/to-indexed-object":341,"../internals/to-property-key":346}],310:[function(t,e,r){"use strict";var n=t("../internals/classof-raw"),i=t("../internals/to-indexed-object"),s=t("../internals/object-get-own-property-names").f,o=t("../internals/array-slice-simple"),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(t){return a&&"Window"===n(t)?function(t){try{return s(t)}catch(t){return o(a)}}(t):s(i(t))}},{"../internals/array-slice-simple":230,"../internals/classof-raw":235,"../internals/object-get-own-property-names":311,"../internals/to-indexed-object":341}],311:[function(t,e,r){"use strict";var n=t("../internals/object-keys-internal"),i=t("../internals/enum-bug-keys").concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return n(t,i)}},{"../internals/enum-bug-keys":258,"../internals/object-keys-internal":315}],312:[function(t,e,r){"use strict";r.f=Object.getOwnPropertySymbols},{}],313:[function(t,e,r){"use strict";var n=t("../internals/has-own-property"),i=t("../internals/is-callable"),s=t("../internals/to-object"),o=t("../internals/shared-key"),a=t("../internals/correct-prototype-getter"),l=o("IE_PROTO"),u=Object,c=u.prototype;e.exports=a?u.getPrototypeOf:function(t){var e=s(t);if(n(e,l))return e[l];var r=e.constructor;return i(r)&&e instanceof r?r.prototype:e instanceof u?c:null}},{"../internals/correct-prototype-getter":239,"../internals/has-own-property":275,"../internals/is-callable":285,"../internals/shared-key":332,"../internals/to-object":344}],314:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this");e.exports=n({}.isPrototypeOf)},{"../internals/function-uncurry-this":268}],315:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this"),i=t("../internals/has-own-property"),s=t("../internals/to-indexed-object"),o=t("../internals/array-includes").indexOf,a=t("../internals/hidden-keys"),l=n([].push);e.exports=function(t,e){var r,n=s(t),u=0,c=[];for(r in n)!i(a,r)&&i(n,r)&&l(c,r);for(;e.length>u;)i(n,r=e[u++])&&(~o(c,r)||l(c,r));return c}},{"../internals/array-includes":228,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/hidden-keys":276,"../internals/to-indexed-object":341}],316:[function(t,e,r){"use strict";var n=t("../internals/object-keys-internal"),i=t("../internals/enum-bug-keys");e.exports=Object.keys||function(t){return n(t,i)}},{"../internals/enum-bug-keys":258,"../internals/object-keys-internal":315}],317:[function(t,e,r){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,s=i&&!n.call({1:2},1);r.f=s?function(t){var e=i(this,t);return!!e&&e.enumerable}:n},{}],318:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this-accessor"),i=t("../internals/an-object"),s=t("../internals/a-possible-prototype");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=n(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return i(r),s(n),e?t(r,n):r.__proto__=n,r}}():void 0)},{"../internals/a-possible-prototype":224,"../internals/an-object":227,"../internals/function-uncurry-this-accessor":266}],319:[function(t,e,r){"use strict";var n=t("../internals/descriptors"),i=t("../internals/fails"),s=t("../internals/function-uncurry-this"),o=t("../internals/object-get-prototype-of"),a=t("../internals/object-keys"),l=t("../internals/to-indexed-object"),u=s(t("../internals/object-property-is-enumerable").f),c=s([].push),h=n&&i((function(){var t=Object.create(null);return t[2]=2,!u(t,2)})),d=function(t){return function(e){for(var r,i=l(e),s=a(i),d=h&&null===o(i),f=s.length,p=0,m=[];f>p;)r=s[p++],n&&!(d?r in i:u(i,r))||c(m,t?[r,i[r]]:i[r]);return m}};e.exports={entries:d(!0),values:d(!1)}},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-uncurry-this":268,"../internals/object-get-prototype-of":313,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-indexed-object":341}],320:[function(t,e,r){"use strict";var n=t("../internals/function-call"),i=t("../internals/is-callable"),s=t("../internals/is-object"),o=TypeError;e.exports=function(t,e){var r,a;if("string"===e&&i(r=t.toString)&&!s(a=n(r,t)))return a;if(i(r=t.valueOf)&&!s(a=n(r,t)))return a;if("string"!==e&&i(r=t.toString)&&!s(a=n(r,t)))return a;throw new o("Can't convert object to primitive value")}},{"../internals/function-call":264,"../internals/is-callable":285,"../internals/is-object":289}],321:[function(t,e,r){"use strict";var n=t("../internals/get-built-in"),i=t("../internals/function-uncurry-this"),s=t("../internals/object-get-own-property-names"),o=t("../internals/object-get-own-property-symbols"),a=t("../internals/an-object"),l=i([].concat);e.exports=n("Reflect","ownKeys")||function(t){var e=s.f(a(t)),r=o.f;return r?l(e,r(t)):e}},{"../internals/an-object":227,"../internals/function-uncurry-this":268,"../internals/get-built-in":269,"../internals/object-get-own-property-names":311,"../internals/object-get-own-property-symbols":312}],322:[function(t,e,r){"use strict";var n=t("../internals/global");e.exports=n},{"../internals/global":274}],323:[function(t,e,r){"use strict";e.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},{}],324:[function(t,e,r){"use strict";var n=t("../internals/global"),i=t("../internals/promise-native-constructor"),s=t("../internals/is-callable"),o=t("../internals/is-forced"),a=t("../internals/inspect-source"),l=t("../internals/well-known-symbol"),u=t("../internals/engine-is-browser"),c=t("../internals/engine-is-deno"),h=t("../internals/is-pure"),d=t("../internals/engine-v8-version"),f=i&&i.prototype,p=l("species"),m=!1,b=s(n.PromiseRejectionEvent),g=o("Promise",(function(){var t=a(i),e=t!==String(i);if(!e&&66===d)return!0;if(h&&(!f.catch||!f.finally))return!0;if(!d||d<51||!/native code/.test(t)){var r=new i((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[p]=n,!(m=r.then((function(){}))instanceof n))return!0}return!e&&(u||c)&&!b}));e.exports={CONSTRUCTOR:g,REJECTION_EVENT:b,SUBCLASSING:m}},{"../internals/engine-is-browser":250,"../internals/engine-is-deno":251,"../internals/engine-v8-version":257,"../internals/global":274,"../internals/inspect-source":281,"../internals/is-callable":285,"../internals/is-forced":287,"../internals/is-pure":290,"../internals/promise-native-constructor":325,"../internals/well-known-symbol":357}],325:[function(t,e,r){"use strict";var n=t("../internals/global");e.exports=n.Promise},{"../internals/global":274}],326:[function(t,e,r){"use strict";var n=t("../internals/an-object"),i=t("../internals/is-object"),s=t("../internals/new-promise-capability");e.exports=function(t,e){if(n(t),i(e)&&e.constructor===t)return e;var r=s.f(t);return(0,r.resolve)(e),r.promise}},{"../internals/an-object":227,"../internals/is-object":289,"../internals/new-promise-capability":303}],327:[function(t,e,r){"use strict";var n=t("../internals/promise-native-constructor"),i=t("../internals/check-correctness-of-iteration"),s=t("../internals/promise-constructor-detection").CONSTRUCTOR;e.exports=s||!i((function(t){n.all(t).then(void 0,(function(){}))}))},{"../internals/check-correctness-of-iteration":234,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325}],328:[function(t,e,r){"use strict";var n=function(){this.head=null,this.tail=null};n.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},e.exports=n},{}],329:[function(t,e,r){"use strict";var n=t("../internals/is-null-or-undefined"),i=TypeError;e.exports=function(t){if(n(t))throw new i("Can't call method on "+t);return t}},{"../internals/is-null-or-undefined":288}],330:[function(t,e,r){"use strict";var n=t("../internals/get-built-in"),i=t("../internals/define-built-in-accessor"),s=t("../internals/well-known-symbol"),o=t("../internals/descriptors"),a=s("species");e.exports=function(t){var e=n(t);o&&e&&!e[a]&&i(e,a,{configurable:!0,get:function(){return this}})}},{"../internals/define-built-in-accessor":244,"../internals/descriptors":247,"../internals/get-built-in":269,"../internals/well-known-symbol":357}],331:[function(t,e,r){"use strict";var n=t("../internals/object-define-property").f,i=t("../internals/has-own-property"),s=t("../internals/well-known-symbol")("toStringTag");e.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!i(t,s)&&n(t,s,{configurable:!0,value:e})}},{"../internals/has-own-property":275,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],332:[function(t,e,r){"use strict";var n=t("../internals/shared"),i=t("../internals/uid"),s=n("keys");e.exports=function(t){return s[t]||(s[t]=i(t))}},{"../internals/shared":334,"../internals/uid":350}],333:[function(t,e,r){"use strict";var n=t("../internals/global"),i=t("../internals/define-global-property"),s=n["__core-js_shared__"]||i("__core-js_shared__",{});e.exports=s},{"../internals/define-global-property":246,"../internals/global":274}],334:[function(t,e,r){"use strict";var n=t("../internals/is-pure"),i=t("../internals/shared-store");(e.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.33.0",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"})},{"../internals/is-pure":290,"../internals/shared-store":333}],335:[function(t,e,r){"use strict";var n=t("../internals/an-object"),i=t("../internals/a-constructor"),s=t("../internals/is-null-or-undefined"),o=t("../internals/well-known-symbol")("species");e.exports=function(t,e){var r,a=n(t).constructor;return void 0===a||s(r=n(a)[o])?e:i(r)}},{"../internals/a-constructor":223,"../internals/an-object":227,"../internals/is-null-or-undefined":288,"../internals/well-known-symbol":357}],336:[function(t,e,r){"use strict";var n=t("../internals/engine-v8-version"),i=t("../internals/fails"),s=t("../internals/global").String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},{"../internals/engine-v8-version":257,"../internals/fails":260,"../internals/global":274}],337:[function(t,e,r){"use strict";var n=t("../internals/function-call"),i=t("../internals/get-built-in"),s=t("../internals/well-known-symbol"),o=t("../internals/define-built-in");e.exports=function(){var t=i("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,a=s("toPrimitive");e&&!e[a]&&o(e,a,(function(t){return n(r,this)}),{arity:1})}},{"../internals/define-built-in":245,"../internals/function-call":264,"../internals/get-built-in":269,"../internals/well-known-symbol":357}],338:[function(t,e,r){"use strict";var n=t("../internals/symbol-constructor-detection");e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},{"../internals/symbol-constructor-detection":336}],339:[function(t,e,r){"use strict";var n,i,s,o,a=t("../internals/global"),l=t("../internals/function-apply"),u=t("../internals/function-bind-context"),c=t("../internals/is-callable"),h=t("../internals/has-own-property"),d=t("../internals/fails"),f=t("../internals/html"),p=t("../internals/array-slice"),m=t("../internals/document-create-element"),b=t("../internals/validate-arguments-length"),g=t("../internals/engine-is-ios"),y=t("../internals/engine-is-node"),v=a.setImmediate,w=a.clearImmediate,_=a.process,x=a.Dispatch,S=a.Function,C=a.MessageChannel,A=a.String,k=0,T={};d((function(){n=a.location}));var E=function(t){if(h(T,t)){var e=T[t];delete T[t],e()}},M=function(t){return function(){E(t)}},R=function(t){E(t.data)},I=function(t){a.postMessage(A(t),n.protocol+"//"+n.host)};v&&w||(v=function(t){b(arguments.length,1);var e=c(t)?t:S(t),r=p(arguments,1);return T[++k]=function(){l(e,void 0,r)},i(k),k},w=function(t){delete T[t]},y?i=function(t){_.nextTick(M(t))}:x&&x.now?i=function(t){x.now(M(t))}:C&&!g?(o=(s=new C).port2,s.port1.onmessage=R,i=u(o.postMessage,o)):a.addEventListener&&c(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!d(I)?(i=I,a.addEventListener("message",R,!1)):i="onreadystatechange"in m("script")?function(t){f.appendChild(m("script")).onreadystatechange=function(){f.removeChild(this),E(t)}}:function(t){setTimeout(M(t),0)}),e.exports={set:v,clear:w}},{"../internals/array-slice":231,"../internals/document-create-element":249,"../internals/engine-is-ios":253,"../internals/engine-is-node":254,"../internals/fails":260,"../internals/function-apply":261,"../internals/function-bind-context":262,"../internals/global":274,"../internals/has-own-property":275,"../internals/html":278,"../internals/is-callable":285,"../internals/validate-arguments-length":353}],340:[function(t,e,r){"use strict";var n=t("../internals/to-integer-or-infinity"),i=Math.max,s=Math.min;e.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):s(r,e)}},{"../internals/to-integer-or-infinity":342}],341:[function(t,e,r){"use strict";var n=t("../internals/indexed-object"),i=t("../internals/require-object-coercible");e.exports=function(t){return n(i(t))}},{"../internals/indexed-object":280,"../internals/require-object-coercible":329}],342:[function(t,e,r){"use strict";var n=t("../internals/math-trunc");e.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},{"../internals/math-trunc":301}],343:[function(t,e,r){"use strict";var n=t("../internals/to-integer-or-infinity"),i=Math.min;e.exports=function(t){return t>0?i(n(t),9007199254740991):0}},{"../internals/to-integer-or-infinity":342}],344:[function(t,e,r){"use strict";var n=t("../internals/require-object-coercible"),i=Object;e.exports=function(t){return i(n(t))}},{"../internals/require-object-coercible":329}],345:[function(t,e,r){"use strict";var n=t("../internals/function-call"),i=t("../internals/is-object"),s=t("../internals/is-symbol"),o=t("../internals/get-method"),a=t("../internals/ordinary-to-primitive"),l=t("../internals/well-known-symbol"),u=TypeError,c=l("toPrimitive");e.exports=function(t,e){if(!i(t)||s(t))return t;var r,l=o(t,c);if(l){if(void 0===e&&(e="default"),r=n(l,t,e),!i(r)||s(r))return r;throw new u("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},{"../internals/function-call":264,"../internals/get-method":273,"../internals/is-object":289,"../internals/is-symbol":292,"../internals/ordinary-to-primitive":320,"../internals/well-known-symbol":357}],346:[function(t,e,r){"use strict";var n=t("../internals/to-primitive"),i=t("../internals/is-symbol");e.exports=function(t){var e=n(t,"string");return i(e)?e:e+""}},{"../internals/is-symbol":292,"../internals/to-primitive":345}],347:[function(t,e,r){"use strict";var n={};n[t("../internals/well-known-symbol")("toStringTag")]="z",e.exports="[object z]"===String(n)},{"../internals/well-known-symbol":357}],348:[function(t,e,r){"use strict";var n=t("../internals/classof"),i=String;e.exports=function(t){if("Symbol"===n(t))throw new TypeError("Cannot convert a Symbol value to a string");return i(t)}},{"../internals/classof":236}],349:[function(t,e,r){"use strict";var n=String;e.exports=function(t){try{return n(t)}catch(t){return"Object"}}},{}],350:[function(t,e,r){"use strict";var n=t("../internals/function-uncurry-this"),i=0,s=Math.random(),o=n(1..toString);e.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++i+s,36)}},{"../internals/function-uncurry-this":268}],351:[function(t,e,r){"use strict";var n=t("../internals/symbol-constructor-detection");e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/symbol-constructor-detection":336}],352:[function(t,e,r){"use strict";var n=t("../internals/descriptors"),i=t("../internals/fails");e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},{"../internals/descriptors":247,"../internals/fails":260}],353:[function(t,e,r){"use strict";var n=TypeError;e.exports=function(t,e){if(t<e)throw new n("Not enough arguments");return t}},{}],354:[function(t,e,r){"use strict";var n=t("../internals/global"),i=t("../internals/is-callable"),s=n.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},{"../internals/global":274,"../internals/is-callable":285}],355:[function(t,e,r){"use strict";var n=t("../internals/path"),i=t("../internals/has-own-property"),s=t("../internals/well-known-symbol-wrapped"),o=t("../internals/object-define-property").f;e.exports=function(t){var e=n.Symbol||(n.Symbol={});i(e,t)||o(e,t,{value:s.f(t)})}},{"../internals/has-own-property":275,"../internals/object-define-property":308,"../internals/path":322,"../internals/well-known-symbol-wrapped":356}],356:[function(t,e,r){"use strict";var n=t("../internals/well-known-symbol");r.f=n},{"../internals/well-known-symbol":357}],357:[function(t,e,r){"use strict";var n=t("../internals/global"),i=t("../internals/shared"),s=t("../internals/has-own-property"),o=t("../internals/uid"),a=t("../internals/symbol-constructor-detection"),l=t("../internals/use-symbol-as-uid"),u=n.Symbol,c=i("wks"),h=l?u.for||u:u&&u.withoutSetter||o;e.exports=function(t){return s(c,t)||(c[t]=a&&s(u,t)?u[t]:h("Symbol."+t)),c[t]}},{"../internals/global":274,"../internals/has-own-property":275,"../internals/shared":334,"../internals/symbol-constructor-detection":336,"../internals/uid":350,"../internals/use-symbol-as-uid":351}],358:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/array-iteration").findIndex,s=t("../internals/add-to-unscopables"),o=!0;"findIndex"in[]&&Array(1).findIndex((function(){o=!1})),n({target:"Array",proto:!0,forced:o},{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),s("findIndex")},{"../internals/add-to-unscopables":225,"../internals/array-iteration":229,"../internals/export":259}],359:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/array-iteration").find,s=t("../internals/add-to-unscopables"),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),n({target:"Array",proto:!0,forced:o},{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),s("find")},{"../internals/add-to-unscopables":225,"../internals/array-iteration":229,"../internals/export":259}],360:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/array-includes").includes,s=t("../internals/fails"),o=t("../internals/add-to-unscopables");n({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},{"../internals/add-to-unscopables":225,"../internals/array-includes":228,"../internals/export":259,"../internals/fails":260}],361:[function(t,e,r){"use strict";var n=t("../internals/to-indexed-object"),i=t("../internals/add-to-unscopables"),s=t("../internals/iterators"),o=t("../internals/internal-state"),a=t("../internals/object-define-property").f,l=t("../internals/iterator-define"),u=t("../internals/create-iter-result-object"),c=t("../internals/is-pure"),h=t("../internals/descriptors"),d=o.set,f=o.getterFor("Array Iterator");e.exports=l(Array,"Array",(function(t,e){d(this,{type:"Array Iterator",target:n(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,r=t.kind,n=t.index++;if(!e||n>=e.length)return t.target=void 0,u(void 0,!0);switch(r){case"keys":return u(n,!1);case"values":return u(e[n],!1)}return u([n,e[n]],!1)}),"values");var p=s.Arguments=s.Array;if(i("keys"),i("values"),i("entries"),!c&&h&&"values"!==p.name)try{a(p,"name",{value:"values"})}catch(t){}},{"../internals/add-to-unscopables":225,"../internals/create-iter-result-object":240,"../internals/descriptors":247,"../internals/internal-state":282,"../internals/is-pure":290,"../internals/iterator-define":296,"../internals/iterators":298,"../internals/object-define-property":308,"../internals/to-indexed-object":341}],362:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/get-built-in"),s=t("../internals/function-apply"),o=t("../internals/function-call"),a=t("../internals/function-uncurry-this"),l=t("../internals/fails"),u=t("../internals/is-callable"),c=t("../internals/is-symbol"),h=t("../internals/array-slice"),d=t("../internals/get-json-replacer-function"),f=t("../internals/symbol-constructor-detection"),p=String,m=i("JSON","stringify"),b=a(/./.exec),g=a("".charAt),y=a("".charCodeAt),v=a("".replace),w=a(1..toString),_=/[\uD800-\uDFFF]/g,x=/^[\uD800-\uDBFF]$/,S=/^[\uDC00-\uDFFF]$/,C=!f||l((function(){var t=i("Symbol")("stringify detection");return"[null]"!==m([t])||"{}"!==m({a:t})||"{}"!==m(Object(t))})),A=l((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),k=function(t,e){var r=h(arguments),n=d(e);if(u(n)||void 0!==t&&!c(t))return r[1]=function(t,e){if(u(n)&&(e=o(n,this,p(t),e)),!c(e))return e},s(m,null,r)},T=function(t,e,r){var n=g(r,e-1),i=g(r,e+1);return b(x,t)&&!b(S,i)||b(S,t)&&!b(x,n)?"\\u"+w(y(t,0),16):t};m&&n({target:"JSON",stat:!0,arity:3,forced:C||A},{stringify:function(t,e,r){var n=h(arguments),i=s(C?k:m,null,n);return A&&"string"==typeof i?v(i,_,T):i}})},{"../internals/array-slice":231,"../internals/export":259,"../internals/fails":260,"../internals/function-apply":261,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/get-built-in":269,"../internals/get-json-replacer-function":272,"../internals/is-callable":285,"../internals/is-symbol":292,"../internals/symbol-constructor-detection":336}],363:[function(t,e,r){"use strict";t("../internals/export")({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})},{"../internals/export":259}],364:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/object-assign");n({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},{"../internals/export":259,"../internals/object-assign":305}],365:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/symbol-constructor-detection"),s=t("../internals/fails"),o=t("../internals/object-get-own-property-symbols"),a=t("../internals/to-object");n({target:"Object",stat:!0,forced:!i||s((function(){o.f(1)}))},{getOwnPropertySymbols:function(t){var e=o.f;return e?e(a(t)):[]}})},{"../internals/export":259,"../internals/fails":260,"../internals/object-get-own-property-symbols":312,"../internals/symbol-constructor-detection":336,"../internals/to-object":344}],366:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/to-object"),s=t("../internals/object-keys");n({target:"Object",stat:!0,forced:t("../internals/fails")((function(){s(1)}))},{keys:function(t){return s(i(t))}})},{"../internals/export":259,"../internals/fails":260,"../internals/object-keys":316,"../internals/to-object":344}],367:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/object-to-array").values;n({target:"Object",stat:!0},{values:function(t){return i(t)}})},{"../internals/export":259,"../internals/object-to-array":319}],368:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/function-call"),s=t("../internals/a-callable"),o=t("../internals/new-promise-capability"),a=t("../internals/perform"),l=t("../internals/iterate");n({target:"Promise",stat:!0,forced:t("../internals/promise-statics-incorrect-iteration")},{all:function(t){var e=this,r=o.f(e),n=r.resolve,u=r.reject,c=a((function(){var r=s(e.resolve),o=[],a=0,c=1;l(t,(function(t){var s=a++,l=!1;c++,i(r,e,t).then((function(t){l||(l=!0,o[s]=t,--c||n(o))}),u)})),--c||n(o)}));return c.error&&u(c.value),r.promise}})},{"../internals/a-callable":222,"../internals/export":259,"../internals/function-call":264,"../internals/iterate":293,"../internals/new-promise-capability":303,"../internals/perform":323,"../internals/promise-statics-incorrect-iteration":327}],369:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/is-pure"),s=t("../internals/promise-constructor-detection").CONSTRUCTOR,o=t("../internals/promise-native-constructor"),a=t("../internals/get-built-in"),l=t("../internals/is-callable"),u=t("../internals/define-built-in"),c=o&&o.prototype;if(n({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(t){return this.then(void 0,t)}}),!i&&l(o)){var h=a("Promise").prototype.catch;c.catch!==h&&u(c,"catch",h,{unsafe:!0})}},{"../internals/define-built-in":245,"../internals/export":259,"../internals/get-built-in":269,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325}],370:[function(t,e,r){"use strict";var n,i,s,o=t("../internals/export"),a=t("../internals/is-pure"),l=t("../internals/engine-is-node"),u=t("../internals/global"),c=t("../internals/function-call"),h=t("../internals/define-built-in"),d=t("../internals/object-set-prototype-of"),f=t("../internals/set-to-string-tag"),p=t("../internals/set-species"),m=t("../internals/a-callable"),b=t("../internals/is-callable"),g=t("../internals/is-object"),y=t("../internals/an-instance"),v=t("../internals/species-constructor"),w=t("../internals/task").set,_=t("../internals/microtask"),x=t("../internals/host-report-errors"),S=t("../internals/perform"),C=t("../internals/queue"),A=t("../internals/internal-state"),k=t("../internals/promise-native-constructor"),T=t("../internals/promise-constructor-detection"),E=t("../internals/new-promise-capability"),M=T.CONSTRUCTOR,R=T.REJECTION_EVENT,I=T.SUBCLASSING,O=A.getterFor("Promise"),j=A.set,P=k&&k.prototype,N=k,B=P,F=u.TypeError,D=u.document,L=u.process,V=E.f,z=V,U=!!(D&&D.createEvent&&u.dispatchEvent),$=function(t){var e;return!(!g(t)||!b(e=t.then))&&e},H=function(t,e){var r,n,i,s=e.value,o=1===e.state,a=o?t.ok:t.fail,l=t.resolve,u=t.reject,h=t.domain;try{a?(o||(2===e.rejection&&G(e),e.rejection=1),!0===a?r=s:(h&&h.enter(),r=a(s),h&&(h.exit(),i=!0)),r===t.promise?u(new F("Promise-chain cycle")):(n=$(r))?c(n,r,l,u):l(r)):u(s)}catch(t){h&&!i&&h.exit(),u(t)}},W=function(t,e){t.notified||(t.notified=!0,_((function(){for(var r,n=t.reactions;r=n.get();)H(r,t);t.notified=!1,e&&!t.rejection&&Y(t)})))},q=function(t,e,r){var n,i;U?((n=D.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),u.dispatchEvent(n)):n={promise:e,reason:r},!R&&(i=u["on"+t])?i(n):"unhandledrejection"===t&&x("Unhandled promise rejection",r)},Y=function(t){c(w,u,(function(){var e,r=t.facade,n=t.value;if(X(t)&&(e=S((function(){l?L.emit("unhandledRejection",n,r):q("unhandledrejection",r,n)})),t.rejection=l||X(t)?2:1,e.error))throw e.value}))},X=function(t){return 1!==t.rejection&&!t.parent},G=function(t){c(w,u,(function(){var e=t.facade;l?L.emit("rejectionHandled",e):q("rejectionhandled",e,t.value)}))},K=function(t,e,r){return function(n){t(e,n,r)}},Z=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,W(t,!0))},J=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new F("Promise can't be resolved itself");var n=$(e);n?_((function(){var r={done:!1};try{c(n,e,K(J,r,t),K(Z,r,t))}catch(e){Z(r,e,t)}})):(t.value=e,t.state=1,W(t,!1))}catch(e){Z({done:!1},e,t)}}};if(M&&(B=(N=function(t){y(this,B),m(t),c(n,this);var e=O(this);try{t(K(J,e),K(Z,e))}catch(t){Z(e,t)}}).prototype,(n=function(t){j(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new C,rejection:!1,state:0,value:void 0})}).prototype=h(B,"then",(function(t,e){var r=O(this),n=V(v(this,N));return r.parent=!0,n.ok=!b(t)||t,n.fail=b(e)&&e,n.domain=l?L.domain:void 0,0===r.state?r.reactions.add(n):_((function(){H(n,r)})),n.promise})),i=function(){var t=new n,e=O(t);this.promise=t,this.resolve=K(J,e),this.reject=K(Z,e)},E.f=V=function(t){return t===N||void 0===t?new i(t):z(t)},!a&&b(k)&&P!==Object.prototype)){s=P.then,I||h(P,"then",(function(t,e){var r=this;return new N((function(t,e){c(s,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete P.constructor}catch(t){}d&&d(P,B)}o({global:!0,constructor:!0,wrap:!0,forced:M},{Promise:N}),f(N,"Promise",!1,!0),p("Promise")},{"../internals/a-callable":222,"../internals/an-instance":226,"../internals/define-built-in":245,"../internals/engine-is-node":254,"../internals/export":259,"../internals/function-call":264,"../internals/global":274,"../internals/host-report-errors":277,"../internals/internal-state":282,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/microtask":302,"../internals/new-promise-capability":303,"../internals/object-set-prototype-of":318,"../internals/perform":323,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325,"../internals/queue":328,"../internals/set-species":330,"../internals/set-to-string-tag":331,"../internals/species-constructor":335,"../internals/task":339}],371:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/is-pure"),s=t("../internals/promise-native-constructor"),o=t("../internals/fails"),a=t("../internals/get-built-in"),l=t("../internals/is-callable"),u=t("../internals/species-constructor"),c=t("../internals/promise-resolve"),h=t("../internals/define-built-in"),d=s&&s.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!s&&o((function(){d.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=u(this,a("Promise")),r=l(t);return this.then(r?function(r){return c(e,t()).then((function(){return r}))}:t,r?function(r){return c(e,t()).then((function(){throw r}))}:t)}}),!i&&l(s)){var f=a("Promise").prototype.finally;d.finally!==f&&h(d,"finally",f,{unsafe:!0})}},{"../internals/define-built-in":245,"../internals/export":259,"../internals/fails":260,"../internals/get-built-in":269,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/promise-native-constructor":325,"../internals/promise-resolve":326,"../internals/species-constructor":335}],372:[function(t,e,r){"use strict";t("../modules/es.promise.constructor"),t("../modules/es.promise.all"),t("../modules/es.promise.catch"),t("../modules/es.promise.race"),t("../modules/es.promise.reject"),t("../modules/es.promise.resolve")},{"../modules/es.promise.all":368,"../modules/es.promise.catch":369,"../modules/es.promise.constructor":370,"../modules/es.promise.race":373,"../modules/es.promise.reject":374,"../modules/es.promise.resolve":375}],373:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/function-call"),s=t("../internals/a-callable"),o=t("../internals/new-promise-capability"),a=t("../internals/perform"),l=t("../internals/iterate");n({target:"Promise",stat:!0,forced:t("../internals/promise-statics-incorrect-iteration")},{race:function(t){var e=this,r=o.f(e),n=r.reject,u=a((function(){var o=s(e.resolve);l(t,(function(t){i(o,e,t).then(r.resolve,n)}))}));return u.error&&n(u.value),r.promise}})},{"../internals/a-callable":222,"../internals/export":259,"../internals/function-call":264,"../internals/iterate":293,"../internals/new-promise-capability":303,"../internals/perform":323,"../internals/promise-statics-incorrect-iteration":327}],374:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/function-call"),s=t("../internals/new-promise-capability");n({target:"Promise",stat:!0,forced:t("../internals/promise-constructor-detection").CONSTRUCTOR},{reject:function(t){var e=s.f(this);return i(e.reject,void 0,t),e.promise}})},{"../internals/export":259,"../internals/function-call":264,"../internals/new-promise-capability":303,"../internals/promise-constructor-detection":324}],375:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/get-built-in"),s=t("../internals/is-pure"),o=t("../internals/promise-native-constructor"),a=t("../internals/promise-constructor-detection").CONSTRUCTOR,l=t("../internals/promise-resolve"),u=i("Promise"),c=s&&!a;n({target:"Promise",stat:!0,forced:s||a},{resolve:function(t){return l(c&&this===u?o:this,t)}})},{"../internals/export":259,"../internals/get-built-in":269,"../internals/is-pure":290,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325,"../internals/promise-resolve":326}],376:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/function-uncurry-this"),s=t("../internals/to-absolute-index"),o=RangeError,a=String.fromCharCode,l=String.fromCodePoint,u=i([].join);n({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(t){for(var e,r=[],n=arguments.length,i=0;n>i;){if(e=+arguments[i++],s(e,1114111)!==e)throw new o(e+" is not a valid code point");r[i]=e<65536?a(e):a(55296+((e-=65536)>>10),e%1024+56320)}return u(r,"")}})},{"../internals/export":259,"../internals/function-uncurry-this":268,"../internals/to-absolute-index":340}],377:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/function-uncurry-this"),s=t("../internals/not-a-regexp"),o=t("../internals/require-object-coercible"),a=t("../internals/to-string"),l=t("../internals/correct-is-regexp-logic"),u=i("".indexOf);n({target:"String",proto:!0,forced:!l("includes")},{includes:function(t){return!!~u(a(o(this)),a(s(t)),arguments.length>1?arguments[1]:void 0)}})},{"../internals/correct-is-regexp-logic":238,"../internals/export":259,"../internals/function-uncurry-this":268,"../internals/not-a-regexp":304,"../internals/require-object-coercible":329,"../internals/to-string":348}],378:[function(t,e,r){"use strict";t("../internals/well-known-symbol-define")("asyncIterator")},{"../internals/well-known-symbol-define":355}],379:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/global"),s=t("../internals/function-call"),o=t("../internals/function-uncurry-this"),a=t("../internals/is-pure"),l=t("../internals/descriptors"),u=t("../internals/symbol-constructor-detection"),c=t("../internals/fails"),h=t("../internals/has-own-property"),d=t("../internals/object-is-prototype-of"),f=t("../internals/an-object"),p=t("../internals/to-indexed-object"),m=t("../internals/to-property-key"),b=t("../internals/to-string"),g=t("../internals/create-property-descriptor"),y=t("../internals/object-create"),v=t("../internals/object-keys"),w=t("../internals/object-get-own-property-names"),_=t("../internals/object-get-own-property-names-external"),x=t("../internals/object-get-own-property-symbols"),S=t("../internals/object-get-own-property-descriptor"),C=t("../internals/object-define-property"),A=t("../internals/object-define-properties"),k=t("../internals/object-property-is-enumerable"),T=t("../internals/define-built-in"),E=t("../internals/define-built-in-accessor"),M=t("../internals/shared"),R=t("../internals/shared-key"),I=t("../internals/hidden-keys"),O=t("../internals/uid"),j=t("../internals/well-known-symbol"),P=t("../internals/well-known-symbol-wrapped"),N=t("../internals/well-known-symbol-define"),B=t("../internals/symbol-define-to-primitive"),F=t("../internals/set-to-string-tag"),D=t("../internals/internal-state"),L=t("../internals/array-iteration").forEach,V=R("hidden"),z=D.set,U=D.getterFor("Symbol"),$=Object.prototype,H=i.Symbol,W=H&&H.prototype,q=i.RangeError,Y=i.TypeError,X=i.QObject,G=S.f,K=C.f,Z=_.f,J=k.f,Q=o([].push),tt=M("symbols"),et=M("op-symbols"),rt=M("wks"),nt=!X||!X.prototype||!X.prototype.findChild,it=function(t,e,r){var n=G($,e);n&&delete $[e],K(t,e,r),n&&t!==$&&K($,e,n)},st=l&&c((function(){return 7!==y(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?it:K,ot=function(t,e){var r=tt[t]=y(W);return z(r,{type:"Symbol",tag:t,description:e}),l||(r.description=e),r},at=function(t,e,r){t===$&&at(et,e,r),f(t);var n=m(e);return f(r),h(tt,n)?(r.enumerable?(h(t,V)&&t[V][n]&&(t[V][n]=!1),r=y(r,{enumerable:g(0,!1)})):(h(t,V)||K(t,V,g(1,{})),t[V][n]=!0),st(t,n,r)):K(t,n,r)},lt=function(t,e){f(t);var r=p(e),n=v(r).concat(dt(r));return L(n,(function(e){l&&!s(ut,r,e)||at(t,e,r[e])})),t},ut=function(t){var e=m(t),r=s(J,this,e);return!(this===$&&h(tt,e)&&!h(et,e))&&(!(r||!h(this,e)||!h(tt,e)||h(this,V)&&this[V][e])||r)},ct=function(t,e){var r=p(t),n=m(e);if(r!==$||!h(tt,n)||h(et,n)){var i=G(r,n);return!i||!h(tt,n)||h(r,V)&&r[V][n]||(i.enumerable=!0),i}},ht=function(t){var e=Z(p(t)),r=[];return L(e,(function(t){h(tt,t)||h(I,t)||Q(r,t)})),r},dt=function(t){var e=t===$,r=Z(e?et:p(t)),n=[];return L(r,(function(t){!h(tt,t)||e&&!h($,t)||Q(n,tt[t])})),n};u||(T(W=(H=function(){if(d(W,this))throw new Y("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?b(arguments[0]):void 0,e=O(t),r=function(t){this===$&&s(r,et,t),h(this,V)&&h(this[V],e)&&(this[V][e]=!1);var n=g(1,t);try{st(this,e,n)}catch(t){if(!(t instanceof q))throw t;it(this,e,n)}};return l&&nt&&st($,e,{configurable:!0,set:r}),ot(e,t)}).prototype,"toString",(function(){return U(this).tag})),T(H,"withoutSetter",(function(t){return ot(O(t),t)})),k.f=ut,C.f=at,A.f=lt,S.f=ct,w.f=_.f=ht,x.f=dt,P.f=function(t){return ot(j(t),t)},l&&(E(W,"description",{configurable:!0,get:function(){return U(this).description}}),a||T($,"propertyIsEnumerable",ut,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!u,sham:!u},{Symbol:H}),L(v(rt),(function(t){N(t)})),n({target:"Symbol",stat:!0,forced:!u},{useSetter:function(){nt=!0},useSimple:function(){nt=!1}}),n({target:"Object",stat:!0,forced:!u,sham:!l},{create:function(t,e){return void 0===e?y(t):lt(y(t),e)},defineProperty:at,defineProperties:lt,getOwnPropertyDescriptor:ct}),n({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:ht}),B(),F(H,"Symbol"),I[V]=!0},{"../internals/an-object":227,"../internals/array-iteration":229,"../internals/create-property-descriptor":242,"../internals/define-built-in":245,"../internals/define-built-in-accessor":244,"../internals/descriptors":247,"../internals/export":259,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/global":274,"../internals/has-own-property":275,"../internals/hidden-keys":276,"../internals/internal-state":282,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-define-properties":307,"../internals/object-define-property":308,"../internals/object-get-own-property-descriptor":309,"../internals/object-get-own-property-names":311,"../internals/object-get-own-property-names-external":310,"../internals/object-get-own-property-symbols":312,"../internals/object-is-prototype-of":314,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/set-to-string-tag":331,"../internals/shared":334,"../internals/shared-key":332,"../internals/symbol-constructor-detection":336,"../internals/symbol-define-to-primitive":337,"../internals/to-indexed-object":341,"../internals/to-property-key":346,"../internals/to-string":348,"../internals/uid":350,"../internals/well-known-symbol":357,"../internals/well-known-symbol-define":355,"../internals/well-known-symbol-wrapped":356}],380:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/get-built-in"),s=t("../internals/has-own-property"),o=t("../internals/to-string"),a=t("../internals/shared"),l=t("../internals/symbol-registry-detection"),u=a("string-to-symbol-registry"),c=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{for:function(t){var e=o(t);if(s(u,e))return u[e];var r=i("Symbol")(e);return u[e]=r,c[r]=e,r}})},{"../internals/export":259,"../internals/get-built-in":269,"../internals/has-own-property":275,"../internals/shared":334,"../internals/symbol-registry-detection":338,"../internals/to-string":348}],381:[function(t,e,r){"use strict";t("../modules/es.symbol.constructor"),t("../modules/es.symbol.for"),t("../modules/es.symbol.key-for"),t("../modules/es.json.stringify"),t("../modules/es.object.get-own-property-symbols")},{"../modules/es.json.stringify":362,"../modules/es.object.get-own-property-symbols":365,"../modules/es.symbol.constructor":379,"../modules/es.symbol.for":380,"../modules/es.symbol.key-for":382}],382:[function(t,e,r){"use strict";var n=t("../internals/export"),i=t("../internals/has-own-property"),s=t("../internals/is-symbol"),o=t("../internals/try-to-string"),a=t("../internals/shared"),l=t("../internals/symbol-registry-detection"),u=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!l},{keyFor:function(t){if(!s(t))throw new TypeError(o(t)+" is not a symbol");if(i(u,t))return u[t]}})},{"../internals/export":259,"../internals/has-own-property":275,"../internals/is-symbol":292,"../internals/shared":334,"../internals/symbol-registry-detection":338,"../internals/try-to-string":349}],383:[function(t,e,r){"use strict";function n(t){return Object.prototype.toString.call(t)}r.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},r.isBoolean=function(t){return"boolean"==typeof t},r.isNull=function(t){return null===t},r.isNullOrUndefined=function(t){return null==t},r.isNumber=function(t){return"number"==typeof t},r.isString=function(t){return"string"==typeof t},r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=function(t){return void 0===t},r.isRegExp=function(t){return"[object RegExp]"===n(t)},r.isObject=function(t){return"object"==typeof t&&null!==t},r.isDate=function(t){return"[object Date]"===n(t)},r.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},r.isFunction=function(t){return"function"==typeof t},r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("buffer").Buffer.isBuffer},{buffer:220}],384:[function(t,e,r){(function(r){(function(){"use strict";var n=t("elliptic"),i=t("bn.js");e.exports=function(t){return new o(t)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function o(t){this.curveType=s[t],this.curveType||(this.curveType={name:t}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function a(t,e,n){Array.isArray(t)||(t=t.toArray());var i=new r(t);if(n&&i.length<n){var s=new r(n-i.length);s.fill(0),i=r.concat([s,i])}return e?i.toString(e):i}s.p224=s.secp224r1,s.p256=s.secp256r1=s.prime256v1,s.p192=s.secp192r1=s.prime192v1,s.p384=s.secp384r1,s.p521=s.secp521r1,o.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},o.prototype.computeSecret=function(t,e,n){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),a(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},o.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),a(r,t)},o.prototype.getPrivateKey=function(t){return a(this.keys.getPrivate(),t)},o.prototype.setPublicKey=function(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this.keys._importPublic(t),this},o.prototype.setPrivateKey=function(t,e){e=e||"utf8",r.isBuffer(t)||(t=new r(t,e));var n=new i(t);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this)}).call(this,t("buffer").Buffer)},{"bn.js":385,buffer:220,elliptic:405}],385:[function(t,e,r){arguments[4][184][0].apply(r,arguments)},{buffer:188,dup:184}],386:[function(t,e,r){"use strict";var n=t("inherits"),i=t("md5.js"),s=t("ripemd160"),o=t("sha.js"),a=t("cipher-base");function l(t){a.call(this,"digest"),this._hash=t}n(l,a),l.prototype._update=function(t){this._hash.update(t)},l.prototype._final=function(){return this._hash.digest()},e.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new s:new l(o(t))}},{"cipher-base":221,inherits:440,"md5.js":450,ripemd160:493,"sha.js":498}],387:[function(t,e,r){"use strict";var n=t("md5.js");e.exports=function(t){return(new n).update(t).digest()}},{"md5.js":450}],388:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./legacy"),s=t("cipher-base"),o=t("safe-buffer").Buffer,a=t("create-hash/md5"),l=t("ripemd160"),u=t("sha.js"),c=o.alloc(128);function h(t,e){s.call(this,"digest"),"string"==typeof e&&(e=o.from(e));var r="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>r?e=("rmd160"===t?new l:u(t)).update(e).digest():e.length<r&&(e=o.concat([e,c],r));for(var n=this._ipad=o.allocUnsafe(r),i=this._opad=o.allocUnsafe(r),a=0;a<r;a++)n[a]=54^e[a],i[a]=92^e[a];this._hash="rmd160"===t?new l:u(t),this._hash.update(n)}n(h,s),h.prototype._update=function(t){this._hash.update(t)},h.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new l:u(this._alg)).update(this._opad).update(t).digest()},e.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new h("rmd160",e):"md5"===t?new i(a,e):new h(t,e)}},{"./legacy":389,"cipher-base":221,"create-hash/md5":387,inherits:440,ripemd160:493,"safe-buffer":494,"sha.js":498}],389:[function(t,e,r){"use strict";var n=t("inherits"),i=t("safe-buffer").Buffer,s=t("cipher-base"),o=i.alloc(128);function a(t,e){s.call(this,"digest"),"string"==typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=i.concat([e,o],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),a=0;a<64;a++)r[a]=54^e[a],n[a]=92^e[a];this._hash=[r]}n(a,s),a.prototype._update=function(t){this._hash.push(t)},a.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},e.exports=a},{"cipher-base":221,inherits:440,"safe-buffer":494}],390:[function(t,e,r){"use strict";r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=t("randombytes"),r.createHash=r.Hash=t("create-hash"),r.createHmac=r.Hmac=t("create-hmac");var n=t("browserify-sign/algos"),i=Object.keys(n),s=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);r.getHashes=function(){return s};var o=t("pbkdf2");r.pbkdf2=o.pbkdf2,r.pbkdf2Sync=o.pbkdf2Sync;var a=t("browserify-cipher");r.Cipher=a.Cipher,r.createCipher=a.createCipher,r.Cipheriv=a.Cipheriv,r.createCipheriv=a.createCipheriv,r.Decipher=a.Decipher,r.createDecipher=a.createDecipher,r.Decipheriv=a.Decipheriv,r.createDecipheriv=a.createDecipheriv,r.getCiphers=a.getCiphers,r.listCiphers=a.listCiphers;var l=t("diffie-hellman");r.DiffieHellmanGroup=l.DiffieHellmanGroup,r.createDiffieHellmanGroup=l.createDiffieHellmanGroup,r.getDiffieHellman=l.getDiffieHellman,r.createDiffieHellman=l.createDiffieHellman,r.DiffieHellman=l.DiffieHellman;var u=t("browserify-sign");r.createSign=u.createSign,r.Sign=u.Sign,r.createVerify=u.createVerify,r.Verify=u.Verify,r.createECDH=t("create-ecdh");var c=t("public-encrypt");r.publicEncrypt=c.publicEncrypt,r.privateEncrypt=c.privateEncrypt,r.publicDecrypt=c.publicDecrypt,r.privateDecrypt=c.privateDecrypt;var h=t("randomfill");r.randomFill=h.randomFill,r.randomFillSync=h.randomFillSync,r.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},r.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":206,"browserify-sign":213,"browserify-sign/algos":210,"create-ecdh":384,"create-hash":386,"create-hmac":388,"diffie-hellman":400,pbkdf2:460,"public-encrypt":468,randombytes:475,randomfill:476}],391:[function(t,e,r){"use strict";!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=n()}(void 0,(function(){var t=6e4,e=36e5,r="millisecond",n="second",i="minute",s="hour",o="day",a="week",l="month",u="quarter",c="year",h="date",d="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},b=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},g={s:b,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+b(n,2,"0")+":"+b(i,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),i=e.clone().add(n,l),s=r-i<0,o=e.clone().add(n+(s?-1:1),l);return+(-(n+(r-i)/(s?i-o:o-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:l,y:c,w:a,d:o,D:h,h:s,m:i,s:n,ms:r,Q:u}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",v={};v[y]=m;var w="$isDayjsObject",_=function(t){return t instanceof A||!(!t||!t[w])},x=function t(e,r,n){var i;if(!e)return y;if("string"==typeof e){var s=e.toLowerCase();v[s]&&(i=s),r&&(v[s]=r,i=s);var o=e.split("-");if(!i&&o.length>1)return t(o[0])}else{var a=e.name;v[a]=e,i=a}return!n&&i&&(y=i),i||!n&&y},S=function(t,e){if(_(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new A(r)},C=g;C.l=x,C.i=_,C.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var A=function(){function m(t){this.$L=x(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var b=m.prototype;return b.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(C.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(f);if(n){var i=n[2]-1||0,s=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(e)}(t),this.init()},b.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},b.$utils=function(){return C},b.isValid=function(){return!(this.$d.toString()===d)},b.isSame=function(t,e){var r=S(t);return this.startOf(e)<=r&&r<=this.endOf(e)},b.isAfter=function(t,e){return S(t)<this.startOf(e)},b.isBefore=function(t,e){return this.endOf(e)<S(t)},b.$g=function(t,e,r){return C.u(t)?this[e]:this.set(r,t)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(t,e){var r=this,u=!!C.u(e)||e,d=C.p(t),f=function(t,e){var n=C.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return u?n:n.endOf(o)},p=function(t,e){return C.w(r.toDate()[t].apply(r.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},m=this.$W,b=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(d){case c:return u?f(1,0):f(31,11);case l:return u?f(1,b):f(0,b+1);case a:var v=this.$locale().weekStart||0,w=(m<v?m+7:m)-v;return f(u?g-w:g+(6-w),b);case o:case h:return p(y+"Hours",0);case s:return p(y+"Minutes",1);case i:return p(y+"Seconds",2);case n:return p(y+"Milliseconds",3);default:return this.clone()}},b.endOf=function(t){return this.startOf(t,!1)},b.$set=function(t,e){var a,u=C.p(t),d="set"+(this.$u?"UTC":""),f=(a={},a[o]=d+"Date",a[h]=d+"Date",a[l]=d+"Month",a[c]=d+"FullYear",a[s]=d+"Hours",a[i]=d+"Minutes",a[n]=d+"Seconds",a[r]=d+"Milliseconds",a)[u],p=u===o?this.$D+(e-this.$W):e;if(u===l||u===c){var m=this.clone().set(h,1);m.$d[f](p),m.init(),this.$d=m.set(h,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},b.set=function(t,e){return this.clone().$set(t,e)},b.get=function(t){return this[C.p(t)]()},b.add=function(r,u){var h,d=this;r=Number(r);var f=C.p(u),p=function(t){var e=S(d);return C.w(e.date(e.date()+Math.round(t*r)),d)};if(f===l)return this.set(l,this.$M+r);if(f===c)return this.set(c,this.$y+r);if(f===o)return p(1);if(f===a)return p(7);var m=(h={},h[i]=t,h[s]=e,h[n]=1e3,h)[f]||1,b=this.$d.getTime()+r*m;return C.w(b,this)},b.subtract=function(t,e){return this.add(-1*t,e)},b.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||d;var n=t||"YYYY-MM-DDTHH:mm:ssZ",i=C.z(this),s=this.$H,o=this.$m,a=this.$M,l=r.weekdays,u=r.months,c=r.meridiem,h=function(t,r,i,s){return t&&(t[r]||t(e,n))||i[r].slice(0,s)},f=function(t){return C.s(s%12||12,t,"0")},m=c||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(p,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return C.s(e.$y,4,"0");case"M":return a+1;case"MM":return C.s(a+1,2,"0");case"MMM":return h(r.monthsShort,a,u,3);case"MMMM":return h(u,a);case"D":return e.$D;case"DD":return C.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(r.weekdaysMin,e.$W,l,2);case"ddd":return h(r.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(s);case"HH":return C.s(s,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(s,o,!0);case"A":return m(s,o,!1);case"m":return String(o);case"mm":return C.s(o,2,"0");case"s":return String(e.$s);case"ss":return C.s(e.$s,2,"0");case"SSS":return C.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(r,h,d){var f,p=this,m=C.p(h),b=S(r),g=(b.utcOffset()-this.utcOffset())*t,y=this-b,v=function(){return C.m(p,b)};switch(m){case c:f=v()/12;break;case l:f=v();break;case u:f=v()/3;break;case a:f=(y-g)/6048e5;break;case o:f=(y-g)/864e5;break;case s:f=y/e;break;case i:f=y/t;break;case n:f=y/1e3;break;default:f=y}return d?f:C.a(f)},b.daysInMonth=function(){return this.endOf(l).$D},b.$locale=function(){return v[this.$L]},b.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=x(t,e,!0);return n&&(r.$L=n),r},b.clone=function(){return C.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},m}(),k=A.prototype;return S.prototype=k,[["$ms",r],["$s",n],["$m",i],["$H",s],["$W",o],["$M",l],["$y",c],["$D",h]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),S.extend=function(t,e){return t.$i||(t(e,A,S),t.$i=!0),S},S.locale=x,S.isDayjs=_,S.unix=function(t){return S(1e3*t)},S.en=v[y],S.Ls=v,S.p={},S}))},{}],392:[function(t,e,r){"use strict";!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_customParseFormat=n()}(void 0,(function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,n=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,s={},o=function(t){return(t=+t)+(t>68?1900:2e3)},a=function(t){return function(e){this[t]=+e}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),r=60*e[1]+(+e[2]||0);return 0===r?0:"+"===e[0]?-r:r}(t)}],u=function(t){var e=s[t];return e&&(e.indexOf?e:e.s.concat(e.f))},c=function(t,e){var r,n=s.meridiem;if(n){for(var i=1;i<=24;i+=1)if(t.indexOf(n(i,0,e))>-1){r=i>12;break}}else r=t===(e?"pm":"PM");return r},h={A:[i,function(t){this.afternoon=c(t,!1)}],a:[i,function(t){this.afternoon=c(t,!0)}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[r,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[n,a("seconds")],ss:[n,a("seconds")],m:[n,a("minutes")],mm:[n,a("minutes")],H:[n,a("hours")],h:[n,a("hours")],HH:[n,a("hours")],hh:[n,a("hours")],D:[n,a("day")],DD:[r,a("day")],Do:[i,function(t){var e=s.ordinal,r=t.match(/\d+/);if(this.day=r[0],e)for(var n=1;n<=31;n+=1)e(n).replace(/\[|\]/g,"")===t&&(this.day=n)}],M:[n,a("month")],MM:[r,a("month")],MMM:[i,function(t){var e=u("months"),r=(u("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(r<1)throw new Error;this.month=r%12||r}],MMMM:[i,function(t){var e=u("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,a("year")],YY:[r,function(t){this.year=o(t)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function d(r){var n,i;n=r,i=s&&s.formats;for(var o=(r=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,r,n){var s=n&&n.toUpperCase();return r||i[n]||t[n]||i[s].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,r){return e||r.slice(1)}))}))).match(e),a=o.length,l=0;l<a;l+=1){var u=o[l],c=h[u],d=c&&c[0],f=c&&c[1];o[l]=f?{regex:d,parser:f}:u.replace(/^\[|\]$/g,"")}return function(t){for(var e={},r=0,n=0;r<a;r+=1){var i=o[r];if("string"==typeof i)n+=i.length;else{var s=i.regex,l=i.parser,u=t.slice(n),c=s.exec(u)[0];l.call(e,c),t=t.replace(c,"")}}return function(t){var e=t.afternoon;if(void 0!==e){var r=t.hours;e?r<12&&(t.hours+=12):12===r&&(t.hours=0),delete t.afternoon}}(e),e}}return function(t,e,r){r.p.customParseFormat=!0,t&&t.parseTwoDigitYear&&(o=t.parseTwoDigitYear);var n=e.prototype,i=n.parse;n.parse=function(t){var e=t.date,n=t.utc,o=t.args;this.$u=n;var a=o[1];if("string"==typeof a){var l=!0===o[2],u=!0===o[3],c=l||u,h=o[2];u&&(h=o[2]),s=this.$locale(),!l&&h&&(s=r.Ls[h]),this.$d=function(t,e,r){try{if(["x","X"].indexOf(e)>-1)return new Date(("X"===e?1e3:1)*t);var n=d(e)(t),i=n.year,s=n.month,o=n.day,a=n.hours,l=n.minutes,u=n.seconds,c=n.milliseconds,h=n.zone,f=new Date,p=o||(i||s?1:f.getDate()),m=i||f.getFullYear(),b=0;i&&!s||(b=s>0?s-1:f.getMonth());var g=a||0,y=l||0,v=u||0,w=c||0;return h?new Date(Date.UTC(m,b,p,g,y,v,w+60*h.offset*1e3)):r?new Date(Date.UTC(m,b,p,g,y,v,w)):new Date(m,b,p,g,y,v,w)}catch(t){return new Date("")}}(e,a,n),this.init(),h&&!0!==h&&(this.$L=this.locale(h).$L),c&&e!=this.format(a)&&(this.$d=new Date("")),s={}}else if(a instanceof Array)for(var f=a.length,p=1;p<=f;p+=1){o[1]=a[p-1];var m=r.apply(this,o);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===f&&(this.$d=new Date(""))}else i.call(this,t)}}}))},{}],393:[function(t,e,r){"use strict";!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_utc=n()}(void 0,(function(){var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,s){var o=i.prototype;s.utc=function(t){return new i({date:t,utc:!0,args:arguments})},o.utc=function(e){var r=s(this.toDate(),{locale:this.$L,utc:!0});return e?r.add(this.utcOffset(),t):r},o.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var a=o.parse;o.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),a.call(this,t)};var l=o.init;o.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else l.call(this)};var u=o.utcOffset;o.utcOffset=function(n,i){var s=this.$utils().u;if(s(n))return this.$u?0:s(this.$offset)?u.call(this):this.$offset;if("string"==typeof n&&null===(n=function(t){void 0===t&&(t="");var n=t.match(e);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],s=i[0],o=60*+i[1]+ +i[2];return 0===o?0:"+"===s?o:-o}(n)))return this;var o=Math.abs(n)<=16?60*n:n,a=this;if(i)return a.$offset=o,a.$u=0===n,a;if(0!==n){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(o+l,t)).$offset=o,a.$x.$localOffset=l}else a=this.utc();return a};var c=o.format;o.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,e)},o.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var h=o.toDate;o.toDate=function(t){return"s"===t&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var d=o.diff;o.diff=function(t,e,r){if(t&&this.$u===t.$u)return d.call(this,t,e,r);var n=this.local(),i=s(t).local();return d.call(n,i,e,r)}}}))},{}],394:[function(t,e,r){"use strict";r.utils=t("./des/utils"),r.Cipher=t("./des/cipher"),r.DES=t("./des/des"),r.CBC=t("./des/cbc"),r.EDE=t("./des/ede")},{"./des/cbc":395,"./des/cipher":396,"./des/des":397,"./des/ede":398,"./des/utils":399}],395:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits"),s={};function o(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}r.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(s),n=0;n<r.length;n++){var o=r[n];e.prototype[o]=s[o]}return e.create=function(t){return new e(t)},e},s._cbcInit=function(){var t=new o(this.options.iv);this._cbcState=t},s._update=function(t,e,r,n){var i=this._cbcState,s=this.constructor.super_.prototype,o=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)o[a]^=t[e+a];for(s._update.call(this,o,0,r,n),a=0;a<this.blockSize;a++)o[a]=r[n+a]}else{for(s._update.call(this,t,e,r,n),a=0;a<this.blockSize;a++)r[n+a]^=o[a];for(a=0;a<this.blockSize;a++)o[a]=t[e+a]}}},{inherits:440,"minimalistic-assert":453}],396:[function(t,e,r){"use strict";var n=t("minimalistic-assert");function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==t.padding}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var s=t.length-(t.length-e)%this.blockSize;e<s;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},i.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},i.prototype._unpad=function(t){return t},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},{"minimalistic-assert":453}],397:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits"),s=t("./utils"),o=t("./cipher");function a(){this.tmp=new Array(2),this.keys=null}function l(t){o.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}i(l,o),e.exports=l,l.create=function(t){return new l(t)};var u=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];l.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=s.readUInt32BE(e,0),i=s.readUInt32BE(e,4);s.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var o=0;o<t.keys.length;o+=2){var a=u[o>>>1];r=s.r28shl(r,a),i=s.r28shl(i,a),s.pc2(r,i,t.keys,o)}},l.prototype._update=function(t,e,r,n){var i=this._desState,o=s.readUInt32BE(t,e),a=s.readUInt32BE(t,e+4);s.ip(o,a,i.tmp,0),o=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,a,i.tmp,0):this._decrypt(i,o,a,i.tmp,0),o=i.tmp[0],a=i.tmp[1],s.writeUInt32BE(r,o,n),s.writeUInt32BE(r,a,n+4)},l.prototype._pad=function(t,e){if(!1===this.padding)return!1;for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},l.prototype._unpad=function(t){if(!1===this.padding)return t;for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)n.equal(t[r],e);return t.slice(0,t.length-e)},l.prototype._encrypt=function(t,e,r,n,i){for(var o=e,a=r,l=0;l<t.keys.length;l+=2){var u=t.keys[l],c=t.keys[l+1];s.expand(a,t.tmp,0),u^=t.tmp[0],c^=t.tmp[1];var h=s.substitute(u,c),d=a;a=(o^s.permute(h))>>>0,o=d}s.rip(a,o,n,i)},l.prototype._decrypt=function(t,e,r,n,i){for(var o=r,a=e,l=t.keys.length-2;l>=0;l-=2){var u=t.keys[l],c=t.keys[l+1];s.expand(o,t.tmp,0),u^=t.tmp[0],c^=t.tmp[1];var h=s.substitute(u,c),d=o;o=(a^s.permute(h))>>>0,a=d}s.rip(o,a,n,i)}},{"./cipher":396,"./utils":399,inherits:440,"minimalistic-assert":453}],398:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits"),s=t("./cipher"),o=t("./des");function a(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),s=e.slice(16,24);this.ciphers="encrypt"===t?[o.create({type:"encrypt",key:r}),o.create({type:"decrypt",key:i}),o.create({type:"encrypt",key:s})]:[o.create({type:"decrypt",key:s}),o.create({type:"encrypt",key:i}),o.create({type:"decrypt",key:r})]}function l(t){s.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}i(l,s),e.exports=l,l.create=function(t){return new l(t)},l.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},l.prototype._pad=o.prototype._pad,l.prototype._unpad=o.prototype._unpad},{"./cipher":396,"./des":397,inherits:440,"minimalistic-assert":453}],399:[function(t,e,r){"use strict";r.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},r.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},r.ip=function(t,e,r,n){for(var i=0,s=0,o=6;o>=0;o-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>>a+o&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>>a+o&1}for(o=6;o>=0;o-=2){for(a=1;a<=25;a+=8)s<<=1,s|=e>>>a+o&1;for(a=1;a<=25;a+=8)s<<=1,s|=t>>>a+o&1}r[n+0]=i>>>0,r[n+1]=s>>>0},r.rip=function(t,e,r,n){for(var i=0,s=0,o=0;o<4;o++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+o&1,i<<=1,i|=t>>>a+o&1;for(o=4;o<8;o++)for(a=24;a>=0;a-=8)s<<=1,s|=e>>>a+o&1,s<<=1,s|=t>>>a+o&1;r[n+0]=i>>>0,r[n+1]=s>>>0},r.pc1=function(t,e,r,n){for(var i=0,s=0,o=7;o>=5;o--){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>a+o&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+o&1}for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+o&1;for(o=1;o<=3;o++){for(a=0;a<=24;a+=8)s<<=1,s|=e>>a+o&1;for(a=0;a<=24;a+=8)s<<=1,s|=t>>a+o&1}for(a=0;a<=24;a+=8)s<<=1,s|=t>>a+o&1;r[n+0]=i>>>0,r[n+1]=s>>>0},r.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(t,e,r,i){for(var s=0,o=0,a=n.length>>>1,l=0;l<a;l++)s<<=1,s|=t>>>n[l]&1;for(l=a;l<n.length;l++)o<<=1,o|=e>>>n[l]&1;r[i+0]=s>>>0,r[i+1]=o>>>0},r.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var s=23;s>=15;s-=4)n<<=6,n|=t>>>s&63;for(s=11;s>=3;s-=4)i|=t>>>s&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(t,e){for(var r=0,n=0;n<4;n++)r<<=4,r|=i[64*n+(t>>>18-6*n&63)];for(n=0;n<4;n++)r<<=4,r|=i[256+64*n+(e>>>18-6*n&63)];return r>>>0};var s=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(t){for(var e=0,r=0;r<s.length;r++)e<<=1,e|=t>>>s[r]&1;return e>>>0},r.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],s=0;s<e;s+=r)i.push(n.slice(s,s+r));return i.join(" ")}},{}],400:[function(t,e,r){(function(e){(function(){"use strict";var n=t("./lib/generatePrime"),i=t("./lib/primes.json"),s=t("./lib/dh"),o={binary:!0,hex:!0,base64:!0};r.DiffieHellmanGroup=r.createDiffieHellmanGroup=r.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new s(r,n)},r.createDiffieHellman=r.DiffieHellman=function t(r,i,a,l){return e.isBuffer(i)||void 0===o[i]?t(r,"binary",i,a):(i=i||"binary",l=l||"binary",a=a||new e([2]),e.isBuffer(a)||(a=new e(a,l)),"number"==typeof r?new s(n(r,a),a,!0):(e.isBuffer(r)||(r=new e(r,i)),new s(r,a,!0)))}}).call(this)}).call(this,t("buffer").Buffer)},{"./lib/dh":401,"./lib/generatePrime":402,"./lib/primes.json":403,buffer:220}],401:[function(t,e,r){(function(r){(function(){"use strict";var n=t("bn.js"),i=new(t("miller-rabin")),s=new n(24),o=new n(11),a=new n(10),l=new n(3),u=new n(7),c=t("./generatePrime"),h=t("randombytes");function d(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._pub=new n(t),this}function f(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._priv=new n(t),this}e.exports=m;var p={};function m(t,e,r){this.setGenerator(e),this.__prime=new n(t),this._prime=n.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=f):this._primeCode=8}function b(t,e){var n=new r(t.toArray());return e?n.toString(e):n}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in p)return p[n];var h,d=0;if(t.isEven()||!c.simpleSieve||!c.fermatTest(t)||!i.test(t))return d+=1,d+="02"===r||"05"===r?8:4,p[n]=d,d;switch(i.test(t.shrn(1))||(d+=2),r){case"02":t.mod(s).cmp(o)&&(d+=8);break;case"05":(h=t.mod(a)).cmp(l)&&h.cmp(u)&&(d+=8);break;default:d+=4}return p[n]=d,d}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new n(h(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(t){var e=(t=(t=new n(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new r(e.toArray()),s=this.getPrime();if(i.length<s.length){var o=new r(s.length-i.length);o.fill(0),i=r.concat([o,i])}return i},m.prototype.getPublicKey=function(t){return b(this._pub,t)},m.prototype.getPrivateKey=function(t){return b(this._priv,t)},m.prototype.getPrime=function(t){return b(this.__prime,t)},m.prototype.getGenerator=function(t){return b(this._gen,t)},m.prototype.setGenerator=function(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this.__gen=t,this._gen=new n(t),this}}).call(this)}).call(this,t("buffer").Buffer)},{"./generatePrime":402,"bn.js":404,buffer:220,"miller-rabin":451,randombytes:475}],402:[function(t,e,r){"use strict";var n=t("randombytes");e.exports=g,g.simpleSieve=m,g.fermatTest=b;var i=t("bn.js"),s=new i(24),o=new(t("miller-rabin")),a=new i(1),l=new i(2),u=new i(5),c=(new i(16),new i(8),new i(10)),h=new i(3),d=(new i(7),new i(11)),f=new i(4),p=(new i(12),null);function m(t){for(var e=function(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<e&&t[i]<=n&&r%t[i]!=0;i++);e!==i&&t[i]<=n||(t[e++]=r)}return p=t,t}(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function b(t){var e=i.mont(t);return 0===l.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function g(t,e){if(t<16)return new i(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new i(e);;){for(r=new i(n(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(l),e.cmp(l)){if(!e.cmp(u))for(;r.mod(c).cmp(h);)r.iadd(f)}else for(;r.mod(s).cmp(d);)r.iadd(f);if(m(p=r.shrn(1))&&m(r)&&b(p)&&b(r)&&o.test(p)&&o.test(r))return r}}},{"bn.js":404,"miller-rabin":451,randombytes:475}],403:[function(t,e,r){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],404:[function(t,e,r){arguments[4][184][0].apply(r,arguments)},{buffer:188,dup:184}],405:[function(t,e,r){"use strict";var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":421,"./elliptic/curve":408,"./elliptic/curves":411,"./elliptic/ec":412,"./elliptic/eddsa":415,"./elliptic/utils":419,brorand:187}],406:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),s=i.getNAF,o=i.getJSF,a=i.assert;function l(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}e.exports=l,l.prototype.point=function(){throw new Error("Not implemented")},l.prototype.validate=function(){throw new Error("Not implemented")},l.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=s(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,l,u=[];for(o=0;o<n.length;o+=r.step){l=0;for(var c=o+r.step-1;c>=o;c--)l=(l<<1)+n[c];u.push(l)}for(var h=this.jpoint(null,null,null),d=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o<u.length;o++)(l=u[o])===f?d=d.mixedAdd(r.points[o]):l===-f&&(d=d.mixedAdd(r.points[o].neg()));h=h.add(d)}return h.toP()},l.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=s(e,r,this._bitLength),l=this.jpoint(null,null,null),u=o.length-1;u>=0;u--){for(var c=0;u>=0&&0===o[u];u--)c++;if(u>=0&&c++,l=l.dblp(c),u<0)break;var h=o[u];a(0!==h),l="affine"===t.type?h>0?l.mixedAdd(i[h-1>>1]):l.mixedAdd(i[-h-1>>1].neg()):h>0?l.add(i[h-1>>1]):l.add(i[-h-1>>1].neg())}return"affine"===t.type?l.toP():l},l.prototype._wnafMulAdd=function(t,e,r,n,i){var a,l,u,c=this._wnafT1,h=this._wnafT2,d=this._wnafT3,f=0;for(a=0;a<n;a++){var p=(u=e[a])._getNAFPoints(t);c[a]=p.wnd,h[a]=p.points}for(a=n-1;a>=1;a-=2){var m=a-1,b=a;if(1===c[m]&&1===c[b]){var g=[e[m],null,null,e[b]];0===e[m].y.cmp(e[b].y)?(g[1]=e[m].add(e[b]),g[2]=e[m].toJ().mixedAdd(e[b].neg())):0===e[m].y.cmp(e[b].y.redNeg())?(g[1]=e[m].toJ().mixedAdd(e[b]),g[2]=e[m].add(e[b].neg())):(g[1]=e[m].toJ().mixedAdd(e[b]),g[2]=e[m].toJ().mixedAdd(e[b].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=o(r[m],r[b]);for(f=Math.max(v[0].length,f),d[m]=new Array(f),d[b]=new Array(f),l=0;l<f;l++){var w=0|v[0][l],_=0|v[1][l];d[m][l]=y[3*(w+1)+(_+1)],d[b][l]=0,h[m]=g}}else d[m]=s(r[m],c[m],this._bitLength),d[b]=s(r[b],c[b],this._bitLength),f=Math.max(d[m].length,f),f=Math.max(d[b].length,f)}var x=this.jpoint(null,null,null),S=this._wnafT4;for(a=f;a>=0;a--){for(var C=0;a>=0;){var A=!0;for(l=0;l<n;l++)S[l]=0|d[l][a],0!==S[l]&&(A=!1);if(!A)break;C++,a--}if(a>=0&&C++,x=x.dblp(C),a<0)break;for(l=0;l<n;l++){var k=S[l];0!==k&&(k>0?u=h[l][k-1>>1]:k<0&&(u=h[l][-k-1>>1].neg()),x="affine"===u.type?x.mixedAdd(u):x.add(u))}}for(a=0;a<n;a++)h[a]=null;return i?x:x.toP()},l.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},l.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(t){return this.encode(t,!0)},u.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},u.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},u.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},u.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var s=0;s<t;s++)n=n.dbl();r.push(n)}return{step:t,points:r}},u.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},{"../utils":419,"bn.js":420}],407:[function(t,e,r){"use strict";var n=t("../utils"),i=t("bn.js"),s=t("inherits"),o=t("./base"),a=n.assert;function l(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,o.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,n,s){o.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=s&&new i(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}s(l,o),e.exports=l,l.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},l.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},l.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},l.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),s=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(s.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var l=a.fromRed().isOdd();return(e&&!l||!e&&l)&&(a=a.redNeg()),this.point(t,a)},l.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),s=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(s.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},l.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},s(u,o.BasePoint),l.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},l.prototype.point=function(t,e,r,n){return new u(this,t,e,r,n)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),s=n.redAdd(e),o=s.redSub(r),a=n.redSub(e),l=i.redMul(o),u=s.redMul(a),c=i.redMul(a),h=o.redMul(s);return this.curve.point(l,u,h,c)},u.prototype._projDbl=function(){var t,e,r,n,i,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),l=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(l);this.zOne?(t=o.redSub(a).redSub(l).redMul(u.redSub(this.curve.two)),e=u.redMul(n.redSub(l)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),s=u.redSub(i).redISub(i),t=o.redSub(a).redISub(l).redMul(s),e=u.redMul(n.redSub(l)),r=u.redMul(s))}else n=a.redAdd(l),i=this.curve._mulC(this.z).redSqr(),s=n.redSub(i).redSub(i),t=this.curve._mulC(o.redISub(n)).redMul(s),e=this.curve._mulC(n).redMul(a.redISub(l)),r=n.redMul(s);return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),s=r.redSub(e),o=i.redSub(n),a=i.redAdd(n),l=r.redAdd(e),u=s.redMul(o),c=a.redMul(l),h=s.redMul(l),d=o.redMul(a);return this.curve.point(u,c,d,h)},u.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),s=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(s).redMul(o),l=i.redSub(a),u=i.redAdd(a),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(o),h=n.redMul(l).redMul(c);return this.curve.twisted?(e=n.redMul(u).redMul(o.redSub(this.curve._mulA(s))),r=l.redMul(u)):(e=n.redMul(u).redMul(o.redSub(s)),r=this.curve._mulC(l).redMul(u)),this.curve.point(h,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},{"../utils":419,"./base":406,"bn.js":420,inherits:440}],408:[function(t,e,r){"use strict";var n=r;n.base=t("./base"),n.short=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":406,"./edwards":407,"./mont":409,"./short":410}],409:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("inherits"),s=t("./base"),o=t("../utils");function a(t){s.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function l(t,e,r){s.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,s),e.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(l,s.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(o.toArray(t,e),1)},a.prototype.point=function(t,e){return new l(this,t,e)},a.prototype.pointFromJSON=function(t){return l.fromJSON(this,t)},l.prototype.precompute=function(){},l.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},l.fromJSON=function(t,e){return new l(t,e[0],e[1]||t.one)},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},l.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},l.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),s=t.x.redSub(t.z).redMul(r),o=i.redMul(n),a=e.z.redMul(s.redAdd(o).redSqr()),l=e.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,l)},l.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var s=i.length-1;s>=0;s--)0===i[s]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},l.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},l.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},l.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":419,"./base":406,"bn.js":420,inherits:440}],410:[function(t,e,r){"use strict";var n=t("../utils"),i=t("bn.js"),s=t("inherits"),o=t("./base"),a=n.assert;function l(t){o.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,n){o.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(t,e,r,n){o.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(l,o),e.exports=l,l.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},l.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),s=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(s).fromRed(),n.redSub(s).fromRed()]},l.prototype._getEndoBasis=function(t){for(var e,r,n,s,o,a,l,u,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,f=this.n.clone(),p=new i(1),m=new i(0),b=new i(0),g=new i(1),y=0;0!==d.cmpn(0);){var v=f.div(d);u=f.sub(v.mul(d)),c=b.sub(v.mul(p));var w=g.sub(v.mul(m));if(!n&&u.cmp(h)<0)e=l.neg(),r=p,n=u.neg(),s=c;else if(n&&2==++y)break;l=u,f=d,d=u,b=p,p=c,g=m,m=w}o=u.neg(),a=c;var _=n.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=e,a=r),n.negative&&(n=n.neg(),s=s.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:s},{a:o,b:a}]},l.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),o=i.mul(r.a),a=s.mul(n.a),l=i.mul(r.b),u=s.mul(n.b);return{k1:t.sub(o).sub(a),k2:l.add(u).neg()}},l.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var s=n.fromRed().isOdd();return(e&&!s||!e&&s)&&(n=n.redNeg()),this.point(t,n)},l.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},l.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,s=0;s<t.length;s++){var o=this._endoSplit(e[s]),a=t[s],l=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),l=l.neg(!0)),n[2*s]=a,n[2*s+1]=l,i[2*s]=o.k1,i[2*s+1]=o.k2}for(var u=this._wnafMulAdd(1,n,i,2*s,r),c=0;c<2*s;c++)n[c]=null,i[c]=null;return u},s(u,o.BasePoint),l.prototype.point=function(t,e,r){return new u(this,t,e,r)},l.prototype.pointFromJSON=function(t,e){return u.fromJSON(this,t,e)},u.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var s=e[2];return n.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[n].concat(s.doubles.points.map(i))},naf:s.naf&&{wnd:s.naf.wnd,points:[n].concat(s.naf.points.map(i))}},n},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),s=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(c,o.BasePoint),l.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),l=s.redSub(o);if(0===a.cmpn(0))return 0!==l.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),h=n.redMul(u),d=l.redSqr().redIAdd(c).redISub(h).redISub(h),f=l.redMul(h.redISub(d)).redISub(s.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,f,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,s=t.y.redMul(e).redMul(this.z),o=r.redSub(n),a=i.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),u=l.redMul(o),c=r.redMul(l),h=a.redSqr().redIAdd(u).redISub(c).redISub(c),d=a.redMul(c.redISub(h)).redISub(i.redMul(u)),f=this.z.redMul(o);return this.curve.jpoint(h,d,f)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,s=this.x,o=this.y,a=this.z,l=a.redSqr().redSqr(),u=o.redAdd(o);for(e=0;e<t;e++){var c=s.redSqr(),h=u.redSqr(),d=h.redSqr(),f=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(l)),p=s.redMul(h),m=f.redSqr().redISub(p.redAdd(p)),b=p.redISub(m),g=f.redMul(b);g=g.redIAdd(g).redISub(d);var y=u.redMul(a);e+1<t&&(l=l.redMul(d)),s=m,a=y,u=g}return this.curve.jpoint(s,u.redMul(i),a)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),s=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(s);o=o.redIAdd(o);var a=n.redAdd(n).redIAdd(n),l=a.redSqr().redISub(o).redISub(o),u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),t=l,e=a.redMul(o.redISub(l)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),f=this.x.redAdd(h).redSqr().redISub(c).redISub(d);f=f.redIAdd(f);var p=c.redAdd(c).redIAdd(c),m=p.redSqr(),b=d.redIAdd(d);b=(b=b.redIAdd(b)).redIAdd(b),t=m.redISub(f).redISub(f),e=p.redMul(f.redISub(t)).redISub(b),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},c.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),s=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(s);o=o.redIAdd(o);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),l=a.redSqr().redISub(o).redISub(o);t=l;var u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),e=a.redMul(o.redISub(l)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),f=this.x.redSub(c).redMul(this.x.redAdd(c));f=f.redAdd(f).redIAdd(f);var p=d.redIAdd(d),m=(p=p.redIAdd(p)).redAdd(p);t=f.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var b=h.redSqr();b=(b=(b=b.redIAdd(b)).redIAdd(b)).redIAdd(b),e=f.redMul(p.redISub(t)).redISub(b)}return this.curve.jpoint(t,e,r)},c.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),s=e.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(i)),l=e.redAdd(e),u=(l=l.redIAdd(l)).redMul(o),c=a.redSqr().redISub(u.redAdd(u)),h=u.redISub(c),d=o.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=a.redMul(h).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,f,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),s=i.redSqr(),o=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),l=n.redIAdd(n);l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var u=i.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(l),c=e.redMul(u);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(a).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.y.redMul(u.redMul(l.redISub(u)).redISub(o.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=this.z.redAdd(o).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,d,f)},c.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},c.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":419,"./base":406,"bn.js":420,inherits:440}],411:[function(t,e,r){"use strict";var n,i=r,s=t("hash.js"),o=t("./curve"),a=t("./utils").assert;function l(t){"short"===t.type?this.curve=new o.short(t):"edwards"===t.type?this.curve=new o.edwards(t):this.curve=new o.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new l(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=l,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":408,"./precomputed/secp256k1":418,"./utils":419,"hash.js":426}],412:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("hmac-drbg"),s=t("../utils"),o=t("../curves"),a=t("brorand"),l=s.assert,u=t("./key"),c=t("./signature");function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(l(Object.prototype.hasOwnProperty.call(o,t),"Unknown curve "+t),t=o[t]),t instanceof o.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}e.exports=h,h.prototype.keyPair=function(t){return new u(this,t)},h.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new n(2));;){var o=new n(e.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,s){"object"==typeof r&&(s=r,r=null),s||(s={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var o=this.n.byteLength(),a=e.getPrivate().toArray("be",o),l=t.toArray("be",o),u=new i({hash:this.hash,entropy:a,nonce:l,pers:s.pers,persEnc:s.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var f=s.k?s.k(d):new n(u.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(h)>=0)){var p=this.g.mul(f);if(!p.isInfinity()){var m=p.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var g=f.invm(this.n).mul(b.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return s.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new c({r:b,s:g,recoveryParam:y})}}}}}},h.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var s=(e=new c(e,"hex")).r,o=e.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,l=o.invm(this.n),u=l.mul(t).umod(this.n),h=l.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),h)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(u,r.getPublic(),h)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},h.prototype.recoverPubKey=function(t,e,r,i){l((3&r)===r,"The recovery param is more than two bits"),e=new c(e,i);var s=this.n,o=new n(t),a=e.r,u=e.s,h=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),h):this.curve.pointFromX(a,h);var f=e.r.invm(s),p=s.sub(o).mul(f).umod(s),m=u.mul(f).umod(s);return this.g.mulAdd(p,a,m)},h.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new c(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch(t){continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":411,"../utils":419,"./key":413,"./signature":414,"bn.js":420,brorand:187,"hmac-drbg":438}],413:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils").assert;function s(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}e.exports=s,s.fromPublic=function(t,e,r){return e instanceof s?e:new s(t,{pub:e,pubEnc:r})},s.fromPrivate=function(t,e,r){return e instanceof s?e:new s(t,{priv:e,privEnc:r})},s.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},s.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},s.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},s.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},s.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":419,"bn.js":420}],414:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),s=i.assert;function o(t,e){if(t instanceof o)return t;this._importDER(t,e)||(s(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function l(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,s=0,o=e.place;s<n;s++,o++)i<<=8,i|=t[o],i>>>=0;return!(i<=127)&&(e.place=o,i)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function c(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}e.exports=o,o.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var s=l(t,r);if(!1===s)return!1;if(s+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=l(t,r);if(!1===o)return!1;var u=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var c=l(t,r);if(!1===c)return!1;if(t.length!==c+r.place)return!1;var h=t.slice(r.place,c+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new n(u),this.s=new n(h),this.recoveryParam=null,!0},o.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,e.length),(n=n.concat(e)).push(2),c(n,r.length);var s=n.concat(r),o=[48];return c(o,s.length),o=o.concat(s),i.encode(o,t)}},{"../utils":419,"bn.js":420}],415:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("../curves"),s=t("../utils"),o=s.assert,a=s.parseBytes,l=t("./key"),u=t("./signature");function c(t){if(o("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}e.exports=c,c.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),s=this.encodePoint(i),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),l=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:l,Rencoded:s})},c.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(s)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return s.intFromLE(t.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(t){return l.fromPublic(this,t)},c.prototype.keyFromSecret=function(t){return l.fromSecret(this,t)},c.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},c.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},c.prototype.decodePoint=function(t){var e=(t=s.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=!!(128&t[e]),i=s.intFromLE(r);return this.curve.pointFromY(i,n)},c.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(t){return s.intFromLE(t)},c.prototype.isPoint=function(t){return t instanceof this.pointClass}},{"../curves":411,"../utils":419,"./key":416,"./signature":417,"hash.js":426}],416:[function(t,e,r){"use strict";var n=t("../utils"),i=n.assert,s=n.parseBytes,o=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),o(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},e.exports=a},{"../utils":419}],417:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),s=i.assert,o=i.cachedProperty,a=i.parseBytes;function l(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),s(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}o(l,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(l,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(l,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(l,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),l.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},l.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=l},{"../utils":419,"bn.js":420}],418:[function(t,e,r){"use strict";e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],419:[function(t,e,r){"use strict";var n=r,i=t("bn.js"),s=t("minimalistic-assert"),o=t("minimalistic-crypto-utils");n.assert=s,n.toArray=o.toArray,n.zero2=o.zero2,n.toHex=o.toHex,n.encode=o.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,s=t.clone(),o=0;o<n.length;o++){var a,l=s.andln(i-1);s.isOdd()?(a=l>(i>>1)-1?(i>>1)-l:l,s.isubn(a)):a=0,n[o]=a,s.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,s=0;t.cmpn(-i)>0||e.cmpn(-s)>0;){var o,a,l=t.andln(3)+i&3,u=e.andln(3)+s&3;3===l&&(l=-1),3===u&&(u=-1),o=1&l?3!=(n=t.andln(7)+i&7)&&5!==n||2!==u?l:-l:0,r[0].push(o),a=1&u?3!=(n=e.andln(7)+s&7)&&5!==n||2!==l?u:-u:0,r[1].push(a),2*i===o+1&&(i=1-i),2*s===a+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},{"bn.js":420,"minimalistic-assert":453,"minimalistic-crypto-utils":454}],420:[function(t,e,r){arguments[4][184][0].apply(r,arguments)},{buffer:188,dup:184}],421:[function(t,e,r){e.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}},{}],422:[function(t,e,r){"use strict";var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},i=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},s=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var a,l=10;try{var u={};Object.defineProperty&&Object.defineProperty(u,"x",{value:0}),a=0===u.x}catch(t){a=!1}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var s,o,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=t._events)?(o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]):(o=t._events=n(null),t._eventsCount=0),a){if("function"==typeof a?a=o[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),!a.warned&&(s=c(t))&&s>0&&a.length>s){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",l.name,l.message)}}else a=o[e]=r,++t._eventsCount;return t}function d(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=s.call(d,n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(!n)return[];var i=n[e];return i?"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):b(i,i.length):[]}function m(t){var e=this._events;if(e){var r=e[t];if("function"==typeof r)return 1;if(r)return r.length}return 0}function b(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}a?Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');l=t}}):o.defaultMaxListeners=l,o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(t){var e,r,n,i,s,o,a="error"===t;if(o=this._events)a=a&&null==o.error;else if(!a)return!1;if(a){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var l=new Error('Unhandled "error" event. ('+e+")");throw l.context=e,l}if(!(r=o[t]))return!1;var u="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=b(t,n),s=0;s<n;++s)i[s].call(r)}(r,u,this);break;case 2:!function(t,e,r,n){if(e)t.call(r,n);else for(var i=t.length,s=b(t,i),o=0;o<i;++o)s[o].call(r,n)}(r,u,this,arguments[1]);break;case 3:!function(t,e,r,n,i){if(e)t.call(r,n,i);else for(var s=t.length,o=b(t,s),a=0;a<s;++a)o[a].call(r,n,i)}(r,u,this,arguments[1],arguments[2]);break;case 4:!function(t,e,r,n,i,s){if(e)t.call(r,n,i,s);else for(var o=t.length,a=b(t,o),l=0;l<o;++l)a[l].call(r,n,i,s)}(r,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),s=1;s<n;s++)i[s-1]=arguments[s];!function(t,e,r,n){if(e)t.apply(r,n);else for(var i=t.length,s=b(t,i),o=0;o<i;++o)s[o].apply(r,n)}(r,u,this,i)}return!0},o.prototype.addListener=function(t,e){return h(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return h(this,t,e,!0)},o.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,f(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,f(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,i,s,o,a;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=n(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(s=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,s=o;break}if(s<0)return this;0===s?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n<i;r+=1,n+=1)t[r]=t[n];t.pop()}(r,s),1===r.length&&(i[t]=r[0]),i.removeListener&&this.emit("removeListener",t,a||e)}return this},o.prototype.removeAllListeners=function(t){var e,r,s;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=n(null):delete r[t]),this;if(0===arguments.length){var o,a=i(r);for(s=0;s<a.length;++s)"removeListener"!==(o=a[s])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)for(s=e.length-1;s>=0;s--)this.removeListener(t,e[s]);return this},o.prototype.listeners=function(t){return p(this,t,!0)},o.prototype.rawListeners=function(t){return p(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],423:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("md5.js");e.exports=function(t,e,r,s){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var o=r/8,a=n.alloc(o),l=n.alloc(s||0),u=n.alloc(0);o>0||s>0;){var c=new i;c.update(u),c.update(t),e&&c.update(e),u=c.digest();var h=0;if(o>0){var d=a.length-o;h=Math.min(o,u.length),u.copy(a,d,0,h),o-=h}if(h<u.length&&s>0){var f=l.length-s,p=Math.min(s,u.length-h);u.copy(l,f,h,h+p),s-=p}}return u.fill(0),{key:a,iv:l}}},{"md5.js":450,"safe-buffer":494}],424:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.CsvParserStream=r.ParserOptions=r.parseFile=r.parseStream=r.parseString=r.parse=r.FormatterOptions=r.CsvFormatterStream=r.writeToPath=r.writeToString=r.writeToBuffer=r.writeToStream=r.write=r.format=void 0;var n=t("@fast-csv/format");Object.defineProperty(r,"format",{enumerable:!0,get:function(){return n.format}}),Object.defineProperty(r,"write",{enumerable:!0,get:function(){return n.write}}),Object.defineProperty(r,"writeToStream",{enumerable:!0,get:function(){return n.writeToStream}}),Object.defineProperty(r,"writeToBuffer",{enumerable:!0,get:function(){return n.writeToBuffer}}),Object.defineProperty(r,"writeToString",{enumerable:!0,get:function(){return n.writeToString}}),Object.defineProperty(r,"writeToPath",{enumerable:!0,get:function(){return n.writeToPath}}),Object.defineProperty(r,"CsvFormatterStream",{enumerable:!0,get:function(){return n.CsvFormatterStream}}),Object.defineProperty(r,"FormatterOptions",{enumerable:!0,get:function(){return n.FormatterOptions}});var i=t("@fast-csv/parse");Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return i.parse}}),Object.defineProperty(r,"parseString",{enumerable:!0,get:function(){return i.parseString}}),Object.defineProperty(r,"parseStream",{enumerable:!0,get:function(){return i.parseStream}}),Object.defineProperty(r,"parseFile",{enumerable:!0,get:function(){return i.parseFile}}),Object.defineProperty(r,"ParserOptions",{enumerable:!0,get:function(){return i.ParserOptions}}),Object.defineProperty(r,"CsvParserStream",{enumerable:!0,get:function(){return i.CsvParserStream}})},{"@fast-csv/format":151,"@fast-csv/parse":155}],425:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("readable-stream").Transform;function s(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t("inherits")(s,i),s.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},s.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},s.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)r[s++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var o=0,a=8*t.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},s.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=s},{inherits:440,"readable-stream":491,"safe-buffer":494}],426:[function(t,e,r){"use strict";var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":427,"./hash/hmac":428,"./hash/ripemd":429,"./hash/sha":430,"./hash/utils":437}],427:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function s(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}r.BlockHash=s,s.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},s.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},s.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,s=8;s<this.padLength;s++)n[i++]=0;return n}},{"./utils":437,"minimalistic-assert":453}],428:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function s(t,e,r){if(!(this instanceof s))return new s(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}e.exports=s,s.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},s.prototype.update=function(t,e){return this.inner.update(t,e),this},s.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"./utils":437,"minimalistic-assert":453}],429:[function(t,e,r){"use strict";var n=t("./utils"),i=t("./common"),s=n.rotl32,o=n.sum32,a=n.sum32_3,l=n.sum32_4,u=i.BlockHash;function c(){if(!(this instanceof c))return new c;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function f(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(c,u),r.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],c=this.h[4],y=r,v=n,w=i,_=u,x=c,S=0;S<80;S++){var C=o(s(l(r,h(S,n,i,u),t[p[S]+e],d(S)),b[S]),c);r=c,c=u,u=s(i,10),i=n,n=C,C=o(s(l(y,h(79-S,v,w,_),t[m[S]+e],f(S)),g[S]),x),y=x,x=_,_=s(w,10),w=v,v=C}C=a(this.h[1],i,_),this.h[1]=a(this.h[2],u,x),this.h[2]=a(this.h[3],c,y),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=C},c.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"./common":427,"./utils":437}],430:[function(t,e,r){"use strict";r.sha1=t("./sha/1"),r.sha224=t("./sha/224"),r.sha256=t("./sha/256"),r.sha384=t("./sha/384"),r.sha512=t("./sha/512")},{"./sha/1":431,"./sha/224":432,"./sha/256":433,"./sha/384":434,"./sha/512":435}],431:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),s=t("./common"),o=n.rotl32,a=n.sum32,l=n.sum32_5,u=s.ft_1,c=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,c),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=o(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],s=this.h[1],c=this.h[2],d=this.h[3],f=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),m=l(o(i,5),u(p,s,c,d),f,r[n],h[p]);f=d,d=c,c=o(s,30),s=i,i=m}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],c),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],f)},d.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":427,"../utils":437,"./common":436}],432:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./256");function s(){if(!(this instanceof s))return new s;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(s,i),e.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},{"../utils":437,"./256":433}],433:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),s=t("./common"),o=t("minimalistic-assert"),a=n.sum32,l=n.sum32_4,u=n.sum32_5,c=s.ch32,h=s.maj32,d=s.s0_256,f=s.s1_256,p=s.g0_256,m=s.g1_256,b=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(y,b),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=l(m(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],s=this.h[1],b=this.h[2],g=this.h[3],y=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(o(this.k.length===r.length),n=0;n<r.length;n++){var x=u(_,f(y),c(y,v,w),this.k[n],r[n]),S=a(d(i),h(i,s,b));_=w,w=v,v=y,y=a(g,x),g=b,b=s,s=i,i=a(x,S)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],b),this.h[3]=a(this.h[3],g),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},y.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":427,"../utils":437,"./common":436,"minimalistic-assert":453}],434:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./512");function s(){if(!(this instanceof s))return new s;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(s,i),e.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},{"../utils":437,"./512":435}],435:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),s=t("minimalistic-assert"),o=n.rotr64_hi,a=n.rotr64_lo,l=n.shr64_hi,u=n.shr64_lo,c=n.sum64,h=n.sum64_hi,d=n.sum64_lo,f=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,b=n.sum64_5_lo,g=i.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(t,e,r,n,i){var s=t&r^~t&i;return s<0&&(s+=4294967296),s}function _(t,e,r,n,i,s){var o=e&n^~e&s;return o<0&&(o+=4294967296),o}function x(t,e,r,n,i){var s=t&r^t&i^r&i;return s<0&&(s+=4294967296),s}function S(t,e,r,n,i,s){var o=e&n^e&s^n&s;return o<0&&(o+=4294967296),o}function C(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function k(t,e){var r=o(t,e,14)^o(t,e,18)^o(e,t,9);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function E(t,e){var r=o(t,e,1)^o(t,e,8)^l(t,e,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function R(t,e){var r=o(t,e,19)^o(e,t,29)^l(t,e,6);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,g),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=R(r[n-4],r[n-3]),s=I(r[n-4],r[n-3]),o=r[n-14],a=r[n-13],l=E(r[n-30],r[n-29]),u=M(r[n-30],r[n-29]),c=r[n-32],h=r[n-31];r[n]=f(i,s,o,a,l,u,c,h),r[n+1]=p(i,s,o,a,l,u,c,h)}},v.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],l=this.h[4],u=this.h[5],f=this.h[6],p=this.h[7],g=this.h[8],y=this.h[9],v=this.h[10],E=this.h[11],M=this.h[12],R=this.h[13],I=this.h[14],O=this.h[15];s(this.k.length===r.length);for(var j=0;j<r.length;j+=2){var P=I,N=O,B=k(g,y),F=T(g,y),D=w(g,0,v,0,M),L=_(0,y,0,E,0,R),V=this.k[j],z=this.k[j+1],U=r[j],$=r[j+1],H=m(P,N,B,F,D,L,V,z,U,$),W=b(P,N,B,F,D,L,V,z,U,$);P=C(n,i),N=A(n,i),B=x(n,0,o,0,l),F=S(0,i,0,a,0,u);var q=h(P,N,B,F),Y=d(P,N,B,F);I=M,O=R,M=v,R=E,v=g,E=y,g=h(f,p,H,W),y=d(p,p,H,W),f=l,p=u,l=o,u=a,o=n,a=i,n=h(H,W,q,Y),i=d(H,W,q,Y)}c(this.h,0,n,i),c(this.h,2,o,a),c(this.h,4,l,u),c(this.h,6,f,p),c(this.h,8,g,y),c(this.h,10,v,E),c(this.h,12,M,R),c(this.h,14,I,O)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":427,"../utils":437,"minimalistic-assert":453}],436:[function(t,e,r){"use strict";var n=t("../utils").rotr32;function i(t,e,r){return t&e^~t&r}function s(t,e,r){return t&e^t&r^e&r}function o(t,e,r){return t^e^r}r.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?o(e,r,n):2===t?s(e,r,n):void 0},r.ch32=i,r.maj32=s,r.p32=o,r.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},r.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},r.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":437}],437:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits");function s(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function l(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=i,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):s(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},r.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},r.htonl=o,r.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=o(i)),r+=l(i.toString(16))}return r},r.zero2=a,r.zero8=l,r.join32=function(t,e,r,i){var s=r-e;n(s%4==0);for(var o=new Array(s/4),a=0,l=e;a<o.length;a++,l+=4){var u;u="big"===i?t[l]<<24|t[l+1]<<16|t[l+2]<<8|t[l+3]:t[l+3]<<24|t[l+2]<<16|t[l+1]<<8|t[l],o[a]=u>>>0}return o},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var s=t[n];"big"===e?(r[i]=s>>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=255&s):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=255&s)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<<e|t>>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],s=n+t[e+1]>>>0,o=(s<n?1:0)+r+i;t[e]=o>>>0,t[e+1]=s},r.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,s,o,a){var l=0,u=e;return l+=(u=u+n>>>0)<e?1:0,l+=(u=u+s>>>0)<s?1:0,t+r+i+o+(l+=(u=u+a>>>0)<a?1:0)>>>0},r.sum64_4_lo=function(t,e,r,n,i,s,o,a){return e+n+s+a>>>0},r.sum64_5_hi=function(t,e,r,n,i,s,o,a,l,u){var c=0,h=e;return c+=(h=h+n>>>0)<e?1:0,c+=(h=h+s>>>0)<s?1:0,c+=(h=h+a>>>0)<a?1:0,t+r+i+o+l+(c+=(h=h+u>>>0)<u?1:0)>>>0},r.sum64_5_lo=function(t,e,r,n,i,s,o,a,l,u){return e+n+s+a+u>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:440,"minimalistic-assert":453}],438:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("minimalistic-crypto-utils"),s=t("minimalistic-assert");function o(t){if(!(this instanceof o))return new o(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}e.exports=o,o.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},o.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},o.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var s=[];s.length<t;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,t);return this._update(r),this._reseed++,i.encode(o,e)}},{"hash.js":426,"minimalistic-assert":453,"minimalistic-crypto-utils":454}],439:[function(t,e,r){"use strict";r.read=function(t,e,r,n,i){var s,o,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,d=r?-1:1,f=t[e+h];for(h+=d,s=f&(1<<-c)-1,f>>=-c,c+=a;c>0;s=256*s+t[e+h],h+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=d,c-=8);if(0===s)s=1-u;else{if(s===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),s-=u}return(f?-1:1)*o*Math.pow(2,s-n)},r.write=function(t,e,r,n,i,s){var o,a,l,u=8*s-i-1,c=(1<<u)-1,h=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(e*l-1)*Math.pow(2,i),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&a,f+=p,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;t[r+f]=255&o,f+=p,o/=256,u-=8);t[r+f-p]|=128*m}},{}],440:[function(t,e,r){"use strict";"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],441:[function(t,e,n){(function(r,i,s,o,a,l,u,c){(function(){"use strict";!function(t){"object"==typeof n&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==i?i:"undefined"!=typeof self?self:this).JSZip=t()}((function(){return function e(r,n,i){function s(a,l){if(!n[a]){if(!r[a]){var u="function"==typeof t&&t;if(!l&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var h=n[a]={exports:{}};r[a][0].call(h.exports,(function(t){return s(r[a][1][t]||t)}),h,h.exports,e,r,n,i)}return n[a].exports}for(var o="function"==typeof t&&t,a=0;a<i.length;a++)s(i[a]);return s}({1:[function(t,e,r){var n=t("./utils"),i=t("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(t){for(var e,r,i,o,a,l,u,c=[],h=0,d=t.length,f=d,p="string"!==n.getTypeOf(t);h<t.length;)f=d-h,i=p?(e=t[h++],r=h<d?t[h++]:0,h<d?t[h++]:0):(e=t.charCodeAt(h++),r=h<d?t.charCodeAt(h++):0,h<d?t.charCodeAt(h++):0),o=e>>2,a=(3&e)<<4|r>>4,l=1<f?(15&r)<<2|i>>6:64,u=2<f?63&i:64,c.push(s.charAt(o)+s.charAt(a)+s.charAt(l)+s.charAt(u));return c.join("")},r.decode=function(t){var e,r,n,o,a,l,u=0,c=0,h="data:";if(t.substr(0,5)===h)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===s.charAt(64)&&f--,t.charAt(t.length-2)===s.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=i.uint8array?new Uint8Array(0|f):new Array(0|f);u<t.length;)e=s.indexOf(t.charAt(u++))<<2|(o=s.indexOf(t.charAt(u++)))>>4,r=(15&o)<<4|(a=s.indexOf(t.charAt(u++)))>>2,n=(3&a)<<6|(l=s.indexOf(t.charAt(u++))),d[c++]=e,64!==a&&(d[c++]=r),64!==l&&(d[c++]=n);return d}},{"./support":30,"./utils":32}],2:[function(t,e,r){var n=t("./external"),i=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}a.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){var n=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){var n=t("./utils"),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r,n){var s=i,o=0+r;t^=-1;for(var a=0;a<o;a++)t=t>>>8^s[255&(t^e[a])];return~t}(0|e,t,t.length):function(t,e,r,n){var s=i,o=0+r;t^=-1;for(var a=0;a<o;a++)t=t>>>8^s[255&(t^e.charCodeAt(a))];return~t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){var n;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=n?"uint8array":"array";function l(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",s.inherits(l,o),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new l("Deflate",t)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){function n(t,e){var r,n="";for(r=0;r<e;r++)n+=String.fromCharCode(255&t),t>>>=8;return n}function i(t,e,r,i,o,c){var h,d,f=t.file,p=t.compression,m=c!==a.utf8encode,b=s.transformTo("string",c(f.name)),g=s.transformTo("string",a.utf8encode(f.name)),y=f.comment,v=s.transformTo("string",c(y)),w=s.transformTo("string",a.utf8encode(y)),_=g.length!==f.name.length,x=w.length!==y.length,S="",C="",A="",k=f.dir,T=f.date,E={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(E.crc32=t.crc32,E.compressedSize=t.compressedSize,E.uncompressedSize=t.uncompressedSize);var M=0;e&&(M|=8),m||!_&&!x||(M|=2048);var R=0,I=0;k&&(R|=16),"UNIX"===o?(I=798,R|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(f.unixPermissions,k)):(I=20,R|=function(t){return 63&(t||0)}(f.dosPermissions)),h=T.getUTCHours(),h<<=6,h|=T.getUTCMinutes(),h<<=5,h|=T.getUTCSeconds()/2,d=T.getUTCFullYear()-1980,d<<=4,d|=T.getUTCMonth()+1,d<<=5,d|=T.getUTCDate(),_&&(C=n(1,1)+n(l(b),4)+g,S+="up"+n(C.length,2)+C),x&&(A=n(1,1)+n(l(v),4)+w,S+="uc"+n(A.length,2)+A);var O="";return O+="\n\0",O+=n(M,2),O+=p.magic,O+=n(h,2),O+=n(d,2),O+=n(E.crc32,4),O+=n(E.compressedSize,4),O+=n(E.uncompressedSize,4),O+=n(b.length,2),O+=n(S.length,2),{fileRecord:u.LOCAL_FILE_HEADER+O+b+S,dirRecord:u.CENTRAL_FILE_HEADER+n(I,2)+O+n(v.length,2)+"\0\0\0\0"+n(R,4)+n(i,4)+b+S+v}}var s=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),l=t("../crc32"),u=t("../signature");function c(t,e,r,n){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(c,o),c.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=i(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=i(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:function(t){return u.DATA_DESCRIPTOR+n(t.crc32,4)+n(t.compressedSize,4)+n(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var r=this.bytesWritten-t,i=function(t,e,r,i,o){var a=s.transformTo("string",o(i));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(t,2)+n(t,2)+n(e,4)+n(r,4)+n(a.length,2)+a}(this.dirRecords.length,r,t,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},c.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},c.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},c.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},c.prototype.error=function(t){var e=this._sources;if(!o.prototype.error.call(this,t))return!1;for(var r=0;r<e.length;r++)try{e[r].error(t)}catch(t){}return!0},c.prototype.lock=function(){o.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=c},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,r){var n=t("../compressions"),i=t("./ZipFileWorker");r.generateWorker=function(t,e,r){var s=new i(e.streamFiles,r,e.platform,e.encodeFileName),o=0;try{t.forEach((function(t,r){o++;var i=function(t,e){var r=t||e,i=n[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,e.compression),a=r.options.compressionOptions||e.compressionOptions||{},l=r.dir,u=r.date;r._compressWorker(i,a).withStreamInfo("file",{name:t,dir:l,date:u,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(s)})),s.entriesCount=o}catch(t){s.error(t)}return s}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,r){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(n.prototype=t("./object")).loadAsync=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.version="3.10.1",n.loadAsync=function(t,e){return(new n).loadAsync(t,e)},n.external=t("./external"),e.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,r){var n=t("./utils"),i=t("./external"),s=t("./utf8"),o=t("./zipEntries"),a=t("./stream/Crc32Probe"),l=t("./nodejsUtils");function u(t){return new i.Promise((function(e,r){var n=t.decompressed.getContentWorker().pipe(new a);n.on("error",(function(t){r(t)})).on("end",(function(){n.streamInfo.crc32!==t.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}e.exports=function(t,e){var r=this;return e=n.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),l.isNode&&l.isStream(t)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var r=new o(e);return r.load(t),r})).then((function(t){var r=[i.Promise.resolve(t)],n=t.files;if(e.checkCRC32)for(var s=0;s<n.length;s++)r.push(u(n[s]));return i.Promise.all(r)})).then((function(t){for(var i=t.shift(),s=i.files,o=0;o<s.length;o++){var a=s[o],l=a.fileNameStr,u=n.resolve(a.fileNameStr);r.file(u,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:e.createFolders}),a.dir||(r.file(u).unsafeOriginalName=l)}return i.zipComment.length&&(r.comment=i.zipComment),r}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,r){var n=t("../utils"),i=t("../stream/GenericWorker");function s(t,e){i.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}n.inherits(s,i),s.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",(function(t){e.push({data:t,meta:{percent:0}})})).on("error",(function(t){e.isPaused?this.generatedError=t:e.error(t)})).on("end",(function(){e.isPaused?e._upstreamEnded=!0:e.end()}))},s.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,r){var n=t("readable-stream").Readable;function i(t,e,r){n.call(this,e),this._helper=t;var i=this;t.on("data",(function(t,e){i.push(t)||i._helper.pause(),r&&r(e)})).on("error",(function(t){i.emit("error",t)})).on("end",(function(){i.push(null)}))}t("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},e.exports=i},{"../utils":32,"readable-stream":16}],14:[function(t,e,r){e.exports={isNode:void 0!==s,newBufferFrom:function(t,e){if(s.from&&s.from!==Uint8Array.from)return s.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new s(t,e)},allocBuffer:function(t){if(s.alloc)return s.alloc(t);var e=new s(t);return e.fill(0),e},isBuffer:function(t){return s.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,r){function n(t,e,r){var n,i=s.getTypeOf(e),a=s.extend(r||{},l);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(t=m(t)),a.createFolders&&(n=p(t))&&b.call(this,n,!0);var h,g="string"===i&&!1===a.binary&&!1===a.base64;r&&void 0!==r.binary||(a.binary=!g),(e instanceof u&&0===e.uncompressedSize||a.dir||!e||0===e.length)&&(a.base64=!1,a.binary=!0,e="",a.compression="STORE",i="string"),h=e instanceof u||e instanceof o?e:d.isNode&&d.isStream(e)?new f(t,e):s.prepareContent(t,e,a.binary,a.optimizedBinaryString,a.base64);var y=new c(t,h,a);this.files[t]=y}var i=t("./utf8"),s=t("./utils"),o=t("./stream/GenericWorker"),a=t("./stream/StreamHelper"),l=t("./defaults"),u=t("./compressedObject"),c=t("./zipObject"),h=t("./generate"),d=t("./nodejsUtils"),f=t("./nodejs/NodejsStreamInputAdapter"),p=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},b=function(t,e){return e=void 0!==e?e:l.createFolders,t=m(t),this.files[t]||n.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function g(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var y={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,r,n;for(e in this.files)n=this.files[e],(r=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(r,n)},filter:function(t){var e=[];return this.forEach((function(r,n){t(r,n)&&e.push(n)})),e},file:function(t,e,r){if(1!==arguments.length)return t=this.root+t,n.call(this,t,e,r),this;if(g(t)){var i=t;return this.filter((function(t,e){return!e.dir&&i.test(t)}))}var s=this.files[this.root+t];return s&&!s.dir?s:null},folder:function(t){if(!t)return this;if(g(t))return this.filter((function(e,r){return r.dir&&t.test(e)}));var e=this.root+t,r=b.call(this,e),n=this.clone();return n.root=r.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter((function(e,r){return r.name.slice(0,t.length)===t})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,r={};try{if((r=s.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");s.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";e=h.generateWorker(this,r,n)}catch(t){(e=new o("error")).error(t)}return new a(e,r.type||"string",r.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=y},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,r){e.exports=t("stream")},{stream:void 0}],17:[function(t,e,r){var n=t("./DataReader");function i(t){n.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(i,n),i.prototype.byteAt=function(t){return this.data[this.zero+t]},i.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),s=this.length-4;0<=s;--s)if(this.data[s]===e&&this.data[s+1]===r&&this.data[s+2]===n&&this.data[s+3]===i)return s-this.zero;return-1},i.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),s=this.readData(4);return e===s[0]&&r===s[1]&&n===s[2]&&i===s[3]},i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./DataReader":18}],18:[function(t,e,r){var n=t("../utils");function i(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,r=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},{"../utils":32}],19:[function(t,e,r){var n=t("./Uint8ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){var n=t("./DataReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){var n=t("./ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){var n=t("../utils"),i=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||i.uint8array?"nodebuffer"===e?new a(t):i.uint8array?new l(n.transformTo("uint8array",t)):new s(n.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){var n=t("./GenericWorker"),i=t("../utils");function s(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(s,n),s.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){var n=t("./GenericWorker"),i=t("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,n),s.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(s,i),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){var n=t("../utils"),i=t("./GenericWorker");function s(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r<this._listeners[t].length;r++)this._listeners[t][r].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=n},{}],29:[function(t,e,r){var n=t("../utils"),i=t("./ConvertWorker"),o=t("./GenericWorker"),a=t("../base64"),l=t("../support"),u=t("../external"),c=null;if(l.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function h(t,e,r){var s=e;switch(e){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=e,this._mimeType=r,n.checkSupport(s),this._worker=t.pipe(new i(s)),t.lock()}catch(t){this._worker=new o("error"),this._worker.error(t)}}h.prototype={accumulate:function(t){return function(t,e){return new u.Promise((function(r,i){var o=[],l=t._internalType,u=t._outputType,c=t._mimeType;t.on("data",(function(t,r){o.push(t),e&&e(r)})).on("error",(function(t){o=[],i(t)})).on("end",(function(){try{var t=function(t,e,r){switch(t){case"blob":return n.newBlob(n.transformTo("arraybuffer",e),r);case"base64":return a.encode(e);default:return n.transformTo(t,e)}}(u,function(t,e){var r,n=0,i=null,o=0;for(r=0;r<e.length;r++)o+=e[r].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(i=new Uint8Array(o),r=0;r<e.length;r++)i.set(e[r],n),n+=e[r].length;return i;case"nodebuffer":return s.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(l,o),c);r(t)}catch(t){i(t)}o=[]})).resume()}))}(this,t)},on:function(t,e){var r=this;return"data"===t?this._worker.on(t,(function(t){e.call(r,t.data,t.meta)})):this._worker.on(t,(function(){n.delay(e,arguments,r)})),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(n.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=void 0!==s,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=0===new Blob([n],{type:"application/zip"}).size}catch(t){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),r.blob=0===i.getBlob("application/zip").size}catch(t){r.blob=!1}}}try{r.nodestream=!!t("readable-stream").Readable}catch(t){r.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,r){for(var n=t("./utils"),i=t("./support"),s=t("./nodejsUtils"),o=t("./stream/GenericWorker"),a=new Array(256),l=0;l<256;l++)a[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function u(){o.call(this,"utf-8 decode"),this.leftOver=null}function c(){o.call(this,"utf-8 encode")}a[254]=a[254]=1,r.utf8encode=function(t){return i.nodebuffer?s.newBufferFrom(t,"utf-8"):function(t){var e,r,n,s,o,a=t.length,l=0;for(s=0;s<a;s++)55296==(64512&(r=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=t.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(n-56320),s++),l+=r<128?1:r<2048?2:r<65536?3:4;for(e=i.uint8array?new Uint8Array(l):new Array(l),s=o=0;o<l;s++)55296==(64512&(r=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=t.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(n-56320),s++),r<128?e[o++]=r:(r<2048?e[o++]=192|r>>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e}(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,i,s,o=t.length,l=new Array(2*o);for(e=r=0;e<o;)if((i=t[e++])<128)l[r++]=i;else if(4<(s=a[i]))l[r++]=65533,e+=s-1;else{for(i&=2===s?31:3===s?15:7;1<s&&e<o;)i=i<<6|63&t[e++],s--;1<s?l[r++]=65533:i<65536?l[r++]=i:(i-=65536,l[r++]=55296|i>>10&1023,l[r++]=56320|1023&i)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),n.applyFromCharCode(l)}(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(u,o),u.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}(e),l=e;o!==e.length&&(i.uint8array?(l=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(l=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:r.utf8decode(l),meta:t.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=u,n.inherits(c,o),c.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){var n=t("./support"),i=t("./base64"),s=t("./nodejsUtils"),o=t("./external");function a(t){return t}function l(t,e){for(var r=0;r<t.length;++r)e[r]=255&t.charCodeAt(r);return e}t("setimmediate"),r.newBlob=function(t,e){r.checkSupport("blob");try{return new Blob([t],{type:e})}catch(r){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(t,e,r){var n=[],i=0,s=t.length;if(s<=r)return String.fromCharCode.apply(null,t);for(;i<s;)"array"===e||"nodebuffer"===e?n.push(String.fromCharCode.apply(null,t.slice(i,Math.min(i+r,s)))):n.push(String.fromCharCode.apply(null,t.subarray(i,Math.min(i+r,s)))),i+=r;return n.join("")},stringifyByChar:function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,s.allocBuffer(1)).length}catch(t){return!1}}()}};function h(t){var e=65536,n=r.getTypeOf(t),i=!0;if("uint8array"===n?i=u.applyCanBeUsed.uint8array:"nodebuffer"===n&&(i=u.applyCanBeUsed.nodebuffer),i)for(;1<e;)try{return u.stringifyByChunk(t,n,e)}catch(t){e=Math.floor(e/2)}return u.stringifyByChar(t)}function d(t,e){for(var r=0;r<t.length;r++)e[r]=t[r];return e}r.applyFromCharCode=h;var f={};f.string={string:a,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return l(t,new Uint8Array(t.length))},nodebuffer:function(t){return l(t,s.allocBuffer(t.length))}},f.array={string:h,array:a,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(t)}},f.arraybuffer={string:function(t){return h(new Uint8Array(t))},array:function(t){return d(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:a,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(new Uint8Array(t))}},f.uint8array={string:h,array:function(t){return d(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:a,nodebuffer:function(t){return s.newBufferFrom(t)}},f.nodebuffer={string:h,array:function(t){return d(t,new Array(t.length))},arraybuffer:function(t){return f.nodebuffer.uint8array(t).buffer},uint8array:function(t){return d(t,new Uint8Array(t.length))},nodebuffer:a},r.transformTo=function(t,e){if(e=e||"",!t)return e;r.checkSupport(t);var n=r.getTypeOf(e);return f[n][t](e)},r.resolve=function(t){for(var e=t.split("/"),r=[],n=0;n<e.length;n++){var i=e[n];"."===i||""===i&&0!==n&&n!==e.length-1||(".."===i?r.pop():r.push(i))}return r.join("/")},r.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":n.nodebuffer&&s.isBuffer(t)?"nodebuffer":n.uint8array&&t instanceof Uint8Array?"uint8array":n.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(t){if(!n[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(t){var e,r,n="";for(r=0;r<(t||"").length;r++)n+="\\x"+((e=t.charCodeAt(r))<16?"0":"")+e.toString(16).toUpperCase();return n},r.delay=function(t,e,r){c((function(){t.apply(r||null,e||[])}))},r.inherits=function(t,e){function r(){}r.prototype=e.prototype,t.prototype=new r},r.extend=function(){var t,e,r={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===r[e]&&(r[e]=arguments[t][e]);return r},r.prepareContent=function(t,e,s,a,u){return o.Promise.resolve(e).then((function(t){return n.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new o.Promise((function(e,r){var n=new FileReader;n.onload=function(t){e(t.target.result)},n.onerror=function(t){r(t.target.error)},n.readAsArrayBuffer(t)})):t})).then((function(e){var c=r.getTypeOf(e);return c?("arraybuffer"===c?e=r.transformTo("uint8array",e):"string"===c&&(u?e=i.decode(e):s&&!0!==a&&(e=function(t){return l(t,n.uint8array?new Uint8Array(t.length):new Array(t.length))}(e))),e):o.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,r){var n=t("./reader/readerFor"),i=t("./utils"),s=t("./signature"),o=t("./zipEntry"),a=t("./support");function l(t){this.files=[],this.loadOptions=t}l.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(e)+", expected "+i.pretty(t)+")")}},isSignature:function(t,e){var r=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4)===e;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=a.uint8array?"uint8array":"array",r=i.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,r,n=this.zip64EndOfCentralSize-44;0<n;)t=this.reader.readInt(2),e=this.reader.readInt(4),r=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(t=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=e-r;if(0<n)this.isSignature(e,s.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(t){this.reader=n(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,r){var n=t("./reader/readerFor"),i=t("./utils"),s=t("./compressedObject"),o=t("./crc32"),a=t("./utf8"),l=t("./compressions"),u=t("./support");function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(t){var e,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in l)if(Object.prototype.hasOwnProperty.call(l,e)&&l[e].magic===t)return l[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<i;)e=t.readInt(2),r=t.readInt(2),n=t.readData(r),this.extraFields[e]={id:e,length:r,value:n};t.setIndex(i)},handleUTF8:function(){var t=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var r=i.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var s=i.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=n(t.value);return 1!==e.readInt(1)||o(this.fileName)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=n(t.value);return 1!==e.readInt(1)||o(this.fileComment)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null}},e.exports=c},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,r){function n(t,e,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=e,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var i=t("./stream/StreamHelper"),s=t("./stream/DataWorker"),o=t("./utf8"),a=t("./compressedObject"),l=t("./stream/GenericWorker");n.prototype={internalStream:function(t){var e=null,r="string";try{if(!t)throw new Error("No output type specified.");var n="string"===(r=t.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),e=this._decompressWorker();var s=!this._dataBinary;s&&!n&&(e=e.pipe(new o.Utf8EncodeWorker)),!s&&n&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new l("error")).error(t)}return new i(e,r,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof a&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(r,t,e)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof l?this._data:new s(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],c=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<u.length;h++)n.prototype[u[h]]=c;e.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,r){(function(t){var r,n,i=t.MutationObserver||t.WebKitMutationObserver;if(i){var s=0,o=new i(c),a=t.document.createTextNode("");o.observe(a,{characterData:!0}),r=function(){a.data=s=++s%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var l=new t.MessageChannel;l.port1.onmessage=c,r=function(){l.port2.postMessage(0)}}var u=[];function c(){var t,e;n=!0;for(var r=u.length;r;){for(e=u,u=[],t=-1;++t<r;)e[t]();r=u.length}n=!1}e.exports=function(t){1!==u.push(t)||n||r()}}).call(this,void 0!==i?i:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,r){var n=t("immediate");function i(){}var s={},o=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function u(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,t!==i&&f(this,t)}function c(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function h(t,e,r){n((function(){var n;try{n=e(r)}catch(n){return s.reject(t,n)}n===t?s.reject(t,new TypeError("Cannot resolve promise with itself")):s.resolve(t,n)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function f(t,e){var r=!1;function n(e){r||(r=!0,s.reject(t,e))}function i(e){r||(r=!0,s.resolve(t,e))}var o=p((function(){e(i,n)}));"error"===o.status&&n(o.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}(e.exports=u).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){throw r}))}))},u.prototype.catch=function(t){return this.then(null,t)},u.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===o)return this;var r=new this.constructor(i);return this.state!==l?h(r,this.state===a?t:e,this.outcome):this.queue.push(new c(r,t,e)),r},c.prototype.callFulfilled=function(t){s.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){h(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){s.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){h(this.promise,this.onRejected,t)},s.resolve=function(t,e){var r=p(d,e);if("error"===r.status)return s.reject(t,r.value);var n=r.value;if(n)f(t,n);else{t.state=a,t.outcome=e;for(var i=-1,o=t.queue.length;++i<o;)t.queue[i].callFulfilled(e)}return t},s.reject=function(t,e){t.state=o,t.outcome=e;for(var r=-1,n=t.queue.length;++r<n;)t.queue[r].callRejected(e);return t},u.resolve=function(t){return t instanceof this?t:s.resolve(new this(i),t)},u.reject=function(t){var e=new this(i);return s.reject(e,t)},u.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var o=new Array(r),a=0,l=-1,u=new this(i);++l<r;)c(t[l],l);return u;function c(t,i){e.resolve(t).then((function(t){o[i]=t,++a!==r||n||(n=!0,s.resolve(u,o))}),(function(t){n||(n=!0,s.reject(u,t))}))}},u.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,r=!1;if(!e)return this.resolve([]);for(var n,o=-1,a=new this(i);++o<e;)n=t[o],this.resolve(n).then((function(t){r||(r=!0,s.resolve(a,t))}),(function(t){r||(r=!0,s.reject(a,t))}));return a}},{immediate:36}],38:[function(t,e,r){var n={};(0,t("./lib/utils/common").assign)(n,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,r){var n=t("./zlib/deflate"),i=t("./utils/common"),s=t("./utils/strings"),o=t("./zlib/messages"),a=t("./zlib/zstream"),l=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==r)throw new Error(o[r]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var c;if(c="string"==typeof e.dictionary?s.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(r=n.deflateSetDictionary(this.strm,c)))throw new Error(o[r]);this._dict_set=!0}}function c(t,e){var r=new u(e);if(r.push(t,!0),r.err)throw r.msg||o[r.err];return r.result}u.prototype.push=function(t,e){var r,o,a=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=s.string2buf(t):"[object ArrayBuffer]"===l.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new i.Buf8(u),a.next_out=0,a.avail_out=u),1!==(r=n.deflate(a,o))&&0!==r)return this.onEnd(r),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(s.buf2binstring(i.shrinkBuf(a.output,a.next_out))):this.onData(i.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||0===a.avail_out)&&1!==r);return 4===o?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==o||(this.onEnd(0),!(a.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Deflate=u,r.deflate=c,r.deflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},r.gzip=function(t,e){return(e=e||{}).gzip=!0,c(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,r){var n=t("./zlib/inflate"),i=t("./utils/common"),s=t("./utils/strings"),o=t("./zlib/constants"),a=t("./zlib/messages"),l=t("./zlib/zstream"),u=t("./zlib/gzheader"),c=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&!(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==o.Z_OK)throw new Error(a[r]);this.header=new u,n.inflateGetHeader(this.strm,this.header)}function d(t,e){var r=new h(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}h.prototype.push=function(t,e){var r,a,l,u,h,d,f=this.strm,p=this.options.chunkSize,m=this.options.dictionary,b=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof t?f.input=s.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(p),f.next_out=0,f.avail_out=p),(r=n.inflate(f,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&m&&(d="string"==typeof m?s.string2buf(m):"[object ArrayBuffer]"===c.call(m)?new Uint8Array(m):m,r=n.inflateSetDictionary(this.strm,d)),r===o.Z_BUF_ERROR&&!0===b&&(r=o.Z_OK,b=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),!(this.ended=!0);f.next_out&&(0!==f.avail_out&&r!==o.Z_STREAM_END&&(0!==f.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=s.utf8border(f.output,f.next_out),u=f.next_out-l,h=s.buf2string(f.output,l),f.next_out=u,f.avail_out=p-u,u&&i.arraySet(f.output,f.output,l,u,0),this.onData(h)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(b=!0)}while((0<f.avail_in||0===f.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(f.avail_out=0))},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Inflate=h,r.inflate=d,r.inflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},r.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var s=0;s<n;s++)t[i+s]=e[r+s]},flattenChunks:function(t){var e,r,n,i,s,o;for(e=n=0,r=t.length;e<r;e++)n+=t[e].length;for(o=new Uint8Array(n),e=i=0,r=t.length;e<r;e++)s=t[e],o.set(s,i),i+=s.length;return o}},s={arraySet:function(t,e,r,n,i){for(var s=0;s<n;s++)t[i+s]=e[r+s]},flattenChunks:function(t){return[].concat.apply([],t)}};r.setTyped=function(t){t?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,s))},r.setTyped(n)},{}],42:[function(t,e,r){var n=t("./common"),i=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var o=new n.Buf8(256),a=0;a<256;a++)o[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function l(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",o=0;o<e;o++)r+=String.fromCharCode(t[o]);return r}o[254]=o[254]=1,r.string2buf=function(t){var e,r,i,s,o,a=t.length,l=0;for(s=0;s<a;s++)55296==(64512&(r=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(i=t.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(i-56320),s++),l+=r<128?1:r<2048?2:r<65536?3:4;for(e=new n.Buf8(l),s=o=0;o<l;s++)55296==(64512&(r=t.charCodeAt(s)))&&s+1<a&&56320==(64512&(i=t.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(i-56320),s++),r<128?e[o++]=r:(r<2048?e[o++]=192|r>>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e},r.buf2binstring=function(t){return l(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e},r.buf2string=function(t,e){var r,n,i,s,a=e||t.length,u=new Array(2*a);for(r=n=0;r<a;)if((i=t[r++])<128)u[n++]=i;else if(4<(s=o[i]))u[n++]=65533,r+=s-1;else{for(i&=2===s?31:3===s?15:7;1<s&&r<a;)i=i<<6|63&t[r++],s--;1<s?u[n++]=65533:i<65536?u[n++]=i:(i-=65536,u[n++]=55296|i>>10&1023,u[n++]=56320|1023&i)}return l(u,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){e.exports=function(t,e,r,n){for(var i=65535&t,s=t>>>16&65535,o=0;0!==r;){for(r-=o=2e3<r?2e3:r;s=s+(i=i+e[n++]|0)|0,--o;);i%=65521,s%=65521}return i|s<<16}},{}],44:[function(t,e,r){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,r){var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var s=n,o=i+r;t^=-1;for(var a=i;a<o;a++)t=t>>>8^s[255&(t^e[a])];return~t}},{}],46:[function(t,e,r){var n,i=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),l=t("./messages"),u=-2,c=258,h=262,d=113;function f(t,e){return t.msg=l[e],e}function p(t){return(t<<1)-(4<t?9:0)}function m(t){for(var e=t.length;0<=--e;)t[e]=0}function b(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function g(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,b(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function v(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function w(t,e){var r,n,i=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-h?t.strstart-(t.w_size-h):0,u=t.window,d=t.w_mask,f=t.prev,p=t.strstart+c,m=u[s+o-1],b=u[s+o];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(r=e)+o]===b&&u[r+o-1]===m&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&s<p);if(n=c-(p-s),s=p-c,o<n){if(t.match_start=e,a<=(o=n))break;m=u[s+o-1],b=u[s+o]}}}while((e=f[e&d])>l&&0!=--i);return o<=t.lookahead?o:t.lookahead}function _(t){var e,r,n,s,l,u,c,d,f,p,m=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-h)){for(i.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=r=t.hash_size;n=t.head[--e],t.head[e]=m<=n?n-m:0,--r;);for(e=r=m;n=t.prev[--e],t.prev[e]=m<=n?n-m:0,--r;);s+=m}if(0===t.strm.avail_in)break;if(u=t.strm,c=t.window,d=t.strstart+t.lookahead,p=void 0,(f=s)<(p=u.avail_in)&&(p=f),r=0===p?0:(u.avail_in-=p,i.arraySet(c,u.input,u.next_in,p,d),1===u.state.wrap?u.adler=o(u.adler,c,p,d):2===u.state.wrap&&(u.adler=a(u.adler,c,p,d)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=3)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+3-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<h&&0!==t.strm.avail_in)}function x(t,e){for(var r,n;;){if(t.lookahead<h){if(_(t),t.lookahead<h&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-h&&(t.match_length=w(t,r)),t.match_length>=3)if(n=s._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}function S(t,e){for(var r,n,i;;){if(t.lookahead<h){if(_(t),t.lookahead<h&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-h&&(t.match_length=w(t,r),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-3,n=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(g(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=s._tr_tally(t,0,t.window[t.strstart-1]))&&g(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=s._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}function C(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}function A(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),m(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function k(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:d,t.adler=2===e.wrap?0:1,e.last_flush=0,s._tr_init(e),0):f(t,u)}function T(t){var e=k(t);return 0===e&&function(t){t.window_size=2*t.w_size,m(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),e}function E(t,e,r,n,s,o){if(!t)return u;var a=1;if(-1===e&&(e=6),n<0?(a=0,n=-n):15<n&&(a=2,n-=16),s<1||9<s||8!==r||n<8||15<n||e<0||9<e||o<0||4<o)return f(t,u);8===n&&(n=9);var l=new A;return(t.state=l).strm=t,l.wrap=a,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=s+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<s+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=o,l.method=r,T(t)}n=[new C(0,0,0,0,(function(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,g(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-h&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(g(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(g(t,!1),t.strm.avail_out),1)})),new C(4,4,8,4,x),new C(4,5,16,8,x),new C(4,6,32,32,x),new C(4,4,16,16,S),new C(8,16,32,32,S),new C(8,16,128,128,S),new C(8,32,128,256,S),new C(32,128,258,1024,S),new C(32,258,258,4096,S)],r.deflateInit=function(t,e){return E(t,e,8,15,8,0)},r.deflateInit2=E,r.deflateReset=T,r.deflateResetKeep=k,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,0):u},r.deflate=function(t,e){var r,i,o,l;if(!t||!t.state||5<e||e<0)return t?f(t,u):u;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return f(t,0===t.avail_out?-5:u);if(i.strm=t,r=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,y(i,31),y(i,139),y(i,8),i.gzhead?(y(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),y(i,255&i.gzhead.time),y(i,i.gzhead.time>>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=a(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,3),i.status=d);else{var h=8+(i.w_bits-8<<4)<<8;h|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=d,v(i,h),0!==i.strstart&&(v(i,t.adler>>>16),v(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),b(t),o=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),b(t),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,y(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),b(t),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,y(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>o&&(t.adler=a(t.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&b(t),i.pending+2<=i.pending_buf_size&&(y(i,255&t.adler),y(i,t.adler>>8&255),t.adler=0,i.status=d)):i.status=d),0!==i.pending){if(b(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(r)&&4!==e)return f(t,-5);if(666===i.status&&0!==t.avail_in)return f(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var w=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,o,a=t.window;;){if(t.lookahead<=c){if(_(t),t.lookahead<=c&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(n=a[i=t.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=t.strstart+c;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);t.match_length=c-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if(3!==w&&4!==w||(i.status=666),1===w||3===w)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===w&&(1===e?s._tr_align(i):5!==e&&(s._tr_stored_block(i,0,0,!1),3===e&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),b(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&t.adler),y(i,t.adler>>8&255),y(i,t.adler>>16&255),y(i,t.adler>>24&255),y(i,255&t.total_in),y(i,t.total_in>>8&255),y(i,t.total_in>>16&255),y(i,t.total_in>>24&255)):(v(i,t.adler>>>16),v(i,65535&t.adler)),b(t),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?0:1)},r.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&e!==d&&666!==e?f(t,u):(t.state=null,e===d?f(t,-3):0):u},r.deflateSetDictionary=function(t,e){var r,n,s,a,l,c,h,d,f=e.length;if(!t||!t.state)return u;if(2===(a=(r=t.state).wrap)||1===a&&42!==r.status||r.lookahead)return u;for(1===a&&(t.adler=o(t.adler,e,f,0)),r.wrap=0,f>=r.w_size&&(0===a&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),d=new i.Buf8(r.w_size),i.arraySet(d,e,f-r.w_size,r.w_size,0),e=d,f=r.w_size),l=t.avail_in,c=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,_(r);r.lookahead>=3;){for(n=r.strstart,s=r.lookahead-2;r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--s;);r.strstart=n,r.lookahead=2,_(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=c,t.input=h,t.avail_in=l,r.wrap=a,0},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,r){e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,r){e.exports=function(t,e){var r,n,i,s,o,a,l,u,c,h,d,f,p,m,b,g,y,v,w,_,x,S,C,A,k;r=t.state,n=t.next_in,A=t.input,i=n+(t.avail_in-5),s=t.next_out,k=t.output,o=s-(e-t.avail_out),a=s+(t.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,h=r.wnext,d=r.window,f=r.hold,p=r.bits,m=r.lencode,b=r.distcode,g=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;t:do{p<15&&(f+=A[n++]<<p,p+=8,f+=A[n++]<<p,p+=8),v=m[f&g];e:for(;;){if(f>>>=w=v>>>24,p-=w,0==(w=v>>>16&255))k[s++]=65535&v;else{if(!(16&w)){if(!(64&w)){v=m[(65535&v)+(f&(1<<w)-1)];continue e}if(32&w){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}_=65535&v,(w&=15)&&(p<w&&(f+=A[n++]<<p,p+=8),_+=f&(1<<w)-1,f>>>=w,p-=w),p<15&&(f+=A[n++]<<p,p+=8,f+=A[n++]<<p,p+=8),v=b[f&y];r:for(;;){if(f>>>=w=v>>>24,p-=w,!(16&(w=v>>>16&255))){if(!(64&w)){v=b[(65535&v)+(f&(1<<w)-1)];continue r}t.msg="invalid distance code",r.mode=30;break t}if(x=65535&v,p<(w&=15)&&(f+=A[n++]<<p,(p+=8)<w&&(f+=A[n++]<<p,p+=8)),l<(x+=f&(1<<w)-1)){t.msg="invalid distance too far back",r.mode=30;break t}if(f>>>=w,p-=w,(w=s-o)<x){if(c<(w=x-w)&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(C=d,(S=0)===h){if(S+=u-w,w<_){for(_-=w;k[s++]=d[S++],--w;);S=s-x,C=k}}else if(h<w){if(S+=u+h-w,(w-=h)<_){for(_-=w;k[s++]=d[S++],--w;);if(S=0,h<_){for(_-=w=h;k[s++]=d[S++],--w;);S=s-x,C=k}}}else if(S+=h-w,w<_){for(_-=w;k[s++]=d[S++],--w;);S=s-x,C=k}for(;2<_;)k[s++]=C[S++],k[s++]=C[S++],k[s++]=C[S++],_-=3;_&&(k[s++]=C[S++],1<_&&(k[s++]=C[S++]))}else{for(S=s-x;k[s++]=k[S++],k[s++]=k[S++],k[s++]=k[S++],2<(_-=3););_&&(k[s++]=k[S++],1<_&&(k[s++]=k[S++]))}break}}break}}while(n<i&&s<a);n-=_=p>>3,f&=(1<<(p-=_<<3))-1,t.next_in=n,t.next_out=s,t.avail_in=n<i?i-n+5:5-(n-i),t.avail_out=s<a?a-s+257:257-(s-a),r.hold=f,r.bits=p}},{}],49:[function(t,e,r){var n=t("../utils/common"),i=t("./adler32"),s=t("./crc32"),o=t("./inffast"),a=t("./inftrees"),l=-2;function u(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):l}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):l}function f(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?l:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,d(t))):l}function p(t,e){var r,n;return t?(n=new c,(t.state=n).window=null,0!==(r=f(t,e))&&(t.state=null),r):l}var m,b,g=!0;function y(t){if(g){var e;for(m=new n.Buf32(512),b=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,m,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,b,0,t.work,{bits:5}),g=!1}t.lencode=m,t.lenbits=9,t.distcode=b,t.distbits=5}function v(t,e,r,i){var s,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),i>=o.wsize?(n.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(s=o.wsize-o.wnext)&&(s=i),n.arraySet(o.window,e,r-i,s,o.wnext),(i-=s)?(n.arraySet(o.window,e,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}r.inflateReset=d,r.inflateReset2=f,r.inflateResetKeep=h,r.inflateInit=function(t){return p(t,15)},r.inflateInit2=p,r.inflate=function(t,e){var r,c,h,d,f,p,m,b,g,w,_,x,S,C,A,k,T,E,M,R,I,O,j,P,N=0,B=new n.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return l;12===(r=t.state).mode&&(r.mode=13),f=t.next_out,h=t.output,m=t.avail_out,d=t.next_in,c=t.input,p=t.avail_in,b=r.hold,g=r.bits,w=p,_=m,O=0;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;g<16;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(2&r.wrap&&35615===b){B[r.check=0]=255&b,B[1]=b>>>8&255,r.check=s(r.check,B,2,0),g=b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&b)<<8)+(b>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&b)){t.msg="unknown compression method",r.mode=30;break}if(g-=4,I=8+(15&(b>>>=4)),0===r.wbits)r.wbits=I;else if(I>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<<I,t.adler=r.check=1,r.mode=512&b?10:12,g=b=0;break;case 2:for(;g<16;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(r.flags=b,8!=(255&r.flags)){t.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=b>>8&1),512&r.flags&&(B[0]=255&b,B[1]=b>>>8&255,r.check=s(r.check,B,2,0)),g=b=0,r.mode=3;case 3:for(;g<32;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}r.head&&(r.head.time=b),512&r.flags&&(B[0]=255&b,B[1]=b>>>8&255,B[2]=b>>>16&255,B[3]=b>>>24&255,r.check=s(r.check,B,4,0)),g=b=0,r.mode=4;case 4:for(;g<16;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}r.head&&(r.head.xflags=255&b,r.head.os=b>>8),512&r.flags&&(B[0]=255&b,B[1]=b>>>8&255,r.check=s(r.check,B,2,0)),g=b=0,r.mode=5;case 5:if(1024&r.flags){for(;g<16;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}r.length=b,r.head&&(r.head.extra_len=b),512&r.flags&&(B[0]=255&b,B[1]=b>>>8&255,r.check=s(r.check,B,2,0)),g=b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(p<(x=r.length)&&(x=p),x&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,d,x,I)),512&r.flags&&(r.check=s(r.check,c,x,d)),p-=x,d+=x,r.length-=x),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===p)break t;for(x=0;I=c[d+x++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I)),I&&x<p;);if(512&r.flags&&(r.check=s(r.check,c,x,d)),p-=x,d+=x,I)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===p)break t;for(x=0;I=c[d+x++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I)),I&&x<p;);if(512&r.flags&&(r.check=s(r.check,c,x,d)),p-=x,d+=x,I)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;g<16;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(b!==(65535&r.check)){t.msg="header crc mismatch",r.mode=30;break}g=b=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;g<32;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}t.adler=r.check=u(b),g=b=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=f,t.avail_out=m,t.next_in=d,t.avail_in=p,r.hold=b,r.bits=g,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break t;case 13:if(r.last){b>>>=7&g,g-=7&g,r.mode=27;break}for(;g<3;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}switch(r.last=1&b,g-=1,3&(b>>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6!==e)break;b>>>=2,g-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}b>>>=2,g-=2;break;case 14:for(b>>>=7&g,g-=7&g;g<32;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if((65535&b)!=(b>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&b,g=b=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(x=r.length){if(p<x&&(x=p),m<x&&(x=m),0===x)break t;n.arraySet(h,c,d,x,f),p-=x,d+=x,m-=x,f+=x,r.length-=x;break}r.mode=12;break;case 17:for(;g<14;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(r.nlen=257+(31&b),b>>>=5,g-=5,r.ndist=1+(31&b),b>>>=5,g-=5,r.ncode=4+(15&b),b>>>=4,g-=4,286<r.nlen||30<r.ndist){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;g<3;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}r.lens[F[r.have++]]=7&b,b>>>=3,g-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},O=a(0,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,O){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;k=(N=r.lencode[b&(1<<r.lenbits)-1])>>>16&255,T=65535&N,!((A=N>>>24)<=g);){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(T<16)b>>>=A,g-=A,r.lens[r.have++]=T;else{if(16===T){for(P=A+2;g<P;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(b>>>=A,g-=A,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}I=r.lens[r.have-1],x=3+(3&b),b>>>=2,g-=2}else if(17===T){for(P=A+3;g<P;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}g-=A,I=0,x=3+(7&(b>>>=A)),b>>>=3,g-=3}else{for(P=A+7;g<P;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}g-=A,I=0,x=11+(127&(b>>>=A)),b>>>=7,g-=7}if(r.have+x>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;x--;)r.lens[r.have++]=I}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,j={bits:r.lenbits},O=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,O){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},O=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,O){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=p&&258<=m){t.next_out=f,t.avail_out=m,t.next_in=d,t.avail_in=p,r.hold=b,r.bits=g,o(t,_),f=t.next_out,h=t.output,m=t.avail_out,d=t.next_in,c=t.input,p=t.avail_in,b=r.hold,g=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;k=(N=r.lencode[b&(1<<r.lenbits)-1])>>>16&255,T=65535&N,!((A=N>>>24)<=g);){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(k&&!(240&k)){for(E=A,M=k,R=T;k=(N=r.lencode[R+((b&(1<<E+M)-1)>>E)])>>>16&255,T=65535&N,!(E+(A=N>>>24)<=g);){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}b>>>=E,g-=E,r.back+=E}if(b>>>=A,g-=A,r.back+=A,r.length=T,0===k){r.mode=26;break}if(32&k){r.back=-1,r.mode=12;break}if(64&k){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&k,r.mode=22;case 22:if(r.extra){for(P=r.extra;g<P;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}r.length+=b&(1<<r.extra)-1,b>>>=r.extra,g-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;k=(N=r.distcode[b&(1<<r.distbits)-1])>>>16&255,T=65535&N,!((A=N>>>24)<=g);){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(!(240&k)){for(E=A,M=k,R=T;k=(N=r.distcode[R+((b&(1<<E+M)-1)>>E)])>>>16&255,T=65535&N,!(E+(A=N>>>24)<=g);){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}b>>>=E,g-=E,r.back+=E}if(b>>>=A,g-=A,r.back+=A,64&k){t.msg="invalid distance code",r.mode=30;break}r.offset=T,r.extra=15&k,r.mode=24;case 24:if(r.extra){for(P=r.extra;g<P;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}r.offset+=b&(1<<r.extra)-1,b>>>=r.extra,g-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===m)break t;if(x=_-m,r.offset>x){if((x=r.offset-x)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}S=x>r.wnext?(x-=r.wnext,r.wsize-x):r.wnext-x,x>r.length&&(x=r.length),C=r.window}else C=h,S=f-r.offset,x=r.length;for(m<x&&(x=m),m-=x,r.length-=x;h[f++]=C[S++],--x;);0===r.length&&(r.mode=21);break;case 26:if(0===m)break t;h[f++]=r.length,m--,r.mode=21;break;case 27:if(r.wrap){for(;g<32;){if(0===p)break t;p--,b|=c[d++]<<g,g+=8}if(_-=m,t.total_out+=_,r.total+=_,_&&(t.adler=r.check=r.flags?s(r.check,h,_,f-_):i(r.check,h,_,f-_)),_=m,(r.flags?b:u(b))!==r.check){t.msg="incorrect data check",r.mode=30;break}g=b=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;g<32;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(b!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=30;break}g=b=0}r.mode=29;case 29:O=1;break t;case 30:O=-3;break t;case 31:return-4;default:return l}return t.next_out=f,t.avail_out=m,t.next_in=d,t.avail_in=p,r.hold=b,r.bits=g,(r.wsize||_!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&v(t,t.output,t.next_out,_-t.avail_out)?(r.mode=31,-4):(w-=t.avail_in,_-=t.avail_out,t.total_in+=w,t.total_out+=_,r.total+=_,r.wrap&&_&&(t.adler=r.check=r.flags?s(r.check,h,_,t.next_out-_):i(r.check,h,_,t.next_out-_)),t.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==w&&0===_||4===e)&&0===O&&(O=-5),O)},r.inflateEnd=function(t){if(!t||!t.state)return l;var e=t.state;return e.window&&(e.window=null),t.state=null,0},r.inflateGetHeader=function(t,e){var r;return t&&t.state&&2&(r=t.state).wrap?((r.head=e).done=!1,0):l},r.inflateSetDictionary=function(t,e){var r,n=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?l:11===r.mode&&i(1,e,n,0)!==r.check?-3:v(t,e,n,n)?(r.mode=31,-4):(r.havedict=1,0):l},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,r){var n=t("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,r,l,u,c,h,d){var f,p,m,b,g,y,v,w,_,x=d.bits,S=0,C=0,A=0,k=0,T=0,E=0,M=0,R=0,I=0,O=0,j=null,P=0,N=new n.Buf16(16),B=new n.Buf16(16),F=null,D=0;for(S=0;S<=15;S++)N[S]=0;for(C=0;C<l;C++)N[e[r+C]]++;for(T=x,k=15;1<=k&&0===N[k];k--);if(k<T&&(T=k),0===k)return u[c++]=20971520,u[c++]=20971520,d.bits=1,0;for(A=1;A<k&&0===N[A];A++);for(T<A&&(T=A),S=R=1;S<=15;S++)if(R<<=1,(R-=N[S])<0)return-1;if(0<R&&(0===t||1!==k))return-1;for(B[1]=0,S=1;S<15;S++)B[S+1]=B[S]+N[S];for(C=0;C<l;C++)0!==e[r+C]&&(h[B[e[r+C]]++]=C);if(y=0===t?(j=F=h,19):1===t?(j=i,P-=257,F=s,D-=257,256):(j=o,F=a,-1),S=A,g=c,M=C=O=0,m=-1,b=(I=1<<(E=T))-1,1===t&&852<I||2===t&&592<I)return 1;for(;;){for(v=S-M,_=h[C]<y?(w=0,h[C]):h[C]>y?(w=F[D+h[C]],j[P+h[C]]):(w=96,0),f=1<<S-M,A=p=1<<E;u[g+(O>>M)+(p-=f)]=v<<24|w<<16|_,0!==p;);for(f=1<<S-1;O&f;)f>>=1;if(0!==f?(O&=f-1,O+=f):O=0,C++,0==--N[S]){if(S===k)break;S=e[r+h[C]]}if(T<S&&(O&b)!==m){for(0===M&&(M=T),g+=A,R=1<<(E=S-M);E+M<k&&!((R-=N[E+M])<=0);)E++,R<<=1;if(I+=1<<E,1===t&&852<I||2===t&&592<I)return 1;u[m=O&b]=T<<24|E<<16|g-c}}return 0!==O&&(u[g+O]=S-M<<24|64<<16),d.bits=T,0}},{"../utils/common":41}],51:[function(t,e,r){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,r){var n=t("../utils/common");function i(t){for(var e=t.length;0<=--e;)t[e]=0}var s=15,o=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],a=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],c=new Array(576);i(c);var h=new Array(60);i(h);var d=new Array(512);i(d);var f=new Array(256);i(f);var p=new Array(29);i(p);var m,b,g,y=new Array(30);function v(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function _(t){return t<256?d[t]:d[256+(t>>>7)]}function x(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function S(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,x(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function C(t,e,r){S(t,r[2*e],r[2*e+1])}function A(t,e){for(var r=0;r|=1&t,t>>>=1,r<<=1,0<--e;);return r>>>1}function k(t,e,r){var n,i,o=new Array(16),a=0;for(n=1;n<=s;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var l=t[2*i+1];0!==l&&(t[2*i]=A(o[l]++,l))}}function T(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function E(t){8<t.bi_valid?x(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function M(t,e,r,n){var i=2*e,s=2*r;return t[i]<t[s]||t[i]===t[s]&&n[e]<=n[r]}function R(t,e,r){for(var n=t.heap[r],i=r<<1;i<=t.heap_len&&(i<t.heap_len&&M(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!M(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n}function I(t,e,r){var n,i,s,l,u=0;if(0!==t.last_lit)for(;n=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],i=t.pending_buf[t.l_buf+u],u++,0===n?C(t,i,e):(C(t,(s=f[i])+256+1,e),0!==(l=o[s])&&S(t,i-=p[s],l),C(t,s=_(--n),r),0!==(l=a[s])&&S(t,n-=y[s],l)),u<t.last_lit;);C(t,256,e)}function O(t,e){var r,n,i,o=e.dyn_tree,a=e.stat_desc.static_tree,l=e.stat_desc.has_stree,u=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<u;r++)0!==o[2*r]?(t.heap[++t.heap_len]=c=r,t.depth[r]=0):o[2*r+1]=0;for(;t.heap_len<2;)o[2*(i=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[i]=0,t.opt_len--,l&&(t.static_len-=a[2*i+1]);for(e.max_code=c,r=t.heap_len>>1;1<=r;r--)R(t,o,r);for(i=u;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],R(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,R(t,o,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,l,u=e.dyn_tree,c=e.max_code,h=e.stat_desc.static_tree,d=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,m=e.stat_desc.max_length,b=0;for(o=0;o<=s;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)m<(o=u[2*u[2*(n=t.heap[r])+1]+1]+1)&&(o=m,b++),u[2*n+1]=o,c<n||(t.bl_count[o]++,a=0,p<=n&&(a=f[n-p]),l=u[2*n],t.opt_len+=l*(o+a),d&&(t.static_len+=l*(h[2*n+1]+a)));if(0!==b){do{for(o=m-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[m]--,b-=2}while(0<b);for(o=m;0!==o;o--)for(n=t.bl_count[o];0!==n;)c<(i=t.heap[--r])||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(t,e),k(o,c,t.bl_count)}function j(t,e,r){var n,i,s=-1,o=e[1],a=0,l=7,u=4;for(0===o&&(l=138,u=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=e[2*(n+1)+1],++a<l&&i===o||(a<u?t.bl_tree[2*i]+=a:0!==i?(i!==s&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=i,u=(a=0)===o?(l=138,3):i===o?(l=6,3):(l=7,4))}function P(t,e,r){var n,i,s=-1,o=e[1],a=0,l=7,u=4;for(0===o&&(l=138,u=3),n=0;n<=r;n++)if(i=o,o=e[2*(n+1)+1],!(++a<l&&i===o)){if(a<u)for(;C(t,i,t.bl_tree),0!=--a;);else 0!==i?(i!==s&&(C(t,i,t.bl_tree),a--),C(t,16,t.bl_tree),S(t,a-3,2)):a<=10?(C(t,17,t.bl_tree),S(t,a-3,3)):(C(t,18,t.bl_tree),S(t,a-11,7));s=i,u=(a=0)===o?(l=138,3):i===o?(l=6,3):(l=7,4)}}i(y);var N=!1;function B(t,e,r,i){S(t,0+(i?1:0),3),function(t,e,r,i){E(t),x(t,r),x(t,~r),n.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}(t,e,r)}r._tr_init=function(t){N||(function(){var t,e,r,n,i,u=new Array(16);for(n=r=0;n<28;n++)for(p[n]=r,t=0;t<1<<o[n];t++)f[r++]=n;for(f[r-1]=n,n=i=0;n<16;n++)for(y[n]=i,t=0;t<1<<a[n];t++)d[i++]=n;for(i>>=7;n<30;n++)for(y[n]=i<<7,t=0;t<1<<a[n]-7;t++)d[256+i++]=n;for(e=0;e<=s;e++)u[e]=0;for(t=0;t<=143;)c[2*t+1]=8,t++,u[8]++;for(;t<=255;)c[2*t+1]=9,t++,u[9]++;for(;t<=279;)c[2*t+1]=7,t++,u[7]++;for(;t<=287;)c[2*t+1]=8,t++,u[8]++;for(k(c,287,u),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=A(t,5);m=new v(c,o,257,286,s),b=new v(h,a,0,30,s),g=new v(new Array(0),l,0,19,7)}(),N=!0),t.l_desc=new w(t.dyn_ltree,m),t.d_desc=new w(t.dyn_dtree,b),t.bl_desc=new w(t.bl_tree,g),t.bi_buf=0,t.bi_valid=0,T(t)},r._tr_stored_block=B,r._tr_flush_block=function(t,e,r,n){var i,s,o=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),O(t,t.l_desc),O(t,t.d_desc),o=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),O(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*u[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==e?B(t,e,r,n):4===t.strategy||s===i?(S(t,2+(n?1:0),3),I(t,c,h)):(S(t,4+(n?1:0),3),function(t,e,r,n){var i;for(S(t,e-257,5),S(t,r-1,5),S(t,n-4,4),i=0;i<n;i++)S(t,t.bl_tree[2*u[i]+1],3);P(t,t.dyn_ltree,e-1),P(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),I(t,t.dyn_ltree,t.dyn_dtree)),T(t),n&&E(t)},r._tr_tally=function(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(f[r]+256+1)]++,t.dyn_dtree[2*_(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){S(t,2,3),C(t,256,c),function(t){16===t.bi_valid?(x(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,r){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,n){(function(t){!function(t,e){if(!t.setImmediate){var n,i,s,o,a=1,l={},u=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,n="[object process]"==={}.toString.call(t.process)?function(t){r.nextTick((function(){f(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(o="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(o+e,"*")}):t.MessageChannel?((s=new MessageChannel).port1.onmessage=function(t){f(t.data)},function(t){s.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,function(t){var e=c.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):function(t){setTimeout(f,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return l[a]=i,n(a),a++},h.clearImmediate=d}function d(t){delete l[t]}function f(t){if(u)setTimeout(f,0,t);else{var e=l[t];if(e){u=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{d(t),u=!1}}}}function p(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&f(+e.data.slice(o.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,void 0!==i?i:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)}))}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],t("timers").setImmediate)},{_process:467,buffer:220,timers:523}],442:[function(t,e,n){(function(t){(function(){"use strict";var r=/[\\^$.*+?()[\]{}|]/g,n=RegExp(r.source),i="object"==typeof t&&t&&t.Object===Object&&t,s="object"==typeof self&&self&&self.Object===Object&&self,o=i||s||Function("return this")(),a=Object.prototype.toString,l=o.Symbol,u=l?l.prototype:void 0,c=u?u.toString:void 0;e.exports=function(t){var e;return(t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==a.call(t)}(t))return c?c.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e))&&n.test(t)?t.replace(r,"\\$&"):t}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],443:[function(t,e,n){(function(t){(function(){"use strict";var r="[object Arguments]",i="[object Map]",s="[object Object]",o="[object Set]",a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,p={};p["[object Float32Array]"]=p["[object Float64Array]"]=p["[object Int8Array]"]=p["[object Int16Array]"]=p["[object Int32Array]"]=p["[object Uint8Array]"]=p["[object Uint8ClampedArray]"]=p["[object Uint16Array]"]=p["[object Uint32Array]"]=!0,p[r]=p["[object Array]"]=p["[object ArrayBuffer]"]=p["[object Boolean]"]=p["[object DataView]"]=p["[object Date]"]=p["[object Error]"]=p["[object Function]"]=p[i]=p["[object Number]"]=p[s]=p["[object RegExp]"]=p[o]=p["[object String]"]=p["[object WeakMap]"]=!1;var m="object"==typeof t&&t&&t.Object===Object&&t,b="object"==typeof self&&self&&self.Object===Object&&self,g=m||b||Function("return this")(),y="object"==typeof n&&n&&!n.nodeType&&n,v=y&&"object"==typeof e&&e&&!e.nodeType&&e,w=v&&v.exports===y&&m.process,_=function(){try{return w&&w.binding("util")}catch(t){}}(),x=_&&_.isTypedArray;function S(t,e,r,n){for(var i=-1,s=t?t.length:0;++i<s;){var o=t[i];e(n,o,r(o),t)}return n}function C(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function A(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function k(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function T(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var E,M,R,I=Array.prototype,O=Function.prototype,j=Object.prototype,P=g["__core-js_shared__"],N=(E=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",B=O.toString,F=j.hasOwnProperty,D=j.toString,L=RegExp("^"+B.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=g.Symbol,z=g.Uint8Array,U=j.propertyIsEnumerable,$=I.splice,H=(M=Object.keys,R=Object,function(t){return M(R(t))}),W=_t(g,"DataView"),q=_t(g,"Map"),Y=_t(g,"Promise"),X=_t(g,"Set"),G=_t(g,"WeakMap"),K=_t(Object,"create"),Z=Mt(W),J=Mt(q),Q=Mt(Y),tt=Mt(X),et=Mt(G),rt=V?V.prototype:void 0,nt=rt?rt.valueOf:void 0,it=rt?rt.toString:void 0;function st(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function at(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function lt(t){var e=-1,r=t?t.length:0;for(this.__data__=new at;++e<r;)this.add(t[e])}function ut(t){this.__data__=new ot(t)}function ct(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1}function ht(t,e,r,n){return ft(t,(function(t,i,s){e(n,t,r(t),s)})),n}st.prototype.clear=function(){this.__data__=K?K(null):{}},st.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},st.prototype.get=function(t){var e=this.__data__;if(K){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return F.call(e,t)?e[t]:void 0},st.prototype.has=function(t){var e=this.__data__;return K?void 0!==e[t]:F.call(e,t)},st.prototype.set=function(t,e){return this.__data__[t]=K&&void 0===e?"__lodash_hash_undefined__":e,this},ot.prototype.clear=function(){this.__data__=[]},ot.prototype.delete=function(t){var e=this.__data__,r=ct(e,t);return!(r<0||(r==e.length-1?e.pop():$.call(e,r,1),0))},ot.prototype.get=function(t){var e=this.__data__,r=ct(e,t);return r<0?void 0:e[r][1]},ot.prototype.has=function(t){return ct(this.__data__,t)>-1},ot.prototype.set=function(t,e){var r=this.__data__,n=ct(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},at.prototype.clear=function(){this.__data__={hash:new st,map:new(q||ot),string:new st}},at.prototype.delete=function(t){return wt(this,t).delete(t)},at.prototype.get=function(t){return wt(this,t).get(t)},at.prototype.has=function(t){return wt(this,t).has(t)},at.prototype.set=function(t,e){return wt(this,t).set(t,e),this},lt.prototype.add=lt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},lt.prototype.has=function(t){return this.__data__.has(t)},ut.prototype.clear=function(){this.__data__=new ot},ut.prototype.delete=function(t){return this.__data__.delete(t)},ut.prototype.get=function(t){return this.__data__.get(t)},ut.prototype.has=function(t){return this.__data__.has(t)},ut.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ot){var n=r.__data__;if(!q||n.length<199)return n.push([t,e]),this;r=this.__data__=new at(n)}return r.set(t,e),this};var dt,ft=(dt=function(t,e){return t&&pt(t,e,$t)},function(t,e){if(null==t)return t;if(!Bt(t))return dt(t,e);for(var r=t.length,n=-1,i=Object(t);++n<r&&!1!==e(i[n],n,i););return t}),pt=function(t,e,r){for(var n=-1,i=Object(t),s=r(t),o=s.length;o--;){var a=s[++n];if(!1===e(i[a],a,i))break}return t};function mt(t,e){for(var r=0,n=(e=Ct(e,t)?[e]:yt(e)).length;null!=t&&r<n;)t=t[Et(e[r++])];return r&&r==n?t:void 0}function bt(t,e){return null!=t&&e in Object(t)}function gt(t,e,n,a,l){return t===e||(null==t||null==e||!Lt(t)&&!Vt(e)?t!=t&&e!=e:function(t,e,n,a,l,u){var c=Nt(t),h=Nt(e),d="[object Array]",f="[object Array]";c||(d=(d=xt(t))==r?s:d),h||(f=(f=xt(e))==r?s:f);var p=d==s&&!A(t),m=f==s&&!A(e),b=d==f;if(b&&!p)return u||(u=new ut),c||Ut(t)?vt(t,e,n,a,l,u):function(t,e,r,n,s,a,l){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!n(new z(t),new z(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return jt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case i:var u=k;case o:var c=2&a;if(u||(u=T),t.size!=e.size&&!c)return!1;var h=l.get(t);if(h)return h==e;a|=1,l.set(t,e);var d=vt(u(t),u(e),n,s,a,l);return l.delete(t),d;case"[object Symbol]":if(nt)return nt.call(t)==nt.call(e)}return!1}(t,e,d,n,a,l,u);if(!(2&l)){var g=p&&F.call(t,"__wrapped__"),y=m&&F.call(e,"__wrapped__");if(g||y){var v=g?t.value():t,w=y?e.value():e;return u||(u=new ut),n(v,w,a,l,u)}}return!!b&&(u||(u=new ut),function(t,e,r,n,i,s){var o=2&i,a=$t(t),l=a.length;if(l!=$t(e).length&&!o)return!1;for(var u=l;u--;){var c=a[u];if(!(o?c in e:F.call(e,c)))return!1}var h=s.get(t);if(h&&s.get(e))return h==e;var d=!0;s.set(t,e),s.set(e,t);for(var f=o;++u<l;){var p=t[c=a[u]],m=e[c];if(n)var b=o?n(m,p,c,e,t,s):n(p,m,c,t,e,s);if(!(void 0===b?p===m||r(p,m,n,i,s):b)){d=!1;break}f||(f="constructor"==c)}if(d&&!f){var g=t.constructor,y=e.constructor;g==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof y&&y instanceof y||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,n,a,l,u))}(t,e,gt,n,a,l))}function yt(t){return Nt(t)?t:Tt(t)}function vt(t,e,r,n,i,s){var o=2&i,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var u=s.get(t);if(u&&s.get(e))return u==e;var c=-1,h=!0,d=1&i?new lt:void 0;for(s.set(t,e),s.set(e,t);++c<a;){var f=t[c],p=e[c];if(n)var m=o?n(p,f,c,e,t,s):n(f,p,c,t,e,s);if(void 0!==m){if(m)continue;h=!1;break}if(d){if(!C(e,(function(t,e){if(!d.has(e)&&(f===t||r(f,t,n,i,s)))return d.add(e)}))){h=!1;break}}else if(f!==p&&!r(f,p,n,i,s)){h=!1;break}}return s.delete(t),s.delete(e),h}function wt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function _t(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Lt(t)||function(t){return!!N&&N in t}(t))&&(Ft(t)||A(t)?L:d).test(Mt(t))}(r)?r:void 0}var xt=function(t){return D.call(t)};function St(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||f.test(t))&&t>-1&&t%1==0&&t<e}function Ct(t,e){if(Nt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!zt(t))||l.test(t)||!a.test(t)||null!=e&&t in Object(e)}function At(t){return t==t&&!Lt(t)}function kt(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}(W&&"[object DataView]"!=xt(new W(new ArrayBuffer(1)))||q&&xt(new q)!=i||Y&&"[object Promise]"!=xt(Y.resolve())||X&&xt(new X)!=o||G&&"[object WeakMap]"!=xt(new G))&&(xt=function(t){var e=D.call(t),r=e==s?t.constructor:void 0,n=r?Mt(r):void 0;if(n)switch(n){case Z:return"[object DataView]";case J:return i;case Q:return"[object Promise]";case tt:return o;case et:return"[object WeakMap]"}return e});var Tt=Ot((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(zt(t))return it?it.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return u.test(t)&&r.push(""),t.replace(c,(function(t,e,n,i){r.push(n?i.replace(h,"$1"):e||t)})),r}));function Et(t){if("string"==typeof t||zt(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Mt(t){if(null!=t){try{return B.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Rt,It=(Rt=function(t,e,r){F.call(t,r)?t[r].push(e):t[r]=[e]},function(t,e){var r={};return(Nt(t)?S:ht)(t,Rt,function(t){return"function"==typeof t?t:null==t?Ht:"object"==typeof t?Nt(t)?function(t,e){return Ct(t)&&At(e)?kt(Et(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:mt(t,e);return void 0===n?void 0:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){for(var n,i=-1,s=(e=Ct(e,t)?[e]:yt(e)).length;++i<s;){var o=Et(e[i]);if(!(n=null!=t&&r(t,o)))break;t=t[o]}return n||!!(s=t?t.length:0)&&Dt(s)&&St(o,s)&&(Nt(t)||Pt(t))}(t,e,bt)}(r,t):gt(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){for(var e=$t(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,At(i)]}return e}(t);return 1==e.length&&e[0][2]?kt(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var i=r.length,s=i;if(null==t)return!s;for(t=Object(t);i--;){var o=r[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<s;){var a=(o=r[i])[0],l=t[a],u=o[1];if(o[2]){if(void 0===l&&!(a in t))return!1}else{var c,h=new ut;if(!(void 0===c?gt(u,l,n,3,h):c))return!1}}return!0}(r,0,e)}}(t):Ct(e=t)?(r=Et(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return mt(e,t)}}(e);var e,r}(e),r)});function Ot(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=t.apply(this,n);return r.cache=s.set(i,o),o};return r.cache=new(Ot.Cache||at),r}function jt(t,e){return t===e||t!=t&&e!=e}function Pt(t){return function(t){return Vt(t)&&Bt(t)}(t)&&F.call(t,"callee")&&(!U.call(t,"callee")||D.call(t)==r)}Ot.Cache=at;var Nt=Array.isArray;function Bt(t){return null!=t&&Dt(t.length)&&!Ft(t)}function Ft(t){var e=Lt(t)?D.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function Dt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Lt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Vt(t){return!!t&&"object"==typeof t}function zt(t){return"symbol"==typeof t||Vt(t)&&"[object Symbol]"==D.call(t)}var Ut=x?function(t){return function(e){return t(e)}}(x):function(t){return Vt(t)&&Dt(t.length)&&!!p[D.call(t)]};function $t(t){return Bt(t)?function(t,e){var r=Nt(t)||Pt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var s in t)!e&&!F.call(t,s)||i&&("length"==s||St(s,n))||r.push(s);return r}(t):function(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||j))return H(t);var e,r,n=[];for(var i in Object(t))F.call(t,i)&&"constructor"!=i&&n.push(i);return n}(t)}function Ht(t){return t}e.exports=It}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],444:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){return!0===t||!1===t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Boolean]"==n.call(t)}},{}],445:[function(t,e,n){(function(t){(function(){"use strict";var r="[object Arguments]",i="[object Map]",s="[object Object]",o="[object Set]",a=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[r]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u[i]=u["[object Number]"]=u[s]=u["[object RegExp]"]=u[o]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof t&&t&&t.Object===Object&&t,h="object"==typeof self&&self&&self.Object===Object&&self,d=c||h||Function("return this")(),f="object"==typeof n&&n&&!n.nodeType&&n,p=f&&"object"==typeof e&&e&&!e.nodeType&&e,m=p&&p.exports===f,b=m&&c.process,g=function(){try{return b&&b.binding&&b.binding("util")}catch(t){}}(),y=g&&g.isTypedArray;function v(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function w(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function _(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var x,S,C,A=Array.prototype,k=Function.prototype,T=Object.prototype,E=d["__core-js_shared__"],M=k.toString,R=T.hasOwnProperty,I=(x=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",O=T.toString,j=RegExp("^"+M.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=m?d.Buffer:void 0,N=d.Symbol,B=d.Uint8Array,F=T.propertyIsEnumerable,D=A.splice,L=N?N.toStringTag:void 0,V=Object.getOwnPropertySymbols,z=P?P.isBuffer:void 0,U=(S=Object.keys,C=Object,function(t){return S(C(t))}),$=pt(d,"DataView"),H=pt(d,"Map"),W=pt(d,"Promise"),q=pt(d,"Set"),Y=pt(d,"WeakMap"),X=pt(Object,"create"),G=yt($),K=yt(H),Z=yt(W),J=yt(q),Q=yt(Y),tt=N?N.prototype:void 0,et=tt?tt.valueOf:void 0;function rt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function nt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function it(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function st(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new it;++e<r;)this.add(t[e])}function ot(t){var e=this.__data__=new nt(t);this.size=e.size}function at(t,e){for(var r=t.length;r--;)if(vt(t[r][0],e))return r;return-1}function lt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":L&&L in Object(t)?function(t){var e=R.call(t,L),r=t[L];try{t[L]=void 0;var n=!0}catch(t){}var i=O.call(t);return n&&(e?t[L]=r:delete t[L]),i}(t):function(t){return O.call(t)}(t)}function ut(t){return kt(t)&<(t)==r}function ct(t,e,n,a,l){return t===e||(null==t||null==e||!kt(t)&&!kt(e)?t!=t&&e!=e:function(t,e,n,a,l,u){var c=_t(t),h=_t(e),d=c?"[object Array]":bt(t),f=h?"[object Array]":bt(e),p=(d=d==r?s:d)==s,m=(f=f==r?s:f)==s,b=d==f;if(b&&xt(t)){if(!xt(e))return!1;c=!0,p=!1}if(b&&!p)return u||(u=new ot),c||Tt(t)?ht(t,e,n,a,l,u):function(t,e,r,n,s,a,l){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!a(new B(t),new B(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return vt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case i:var u=w;case o:var c=1&n;if(u||(u=_),t.size!=e.size&&!c)return!1;var h=l.get(t);if(h)return h==e;n|=2,l.set(t,e);var d=ht(u(t),u(e),n,s,a,l);return l.delete(t),d;case"[object Symbol]":if(et)return et.call(t)==et.call(e)}return!1}(t,e,d,n,a,l,u);if(!(1&n)){var g=p&&R.call(t,"__wrapped__"),y=m&&R.call(e,"__wrapped__");if(g||y){var v=g?t.value():t,x=y?e.value():e;return u||(u=new ot),l(v,x,n,a,u)}}return!!b&&(u||(u=new ot),function(t,e,r,n,i,s){var o=1&r,a=dt(t),l=a.length;if(l!=dt(e).length&&!o)return!1;for(var u=l;u--;){var c=a[u];if(!(o?c in e:R.call(e,c)))return!1}var h=s.get(t);if(h&&s.get(e))return h==e;var d=!0;s.set(t,e),s.set(e,t);for(var f=o;++u<l;){var p=t[c=a[u]],m=e[c];if(n)var b=o?n(m,p,c,e,t,s):n(p,m,c,t,e,s);if(!(void 0===b?p===m||i(p,m,r,n,s):b)){d=!1;break}f||(f="constructor"==c)}if(d&&!f){var g=t.constructor,y=e.constructor;g==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof y&&y instanceof y||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,n,a,l,u))}(t,e,n,a,ct,l))}function ht(t,e,r,n,i,s){var o=1&r,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var u=s.get(t);if(u&&s.get(e))return u==e;var c=-1,h=!0,d=2&r?new st:void 0;for(s.set(t,e),s.set(e,t);++c<a;){var f=t[c],p=e[c];if(n)var m=o?n(p,f,c,e,t,s):n(f,p,c,t,e,s);if(void 0!==m){if(m)continue;h=!1;break}if(d){if(!v(e,(function(t,e){if(o=e,!d.has(o)&&(f===t||i(f,t,r,n,s)))return d.push(e);var o}))){h=!1;break}}else if(f!==p&&!i(f,p,r,n,s)){h=!1;break}}return s.delete(t),s.delete(e),h}function dt(t){return function(t,e,r){var n=e(t);return _t(t)?n:function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}(n,r(t))}(t,Et,mt)}function ft(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function pt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!At(t)||function(t){return!!I&&I in t}(t))&&(St(t)?j:a).test(yt(t))}(r)?r:void 0}rt.prototype.clear=function(){this.__data__=X?X(null):{},this.size=0},rt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},rt.prototype.get=function(t){var e=this.__data__;if(X){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return R.call(e,t)?e[t]:void 0},rt.prototype.has=function(t){var e=this.__data__;return X?void 0!==e[t]:R.call(e,t)},rt.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=X&&void 0===e?"__lodash_hash_undefined__":e,this},nt.prototype.clear=function(){this.__data__=[],this.size=0},nt.prototype.delete=function(t){var e=this.__data__,r=at(e,t);return!(r<0||(r==e.length-1?e.pop():D.call(e,r,1),--this.size,0))},nt.prototype.get=function(t){var e=this.__data__,r=at(e,t);return r<0?void 0:e[r][1]},nt.prototype.has=function(t){return at(this.__data__,t)>-1},nt.prototype.set=function(t,e){var r=this.__data__,n=at(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},it.prototype.clear=function(){this.size=0,this.__data__={hash:new rt,map:new(H||nt),string:new rt}},it.prototype.delete=function(t){var e=ft(this,t).delete(t);return this.size-=e?1:0,e},it.prototype.get=function(t){return ft(this,t).get(t)},it.prototype.has=function(t){return ft(this,t).has(t)},it.prototype.set=function(t,e){var r=ft(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},st.prototype.add=st.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},st.prototype.has=function(t){return this.__data__.has(t)},ot.prototype.clear=function(){this.__data__=new nt,this.size=0},ot.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},ot.prototype.get=function(t){return this.__data__.get(t)},ot.prototype.has=function(t){return this.__data__.has(t)},ot.prototype.set=function(t,e){var r=this.__data__;if(r instanceof nt){var n=r.__data__;if(!H||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new it(n)}return r.set(t,e),this.size=r.size,this};var mt=V?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,i=0,s=[];++r<n;){var o=t[r];e(o)&&(s[i++]=o)}return s}(V(t),(function(e){return F.call(t,e)})))}:function(){return[]},bt=lt;function gt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||l.test(t))&&t>-1&&t%1==0&&t<e}function yt(t){if(null!=t){try{return M.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function vt(t,e){return t===e||t!=t&&e!=e}($&&"[object DataView]"!=bt(new $(new ArrayBuffer(1)))||H&&bt(new H)!=i||W&&"[object Promise]"!=bt(W.resolve())||q&&bt(new q)!=o||Y&&"[object WeakMap]"!=bt(new Y))&&(bt=function(t){var e=lt(t),r=e==s?t.constructor:void 0,n=r?yt(r):"";if(n)switch(n){case G:return"[object DataView]";case K:return i;case Z:return"[object Promise]";case J:return o;case Q:return"[object WeakMap]"}return e});var wt=ut(function(){return arguments}())?ut:function(t){return kt(t)&&R.call(t,"callee")&&!F.call(t,"callee")},_t=Array.isArray,xt=z||function(){return!1};function St(t){if(!At(t))return!1;var e=lt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ct(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function At(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function kt(t){return null!=t&&"object"==typeof t}var Tt=y?function(t){return function(e){return t(e)}}(y):function(t){return kt(t)&&Ct(t.length)&&!!u[lt(t)]};function Et(t){return null!=(e=t)&&Ct(e.length)&&!St(e)?function(t,e){var r=_t(t),n=!r&&wt(t),i=!r&&!n&&xt(t),s=!r&&!n&&!i&&Tt(t),o=r||n||i||s,a=o?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],l=a.length;for(var u in t)!e&&!R.call(t,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||gt(u,l))||a.push(u);return a}(t):function(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||T))return U(t);var e,r,n=[];for(var i in Object(t))R.call(t,i)&&"constructor"!=i&&n.push(i);return n}(t);var e}e.exports=function(t,e){return ct(t,e)}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],446:[function(t,e,n){(function(t){(function(){"use strict";var r="object"==typeof t&&t&&t.Object===Object&&t,n="object"==typeof self&&self&&self.Object===Object&&self,i=r||n||Function("return this")(),s=Object.prototype,o=s.hasOwnProperty,a=s.toString,l=i.Symbol,u=l?l.toStringTag:void 0;e.exports=function(t){if(!function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}(t))return!1;var e=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?function(t){var e=o.call(t,u),r=t[u];try{t[u]=void 0;var n=!0}catch(t){}var i=a.call(t);return n&&(e?t[u]=r:delete t[u]),i}(t):function(t){return a.call(t)}(t)}(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],447:[function(t,e,r){"use strict";e.exports=function(t){return null==t}},{}],448:[function(t,e,r){"use strict";e.exports=function(t){return void 0===t}},{}],449:[function(t,e,n){(function(t){(function(){"use strict";var r=/^\[object .+?Constructor\]$/,n="object"==typeof t&&t&&t.Object===Object&&t,i="object"==typeof self&&self&&self.Object===Object&&self,s=n||i||Function("return this")();function o(t,e){return!(!t||!t.length)&&function(t,e,r){if(e!=e)return function(t,e,r,n){for(var i=t.length,s=-1;++s<i;)if(e(t[s],s,t))return s;return-1}(t,a);for(var n=-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}(t,e)>-1}function a(t){return t!=t}function l(t,e){return t.has(e)}function u(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var c,h=Array.prototype,d=Function.prototype,f=Object.prototype,p=s["__core-js_shared__"],m=(c=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",b=d.toString,g=f.hasOwnProperty,y=f.toString,v=RegExp("^"+b.call(g).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=h.splice,_=O(s,"Map"),x=O(s,"Set"),S=O(Object,"create");function C(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function A(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function k(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function T(t){var e=-1,r=t?t.length:0;for(this.__data__=new k;++e<r;)this.add(t[e])}function E(t,e){for(var r,n,i=t.length;i--;)if((r=t[i][0])===(n=e)||r!=r&&n!=n)return i;return-1}function M(t){return!(!j(t)||(e=t,m&&m in e))&&(function(t){var e=j(t)?y.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?v:r).test(function(t){if(null!=t){try{return b.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}C.prototype.clear=function(){this.__data__=S?S(null):{}},C.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},C.prototype.get=function(t){var e=this.__data__;if(S){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return g.call(e,t)?e[t]:void 0},C.prototype.has=function(t){var e=this.__data__;return S?void 0!==e[t]:g.call(e,t)},C.prototype.set=function(t,e){return this.__data__[t]=S&&void 0===e?"__lodash_hash_undefined__":e,this},A.prototype.clear=function(){this.__data__=[]},A.prototype.delete=function(t){var e=this.__data__,r=E(e,t);return!(r<0||(r==e.length-1?e.pop():w.call(e,r,1),0))},A.prototype.get=function(t){var e=this.__data__,r=E(e,t);return r<0?void 0:e[r][1]},A.prototype.has=function(t){return E(this.__data__,t)>-1},A.prototype.set=function(t,e){var r=this.__data__,n=E(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},k.prototype.clear=function(){this.__data__={hash:new C,map:new(_||A),string:new C}},k.prototype.delete=function(t){return I(this,t).delete(t)},k.prototype.get=function(t){return I(this,t).get(t)},k.prototype.has=function(t){return I(this,t).has(t)},k.prototype.set=function(t,e){return I(this,t).set(t,e),this},T.prototype.add=T.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},T.prototype.has=function(t){return this.__data__.has(t)};var R=x&&1/u(new x([,-0]))[1]==1/0?function(t){return new x(t)}:function(){};function I(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function O(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return M(r)?r:void 0}function j(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}e.exports=function(t){return t&&t.length?function(t,e,r){var n=-1,i=o,s=t.length,a=!0,c=[],h=c;if(s>=200){var d=R(t);if(d)return u(d);a=!1,i=l,h=new T}else h=c;t:for(;++n<s;){var f=t[n],p=f;if(f=0!==f?f:0,a&&p==p){for(var m=h.length;m--;)if(h[m]===p)continue t;c.push(f)}else i(h,p,r)||(h!==c&&h.push(p),c.push(f))}return c}(t):[]}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],450:[function(t,e,r){"use strict";var n=t("inherits"),i=t("hash-base"),s=t("safe-buffer").Buffer,o=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function l(t,e){return t<<e|t>>>32-e}function u(t,e,r,n,i,s,o){return l(t+(e&r|~e&n)+i+s|0,o)+e|0}function c(t,e,r,n,i,s,o){return l(t+(e&n|r&~n)+i+s|0,o)+e|0}function h(t,e,r,n,i,s,o){return l(t+(e^r^n)+i+s|0,o)+e|0}function d(t,e,r,n,i,s,o){return l(t+(r^(e|~n))+i+s|0,o)+e|0}n(a,i),a.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,s=this._d;r=u(r,n,i,s,t[0],3614090360,7),s=u(s,r,n,i,t[1],3905402710,12),i=u(i,s,r,n,t[2],606105819,17),n=u(n,i,s,r,t[3],3250441966,22),r=u(r,n,i,s,t[4],4118548399,7),s=u(s,r,n,i,t[5],1200080426,12),i=u(i,s,r,n,t[6],2821735955,17),n=u(n,i,s,r,t[7],4249261313,22),r=u(r,n,i,s,t[8],1770035416,7),s=u(s,r,n,i,t[9],2336552879,12),i=u(i,s,r,n,t[10],4294925233,17),n=u(n,i,s,r,t[11],2304563134,22),r=u(r,n,i,s,t[12],1804603682,7),s=u(s,r,n,i,t[13],4254626195,12),i=u(i,s,r,n,t[14],2792965006,17),r=c(r,n=u(n,i,s,r,t[15],1236535329,22),i,s,t[1],4129170786,5),s=c(s,r,n,i,t[6],3225465664,9),i=c(i,s,r,n,t[11],643717713,14),n=c(n,i,s,r,t[0],3921069994,20),r=c(r,n,i,s,t[5],3593408605,5),s=c(s,r,n,i,t[10],38016083,9),i=c(i,s,r,n,t[15],3634488961,14),n=c(n,i,s,r,t[4],3889429448,20),r=c(r,n,i,s,t[9],568446438,5),s=c(s,r,n,i,t[14],3275163606,9),i=c(i,s,r,n,t[3],4107603335,14),n=c(n,i,s,r,t[8],1163531501,20),r=c(r,n,i,s,t[13],2850285829,5),s=c(s,r,n,i,t[2],4243563512,9),i=c(i,s,r,n,t[7],1735328473,14),r=h(r,n=c(n,i,s,r,t[12],2368359562,20),i,s,t[5],4294588738,4),s=h(s,r,n,i,t[8],2272392833,11),i=h(i,s,r,n,t[11],1839030562,16),n=h(n,i,s,r,t[14],4259657740,23),r=h(r,n,i,s,t[1],2763975236,4),s=h(s,r,n,i,t[4],1272893353,11),i=h(i,s,r,n,t[7],4139469664,16),n=h(n,i,s,r,t[10],3200236656,23),r=h(r,n,i,s,t[13],681279174,4),s=h(s,r,n,i,t[0],3936430074,11),i=h(i,s,r,n,t[3],3572445317,16),n=h(n,i,s,r,t[6],76029189,23),r=h(r,n,i,s,t[9],3654602809,4),s=h(s,r,n,i,t[12],3873151461,11),i=h(i,s,r,n,t[15],530742520,16),r=d(r,n=h(n,i,s,r,t[2],3299628645,23),i,s,t[0],4096336452,6),s=d(s,r,n,i,t[7],1126891415,10),i=d(i,s,r,n,t[14],2878612391,15),n=d(n,i,s,r,t[5],4237533241,21),r=d(r,n,i,s,t[12],1700485571,6),s=d(s,r,n,i,t[3],2399980690,10),i=d(i,s,r,n,t[10],4293915773,15),n=d(n,i,s,r,t[1],2240044497,21),r=d(r,n,i,s,t[8],1873313359,6),s=d(s,r,n,i,t[15],4264355552,10),i=d(i,s,r,n,t[6],2734768916,15),n=d(n,i,s,r,t[13],1309151649,21),r=d(r,n,i,s,t[4],4149444226,6),s=d(s,r,n,i,t[11],3174756917,10),i=d(i,s,r,n,t[2],718787259,15),n=d(n,i,s,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+s|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=s.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},e.exports=a},{"hash-base":425,inherits:440,"safe-buffer":494}],451:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("brorand");function s(t){this.rand=t||new i.Rand}e.exports=s,s.create=function(t){return new s(t)},s.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},s.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},s.prototype.test=function(t,e,r){var i=t.bitLength(),s=n.mont(t),o=new n(1).toRed(s);e||(e=Math.max(1,i/48|0));for(var a=t.subn(1),l=0;!a.testn(l);l++);for(var u=t.shrn(l),c=a.toRed(s);e>0;e--){var h=this._randrange(new n(2),a);r&&r(h);var d=h.toRed(s).redPow(u);if(0!==d.cmp(o)&&0!==d.cmp(c)){for(var f=1;f<l;f++){if(0===(d=d.redSqr()).cmp(o))return!1;if(0===d.cmp(c))break}if(f===l)return!1}}return!0},s.prototype.getDivisor=function(t,e){var r=t.bitLength(),i=n.mont(t),s=new n(1).toRed(i);e||(e=Math.max(1,r/48|0));for(var o=t.subn(1),a=0;!o.testn(a);a++);for(var l=t.shrn(a),u=o.toRed(i);e>0;e--){var c=this._randrange(new n(2),o),h=t.gcd(c);if(0!==h.cmpn(1))return h;var d=c.toRed(i).redPow(l);if(0!==d.cmp(s)&&0!==d.cmp(u)){for(var f=1;f<a;f++){if(0===(d=d.redSqr()).cmp(s))return d.fromRed().subn(1).gcd(t);if(0===d.cmp(u))break}if(f===a)return(d=d.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},{"bn.js":452,brorand:187}],452:[function(t,e,r){arguments[4][184][0].apply(r,arguments)},{buffer:188,dup:184}],453:[function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}e.exports=n,n.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},{}],454:[function(t,e,r){"use strict";var n=r;function i(t){return 1===t.length?"0"+t:t}function s(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),s=i>>8,o=255&i;s?r.push(s,o):r.push(o)}return r},n.zero2=i,n.toHex=s,n.encode=function(t,e){return"hex"===e?s(t):t}},{}],455:[function(t,e,r){e.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],456:[function(t,e,r){"use strict";var n=t("asn1.js");r.certificate=t("./certificate");var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));r.RSAPrivateKey=i;var s=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));r.RSAPublicKey=s;var o=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));r.PublicKey=o;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),l=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));r.PrivateKey=l;var u=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));r.EncryptedPrivateKey=u;var c=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));r.DSAPrivateKey=c,r.DSAparam=n.define("DSAparam",(function(){this.int()}));var h=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(d),this.key("publicKey").optional().explicit(1).bitstr())}));r.ECPrivateKey=h;var d=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));r.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},{"./certificate":457,"asn1.js":170}],457:[function(t,e,r){"use strict";var n=t("asn1.js"),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),s=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),o=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())})),l=n.define("RelativeDistinguishedName",(function(){this.setof(s)})),u=n.define("RDNSequence",(function(){this.seqof(l)})),c=n.define("Name",(function(){this.choice({rdnSequence:this.use(u)})})),h=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),d=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),f=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(c),this.key("validity").use(h),this.key("subject").use(c),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(f),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())}));e.exports=p},{"asn1.js":170}],458:[function(t,e,r){"use strict";var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,s=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,o=t("evp_bytestokey"),a=t("browserify-aes"),l=t("safe-buffer").Buffer;e.exports=function(t,e){var r,u=t.toString(),c=u.match(n);if(c){var h="aes"+c[1],d=l.from(c[2],"hex"),f=l.from(c[3].replace(/[\r\n]/g,""),"base64"),p=o(e,d.slice(0,8),parseInt(c[1],10)).key,m=[],b=a.createDecipheriv(h,p,d);m.push(b.update(f)),m.push(b.final()),r=l.concat(m)}else{var g=u.match(s);r=l.from(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(i)[1],data:r}}},{"browserify-aes":191,evp_bytestokey:423,"safe-buffer":494}],459:[function(t,e,r){"use strict";var n=t("./asn1"),i=t("./aesid.json"),s=t("./fixProc"),o=t("browserify-aes"),a=t("pbkdf2"),l=t("safe-buffer").Buffer;function u(t){var e;"object"!=typeof t||l.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=l.from(t));var r,u,c=s(t,e),h=c.tag,d=c.data;switch(h){case"CERTIFICATE":u=n.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=n.PublicKey.decode(d,"der")),r=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=n.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":d=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),s=i[t.algorithm.decrypt.cipher.algo.join(".")],u=t.algorithm.decrypt.cipher.iv,c=t.subjectPrivateKey,h=parseInt(s.split("-")[1],10)/8,d=a.pbkdf2Sync(e,r,n,h,"sha1"),f=o.createDecipheriv(s,d,u),p=[];return p.push(f.update(c)),p.push(f.final()),l.concat(p)}(d=n.EncryptedPrivateKey.decode(d,"der"),e);case"PRIVATE KEY":switch(r=(u=n.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:n.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=n.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=n.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+h)}}e.exports=u,u.signature=n.signature},{"./aesid.json":455,"./asn1":456,"./fixProc":458,"browserify-aes":191,pbkdf2:460,"safe-buffer":494}],460:[function(t,e,r){"use strict";r.pbkdf2=t("./lib/async"),r.pbkdf2Sync=t("./lib/sync")},{"./lib/async":461,"./lib/sync":464}],461:[function(t,e,n){(function(r){(function(){"use strict";var n,i,s=t("safe-buffer").Buffer,o=t("./precondition"),a=t("./default-encoding"),l=t("./sync"),u=t("./to-buffer"),c=r.crypto&&r.crypto.subtle,h={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[];function f(){return i||(i=r.process&&r.process.nextTick?r.process.nextTick:r.queueMicrotask?r.queueMicrotask:r.setImmediate?r.setImmediate:r.setTimeout)}function p(t,e,r,n,i){return c.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return c.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return s.from(t)}))}e.exports=function(t,e,i,m,b,g){"function"==typeof b&&(g=b,b=void 0);var y=h[(b=b||"sha1").toLowerCase()];if(y&&"function"==typeof r.Promise){if(o(i,m),t=u(t,a,"Password"),e=u(e,a,"Salt"),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){f()((function(){e(null,t)}))}),(function(t){f()((function(){e(t)}))}))}(function(t){if(r.process&&!r.process.browser)return Promise.resolve(!1);if(!c||!c.importKey||!c.deriveBits)return Promise.resolve(!1);if(void 0!==d[t])return d[t];var e=p(n=n||s.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return d[t]=e,e}(y).then((function(r){return r?p(t,e,i,m,y):l(t,e,i,m,b)})),g)}else f()((function(){var r;try{r=l(t,e,i,m,b)}catch(t){return g(t)}g(null,r)}))}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":462,"./precondition":463,"./sync":464,"./to-buffer":465,"safe-buffer":494}],462:[function(t,e,n){(function(t,r){(function(){"use strict";var n;n=r.process&&r.process.browser?"utf-8":r.process&&r.process.version?parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",e.exports=n}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:467}],463:[function(t,e,r){"use strict";var n=Math.pow(2,30)-1;e.exports=function(t,e){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(e<0||e>n||e!=e)throw new TypeError("Bad key length")}},{}],464:[function(t,e,r){"use strict";var n=t("create-hash/md5"),i=t("ripemd160"),s=t("sha.js"),o=t("safe-buffer").Buffer,a=t("./precondition"),l=t("./default-encoding"),u=t("./to-buffer"),c=o.alloc(128),h={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(t,e,r){var a=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new i).update(t).digest()}:"md5"===t?n:function(e){return s(t).update(e).digest()}}(t),l="sha512"===t||"sha384"===t?128:64;e.length>l?e=a(e):e.length<l&&(e=o.concat([e,c],l));for(var u=o.allocUnsafe(l+h[t]),d=o.allocUnsafe(l+h[t]),f=0;f<l;f++)u[f]=54^e[f],d[f]=92^e[f];var p=o.allocUnsafe(l+r+4);u.copy(p,0,0,l),this.ipad1=p,this.ipad2=u,this.opad=d,this.alg=t,this.blocksize=l,this.hash=a,this.size=h[t]}d.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(t,e,r,n,i){a(r,n);var s=new d(i=i||"sha1",t=u(t,l,"Password"),(e=u(e,l,"Salt")).length),c=o.allocUnsafe(n),f=o.allocUnsafe(e.length+4);e.copy(f,0,0,e.length);for(var p=0,m=h[i],b=Math.ceil(n/m),g=1;g<=b;g++){f.writeUInt32BE(g,e.length);for(var y=s.run(f,s.ipad1),v=y,w=1;w<r;w++){v=s.run(v,s.ipad2);for(var _=0;_<m;_++)y[_]^=v[_]}y.copy(c,p),p+=m}return c}},{"./default-encoding":462,"./precondition":463,"./to-buffer":465,"create-hash/md5":387,ripemd160:493,"safe-buffer":494,"sha.js":498}],465:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer;e.exports=function(t,e,r){if(n.isBuffer(t))return t;if("string"==typeof t)return n.from(t,e);if(ArrayBuffer.isView(t))return n.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},{"safe-buffer":494}],466:[function(t,e,r){(function(t){(function(){"use strict";void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var s,o,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(s=new Array(a-1),o=0;o<s.length;)s[o++]=arguments[o];return t.nextTick((function(){e.apply(null,s)}))}}}:e.exports=t}).call(this)}).call(this,t("_process"))},{_process:467}],467:[function(t,e,r){"use strict";var n,i,s=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var u,c=[],h=!1,d=-1;function f(){h&&u&&(h=!1,u.length?c=u.concat(c):d=-1,c.length&&p())}function p(){if(!h){var t=l(f);h=!0;for(var e=c.length;e;){for(u=c,c=[];++d<e;)u&&u[d].run();d=-1,e=c.length}u=null,h=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function b(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new m(t,e)),1!==c.length||h||l(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=b,s.addListener=b,s.once=b,s.off=b,s.removeListener=b,s.removeAllListeners=b,s.emit=b,s.prependListener=b,s.prependOnceListener=b,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],468:[function(t,e,r){"use strict";r.publicEncrypt=t("./publicEncrypt"),r.privateDecrypt=t("./privateDecrypt"),r.privateEncrypt=function(t,e){return r.publicEncrypt(t,e,!0)},r.publicDecrypt=function(t,e){return r.privateDecrypt(t,e,!0)}},{"./privateDecrypt":471,"./publicEncrypt":472}],469:[function(t,e,r){"use strict";var n=t("create-hash"),i=t("safe-buffer").Buffer;function s(t){var e=i.allocUnsafe(4);return e.writeUInt32BE(t,0),e}e.exports=function(t,e){for(var r,o=i.alloc(0),a=0;o.length<e;)r=s(a++),o=i.concat([o,n("sha1").update(t).update(r).digest()]);return o.slice(0,e)}},{"create-hash":386,"safe-buffer":494}],470:[function(t,e,r){arguments[4][184][0].apply(r,arguments)},{buffer:188,dup:184}],471:[function(t,e,r){"use strict";var n=t("parse-asn1"),i=t("./mgf"),s=t("./xor"),o=t("bn.js"),a=t("browserify-rsa"),l=t("create-hash"),u=t("./withPublic"),c=t("safe-buffer").Buffer;e.exports=function(t,e,r){var h;h=t.padding?t.padding:r?1:4;var d,f=n(t),p=f.modulus.byteLength();if(e.length>p||new o(e).cmp(f.modulus)>=0)throw new Error("decryption error");d=r?u(new o(e),f):a(e,f);var m=c.alloc(p-d.length);if(d=c.concat([m,d],p),4===h)return function(t,e){var r=t.modulus.byteLength(),n=l("sha1").update(c.alloc(0)).digest(),o=n.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,o+1),u=e.slice(o+1),h=s(a,i(u,o)),d=s(u,i(h,r-o-1));if(function(t,e){t=c.from(t),e=c.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));for(var i=-1;++i<n;)r+=t[i]^e[i];return r}(n,d.slice(0,o)))throw new Error("decryption error");for(var f=o;0===d[f];)f++;if(1!==d[f++])throw new Error("decryption error");return d.slice(f)}(f,d);if(1===h)return function(t,e,r){for(var n=e.slice(0,2),i=2,s=0;0!==e[i++];)if(i>=e.length){s++;break}var o=e.slice(2,i-1);if(("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&s++,o.length<8&&s++,s)throw new Error("decryption error");return e.slice(i)}(0,d,r);if(3===h)return d;throw new Error("unknown padding")}},{"./mgf":469,"./withPublic":473,"./xor":474,"bn.js":470,"browserify-rsa":209,"create-hash":386,"parse-asn1":459,"safe-buffer":494}],472:[function(t,e,r){"use strict";var n=t("parse-asn1"),i=t("randombytes"),s=t("create-hash"),o=t("./mgf"),a=t("./xor"),l=t("bn.js"),u=t("./withPublic"),c=t("browserify-rsa"),h=t("safe-buffer").Buffer;e.exports=function(t,e,r){var d;d=t.padding?t.padding:r?1:4;var f,p=n(t);if(4===d)f=function(t,e){var r=t.modulus.byteLength(),n=e.length,u=s("sha1").update(h.alloc(0)).digest(),c=u.length,d=2*c;if(n>r-d-2)throw new Error("message too long");var f=h.alloc(r-n-d-2),p=r-c-1,m=i(c),b=a(h.concat([u,f,h.alloc(1,1),e],p),o(m,p)),g=a(m,o(b,c));return new l(h.concat([h.alloc(1),g,b],r))}(p,e);else if(1===d)f=function(t,e,r){var n,s=e.length,o=t.modulus.byteLength();if(s>o-11)throw new Error("message too long");return n=r?h.alloc(o-s-3,255):function(t){for(var e,r=h.allocUnsafe(t),n=0,s=i(2*t),o=0;n<t;)o===s.length&&(s=i(2*t),o=0),(e=s[o++])&&(r[n++]=e);return r}(o-s-3),new l(h.concat([h.from([0,r?1:2]),n,h.alloc(1),e],o))}(p,e,r);else{if(3!==d)throw new Error("unknown padding");if((f=new l(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?c(f,p):u(f,p)}},{"./mgf":469,"./withPublic":473,"./xor":474,"bn.js":470,"browserify-rsa":209,"create-hash":386,"parse-asn1":459,randombytes:475,"safe-buffer":494}],473:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("safe-buffer").Buffer;e.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},{"bn.js":470,"safe-buffer":494}],474:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},{}],475:[function(t,e,n){(function(r,n){(function(){"use strict";var i=t("safe-buffer").Buffer,s=n.crypto||n.msCrypto;s&&s.getRandomValues?e.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var n=i.allocUnsafe(t);if(t>0)if(t>65536)for(var o=0;o<t;o+=65536)s.getRandomValues(n.slice(o,o+65536));else s.getRandomValues(n);return"function"==typeof e?r.nextTick((function(){e(null,n)})):n}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:467,"safe-buffer":494}],476:[function(t,e,n){(function(e,r){(function(){"use strict";function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var s=t("safe-buffer"),o=t("randombytes"),a=s.Buffer,l=s.kMaxLength,u=r.crypto||r.msCrypto,c=Math.pow(2,32)-1;function h(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>c||t<0)throw new TypeError("offset must be a uint32");if(t>l||t>e)throw new RangeError("offset out of range")}function d(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>c||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>l)throw new RangeError("buffer too small")}function f(t,r,n,i){if(e.browser){var s=t.buffer,a=new Uint8Array(s,r,n);return u.getRandomValues(a),i?void e.nextTick((function(){i(null,t)})):t}if(!i)return o(n).copy(t,r),t;o(n,(function(e,n){if(e)return i(e);n.copy(t,r),i(null,t)}))}u&&u.getRandomValues||!e.browser?(n.randomFill=function(t,e,n,i){if(!(a.isBuffer(t)||t instanceof r.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return h(e,t.length),d(n,e,t.length),f(t,e,n,i)},n.randomFillSync=function(t,e,n){if(void 0===e&&(e=0),!(a.isBuffer(t)||t instanceof r.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return h(e,t.length),void 0===n&&(n=t.length-e),d(n,e,t.length),f(t,e,n)}):(n.randomFill=i,n.randomFillSync=i)}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:467,randombytes:475,"safe-buffer":494}],477:[function(t,e,r){"use strict";var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function s(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o;if("string"==typeof e&&(i="not ",e.substr(0,4)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))o="The ".concat(t," ").concat(n," ").concat(s(e,"type"));else{var a=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+1>t.length)&&-1!==t.indexOf(".",r)}(t)?"property":"argument";o='The "'.concat(t,'" ').concat(a," ").concat(n," ").concat(s(e,"type"))}return o+". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],478:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=u;var i=t("./_stream_readable"),s=t("./_stream_writable");t("inherits")(u,i);for(var o=n(s.prototype),a=0;a<o.length;a++){var l=o[a];u.prototype[l]||(u.prototype[l]=s.prototype[l])}function u(t){if(!(this instanceof u))return new u(t);i.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||r.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,t("_process"))},{"./_stream_readable":480,"./_stream_writable":482,_process:467,inherits:440}],479:[function(t,e,r){"use strict";e.exports=i;var n=t("./_stream_transform");function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}t("inherits")(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":481,inherits:440}],480:[function(t,e,n){(function(r,n){(function(){"use strict";var i;e.exports=A,A.ReadableState=C,t("events").EventEmitter;var s,o=function(t,e){return t.listeners(e).length},a=t("./internal/streams/stream"),l=t("buffer").Buffer,u=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},c=t("util");s=c&&c.debuglog?c.debuglog("stream"):function(){};var h,d,f,p=t("./internal/streams/buffer_list"),m=t("./internal/streams/destroy"),b=t("./internal/streams/state").getHighWaterMark,g=t("../errors").codes,y=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,_=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t("inherits")(A,a);var x=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function C(e,r,n){i=i||t("./_stream_duplex"),e=e||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=t("string_decoder/").StringDecoder),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function A(e){if(i=i||t("./_stream_duplex"),!(this instanceof A))return new A(e);var r=this instanceof i;this._readableState=new C(e,this,r),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function k(t,e,r,n,i){s("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(s("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?M(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,R(t)))}}(t,a);else if(i||(o=function(t,e){var r,n;return n=e,l.isBuffer(n)||n instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),o)x(t,o);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),n)a.endEmitted?x(t,new _):T(t,a,e,!0);else if(a.ended)x(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?T(t,a,e,!1):I(t,a)):T(t,a,e,!1)}else n||(a.reading=!1,I(t,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function T(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&M(t)),I(t,e)}function E(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function M(t){var e=t._readableState;s("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(s("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(R,t))}function R(t){var e=t._readableState;s("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,B(t)}function I(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(s("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function j(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function P(t){s("readable nexttick read 0"),t.read(0)}function N(t,e){s("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),B(t),e.flowing&&!e.reading&&t.read(0)}function B(t){var e=t._readableState;for(s("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function D(t){var e=t._readableState;s("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(L,e,t))}function L(t,e){if(s("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function V(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=m.destroy,A.prototype._undestroy=m.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=l.from(t,e),e=""),r=!0),k(this,t,e,!1,r)},A.prototype.unshift=function(t){return k(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(e){h||(h=t("string_decoder/").StringDecoder);var r=new h(e);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},A.prototype.read=function(t){s("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return s("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?D(this):M(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&D(this),null;var n,i=e.needReadable;return s("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&s("length less than watermark",i=!0),e.ended||e.reading?s("reading or ended",i=!1):i&&(s("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=E(r,e))),null===(n=t>0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&D(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){x(this,new w("_read()"))},A.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,s("pipe count=%d opts=%j",i.pipesCount,e);var a=e&&!1===e.end||t===r.stdout||t===r.stderr?m:l;function l(){s("onend"),t.end()}i.endEmitted?r.nextTick(a):n.once("end",a),t.on("unpipe",(function e(r,o){s("onunpipe"),r===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,s("cleanup"),t.removeListener("close",f),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",d),t.removeListener("unpipe",e),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",h),c=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}));var u=function(t){return function(){var e=t._readableState;s("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,B(t))}}(n);t.on("drain",u);var c=!1;function h(e){s("ondata");var r=t.write(e);s("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==V(i.pipes,t))&&!c&&(s("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function d(e){s("onerror",e),m(),t.removeListener("error",d),0===o(t,"error")&&x(t,e)}function f(){t.removeListener("finish",p),m()}function p(){s("onfinish"),t.removeListener("close",f),m()}function m(){s("unpipe"),n.unpipe(t)}return n.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",f),t.once("finish",p),t.emit("pipe",n),i.flowing||(s("pipe resume"),n.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=V(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},A.prototype.on=function(t,e){var n=a.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,s("on readable",i.length,i.reading),i.length?M(this):i.reading||r.nextTick(P,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var n=a.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(j,this),n},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(j,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(s("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(N,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(s("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){s("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<S.length;o++)t.on(S[o],this.emit.bind(this,S[o]));return this._read=function(e){s("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=t("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(e,r){return void 0===f&&(f=t("./internal/streams/from")),f(A,e,r)})}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":477,"./_stream_duplex":478,"./internal/streams/async_iterator":483,"./internal/streams/buffer_list":484,"./internal/streams/destroy":485,"./internal/streams/from":487,"./internal/streams/state":489,"./internal/streams/stream":490,_process:467,buffer:220,events:422,inherits:440,"string_decoder/":522,util:188}],481:[function(t,e,r){"use strict";e.exports=c;var n=t("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,s=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,l=t("./_stream_duplex");function u(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(t){if(!(this instanceof c))return new c(t);l.call(this,t),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function h(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(e,r){d(t,e,r)}))}function d(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new o;return t.push(null)}t("inherits")(c,l),c.prototype.push=function(t,e){return this._transformState.needTransform=!1,l.prototype.push.call(this,t,e)},c.prototype._transform=function(t,e,r){r(new i("_transform()"))},c.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},c.prototype._destroy=function(t,e){l.prototype._destroy.call(this,t,(function(t){e(t)}))}},{"../errors":477,"./_stream_duplex":478,inherits:440}],482:[function(t,e,n){(function(r,n){(function(){"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var s;e.exports=A,A.WritableState=C;var o,a={deprecate:t("util-deprecate")},l=t("./internal/streams/stream"),u=t("buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},h=t("./internal/streams/destroy"),d=t("./internal/streams/state").getHighWaterMark,f=t("../errors").codes,p=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,b=f.ERR_MULTIPLE_CALLBACK,g=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,x=h.errorOrDestroy;function S(){}function C(e,n,o){s=s||t("./_stream_duplex"),e=e||{},"boolean"!=typeof o&&(o=n instanceof s),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,s=n.writecb;if("function"!=typeof s)throw new b;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,s){--e.pendingcb,n?(r.nextTick(s,i),r.nextTick(I,t,e),t._writableState.errorEmitted=!0,x(t,i)):(s(i),t._writableState.errorEmitted=!0,x(t,i),I(t,e))}(t,n,i,e,s);else{var o=M(n)||t.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||E(t,n),i?r.nextTick(T,t,n,o,s):T(t,n,o,s)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function A(e){var r=this instanceof(s=s||t("./_stream_duplex"));if(!r&&!o.call(A,this))return new A(e);this._writableState=new C(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function k(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new y("write")):r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function T(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),I(t,e)}function E(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,s=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,l=!0;r;)s[a]=r,r.isBuf||(l=!1),r=r.next,a+=1;s.allBuffers=l,k(t,e,!0,e.length,s,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,h=r.callback;if(k(t,e,!1,e.objectMode?1:u.length,u,c,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function M(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function R(t,e){t._final((function(r){e.pendingcb--,r&&x(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var n=M(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,r.nextTick(R,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}t("inherits")(A,l),C.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(C.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===A&&t&&t._writableState instanceof C}})):o=function(t){return t instanceof this},A.prototype.pipe=function(){x(this,new g)},A.prototype.write=function(t,e,n){var i,s=this._writableState,o=!1,a=!s.objectMode&&(i=t,u.isBuffer(i)||i instanceof c);return a&&!u.isBuffer(t)&&(t=function(t){return u.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=s.defaultEncoding),"function"!=typeof n&&(n=S),s.ending?function(t,e){var n=new w;x(t,n),r.nextTick(e,n)}(this,n):(a||function(t,e,n,i){var s;return null===n?s=new v:"string"==typeof n||e.objectMode||(s=new p("chunk",["string","Buffer"],n)),!s||(x(t,s),r.nextTick(i,s),!1)}(this,s,t,n))&&(s.pendingcb++,o=function(t,e,r,n,i,s){if(!r){var o=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,r)),e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var a=e.objectMode?1:n.length;e.length+=a;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else k(t,e,!1,a,n,i,s);return l}(this,s,a,t,e,n)),o},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||E(this,t))},A.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new m("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,I(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n)),e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=h.destroy,A.prototype._undestroy=h.undestroy,A.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":477,"./_stream_duplex":478,"./internal/streams/destroy":485,"./internal/streams/state":489,"./internal/streams/stream":490,_process:467,buffer:220,inherits:440,"util-deprecate":524}],483:[function(t,e,r){(function(r){(function(){"use strict";var n;function i(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=t("./end-of-stream"),o=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),c=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function f(t,e){return{value:t,done:e}}function p(t){var e=t[o];if(null!==e){var r=t[d].read();null!==r&&(t[c]=null,t[o]=null,t[a]=null,e(f(r,!1)))}}function m(t){r.nextTick(p,t)}var b=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[u])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise((function(e,n){r.nextTick((function(){t[l]?n(t[l]):e(f(void 0,!0))}))}));var n,i=this[c];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[u]?r(f(void 0,!0)):e[h](r,n)}),n)}}(i,this));else{var s=this[d].read();if(null!==s)return Promise.resolve(f(s,!1));n=new Promise(this[h])}return this[c]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[d].destroy(null,(function(t){t?r(t):e(f(void 0,!0))}))}))})),n),b);e.exports=function(t){var e,r=Object.create(g,(i(e={},d,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,u,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var n=r[d].read();n?(r[c]=null,r[o]=null,r[a]=null,t(f(n,!1))):(r[o]=t,r[a]=e)},writable:!0}),e));return r[c]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[c]=null,r[o]=null,r[a]=null,e(t)),void(r[l]=t)}var n=r[o];null!==n&&(r[c]=null,r[o]=null,r[a]=null,n(f(void 0,!0))),r[u]=!0})),t.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":486,_process:467}],484:[function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var l=t("buffer").Buffer,u=t("util").inspect,c=u&&u.custom||"inspect";e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return l.alloc(0);for(var e,r,n,i=l.allocUnsafe(t>>>0),s=this.head,o=0;s;)e=s.data,r=i,n=o,l.prototype.copy.call(e,r,n),o+=s.data.length,s=s.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,s=t>i.length?i.length:t;if(s===i.length?n+=i:n+=i.slice(0,t),0==(t-=s)){s===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(s));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=l.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,s=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,s),0==(t-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,e}},{key:c,value:function(t,e){return u(this,i(i({},e),{},{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},{buffer:220,util:188}],485:[function(t,e,r){(function(t){(function(){"use strict";function r(t,e){i(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}e.exports={destroy:function(e,s){var o=this,a=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return a||l?(s?s(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!s&&e?o._writableState?o._writableState.errorEmitted?t.nextTick(n,o):(o._writableState.errorEmitted=!0,t.nextTick(r,o,e)):t.nextTick(r,o,e):s?(t.nextTick(n,o),s(e)):t.nextTick(n,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this)}).call(this,t("_process"))},{_process:467}],486:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function t(e,r,s){if("function"==typeof r)return t(e,null,r);r||(r={}),s=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(s||i);var o=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,l=function(){e.writable||c()},u=e._writableState&&e._writableState.finished,c=function(){a=!1,u=!0,o||s.call(e)},h=e._readableState&&e._readableState.endEmitted,d=function(){o=!1,h=!0,a||s.call(e)},f=function(t){s.call(e,t)},p=function(){var t;return o&&!h?(e._readableState&&e._readableState.ended||(t=new n),s.call(e,t)):a&&!u?(e._writableState&&e._writableState.ended||(t=new n),s.call(e,t)):void 0},m=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",p),e.req?m():e.on("request",m)):a&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",d),e.on("finish",c),!1!==r.error&&e.on("error",f),e.on("close",p),function(){e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",m),e.req&&e.req.removeListener("finish",c),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("end",d),e.removeListener("error",f),e.removeListener("close",p)}}},{"../../../errors":477}],487:[function(t,e,r){"use strict";e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],488:[function(t,e,r){"use strict";var n,i=t("../../../errors").codes,s=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function l(e,r,i,s){s=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(s);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=t("./end-of-stream")),n(e,{readable:r,writable:i},(function(t){if(t)return s(t);a=!0,s()}));var l=!1;return function(t){if(!a&&!l)return l=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new o("pipe"))}}function u(t){t()}function c(t,e){return t.pipe(e)}e.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=function(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new s("streams");var o=e.map((function(t,r){var s=r<e.length-1;return l(t,s,r>0,(function(t){n||(n=t),t&&o.forEach(u),s||(o.forEach(u),i(n))}))}));return e.reduce(c)}},{"../../../errors":477,"./end-of-stream":486}],489:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,i){var s=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(i?r:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},{"../../../errors":477}],490:[function(t,e,r){"use strict";e.exports=t("events").EventEmitter},{events:422}],491:[function(t,e,r){"use strict";(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js"),r.finished=t("./lib/internal/streams/end-of-stream.js"),r.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":478,"./lib/_stream_passthrough.js":479,"./lib/_stream_readable.js":480,"./lib/_stream_transform.js":481,"./lib/_stream_writable.js":482,"./lib/internal/streams/end-of-stream.js":486,"./lib/internal/streams/pipeline.js":488}],492:[function(t,e,r){"use strict";var n=function(t){var e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,i){var s=e&&e.prototype instanceof d?e:d,o=Object.create(s.prototype),a=new A(i||[]);return n(o,"_invoke",{value:_(t,r,a)}),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function d(){}function f(){}function p(){}var m={};l(m,s,(function(){return this}));var b=Object.getPrototypeOf,g=b&&b(b(k([])));g&&g!==e&&r.call(g,s)&&(m=g);var y=p.prototype=d.prototype=Object.create(m);function v(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var i;n(this,"_invoke",{value:function(n,s){function o(){return new e((function(i,o){!function n(i,s,o,a){var l=c(t[i],t,s);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,o,a)}),(function(t){n("throw",t,o,a)})):e.resolve(h).then((function(t){u.value=t,o(u)}),(function(t){return n("throw",t,o,a)}))}a(l.arg)}(n,s,i,o)}))}return i=i?i.then(o,o):o()}})}function _(t,e,r){var n="suspendedStart";return function(i,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw s;return{value:void 0,done:!0}}for(r.method=i,r.arg=s;;){var o=r.delegate;if(o){var a=x(o,r);if(a){if(a===h)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=c(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=c(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var s=i.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return f.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:f,configurable:!0}),f.displayName=l(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},v(w.prototype),l(w.prototype,o,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,i,s){void 0===s&&(s=Promise);var o=new w(u(e,r,n,i),s);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},v(y),l(y,a,"Generator"),l(y,s,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var a=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(a&&l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,h):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}("object"==typeof e?e.exports:{});try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},{}],493:[function(t,e,r){"use strict";var n=t("buffer").Buffer,i=t("inherits"),s=t("hash-base"),o=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],l=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],c=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],h=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function f(){s.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function m(t,e,r,n,i,s,o,a){return p(t+(e^r^n)+s+o|0,a)+i|0}function b(t,e,r,n,i,s,o,a){return p(t+(e&r|~e&n)+s+o|0,a)+i|0}function g(t,e,r,n,i,s,o,a){return p(t+((e|~r)^n)+s+o|0,a)+i|0}function y(t,e,r,n,i,s,o,a){return p(t+(e&n|r&~n)+s+o|0,a)+i|0}function v(t,e,r,n,i,s,o,a){return p(t+(e^(r|~n))+s+o|0,a)+i|0}i(f,s),f.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,f=0|this._e,w=0|this._a,_=0|this._b,x=0|this._c,S=0|this._d,C=0|this._e,A=0;A<80;A+=1){var k,T;A<16?(k=m(r,n,i,s,f,t[a[A]],h[0],u[A]),T=v(w,_,x,S,C,t[l[A]],d[0],c[A])):A<32?(k=b(r,n,i,s,f,t[a[A]],h[1],u[A]),T=y(w,_,x,S,C,t[l[A]],d[1],c[A])):A<48?(k=g(r,n,i,s,f,t[a[A]],h[2],u[A]),T=g(w,_,x,S,C,t[l[A]],d[2],c[A])):A<64?(k=y(r,n,i,s,f,t[a[A]],h[3],u[A]),T=b(w,_,x,S,C,t[l[A]],d[3],c[A])):(k=v(r,n,i,s,f,t[a[A]],h[4],u[A]),T=m(w,_,x,S,C,t[l[A]],d[4],c[A])),r=f,f=s,s=p(i,10),i=n,n=k,w=C,C=S,S=p(x,10),x=_,_=T}var E=this._b+i+S|0;this._b=this._c+s+C|0,this._c=this._d+f+w|0,this._d=this._e+r+_|0,this._e=this._a+n+x|0,this._a=E},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},e.exports=f},{buffer:220,"hash-base":425,inherits:440}],494:[function(t,e,r){"use strict";var n=t("buffer"),i=n.Buffer;function s(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(s(n,r),r.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:220}],495:[function(t,e,r){(function(r){(function(){"use strict";var n,i=t("buffer"),s=i.Buffer,o={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(o[n]=i[n]);var a=o.Buffer={};for(n in s)s.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(a[n]=s[n]);if(o.Buffer.prototype=s.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(t,e,r){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return s(t,e,r)}),a.alloc||(a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=s(t);return e&&0!==e.length?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n}),!o.kStringMaxLength)try{o.kStringMaxLength=r.binding("buffer").kStringMaxLength}catch(t){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),e.exports=o}).call(this)}).call(this,t("_process"))},{_process:467,buffer:220}],496:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("xmlchars/xml/1.0/ed5"),i=t("xmlchars/xml/1.1/ed2"),s=t("xmlchars/xmlns/1.0/ed3");var o=n.isS,a=n.isChar,l=n.isNameStartChar,u=n.isNameChar,c=n.S_LIST,h=n.NAME_RE,d=i.isChar,f=s.isNCNameStartChar,p=s.isNCNameChar,m=s.NC_NAME_RE;const b="http://www.w3.org/XML/1998/namespace",g="http://www.w3.org/2000/xmlns/",y={__proto__:null,xml:b,xmlns:g},v={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},w=t=>34===t||39===t,_=[34,39],x=[..._,91,62],S=[..._,60,93],C=[61,63,...c],A=[...c,62,38,60];function k(t,e,r){switch(e){case"xml":r!==b&&t.fail(`xml prefix must be bound to ${b}.`);break;case"xmlns":r!==g&&t.fail(`xmlns prefix must be bound to ${g}.`)}switch(r){case g:t.fail(""===e?`the default namespace may not be set to ${r}.`:`may not assign a prefix (even "xmlns") to the URI ${g}.`);break;case b:switch(e){case"xml":break;case"":t.fail(`the default namespace may not be set to ${r}.`);break;default:t.fail("may not assign the xml namespace to another prefix.")}}}const T=t=>m.test(t),E=t=>h.test(t);r.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];const M={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};r.SaxesParser=class{constructor(t){this.opt=null!=t?t:{},this.fragmentOpt=!!this.opt.fragment;const e=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=!1!==this.opt.position,this.fileName=this.opt.fileName,e){this.nameStartCheck=f,this.nameCheck=p,this.isName=T,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},y);const t=this.opt.additionalNamespaces;null!=t&&(function(t,e){for(const r of Object.keys(e))k(t,r,e[r])}(this,t),Object.assign(this.ns,t))}else this.nameStartCheck=l,this.nameCheck=u,this.isName=E,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var t;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=0,this.attribList=[];const{fragmentOpt:e}=this;this.state=e?13:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=e,this.xmlDeclPossible=!e,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:r}=this.opt;if(void 0===r){if(!0===this.opt.forceXMLVersion)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");r="1.0"}this.setXMLVersion(r),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(v),null===(t=this.readyHandler)||void 0===t||t.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,e){this[M[t]]=e}off(t){this[M[t]]=void 0}makeError(t){var e;let r=null!==(e=this.fileName)&&void 0!==e?e:"";return this.trackPosition&&(r.length>0&&(r+=":"),r+=`${this.line}:${this.column}`),r.length>0&&(r+=": "),new Error(r+t)}fail(t){const e=this.makeError(t),r=this.errorHandler;if(void 0===r)throw e;return r(e),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let e=!1;null===t?(e=!0,t=""):"object"==typeof t&&(t=t.toString()),void 0!==this.carriedFromPrevious&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let r=t.length;const n=t.charCodeAt(r-1);!e&&(13===n||n>=55296&&n<=56319)&&(this.carriedFromPrevious=t[r-1],r--,t=t.slice(0,r));const{stateTable:i}=this;for(this.chunk=t,this.i=0;this.i<r;)i[this.state].call(this);return this.chunkPosition+=r,e?this.end():this}close(){return this.write(null)}getCode10(){const{chunk:t,i:e}=this;if(this.prevI=e,this.i=e+1,e>=t.length)return-1;const r=t.charCodeAt(e);if(this.column++,r<55296){if(r>=32||9===r)return r;switch(r){case 10:return this.line++,this.column=0,this.positionAtNewLine=this.position,10;case 13:return 10===t.charCodeAt(e+1)&&(this.i=e+2),this.line++,this.column=0,this.positionAtNewLine=this.position,-2;default:return this.fail("disallowed character."),r}}if(r>56319)return r>=57344&&r<=65533||this.fail("disallowed character."),r;const n=65536+1024*(r-55296)+(t.charCodeAt(e+1)-56320);return this.i=e+2,n>1114111&&this.fail("disallowed character."),n}getCode11(){const{chunk:t,i:e}=this;if(this.prevI=e,this.i=e+1,e>=t.length)return-1;const r=t.charCodeAt(e);if(this.column++,r<55296){if(r>31&&r<127||r>159&&8232!==r||9===r)return r;switch(r){case 10:return this.line++,this.column=0,this.positionAtNewLine=this.position,10;case 13:{const r=t.charCodeAt(e+1);10!==r&&133!==r||(this.i=e+2)}case 133:case 8232:return this.line++,this.column=0,this.positionAtNewLine=this.position,-2;default:return this.fail("disallowed character."),r}}if(r>56319)return r>=57344&&r<=65533||this.fail("disallowed character."),r;const n=65536+1024*(r-55296)+(t.charCodeAt(e+1)-56320);return this.i=e+2,n>1114111&&this.fail("disallowed character."),n}getCodeNorm(){const t=this.getCode();return-2===t?10:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:e}=this;const{chunk:r}=this;for(;;){const n=this.getCode(),i=-2===n,s=i?10:n;if(-1===s||t.includes(s))return this.text+=r.slice(e,this.prevI),s;i&&(this.text+=r.slice(e,this.prevI)+"\n",e=this.i)}}captureToChar(t){let{i:e}=this;const{chunk:r}=this;for(;;){let n=this.getCode();switch(n){case-2:this.text+=r.slice(e,this.prevI)+"\n",e=this.i,n=10;break;case-1:return this.text+=r.slice(e),!1}if(n===t)return this.text+=r.slice(e,this.prevI),!0}}captureNameChars(){const{chunk:t,i:e}=this;for(;;){const r=this.getCode();if(-1===r)return this.name+=t.slice(e),-1;if(!u(r))return this.name+=t.slice(e,this.prevI),-2===r?10:r}}skipSpaces(){for(;;){const t=this.getCodeNorm();if(-1===t||!o(t))return t}}setXMLVersion(t){this.currentXMLVersion=t,"1.0"===t?(this.isChar=a,this.getCode=this.getCode10):(this.isChar=d,this.getCode=this.getCode11)}sBegin(){65279===this.chunk.charCodeAt(0)&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){const t=this.i,e=this.skipSpaces();switch(this.prevI!==t&&(this.xmlDeclPossible=!1),e){case 60:if(this.state=15,0!==this.text.length)throw new Error("no-empty text at start");break;case-1:break;default:this.unget(),this.state=13,this.xmlDeclPossible=!1}}sDoctype(){var t;const e=this.captureTo(x);switch(e){case 62:null===(t=this.doctypeHandler)||void 0===t||t.call(this,this.text),this.text="",this.state=13,this.doctype=!0;break;case-1:break;default:this.text+=String.fromCodePoint(e),91===e?this.state=4:w(e)&&(this.state=3,this.q=e)}}sDoctypeQuote(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.q=null,this.state=2)}sDTD(){const t=this.captureTo(S);-1!==t&&(this.text+=String.fromCodePoint(t),93===t?this.state=2:60===t?this.state=6:w(t)&&(this.state=5,this.q=t))}sDTDQuoted(){const t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.state=4,this.q=null)}sDTDOpenWaka(){const t=this.getCodeNorm();switch(this.text+=String.fromCodePoint(t),t){case 33:this.state=7,this.openWakaBang="";break;case 63:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){const t=String.fromCodePoint(this.getCodeNorm()),e=this.openWakaBang+=t;this.text+=t,"-"!==e&&(this.state="--"===e?8:4,this.openWakaBang="")}sDTDComment(){this.captureToChar(45)&&(this.text+="-",this.state=9)}sDTDCommentEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),this.state=45===t?10:8}sDTDCommentEnded(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),62===t?this.state=4:(this.fail("malformed comment."),this.state=8)}sDTDPI(){this.captureToChar(63)&&(this.text+="?",this.state=12)}sDTDPIEnding(){const t=this.getCodeNorm();this.text+=String.fromCodePoint(t),62===t&&(this.state=4)}sText(){0!==this.tags.length?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:t}=this;const{chunk:e}=this;t:for(;;)switch(this.getCode()){case-2:this.entity+=e.slice(t,this.prevI)+"\n",t=this.i;break;case 59:{const{entityReturnState:r}=this,n=this.entity+e.slice(t,this.prevI);let i;this.state=r,""===n?(this.fail("empty entity name."),i="&;"):(i=this.parseEntity(n),this.entity=""),13===r&&void 0===this.textHandler||(this.text+=i);break t}case-1:this.entity+=e.slice(t);break t}}sOpenWaka(){const t=this.getCode();if(l(t))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(t){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang="",this.xmlDeclPossible=!1;break;case 63:this.state=23;break;default:this.fail("disallowed character in tag name"),this.state=13,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=20,this.openWakaBang="";break;case"--":this.state=17,this.openWakaBang="";break;case"DOCTYPE":this.state=2,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(45)&&(this.state=18)}sCommentEnding(){var t;const e=this.getCodeNorm();45===e?(this.state=19,null===(t=this.commentHandler)||void 0===t||t.call(this,this.text),this.text=""):(this.text+="-"+String.fromCodePoint(e),this.state=17)}sCommentEnded(){const t=this.getCodeNorm();62!==t?(this.fail("malformed comment."),this.text+="--"+String.fromCodePoint(t),this.state=17):this.state=13}sCData(){this.captureToChar(93)&&(this.state=21)}sCDataEnding(){const t=this.getCodeNorm();93===t?this.state=22:(this.text+="]"+String.fromCodePoint(t),this.state=20)}sCDataEnding2(){var t;const e=this.getCodeNorm();switch(e){case 62:null===(t=this.cdataHandler)||void 0===t||t.call(this,this.text),this.text="",this.state=13;break;case 93:this.text+="]";break;default:this.text+="]]"+String.fromCodePoint(e),this.state=20}}sPIFirstChar(){const t=this.getCodeNorm();this.nameStartCheck(t)?(this.piTarget+=String.fromCodePoint(t),this.state=24):63===t||o(t)?(this.fail("processing instruction without a target."),this.state=63===t?26:25):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(t),this.state=24)}sPIRest(){const{chunk:t,i:e}=this;for(;;){const r=this.getCodeNorm();if(-1===r)return void(this.piTarget+=t.slice(e));if(!this.nameCheck(r)){this.piTarget+=t.slice(e,this.prevI);const n=63===r;n||o(r)?"xml"===this.piTarget?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=n?33:27):this.state=n?26:25:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(r));break}}}sPIBody(){if(0===this.text.length){const t=this.getCodeNorm();63===t?this.state=26:o(t)||(this.text=String.fromCodePoint(t))}else this.captureToChar(63)&&(this.state=26)}sPIEnding(){var t;const e=this.getCodeNorm();if(62===e){const{piTarget:e}=this;"xml"===e.toLowerCase()&&this.fail("the XML declaration must appear at the start of the document."),null===(t=this.piHandler)||void 0===t||t.call(this,{target:e,body:this.text}),this.piTarget=this.text="",this.state=13}else 63===e?this.text+="?":(this.text+="?"+String.fromCodePoint(e),this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const t=this.skipSpaces();63!==t?-1!==t&&(this.state=28,this.name=String.fromCodePoint(t)):this.state=33}sXMLDeclName(){const t=this.captureTo(C);if(63===t)return this.state=33,this.name+=this.text,this.text="",void this.fail("XML declaration is incomplete.");if(o(t)||61===t){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail("expected one of "+this.xmlDeclExpects.join(", "))}this.state=61===t?30:29}}sXMLDeclEq(){const t=this.getCodeNorm();if(63===t)return this.state=33,void this.fail("XML declaration is incomplete.");o(t)||(61!==t&&this.fail("value required."),this.state=30)}sXMLDeclValueStart(){const t=this.getCodeNorm();if(63===t)return this.state=33,void this.fail("XML declaration is incomplete.");o(t)||(w(t)?this.q=t:(this.fail("value must be quoted."),this.q=32),this.state=31)}sXMLDeclValue(){const t=this.captureTo([this.q,63]);if(63===t)return this.state=33,this.text="",void this.fail("XML declaration is incomplete.");if(-1===t)return;const e=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const t=e;this.xmlDecl.version=t,/^1\.[0-9]+$/.test(t)?this.opt.forceXMLVersion||this.setXMLVersion(t):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(e)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=e;break;case"standalone":"yes"!==e&&"no"!==e&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=e}this.name="",this.state=32}sXMLDeclSeparator(){const t=this.getCodeNorm();63!==t?(o(t)||(this.fail("whitespace required."),this.unget()),this.state=27):this.state=33}sXMLDeclEnding(){var t;62===this.getCodeNorm()?("xml"!==this.piTarget?this.fail("processing instructions are not allowed before root."):"version"!==this.name&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),null===(t=this.xmldeclHandler)||void 0===t||t.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=13):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var t;const e=this.captureNameChars();if(-1===e)return;const r=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=r.ns=Object.create(null)),null===(t=this.openTagStartHandler)||void 0===t||t.call(this,r),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),e){case 62:this.openTag();break;case 47:this.state=35;break;default:o(e)||this.fail("disallowed character in tag name."),this.state=36}}sOpenTagSlash(){62===this.getCode()?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=36)}sAttrib(){const t=this.skipSpaces();-1!==t&&(l(t)?(this.unget(),this.state=37):62===t?this.openTag():47===t?this.state=35:this.fail("disallowed character in attribute name."))}sAttribName(){const t=this.captureNameChars();61===t?this.state=39:o(t)?this.state=38:62===t?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):-1!==t&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const t=this.skipSpaces();switch(t){case-1:return;case 61:this.state=39;break;default:this.fail("attribute without value."),this.text="",this.name="",62===t?this.openTag():l(t)?(this.unget(),this.state=37):(this.fail("disallowed character in attribute name."),this.state=36)}}sAttribValue(){const t=this.getCodeNorm();w(t)?(this.q=t,this.state=40):o(t)||(this.fail("unquoted attribute value."),this.state=42,this.unget())}sAttribValueQuoted(){const{q:t,chunk:e}=this;let{i:r}=this;for(;;)switch(this.getCode()){case t:return this.pushAttrib(this.name,this.text+e.slice(r,this.prevI)),this.name=this.text="",this.q=null,void(this.state=41);case 38:return this.text+=e.slice(r,this.prevI),this.state=14,void(this.entityReturnState=40);case 10:case-2:case 9:this.text+=e.slice(r,this.prevI)+" ",r=this.i;break;case 60:return this.text+=e.slice(r,this.prevI),void this.fail("disallowed character.");case-1:return void(this.text+=e.slice(r))}}sAttribValueClosed(){const t=this.getCodeNorm();o(t)?this.state=36:62===t?this.openTag():47===t?this.state=35:l(t)?(this.fail("no whitespace between attributes."),this.unget(),this.state=37):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const t=this.captureTo(A);switch(t){case 38:this.state=14,this.entityReturnState=42;break;case 60:this.fail("disallowed character.");break;case-1:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",62===t?this.openTag():this.state=36}}sCloseTag(){const t=this.captureNameChars();62===t?this.closeTag():o(t)?this.state=44:-1!==t&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case 62:this.closeTag();break;case-1:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:t,forbiddenState:e}=this;const{chunk:r,textHandler:n}=this;t:for(;;)switch(this.getCode()){case 60:if(this.state=15,void 0!==n){const{text:e}=this,i=r.slice(t,this.prevI);0!==e.length?(n(e+i),this.text=""):0!==i.length&&n(i)}e=0;break t;case 38:this.state=14,this.entityReturnState=13,void 0!==n&&(this.text+=r.slice(t,this.prevI)),e=0;break t;case 93:switch(e){case 0:e=1;break;case 1:e=2;break;case 2:break;default:throw new Error("impossible state")}break;case 62:2===e&&this.fail('the string "]]>" is disallowed in char data.'),e=0;break;case-2:void 0!==n&&(this.text+=r.slice(t,this.prevI)+"\n"),t=this.i,e=0;break;case-1:void 0!==n&&(this.text+=r.slice(t));break t;default:e=0}this.forbiddenState=e}handleTextOutsideRoot(){let{i:t}=this;const{chunk:e,textHandler:r}=this;let n=!1;t:for(;;){const i=this.getCode();switch(i){case 60:if(this.state=15,void 0!==r){const{text:n}=this,i=e.slice(t,this.prevI);0!==n.length?(r(n+i),this.text=""):0!==i.length&&r(i)}break t;case 38:this.state=14,this.entityReturnState=13,void 0!==r&&(this.text+=e.slice(t,this.prevI)),n=!0;break t;case-2:void 0!==r&&(this.text+=e.slice(t,this.prevI)+"\n"),t=this.i;break;case-1:void 0!==r&&(this.text+=e.slice(t));break t;default:o(i)||(n=!0)}}n&&(this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(t,e){var r;const{prefix:n,local:i}=this.qname(t),s={name:t,prefix:n,local:i,value:e};if(this.attribList.push(s),null===(r=this.attributeHandler)||void 0===r||r.call(this,s),"xmlns"===n){const t=e.trim();"1.0"===this.currentXMLVersion&&""===t&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[i]=t,k(this,i,t)}else if("xmlns"===t){const t=e.trim();this.topNS[""]=t,k(this,"",t)}}pushAttribPlain(t,e){var r;const n={name:t,value:e};this.attribList.push(n),null===(r=this.attributeHandler)||void 0===r||r.call(this,n)}end(){var t,e;this.sawRoot||this.fail("document must contain a root element.");const{tags:r}=this;for(;r.length>0;){const t=r.pop();this.fail("unclosed tag: "+t.name)}0!==this.state&&13!==this.state&&this.fail("unexpected end.");const{text:n}=this;return 0!==n.length&&(null===(t=this.textHandler)||void 0===t||t.call(this,n),this.text=""),this._closed=!0,null===(e=this.endHandler)||void 0===e||e.call(this),this._init(),this}resolve(t){var e,r;let n=this.topNS[t];if(void 0!==n)return n;const{tags:i}=this;for(let e=i.length-1;e>=0;e--)if(n=i[e].ns[t],void 0!==n)return n;return n=this.ns[t],void 0!==n?n:null===(r=(e=this.opt).resolvePrefix)||void 0===r?void 0:r.call(e,t)}qname(t){const e=t.indexOf(":");if(-1===e)return{prefix:"",local:t};const r=t.slice(e+1),n=t.slice(0,e);return(""===n||""===r||r.includes(":"))&&this.fail(`malformed name: ${t}.`),{prefix:n,local:r}}processAttribsNS(){var t;const{attribList:e}=this,r=this.tag;{const{prefix:e,local:n}=this.qname(r.name);r.prefix=e,r.local=n;const i=r.uri=null!==(t=this.resolve(e))&&void 0!==t?t:"";""!==e&&("xmlns"===e&&this.fail('tags may not have "xmlns" as prefix.'),""===i&&(this.fail(`unbound namespace prefix: ${JSON.stringify(e)}.`),r.uri=e))}if(0===e.length)return;const{attributes:n}=r,i=new Set;for(const t of e){const{name:e,prefix:r,local:s}=t;let o,a;""===r?(o="xmlns"===e?g:"",a=e):(o=this.resolve(r),void 0===o&&(this.fail(`unbound namespace prefix: ${JSON.stringify(r)}.`),o=r),a=`{${o}}${s}`),i.has(a)&&this.fail(`duplicate attribute: ${a}.`),i.add(a),t.uri=o,n[e]=t}this.attribList=[]}processAttribsPlain(){const{attribList:t}=this,e=this.tag.attributes;for(const{name:r,value:n}of t)void 0!==e[r]&&this.fail(`duplicate attribute: ${r}.`),e[r]=n;this.attribList=[]}openTag(){var t;this.processAttribs();const{tags:e}=this,r=this.tag;r.isSelfClosing=!1,null===(t=this.openTagHandler)||void 0===t||t.call(this,r),e.push(r),this.state=13,this.name=""}openSelfClosingTag(){var t,e,r;this.processAttribs();const{tags:n}=this,i=this.tag;i.isSelfClosing=!0,null===(t=this.openTagHandler)||void 0===t||t.call(this,i),null===(e=this.closeTagHandler)||void 0===e||e.call(this,i),null===(this.tag=null!==(r=n[n.length-1])&&void 0!==r?r:null)&&(this.closedRoot=!0),this.state=13,this.name=""}closeTag(){const{tags:t,name:e}=this;if(this.state=13,this.name="",""===e)return this.fail("weird empty close tag."),void(this.text+="</>");const r=this.closeTagHandler;let n=t.length;for(;n-- >0;){const n=this.tag=t.pop();if(this.topNS=n.ns,null==r||r(n),n.name===e)break;this.fail("unexpected close tag.")}0===n?this.closedRoot=!0:n<0&&(this.fail(`unmatched closing tag: ${e}.`),this.text+=`</${e}>`)}parseEntity(t){if("#"!==t[0]){const e=this.ENTITIES[t];return void 0!==e?e:(this.fail(this.isName(t)?"undefined entity.":"disallowed character in entity name."),`&${t};`)}let e=NaN;return"x"===t[1]&&/^#x[0-9a-f]+$/i.test(t)?e=parseInt(t.slice(2),16):/^#[0-9]+$/.test(t)&&(e=parseInt(t.slice(1),10)),this.isChar(e)?String.fromCodePoint(e):(this.fail("malformed character entity."),`&${t};`)}}},{"xmlchars/xml/1.0/ed5":543,"xmlchars/xml/1.1/ed2":544,"xmlchars/xmlns/1.0/ed3":545}],497:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,s=t.length,o=this._len,a=0;a<s;){for(var l=o%i,u=Math.min(s-a,i-l),c=0;c<u;c++)r[l+c]=t[a+c];a+=u,(o+=u)%i==0&&this._update(r)}return this._len+=s,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},{"safe-buffer":494}],498:[function(t,e,r){"use strict";var n=e.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=t("./sha"),n.sha1=t("./sha1"),n.sha224=t("./sha224"),n.sha256=t("./sha256"),n.sha384=t("./sha384"),n.sha512=t("./sha512")},{"./sha":499,"./sha1":500,"./sha224":501,"./sha256":502,"./sha384":503,"./sha512":504}],499:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./hash"),s=t("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function l(){this.init(),this._w=a,i.call(this,64,56)}function u(t){return t<<30|t>>>2}function c(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(l,i),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},l.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,s=0|this._c,a=0|this._d,l=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var d=0;d<80;++d){var f=~~(d/20),p=0|((e=n)<<5|e>>>27)+c(f,i,s,a)+l+r[d]+o[f];l=a,a=s,s=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=l+this._e|0},l.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=l},{"./hash":497,inherits:440,"safe-buffer":494}],500:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./hash"),s=t("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function l(){this.init(),this._w=a,i.call(this,64,56)}function u(t){return t<<5|t>>>27}function c(t){return t<<30|t>>>2}function h(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(l,i),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},l.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,s=0|this._c,a=0|this._d,l=0|this._e,d=0;d<16;++d)r[d]=t.readInt32BE(4*d);for(;d<80;++d)r[d]=(e=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|e>>>31;for(var f=0;f<80;++f){var p=~~(f/20),m=u(n)+h(p,i,s,a)+l+r[f]+o[p]|0;l=a,a=s,s=c(i),i=n,n=m}this._a=n+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=l+this._e|0},l.prototype._hash=function(){var t=s.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=l},{"./hash":497,inherits:440,"safe-buffer":494}],501:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./sha256"),s=t("./hash"),o=t("safe-buffer").Buffer,a=new Array(64);function l(){this.init(),this._w=a,s.call(this,64,56)}n(l,i),l.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},l.prototype._hash=function(){var t=o.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=l},{"./hash":497,"./sha256":502,inherits:440,"safe-buffer":494}],502:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./hash"),s=t("safe-buffer").Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function l(){this.init(),this._w=a,i.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function h(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function d(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function f(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(l,i),l.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},l.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,s=0|this._c,a=0|this._d,l=0|this._e,p=0|this._f,m=0|this._g,b=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+f(r[g-15])+r[g-16];for(var y=0;y<64;++y){var v=b+d(l)+u(l,p,m)+o[y]+r[y]|0,w=h(n)+c(n,i,s)|0;b=m,m=p,p=l,l=a+v|0,a=s,s=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=l+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=b+this._h|0},l.prototype._hash=function(){var t=s.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=l},{"./hash":497,inherits:440,"safe-buffer":494}],503:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./sha512"),s=t("./hash"),o=t("safe-buffer").Buffer,a=new Array(160);function l(){this.init(),this._w=a,s.call(this,128,112)}n(l,i),l.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},l.prototype._hash=function(){var t=o.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},e.exports=l},{"./hash":497,"./sha512":504,inherits:440,"safe-buffer":494}],504:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./hash"),s=t("safe-buffer").Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function l(){this.init(),this._w=a,i.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function f(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0<e>>>0?1:0}n(l,i),l.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},l.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,s=0|this._dh,a=0|this._eh,l=0|this._fh,y=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,x=0|this._cl,S=0|this._dl,C=0|this._el,A=0|this._fl,k=0|this._gl,T=0|this._hl,E=0;E<32;E+=2)e[E]=t.readInt32BE(4*E),e[E+1]=t.readInt32BE(4*E+4);for(;E<160;E+=2){var M=e[E-30],R=e[E-30+1],I=f(M,R),O=p(R,M),j=m(M=e[E-4],R=e[E-4+1]),P=b(R,M),N=e[E-14],B=e[E-14+1],F=e[E-32],D=e[E-32+1],L=O+B|0,V=I+N+g(L,O)|0;V=(V=V+j+g(L=L+P|0,P)|0)+F+g(L=L+D|0,D)|0,e[E]=V,e[E+1]=L}for(var z=0;z<160;z+=2){V=e[z],L=e[z+1];var U=c(r,n,i),$=c(w,_,x),H=h(r,w),W=h(w,r),q=d(a,C),Y=d(C,a),X=o[z],G=o[z+1],K=u(a,l,y),Z=u(C,A,k),J=T+Y|0,Q=v+q+g(J,T)|0;Q=(Q=(Q=Q+K+g(J=J+Z|0,Z)|0)+X+g(J=J+G|0,G)|0)+V+g(J=J+L|0,L)|0;var tt=W+$|0,et=H+U+g(tt,W)|0;v=y,T=k,y=l,k=A,l=a,A=C,a=s+Q+g(C=S+J|0,S)|0,s=i,S=x,i=n,x=_,n=r,_=w,r=Q+et+g(w=J+tt|0,J)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+x|0,this._dl=this._dl+S|0,this._el=this._el+C|0,this._fl=this._fl+A|0,this._gl=this._gl+k|0,this._hl=this._hl+T|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,_)|0,this._ch=this._ch+i+g(this._cl,x)|0,this._dh=this._dh+s+g(this._dl,S)|0,this._eh=this._eh+a+g(this._el,C)|0,this._fh=this._fh+l+g(this._fl,A)|0,this._gh=this._gh+y+g(this._gl,k)|0,this._hh=this._hh+v+g(this._hl,T)|0},l.prototype._hash=function(){var t=s.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},e.exports=l},{"./hash":497,inherits:440,"safe-buffer":494}],505:[function(t,e,r){"use strict";e.exports=i;var n=t("events").EventEmitter;function i(){n.call(this)}t("inherits")(i,n),i.Readable=t("readable-stream/readable.js"),i.Writable=t("readable-stream/writable.js"),i.Duplex=t("readable-stream/duplex.js"),i.Transform=t("readable-stream/transform.js"),i.PassThrough=t("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function s(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",s),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",l));var o=!1;function a(){o||(o=!0,t.end())}function l(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(c(),0===n.listenerCount(this,"error"))throw t}function c(){r.removeListener("data",i),t.removeListener("drain",s),r.removeListener("end",a),r.removeListener("close",l),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",u),t.on("error",u),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},{events:422,inherits:440,"readable-stream/duplex.js":507,"readable-stream/passthrough.js":516,"readable-stream/readable.js":517,"readable-stream/transform.js":518,"readable-stream/writable.js":519}],506:[function(t,e,r){"use strict";var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],507:[function(t,e,r){"use strict";e.exports=t("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":508}],508:[function(t,e,r){"use strict";var n=t("process-nextick-args"),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=h;var s=Object.create(t("core-util-is"));s.inherits=t("inherits");var o=t("./_stream_readable"),a=t("./_stream_writable");s.inherits(h,o);for(var l=i(a.prototype),u=0;u<l.length;u++){var c=l[u];h.prototype[c]||(h.prototype[c]=a.prototype[c])}function h(t){if(!(this instanceof h))return new h(t);o.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),h.prototype._destroy=function(t,e){this.push(null),this.end(),n.nextTick(e,t)}},{"./_stream_readable":510,"./_stream_writable":512,"core-util-is":383,inherits:440,"process-nextick-args":466}],509:[function(t,e,r){"use strict";e.exports=s;var n=t("./_stream_transform"),i=Object.create(t("core-util-is"));function s(t){if(!(this instanceof s))return new s(t);n.call(this,t)}i.inherits=t("inherits"),i.inherits(s,n),s.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":511,"core-util-is":383,inherits:440}],510:[function(t,e,n){(function(r,n){(function(){"use strict";var i=t("process-nextick-args");e.exports=v;var s,o=t("isarray");v.ReadableState=y,t("events").EventEmitter;var a=function(t,e){return t.listeners(e).length},l=t("./internal/streams/stream"),u=t("safe-buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},h=Object.create(t("core-util-is"));h.inherits=t("inherits");var d=t("util"),f=void 0;f=d&&d.debuglog?d.debuglog("stream"):function(){};var p,m=t("./internal/streams/BufferList"),b=t("./internal/streams/destroy");h.inherits(v,l);var g=["error","close","destroy","pause","resume"];function y(e,r){e=e||{};var n=r instanceof(s=s||t("./_stream_duplex"));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,o=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=t("string_decoder/").StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(s=s||t("./_stream_duplex"),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),l.call(this)}function w(t,e,r,n,i){var s,o=t._readableState;return null===e?(o.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}}(t,o)):(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(o,e)),s?t.emit("error",s):o.objectMode||e&&e.length>0?("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n?o.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,o,e,!0):o.ended?t.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?_(t,o,e,!1):A(t,o)):_(t,o,e,!1))):n||(o.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(o)}function _(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&S(t)),A(t,e)}function x(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(C,t):C(t))}function C(t){f("emit readable"),t.emit("readable"),M(t)}function A(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(k,t,e))}function k(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(f("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function T(t){f("readable nexttick read 0"),t.read(0)}function E(t,e){e.reading||(f("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),M(t),e.flowing&&!e.reading&&t.read(0)}function M(t){var e=t._readableState;for(f("flow",e.flowing);e.flowing&&null!==t.read(););}function R(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;return t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,n=1,i=r.data;for(t-=i.length;r=r.next;){var s=r.data,o=t>s.length?s.length:t;if(o===s.length?i+=s:i+=s.slice(0,t),0==(t-=o)){o===s.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=s.slice(o));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=u.allocUnsafe(t),n=e.head,i=1;for(n.data.copy(r),t-=n.data.length;n=n.next;){var s=n.data,o=t>s.length?s.length:t;if(s.copy(r,r.length-t,0,o),0==(t-=o)){o===s.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=s.slice(o));break}++i}return e.length-=i,r}(t,e),n}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(O,e,t))}function O(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function j(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(t,e){this.push(null),e(t)},v.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=u.from(t,e),e=""),r=!0),w(this,t,e,!1,r)},v.prototype.unshift=function(t){return w(this,t,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=t("string_decoder/").StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this},v.prototype.read=function(t){f("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):S(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&I(this),null;var n,i=e.needReadable;return f("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&f("length less than watermark",i=!0),e.ended||e.reading?f("reading or ended",i=!1):i&&(f("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=x(r,e))),null===(n=t>0?R(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(t,e){var n=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,f("pipe count=%d opts=%j",s.pipesCount,e);var l=e&&!1===e.end||t===r.stdout||t===r.stderr?y:u;function u(){f("onend"),t.end()}s.endEmitted?i.nextTick(l):n.once("end",l),t.on("unpipe",(function e(r,i){f("onunpipe"),r===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,f("cleanup"),t.removeListener("close",b),t.removeListener("finish",g),t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",e),n.removeListener("end",u),n.removeListener("end",y),n.removeListener("data",p),h=!0,!s.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,M(t))}}(n);t.on("drain",c);var h=!1,d=!1;function p(e){f("ondata"),d=!1,!1!==t.write(e)||d||((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==j(s.pipes,t))&&!h&&(f("false write response, pause",s.awaitDrain),s.awaitDrain++,d=!0),n.pause())}function m(e){f("onerror",e),y(),t.removeListener("error",m),0===a(t,"error")&&t.emit("error",e)}function b(){t.removeListener("finish",g),y()}function g(){f("onfinish"),t.removeListener("close",b),y()}function y(){f("unpipe"),n.unpipe(t)}return n.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?o(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",b),t.once("finish",g),t.emit("pipe",n),s.flowing||(f("pipe resume"),n.resume()),t},v.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=j(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},v.prototype.on=function(t,e){var r=l.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&S(this):i.nextTick(T,this))}return r},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var t=this._readableState;return t.flowing||(f("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(E,t,e))}(this,t)),this},v.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(f("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){f("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s<g.length;s++)t.on(g[s],this.emit.bind(this,g[s]));return this._read=function(e){f("wrapped _read",e),n&&(n=!1,t.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=R}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":508,"./internal/streams/BufferList":513,"./internal/streams/destroy":514,"./internal/streams/stream":515,_process:467,"core-util-is":383,events:422,inherits:440,isarray:506,"process-nextick-args":466,"safe-buffer":520,"string_decoder/":521,util:188}],511:[function(t,e,r){"use strict";e.exports=o;var n=t("./_stream_duplex"),i=Object.create(t("core-util-is"));function s(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function o(t){if(!(this instanceof o))return new o(t);n.call(this,t),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",a)}function a(){var t=this;"function"==typeof this._flush?this._flush((function(e,r){l(t,e,r)})):l(this,null,null)}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=t("inherits"),i.inherits(o,n),o.prototype.push=function(t,e){return this._transformState.needTransform=!1,n.prototype.push.call(this,t,e)},o.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},o.prototype._destroy=function(t,e){var r=this;n.prototype._destroy.call(this,t,(function(t){e(t),r.emit("close")}))}},{"./_stream_duplex":508,"core-util-is":383,inherits:440}],512:[function(t,e,n){(function(r,n,i){(function(){"use strict";var s=t("process-nextick-args");function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}e.exports=y;var a,l=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:s.nextTick;y.WritableState=g;var u=Object.create(t("core-util-is"));u.inherits=t("inherits");var c,h={deprecate:t("util-deprecate")},d=t("./internal/streams/stream"),f=t("safe-buffer").Buffer,p=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},m=t("./internal/streams/destroy");function b(){}function g(e,r){a=a||t("./_stream_duplex"),e=e||{};var n=r instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(s.nextTick(i,n),s.nextTick(C,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),C(t,e))}(t,r,n,e,i);else{var o=x(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||_(t,r),n?l(w,t,r,o,i):w(t,r,o,i)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(a=a||t("./_stream_duplex"),!(c.call(y,this)||this instanceof a))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),d.call(this)}function v(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function w(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),C(t,e)}function _(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,l=!0;r;)i[a]=r,r.isBuf||(l=!1),r=r.next,a+=1;i.allBuffers=l,v(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,h=r.callback;if(v(t,e,!1,e.objectMode?1:u.length,u,c,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function x(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),C(t,e)}))}function C(t,e){var r=x(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,s.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(y,d),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:h.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!c.call(this,t)||this===y&&t&&t._writableState instanceof g}})):c=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var n,i=this._writableState,o=!1,a=!i.objectMode&&(n=t,f.isBuffer(n)||n instanceof p);return a&&!f.isBuffer(t)&&(t=function(t){return f.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=b),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),s.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),s.nextTick(n,o),i=!1),i}(this,i,t,r))&&(i.pendingcb++,o=function(t,e,r,n,i,s){if(!r){var o=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=f.from(e,r)),e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var a=e.objectMode?1:n.length;e.length+=a;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else v(t,e,!1,a,n,i,s);return l}(this,i,a,t,e,r)),o},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||_(this,t))},y.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,C(t,e),r&&(e.finished?s.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{"./_stream_duplex":508,"./internal/streams/destroy":514,"./internal/streams/stream":515,_process:467,"core-util-is":383,inherits:440,"process-nextick-args":466,"safe-buffer":520,timers:523,"util-deprecate":524}],513:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("util");e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);for(var e,r,i=n.allocUnsafe(t>>>0),s=this.head,o=0;s;)e=i,r=o,s.data.copy(e,r),o+=s.data.length,s=s.next;return i},t}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":520,util:188}],514:[function(t,e,r){"use strict";var n=t("process-nextick-args");function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,s=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return s||o?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,t)):n.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":466}],515:[function(t,e,r){arguments[4][490][0].apply(r,arguments)},{dup:490,events:422}],516:[function(t,e,r){"use strict";e.exports=t("./readable").PassThrough},{"./readable":517}],517:[function(t,e,r){"use strict";(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":508,"./lib/_stream_passthrough.js":509,"./lib/_stream_readable.js":510,"./lib/_stream_transform.js":511,"./lib/_stream_writable.js":512}],518:[function(t,e,r){"use strict";e.exports=t("./readable").Transform},{"./readable":517}],519:[function(t,e,r){"use strict";e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":512}],520:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{buffer:220,dup:217}],521:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218,"safe-buffer":520}],522:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218,"safe-buffer":494}],523:[function(t,e,r){(function(e,n){(function(){"use strict";var i=t("process/browser.js").nextTick,s=Function.prototype.apply,o=Array.prototype.slice,a={},l=0;function u(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new u(s.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new u(s.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return a[e]=!0,i((function(){a[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete a[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":467,timers:523}],524:[function(t,e,n){(function(t){(function(){"use strict";function r(e){try{if(!t.localStorage)return!1}catch(t){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],525:[function(t,e,r){"use strict";"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],526:[function(t,e,r){"use strict";e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],527:[function(t,e,n){(function(e,r){(function(){"use strict";var i=/%[sdj%]/g;n.format=function(t){if(!g(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(a(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,s=n.length,o=String(t).replace(i,(function(t){if("%%"===t)return"%";if(r>=s)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),l=n[r];r<s;l=n[++r])m(l)||!w(l)?o+=" "+l:o+=" "+a(l);return o},n.deprecate=function(t,i){if(y(r.process))return function(){return n.deprecate(t,i).apply(this,arguments)};if(!0===e.noDeprecation)return t;var s=!1;return function(){if(!s){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),s=!0}return t.apply(this,arguments)}};var s,o={};function a(t,e){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(e)?r.showHidden=e:e&&n._extend(r,e),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),c(r,t,r.depth)}function l(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function u(t,e){return t}function c(t,e,r){if(t.customInspect&&e&&S(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return g(i)||(i=c(t,i,r)),i}var s=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,e);if(s)return s;var o=Object.keys(e),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),x(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(e);if(0===o.length){if(S(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(v(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(x(e))return h(e)}var u,w="",C=!1,A=["{","}"];return f(e)&&(C=!0,A=["[","]"]),S(e)&&(w=" [Function"+(e.name?": "+e.name:"")+"]"),v(e)&&(w=" "+RegExp.prototype.toString.call(e)),_(e)&&(w=" "+Date.prototype.toUTCString.call(e)),x(e)&&(w=" "+h(e)),0!==o.length||C&&0!=e.length?r<0?v(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=C?function(t,e,r,n,i){for(var s=[],o=0,a=e.length;o<a;++o)T(e,String(o))?s.push(d(t,e,r,n,String(o),!0)):s.push("");return i.forEach((function(i){i.match(/^\d+$/)||s.push(d(t,e,r,n,i,!0))})),s}(t,e,r,a,o):o.map((function(n){return d(t,e,r,a,n,C)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,w,A)):A[0]+w+A[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,s){var o,a,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(a=t.stylize("[Setter]","special")),T(n,i)||(o="["+i+"]"),a||(t.seen.indexOf(l.value)<0?(a=m(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),y(o)){if(s&&i.match(/^\d+$/))return a;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function f(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function v(t){return w(t)&&"[object RegExp]"===C(t)}function w(t){return"object"==typeof t&&null!==t}function _(t){return w(t)&&"[object Date]"===C(t)}function x(t){return w(t)&&("[object Error]"===C(t)||t instanceof Error)}function S(t){return"function"==typeof t}function C(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}n.debuglog=function(t){if(y(s)&&(s=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(s)){var r=e.pid;o[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else o[t]=function(){};return o[t]},n.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=f,n.isBoolean=p,n.isNull=m,n.isNullOrUndefined=function(t){return null==t},n.isNumber=b,n.isString=g,n.isSymbol=function(t){return"symbol"==typeof t},n.isUndefined=y,n.isRegExp=v,n.isObject=w,n.isDate=_,n.isError=x,n.isFunction=S,n.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},n.isBuffer=t("./support/isBuffer");var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n.log=function(){console.log("%s - %s",function(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),k[t.getMonth()],e].join(" ")}(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":526,_process:467,inherits:525}],528:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return h.default}});var n=d(t("./v1.js")),i=d(t("./v3.js")),s=d(t("./v4.js")),o=d(t("./v5.js")),a=d(t("./nil.js")),l=d(t("./version.js")),u=d(t("./validate.js")),c=d(t("./stringify.js")),h=d(t("./parse.js"));function d(t){return t&&t.__esModule?t:{default:t}}},{"./nil.js":530,"./parse.js":531,"./stringify.js":535,"./v1.js":536,"./v3.js":537,"./v4.js":539,"./v5.js":540,"./validate.js":541,"./version.js":542}],529:[function(t,e,r){"use strict";function n(t){return 14+(t+64>>>9<<4)+1}function i(t,e){const r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function s(t,e,r,n,s,o){return i((a=i(i(e,t),i(n,o)))<<(l=s)|a>>>32-l,r);var a,l}function o(t,e,r,n,i,o,a){return s(e&r|~e&n,t,e,i,o,a)}function a(t,e,r,n,i,o,a){return s(e&n|r&~n,t,e,i,o,a)}function l(t,e,r,n,i,o,a){return s(e^r^n,t,e,i,o,a)}function u(t,e,r,n,i,o,a){return s(r^(e|~n),t,e,i,o,a)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default=function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return function(t){const e=[],r=32*t.length;for(let n=0;n<r;n+=8){const r=t[n>>5]>>>n%32&255,i=parseInt("0123456789abcdef".charAt(r>>>4&15)+"0123456789abcdef".charAt(15&r),16);e.push(i)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[n(e)-1]=e;let r=1732584193,s=-271733879,c=-1732584194,h=271733878;for(let e=0;e<t.length;e+=16){const n=r,d=s,f=c,p=h;r=o(r,s,c,h,t[e],7,-680876936),h=o(h,r,s,c,t[e+1],12,-389564586),c=o(c,h,r,s,t[e+2],17,606105819),s=o(s,c,h,r,t[e+3],22,-1044525330),r=o(r,s,c,h,t[e+4],7,-176418897),h=o(h,r,s,c,t[e+5],12,1200080426),c=o(c,h,r,s,t[e+6],17,-1473231341),s=o(s,c,h,r,t[e+7],22,-45705983),r=o(r,s,c,h,t[e+8],7,1770035416),h=o(h,r,s,c,t[e+9],12,-1958414417),c=o(c,h,r,s,t[e+10],17,-42063),s=o(s,c,h,r,t[e+11],22,-1990404162),r=o(r,s,c,h,t[e+12],7,1804603682),h=o(h,r,s,c,t[e+13],12,-40341101),c=o(c,h,r,s,t[e+14],17,-1502002290),s=o(s,c,h,r,t[e+15],22,1236535329),r=a(r,s,c,h,t[e+1],5,-165796510),h=a(h,r,s,c,t[e+6],9,-1069501632),c=a(c,h,r,s,t[e+11],14,643717713),s=a(s,c,h,r,t[e],20,-373897302),r=a(r,s,c,h,t[e+5],5,-701558691),h=a(h,r,s,c,t[e+10],9,38016083),c=a(c,h,r,s,t[e+15],14,-660478335),s=a(s,c,h,r,t[e+4],20,-405537848),r=a(r,s,c,h,t[e+9],5,568446438),h=a(h,r,s,c,t[e+14],9,-1019803690),c=a(c,h,r,s,t[e+3],14,-187363961),s=a(s,c,h,r,t[e+8],20,1163531501),r=a(r,s,c,h,t[e+13],5,-1444681467),h=a(h,r,s,c,t[e+2],9,-51403784),c=a(c,h,r,s,t[e+7],14,1735328473),s=a(s,c,h,r,t[e+12],20,-1926607734),r=l(r,s,c,h,t[e+5],4,-378558),h=l(h,r,s,c,t[e+8],11,-2022574463),c=l(c,h,r,s,t[e+11],16,1839030562),s=l(s,c,h,r,t[e+14],23,-35309556),r=l(r,s,c,h,t[e+1],4,-1530992060),h=l(h,r,s,c,t[e+4],11,1272893353),c=l(c,h,r,s,t[e+7],16,-155497632),s=l(s,c,h,r,t[e+10],23,-1094730640),r=l(r,s,c,h,t[e+13],4,681279174),h=l(h,r,s,c,t[e],11,-358537222),c=l(c,h,r,s,t[e+3],16,-722521979),s=l(s,c,h,r,t[e+6],23,76029189),r=l(r,s,c,h,t[e+9],4,-640364487),h=l(h,r,s,c,t[e+12],11,-421815835),c=l(c,h,r,s,t[e+15],16,530742520),s=l(s,c,h,r,t[e+2],23,-995338651),r=u(r,s,c,h,t[e],6,-198630844),h=u(h,r,s,c,t[e+7],10,1126891415),c=u(c,h,r,s,t[e+14],15,-1416354905),s=u(s,c,h,r,t[e+5],21,-57434055),r=u(r,s,c,h,t[e+12],6,1700485571),h=u(h,r,s,c,t[e+3],10,-1894986606),c=u(c,h,r,s,t[e+10],15,-1051523),s=u(s,c,h,r,t[e+1],21,-2054922799),r=u(r,s,c,h,t[e+8],6,1873313359),h=u(h,r,s,c,t[e+15],10,-30611744),c=u(c,h,r,s,t[e+6],15,-1560198380),s=u(s,c,h,r,t[e+13],21,1309151649),r=u(r,s,c,h,t[e+4],6,-145523070),h=u(h,r,s,c,t[e+11],10,-1120210379),c=u(c,h,r,s,t[e+2],15,718787259),s=u(s,c,h,r,t[e+9],21,-343485551),r=i(r,n),s=i(s,d),c=i(c,f),h=i(h,p)}return[r,s,c,h]}(function(t){if(0===t.length)return[];const e=8*t.length,r=new Uint32Array(n(e));for(let n=0;n<e;n+=8)r[n>>5]|=(255&t[n/8])<<n%32;return r}(t),8*t.length))}},{}],530:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default="00000000-0000-0000-0000-000000000000"},{}],531:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=t("./validate.js"))&&n.__esModule?n:{default:n};r.default=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");let e;const r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r}},{"./validate.js":541}],532:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},{}],533:[function(t,e,r){"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)};const i=new Uint8Array(16)},{}],534:[function(t,e,r){"use strict";function n(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}function i(t,e){return t<<e|t>>>32-e}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default=function(t){const e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const s=t.length/4+2,o=Math.ceil(s/16),a=new Array(o);for(let e=0;e<o;++e){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=t[64*e+4*n]<<24|t[64*e+4*n+1]<<16|t[64*e+4*n+2]<<8|t[64*e+4*n+3];a[e]=r}a[o-1][14]=8*(t.length-1)/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const s=new Uint32Array(80);for(let e=0;e<16;++e)s[e]=a[t][e];for(let t=16;t<80;++t)s[t]=i(s[t-3]^s[t-8]^s[t-14]^s[t-16],1);let o=r[0],l=r[1],u=r[2],c=r[3],h=r[4];for(let t=0;t<80;++t){const r=Math.floor(t/20),a=i(o,5)+n(r,l,u,c)+h+e[r]+s[t]>>>0;h=c,c=u,u=i(l,30)>>>0,l=o,o=a}r[0]=r[0]+o>>>0,r[1]=r[1]+l>>>0,r[2]=r[2]+u>>>0,r[3]=r[3]+c>>>0,r[4]=r[4]+h>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}},{}],535:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=t("./validate.js"))&&n.__esModule?n:{default:n};const s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).substr(1));r.default=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase();if(!(0,i.default)(r))throw TypeError("Stringified UUID is invalid");return r}},{"./validate.js":541}],536:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(t("./rng.js")),i=s(t("./stringify.js"));function s(t){return t&&t.__esModule?t:{default:t}}let o,a,l=0,u=0;r.default=function(t,e,r){let s=e&&r||0;const c=e||new Array(16);let h=(t=t||{}).node||o,d=void 0!==t.clockseq?t.clockseq:a;if(null==h||null==d){const e=t.random||(t.rng||n.default)();null==h&&(h=o=[1|e[0],e[1],e[2],e[3],e[4],e[5]]),null==d&&(d=a=16383&(e[6]<<8|e[7]))}let f=void 0!==t.msecs?t.msecs:Date.now(),p=void 0!==t.nsecs?t.nsecs:u+1;const m=f-l+(p-u)/1e4;if(m<0&&void 0===t.clockseq&&(d=d+1&16383),(m<0||f>l)&&void 0===t.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=f,u=p,a=d,f+=122192928e5;const b=(1e4*(268435455&f)+p)%4294967296;c[s++]=b>>>24&255,c[s++]=b>>>16&255,c[s++]=b>>>8&255,c[s++]=255&b;const g=f/4294967296*1e4&268435455;c[s++]=g>>>8&255,c[s++]=255&g,c[s++]=g>>>24&15|16,c[s++]=g>>>16&255,c[s++]=d>>>8|128,c[s++]=255&d;for(let t=0;t<6;++t)c[s+t]=h[t];return e||(0,i.default)(c)}},{"./rng.js":533,"./stringify.js":535}],537:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(t("./v35.js")),i=s(t("./md5.js"));function s(t){return t&&t.__esModule?t:{default:t}}var o=(0,n.default)("v3",48,i.default);r.default=o},{"./md5.js":529,"./v35.js":538}],538:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(t,e,r){function s(t,s,o,a){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}(t)),"string"==typeof s&&(s=(0,i.default)(s)),16!==s.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+t.length);if(l.set(s),l.set(t,s.length),l=r(l),l[6]=15&l[6]|e,l[8]=63&l[8]|128,o){a=a||0;for(let t=0;t<16;++t)o[a+t]=l[t];return o}return(0,n.default)(l)}try{s.name=t}catch(t){}return s.DNS=o,s.URL=a,s},r.URL=r.DNS=void 0;var n=s(t("./stringify.js")),i=s(t("./parse.js"));function s(t){return t&&t.__esModule?t:{default:t}}const o="6ba7b810-9dad-11d1-80b4-00c04fd430c8";r.DNS=o;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";r.URL=a},{"./parse.js":531,"./stringify.js":535}],539:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(t("./rng.js")),i=s(t("./stringify.js"));function s(t){return t&&t.__esModule?t:{default:t}}r.default=function(t,e,r){const s=(t=t||{}).random||(t.rng||n.default)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=s[t];return e}return(0,i.default)(s)}},{"./rng.js":533,"./stringify.js":535}],540:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(t("./v35.js")),i=s(t("./sha1.js"));function s(t){return t&&t.__esModule?t:{default:t}}var o=(0,n.default)("v5",80,i.default);r.default=o},{"./sha1.js":534,"./v35.js":538}],541:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=t("./regex.js"))&&n.__esModule?n:{default:n};r.default=function(t){return"string"==typeof t&&i.default.test(t)}},{"./regex.js":532}],542:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=t("./validate.js"))&&n.__esModule?n:{default:n};r.default=function(t){if(!(0,i.default)(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}},{"./validate.js":541}],543:[function(t,e,r){"use strict";function n(t){return t>=65&&t<=90||t>=97&&t<=122||58===t||95===t||8204===t||8205===t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}Object.defineProperty(r,"__esModule",{value:!0}),r.CHAR="\t\n\r --�𐀀-",r.S=" \t\r\n",r.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",r.NAME_CHAR="-"+r.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",r.CHAR_RE=new RegExp("^["+r.CHAR+"]$","u"),r.S_RE=new RegExp("^["+r.S+"]+$","u"),r.NAME_START_CHAR_RE=new RegExp("^["+r.NAME_START_CHAR+"]$","u"),r.NAME_CHAR_RE=new RegExp("^["+r.NAME_CHAR+"]$","u"),r.NAME_RE=new RegExp("^["+r.NAME_START_CHAR+"]["+r.NAME_CHAR+"]*$","u"),r.NMTOKEN_RE=new RegExp("^["+r.NAME_CHAR+"]+$","u"),r.S_LIST=[32,10,13,9],r.isChar=function(t){return t>=32&&t<=55295||10===t||13===t||9===t||t>=57344&&t<=65533||t>=65536&&t<=1114111},r.isS=function(t){return 32===t||10===t||13===t||9===t},r.isNameStartChar=n,r.isNameChar=function(t){return n(t)||t>=48&&t<=57||45===t||46===t||183===t||t>=768&&t<=879||t>=8255&&t<=8256}},{}],544:[function(t,e,r){"use strict";function n(t){return t>=65&&t<=90||t>=97&&t<=122||58===t||95===t||8204===t||8205===t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}Object.defineProperty(r,"__esModule",{value:!0}),r.CHAR="--�𐀀-",r.RESTRICTED_CHAR="-\b\v\f---",r.S=" \t\r\n",r.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",r.NAME_CHAR="-"+r.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",r.CHAR_RE=new RegExp("^["+r.CHAR+"]$","u"),r.RESTRICTED_CHAR_RE=new RegExp("^["+r.RESTRICTED_CHAR+"]$","u"),r.S_RE=new RegExp("^["+r.S+"]+$","u"),r.NAME_START_CHAR_RE=new RegExp("^["+r.NAME_START_CHAR+"]$","u"),r.NAME_CHAR_RE=new RegExp("^["+r.NAME_CHAR+"]$","u"),r.NAME_RE=new RegExp("^["+r.NAME_START_CHAR+"]["+r.NAME_CHAR+"]*$","u"),r.NMTOKEN_RE=new RegExp("^["+r.NAME_CHAR+"]+$","u"),r.S_LIST=[32,10,13,9],r.isChar=function(t){return t>=1&&t<=55295||t>=57344&&t<=65533||t>=65536&&t<=1114111},r.isRestrictedChar=function(t){return t>=1&&t<=8||11===t||12===t||t>=14&&t<=31||t>=127&&t<=132||t>=134&&t<=159},r.isCharAndNotRestricted=function(t){return 9===t||10===t||13===t||t>31&&t<127||133===t||t>159&&t<=55295||t>=57344&&t<=65533||t>=65536&&t<=1114111},r.isS=function(t){return 32===t||10===t||13===t||9===t},r.isNameStartChar=n,r.isNameChar=function(t){return n(t)||t>=48&&t<=57||45===t||46===t||183===t||t>=768&&t<=879||t>=8255&&t<=8256}},{}],545:[function(t,e,r){"use strict";function n(t){return t>=65&&t<=90||95===t||t>=97&&t<=122||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=767||t>=880&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}Object.defineProperty(r,"__esModule",{value:!0}),r.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",r.NC_NAME_CHAR="-"+r.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",r.NC_NAME_START_CHAR_RE=new RegExp("^["+r.NC_NAME_START_CHAR+"]$","u"),r.NC_NAME_CHAR_RE=new RegExp("^["+r.NC_NAME_CHAR+"]$","u"),r.NC_NAME_RE=new RegExp("^["+r.NC_NAME_START_CHAR+"]["+r.NC_NAME_CHAR+"]*$","u"),r.isNCNameStartChar=n,r.isNCNameChar=function(t){return n(t)||45===t||46===t||t>=48&&t<=57||183===t||t>=768&&t<=879||t>=8255&&t<=8256}},{}]},{},[15])(15)},693:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",i=9007199254740991,s="[object Arguments]",o="[object Boolean]",a="[object Date]",l="[object Function]",u="[object GeneratorFunction]",c="[object Map]",h="[object Number]",d="[object Object]",f="[object Promise]",p="[object RegExp]",m="[object Set]",b="[object String]",g="[object Symbol]",y="[object WeakMap]",v="[object ArrayBuffer]",w="[object DataView]",_="[object Float32Array]",x="[object Float64Array]",S="[object Int8Array]",C="[object Int16Array]",A="[object Int32Array]",k="[object Uint8Array]",T="[object Uint8ClampedArray]",E="[object Uint16Array]",M="[object Uint32Array]",R=/\w*$/,I=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,j={};j[s]=j["[object Array]"]=j[v]=j[w]=j[o]=j[a]=j[_]=j[x]=j[S]=j[C]=j[A]=j[c]=j[h]=j[d]=j[p]=j[m]=j[b]=j[g]=j[k]=j[T]=j[E]=j[M]=!0,j["[object Error]"]=j[l]=j[y]=!1;var P="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,N="object"==typeof self&&self&&self.Object===Object&&self,B=P||N||Function("return this")(),F=e&&!e.nodeType&&e,D=F&&t&&!t.nodeType&&t,L=D&&D.exports===F;function V(t,e){return t.set(e[0],e[1]),t}function z(t,e){return t.add(e),t}function U(t,e,r,n){var i=-1,s=t?t.length:0;for(n&&s&&(r=t[++i]);++i<s;)r=e(r,t[i],i,t);return r}function $(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function H(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function W(t,e){return function(r){return t(e(r))}}function q(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Y,X=Array.prototype,G=Function.prototype,K=Object.prototype,Z=B["__core-js_shared__"],J=(Y=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"",Q=G.toString,tt=K.hasOwnProperty,et=K.toString,rt=RegExp("^"+Q.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nt=L?B.Buffer:void 0,it=B.Symbol,st=B.Uint8Array,ot=W(Object.getPrototypeOf,Object),at=Object.create,lt=K.propertyIsEnumerable,ut=X.splice,ct=Object.getOwnPropertySymbols,ht=nt?nt.isBuffer:void 0,dt=W(Object.keys,Object),ft=Bt(B,"DataView"),pt=Bt(B,"Map"),mt=Bt(B,"Promise"),bt=Bt(B,"Set"),gt=Bt(B,"WeakMap"),yt=Bt(Object,"create"),vt=zt(ft),wt=zt(pt),_t=zt(mt),xt=zt(bt),St=zt(gt),Ct=it?it.prototype:void 0,At=Ct?Ct.valueOf:void 0;function kt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Et(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Mt(t){this.__data__=new Tt(t)}function Rt(t,e,r){var n=t[e];tt.call(t,e)&&Ut(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function It(t,e){for(var r=t.length;r--;)if(Ut(t[r][0],e))return r;return-1}function Ot(t,e,r,n,i,f,y){var I;if(n&&(I=f?n(t,i,f,y):n(t)),void 0!==I)return I;if(!Yt(t))return t;var O=$t(t);if(O){if(I=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&tt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,I)}else{var P=Dt(t),N=P==l||P==u;if(Wt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(P==d||P==s||N&&!f){if($(t))return f?t:{};if(I=function(t){return"function"!=typeof t.constructor||Vt(t)?{}:Yt(e=ot(t))?at(e):{};var e}(N?{}:t),!e)return function(t,e){return Pt(t,Ft(t),e)}(t,function(t,e){return t&&Pt(e,Xt(e),t)}(I,t))}else{if(!j[P])return f?t:{};I=function(t,e,r,n){var i,s=t.constructor;switch(e){case v:return jt(t);case o:case a:return new s(+t);case w:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case _:case x:case S:case C:case A:case k:case T:case E:case M:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case c:return function(t,e,r){return U(e?r(H(t),!0):H(t),V,new t.constructor)}(t,n,r);case h:case b:return new s(t);case p:return function(t){var e=new t.constructor(t.source,R.exec(t));return e.lastIndex=t.lastIndex,e}(t);case m:return function(t,e,r){return U(e?r(q(t),!0):q(t),z,new t.constructor)}(t,n,r);case g:return i=t,At?Object(At.call(i)):{}}}(t,P,Ot,e)}}y||(y=new Mt);var B=y.get(t);if(B)return B;if(y.set(t,I),!O)var F=r?function(t){return function(t,e,r){var n=e(t);return $t(t)?n:function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}(n,r(t))}(t,Xt,Ft)}(t):Xt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r););}(F||t,(function(i,s){F&&(i=t[s=i]),Rt(I,s,Ot(i,e,r,n,s,t,y))})),I}function jt(t){var e=new t.constructor(t.byteLength);return new st(e).set(new st(t)),e}function Pt(t,e,r,n){r||(r={});for(var i=-1,s=e.length;++i<s;){var o=e[i],a=n?n(r[o],t[o],o,r,t):void 0;Rt(r,o,void 0===a?t[o]:a)}return r}function Nt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Bt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Yt(t)||(e=t,J&&J in e))&&(qt(t)||$(t)?rt:I).test(zt(t));var e}(r)?r:void 0}kt.prototype.clear=function(){this.__data__=yt?yt(null):{}},kt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},kt.prototype.get=function(t){var e=this.__data__;if(yt){var r=e[t];return r===n?void 0:r}return tt.call(e,t)?e[t]:void 0},kt.prototype.has=function(t){var e=this.__data__;return yt?void 0!==e[t]:tt.call(e,t)},kt.prototype.set=function(t,e){return this.__data__[t]=yt&&void 0===e?n:e,this},Tt.prototype.clear=function(){this.__data__=[]},Tt.prototype.delete=function(t){var e=this.__data__,r=It(e,t);return!(r<0||(r==e.length-1?e.pop():ut.call(e,r,1),0))},Tt.prototype.get=function(t){var e=this.__data__,r=It(e,t);return r<0?void 0:e[r][1]},Tt.prototype.has=function(t){return It(this.__data__,t)>-1},Tt.prototype.set=function(t,e){var r=this.__data__,n=It(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Et.prototype.clear=function(){this.__data__={hash:new kt,map:new(pt||Tt),string:new kt}},Et.prototype.delete=function(t){return Nt(this,t).delete(t)},Et.prototype.get=function(t){return Nt(this,t).get(t)},Et.prototype.has=function(t){return Nt(this,t).has(t)},Et.prototype.set=function(t,e){return Nt(this,t).set(t,e),this},Mt.prototype.clear=function(){this.__data__=new Tt},Mt.prototype.delete=function(t){return this.__data__.delete(t)},Mt.prototype.get=function(t){return this.__data__.get(t)},Mt.prototype.has=function(t){return this.__data__.has(t)},Mt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Tt){var n=r.__data__;if(!pt||n.length<199)return n.push([t,e]),this;r=this.__data__=new Et(n)}return r.set(t,e),this};var Ft=ct?W(ct,Object):function(){return[]},Dt=function(t){return et.call(t)};function Lt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||O.test(t))&&t>-1&&t%1==0&&t<e}function Vt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||K)}function zt(t){if(null!=t){try{return Q.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ut(t,e){return t===e||t!=t&&e!=e}(ft&&Dt(new ft(new ArrayBuffer(1)))!=w||pt&&Dt(new pt)!=c||mt&&Dt(mt.resolve())!=f||bt&&Dt(new bt)!=m||gt&&Dt(new gt)!=y)&&(Dt=function(t){var e=et.call(t),r=e==d?t.constructor:void 0,n=r?zt(r):void 0;if(n)switch(n){case vt:return w;case wt:return c;case _t:return f;case xt:return m;case St:return y}return e});var $t=Array.isArray;function Ht(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}(t.length)&&!qt(t)}var Wt=ht||function(){return!1};function qt(t){var e=Yt(t)?et.call(t):"";return e==l||e==u}function Yt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Xt(t){return Ht(t)?function(t,e){var r=$t(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Ht(t)}(t)&&tt.call(t,"callee")&&(!lt.call(t,"callee")||et.call(t)==s)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!tt.call(t,o)||i&&("length"==o||Lt(o,n))||r.push(o);return r}(t):function(t){if(!Vt(t))return dt(t);var e=[];for(var r in Object(t))tt.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t,e){return Ot(t,!0,!0,e)}},72:t=>{"use strict";var e=[];function r(t){for(var r=-1,n=0;n<e.length;n++)if(e[n].identifier===t){r=n;break}return r}function n(t,n){for(var s={},o=[],a=0;a<t.length;a++){var l=t[a],u=n.base?l[0]+n.base:l[0],c=s[u]||0,h="".concat(u," ").concat(c);s[u]=c+1;var d=r(h),f={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var p=i(f,n);n.byIndex=a,e.splice(a,0,{identifier:h,updater:p,references:1})}o.push(h)}return o}function i(t,e){var r=e.domAPI(e);return r.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,i){var s=n(t=t||[],i=i||{});return function(t){t=t||[];for(var o=0;o<s.length;o++){var a=r(s[o]);e[a].references--}for(var l=n(t,i),u=0;u<s.length;u++){var c=r(s[u]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}s=l}}},659:t=>{"use strict";var e={};t.exports=function(t,r){var n=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},56:(t,e,r)=>{"use strict";t.exports=function(t){var e=r.nc;e&&t.setAttribute("nonce",e)}},825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var i=void 0!==r.layer;i&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,i&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var s=r.sourceMap;s&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={id:n,loaded:!1,exports:{}};return t[n](s,s.exports,r),s.loaded=!0,s.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),r.nc=void 0;var n={};(()=>{"use strict";r.r(n),r.d(n,{AmbTempValidator:()=>Fr,CustomCustomizer:()=>Rr,CustomDataUploader:()=>Er,CustomStringInput:()=>Lr,CustomUploader:()=>Mr,DesiredTempValidator:()=>Nr,HeatCapValidator:()=>Dr,InitialTempValidator:()=>Br,ObjectCoolingSelector:()=>Vr,OutliersSelection:()=>Sr,PipelineStepEditor:()=>Ar,RichFunctionViewEditor:()=>Cr,SimTimeValidator:()=>Pr,_package:()=>_r,init:()=>Ir,modelCatalog:()=>jr,openModelFromFuncall:()=>xr,renderRestPanel:()=>kr});const t=grok,e=ui,i=DG,s=rxjs.operators,o=$;var a=r.n(o);const l=()=>document.querySelector(".d4-balloon-container");class u extends i.JsViewer{constructor(){super()}onFrameAttached(t){this.render()}onTableAttached(){this.render()}render(){if(!this.dataFrame||this.dataFrame.rowCount<=0)return void(this.root.innerHTML="");const r=this.dataFrame,n="isOutlier",s="Rationale",o="Count",u="isConfirmed";r.columns.byName(n)||r.columns.add(i.Column.fromBitSet(n,i.BitSet.create(r.rowCount,(()=>!1)))),r.columns.byName(s)||r.columns.add(i.Column.fromStrings(s,Array.from({length:r.rowCount},(()=>""))));const c=()=>i.DataFrame.fromColumns([i.Column.fromStrings(s,[]),i.Column.fromInt32Array(o,new Int32Array([])),i.Column.fromStrings("Actions",[]),i.Column.fromBitSet(u,i.BitSet.create(0,(()=>!1)))]),h=i.Viewer.grid(c());h.root.style.width="100%",h.root.style.minWidth="230px",h.columns.setVisible([s,o,"Actions"]),this.root.append(e.divV([e.divV([h.root],{style:{height:"75%"}})],{style:{height:"100%"}}));const d=()=>{var t,e;if(!h.dataFrame)return;null===(t=r.col(n))||void 0===t||t.markers.assign("true",i.MARKER_TYPE.OUTLIER);const o=null===(e=h.dataFrame)||void 0===e?void 0:e.cell(h.dataFrame.rowCount-1,s).value;r.selection.getSelectedIndexes().forEach((t=>{r.col(n).set(t,!0,!1),r.col(s).set(t,o,!1)})),r.selection.setAll(!1),r.fireValuesChanged(),a()(l()).empty()},f=()=>{h.dataFrame&&(h.dataFrame.rows.removeAt(h.dataFrame.rowCount-1),r.selection.setAll(!1),a()(l()).empty())};h.onCellPrepare((t=>{var i,o,a;t.isTableCell&&("Actions"===t.gridColumn.name&&(t.gridColumn.cellType="html",t.style.element=e.divH([...(null===(i=t.grid.dataFrame)||void 0===i?void 0:i.get(u,t.gridRow))?[(a=null===(o=t.grid.dataFrame)||void 0===o?void 0:o.get(s,t.gridRow),e.div(e.icons.delete((()=>{for(let t=0;t<r.rowCount;t++)r.columns.byName(s).get(t)===a&&(r.columns.byName(s).set(t,"",!1),r.columns.byName(n).set(t,!1,!1));r.fireValuesChanged()}),"Remove the outliers group"),{style:{"text-align":"center",margin:"6px"}}))]:[e.div(e.iconFA("check",d,"Confirm the outliers"),{style:{"text-align":"center",margin:"6px"}}),e.div(e.iconFA("times",f,"Cancel the outliers"),{style:{"text-align":"center",margin:"6px"}})]])))})),h.onCellValueEdited.subscribe((t=>{var e,n;if(!h.dataFrame||t.gridColumn.name!==s)return;if(!h.dataFrame.columns.byName(u).get(t.gridRow))return;const i=new Set;for(let t=0;t<(null===(e=h.dataFrame)||void 0===e?void 0:e.rowCount);t++){const e=null===(n=h.dataFrame)||void 0===n?void 0:n.columns.byName(s).get(t);i.add(e)}for(let e=0;e<r.rowCount;e++){const n=r.columns.byName(s).get(e);""==n||i.has(n)||r.columns.byName(s).set(e,t.cell.value)}}));const p=()=>{if(r.columns.byName(s))for(let t=0;t<r.rowCount;t++)r.columns.byName(n).get(t)?""===r.columns.byName(s).get(t)&&r.columns.byName(s).set(t,"Manual",!1):""!==r.columns.byName(s).get(t)&&r.columns.byName(s).set(t,"",!1);const t={};if(r.columns.byName(s))for(let e=0;e<r.rowCount;e++){const n=r.columns.byName(s).get(e),i=t[n];""!=n&&(i?t[n]++:t[n]=1)}h.dataFrame=c(),h.columns.setVisible([s,o,"Actions"]),Object.keys(t).map((e=>{var r;null===(r=h.dataFrame)||void 0===r||r.rows.addNew([e,t[e],"",!0])}))};r.onDataChanged.subscribe(p),r.onSelectionChanged.subscribe((()=>{if(!h.dataFrame||!r.selection.trueCount)return;const n=l();if(n&&!a()(n).is(":empty")||t.shell.info(e.div([e.divText("Confirm selected points as outliers?"),e.divH([e.bigButton("Confirm",d),e.button("Cancel",f)])])),h.dataFrame.columns.byName(u).toList().some((t=>!1===t)))h.dataFrame.set(o,h.dataFrame.rowCount-1,r.selection.trueCount);else{const t=h.dataFrame.rows.addNew(["Manual",r.selection.trueCount,"",!1]);h.dataFrame.currentCell=h.dataFrame.cell(t.idx,s)}})),r.selection.setAll(!1),p()}}const c=rxjs,h=dayjs;var d=r.n(h);const f=wu;var p=r.n(f);const m={barchart:i.VIEWER.BAR_CHART,boxplot:i.VIEWER.BOX_PLOT,calendar:i.VIEWER.CALENDAR,corrplot:i.VIEWER.CORR_PLOT,densityplot:i.VIEWER.DENSITY_PLOT,filters:i.VIEWER.FILTERS,form:i.VIEWER.FORM,globe:i.VIEWER.GLOBE,googlemap:i.VIEWER.GOOGLE_MAP,grid:i.VIEWER.GRID,heatmap:i.VIEWER.HEAT_MAP,histogram:i.VIEWER.HISTOGRAM,linechart:i.VIEWER.LINE_CHART,markup:i.VIEWER.MARKUP,matrixplot:i.VIEWER.MATRIX_PLOT,networkdiagram:i.VIEWER.NETWORK_DIAGRAM,pcplot:i.VIEWER.PC_PLOT,piechart:i.VIEWER.PIE_CHART,scatterplot:i.VIEWER.SCATTER_PLOT,"3dscatterplot":i.VIEWER.SCATTER_PLOT_3D,shapemap:i.VIEWER.SHAPE_MAP,statistics:i.VIEWER.STATISTICS,tileviewer:i.VIEWER.TILE_VIEWER,timelines:i.VIEWER.TIMELINES,treemap:i.VIEWER.TREE_MAP,trellisplot:i.VIEWER.TRELLIS_PLOT,wordcloud:i.VIEWER.WORD_CLOUD},b="JsCardView",g="viewer",y="restrictedValues",v="editState";var w;!function(t){t.INPUT="Input",t.OUTPUT="Output"}(w||(w={}));const _="experimental",x="Run name",S="RunId";var C,A,k,T;(T=C||(C={})).HIDDEN="hidden",T.VISIBLE="visible",(k=A||(A={})).ENABLED="enabled",k.DISABLED="disabled";const E="ModelStorage",M="Source",R="Is favorite",I="Is complete",O="Delete",j="Author",P="Date",N="Title",B="Desc.",F="Tags";function D(t){return t&&t.root&&t.onInput}function L(t){return(null==t?void 0:t.setValidation)&&D(t)}function V(t){return(null==t?void 0:t.setDisabled)&&(null==t?void 0:t.setRestricted)&&(null==t?void 0:t.setRestrictedUnlocked)&&(null==t?void 0:t.setInconsistent)&&(null==t?void 0:t.setUserInput)&&D(t)}function z(t){var e;return!(null===(e=null==t?void 0:t.errors)||void 0===e?void 0:e.length)&&!(null==t?void 0:t.pending)}function U(t,e){return{description:t,actions:e}}function H(t){if(null==t?void 0:t.errors)return t.errors.map((t=>t.description)).join("; ")}function W(t){var e,r,n;const i=t=>"string"==typeof t?U(t):t;return{errors:null===(e=null==t?void 0:t.errors)||void 0===e?void 0:e.map((t=>i(t))),warnings:null===(r=null==t?void 0:t.warnings)||void 0===r?void 0:r.map((t=>i(t))),notifications:null===(n=null==t?void 0:t.notifications)||void 0===n?void 0:n.map((t=>i(t)))}}function q(...t){var e,r,n,i,s;const o=[],a=[],l=[],u=[];let c={};for(const h of t)h&&(o.push(...null!==(e=h.errors)&&void 0!==e?e:[]),a.push(...null!==(r=h.warnings)&&void 0!==r?r:[]),l.push(...null!==(n=h.notifications)&&void 0!==n?n:[]),u.push(...null!==(i=h.revalidate)&&void 0!==i?i:[]),c=Object.assign(Object.assign({},c),null!==(s=h.context)&&void 0!==s?s:{}));return{errors:o,warnings:a,notifications:l,revalidate:u,context:c}}function Y(t,r,n){if(n&&r){for(function(t,e){const r=t.getBoundingClientRect().toJSON();e.style.inset="unset",e.style.top=r.y+"px",e.style.left=r.x+20+"px"}(r,n);n.firstChild&&n.removeChild(n.firstChild););const i=function(t){var r;const n=e.divV([],{style:{gap:"10px"}});for(const i of["errors","warnings","notifications"]){const s=t[i];if(null==s?void 0:s.length)for(const t of s){const s=X(i);s.style.marginRight="4px",n.appendChild(e.divV([e.divH([s,e.span([t.description])]),...(null!==(r=t.actions)&&void 0!==r?r:[]).map((t=>e.link(t.actionName,t.action,void 0,{style:{paddingLeft:"20px"}})))]))}}return n}(t);n.appendChild(i),n.showPopover()}}function X(t){let r;return"errors"===t?(r=e.iconFA("exclamation-circle"),r.style.color="var(--red-3)"):"warnings"===t?(r=e.iconFA("exclamation-circle"),r.style.color="var(--orange-2)"):"notifications"===t&&(r=e.iconFA("info-circle"),r.style.color="var(--blue-1)"),r&&(r.classList.remove("fal"),r.classList.add("far")),r}var G=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};const K=t=>!Z(t)||!t.id,Z=t=>{try{return t.started}catch(t){return null}},J=(e,r)=>{var n,i,s,o,a,l,u;if(r===j)return null!==(i=null===(n=e.author)||void 0===n?void 0:n.friendlyName)&&void 0!==i?i:t.shell.user.friendlyName;const c=null!==(l=null!==(a=null!==(o=null!==(s=e[r])&&void 0!==s?s:e.inputs[r])&&void 0!==o?o:e.outputs[r])&&void 0!==a?a:e.options[r])&&void 0!==l?l:null;return null!==(u=null==c?void 0:c.toString())&&void 0!==u?u:""},Q=t=>t.options.mainParams?JSON.parse(t.options.mainParams):null;function tt(t){const e=t;return e.dart&&i.toJs(e.dart)instanceof i.InputBase}const et=t=>{const e=t.clone();t.options.forEach((r=>e.options[r]=t.options[r]));const r=p()(t.outputParams.values()).filter((e=>e.property.propertyType===i.TYPE.DATA_FRAME&&!!t.outputs[e.name]));for(const n of r)e.outputs[n.name]=t.outputs[n.name].clone();const n=p()(t.inputParams.values()).filter((e=>e.property.propertyType===i.TYPE.DATA_FRAME&&!!t.inputs[e.name]));for(const r of n)e.inputs[r.name]=t.inputs[r.name].clone();return e},rt=t=>{const e=t.options[g];return void 0!==e?{name:t.name,config:JSON.parse(e,((t,e)=>{if("true"===e)return!0;if("false"===e)return!1;if("type"===t)return m[e]||e;if(!t.toLowerCase().includes("color")){const t=Number.parseFloat(e);if(!Number.isNaN(t))return t}return e}))}:{name:t.name,config:[]}},nt=(t,e)=>{t.addRow(["Parameter","Value","Units"]).font={bold:!0},e.forEach((e=>{t.addRow([e.caption,e.value,e.units])})),t.getColumn(1).width=1.2*Math.max(...e.map((t=>t.caption.toString().length)),9),t.getColumn(2).width=1.2*Math.max(...e.map((t=>t.value.toString().length)),5),t.getColumn(3).width=1.2*Math.max(...e.map((t=>t.units.toString().length)),5)};let it=0;const st=(t,e,r,n)=>{const i=t.getColumn(null!=r?r:1).letter,s={name:`ID_${it.toString()}`,ref:`${i}${null!=n?n:1}`,columns:e.columns.toList().map((t=>({name:t.name,filterButton:!1}))),rows:new Array(e.rowCount).fill(0).map(((t,r)=>[...e.row(r).cells].map((t=>t.value))))};t.addTable(s),t.columns.forEach((t=>{t.width=25,t.alignment={wrapText:!0}})),it++},ot=(t,e,r,n,...s)=>G(void 0,[t,e,r,n,...s],void 0,(function*(t,e,r,n,s=0){yield i.Utils.loadJsCss(["/js/common/html2canvas.min.js"]);const o=window.html2canvas,a=yield o(r,{logging:!1}),l=a.toDataURL("image/png"),u=t.addImage({base64:l,extension:"png"});e.addImage(u,{tl:{col:n,row:s},ext:{width:a.width,height:a.height}})}));function at(t,e,r){return G(this,void 0,void 0,(function*(){return"file"===t.propertyType&&r.getInput?r.getInput(t.name).value.arrayBuffer():e}))}function lt(t,e){return G(this,void 0,void 0,(function*(){return"file"===t?new File([e],""):e}))}var ut=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};const ct=t=>{switch(t){case"Today":return"started > -1d";case"Yesterday":return"started > -2d and started < -1d";case"Any time":return"";case"Last year":return"started > -2y and started < -1y";case"This year":return"started > -1y";case"Last month":return"started > -2m and started < -1m";case"This month":return"started > -1m";case"Last week":return"started > -2w and started < -1w";case"This week":return"started > -1w"}};var ht;!function(e){const r={},n=new i.LruCache;function s(e){return ut(this,arguments,void 0,(function*(e,n=!0){var i;const s=e.func.id,o=t.dapi.functions.include("package").allPackageVersions().find(s),a=n&&null!==(i=r[s])&&void 0!==i?i:yield o;r[s]||(r[s]=a),e.func=a}))}e.augmentCallWithFunc=s,e.loadChildRuns=function(e){return ut(this,void 0,void 0,(function*(){const r=yield t.dapi.functions.calls.allPackageVersions().find(e);yield s(r);const n=yield t.dapi.functions.calls.allPackageVersions().include("func").filter(`options.parentCallId="${e}"`).list();return yield Promise.all(n.map((t=>ut(this,void 0,void 0,(function*(){return s(t)}))))),{parentRun:r,childRuns:n}}))},e.loadRun=function(e){return ut(this,arguments,void 0,(function*(e,r=!1){const n=yield t.dapi.functions.calls.allPackageVersions().include("session.user, inputs, outputs").find(e);if(yield s(n),!r){const e=p()(n.outputParams.values()).filter((t=>t.property.propertyType===i.TYPE.DATA_FRAME&&!!n.outputs[t.name]));yield Promise.all(e.map((e=>ut(this,void 0,void 0,(function*(){return n.outputs[e.name]=yield t.dapi.tables.getTable(n.outputs[e.name]),Promise.resolve()})))));const r=p()(n.inputParams.values()).filter((t=>t.property.propertyType===i.TYPE.DATA_FRAME&&!!n.inputs[t.name]));yield Promise.all(r.map((e=>ut(this,void 0,void 0,(function*(){return n.inputs[e.name]=yield t.dapi.tables.getTable(n.inputs[e.name]),Promise.resolve()})))))}return n}))},e.saveRun=function(e){return ut(this,void 0,void 0,(function*(){let r=n.get("All users");r||(r=yield t.dapi.groups.find(i.Group.defaultGroupsIds["All users"]),n.set("All users",r));const s=et(e);K(s)&&(s.options.createdOn=d()().unix());const o=p()(s.outputParams.values()).filter((t=>t.property.propertyType===i.TYPE.DATA_FRAME&&!!s.outputs[t.name]));yield Promise.all(o.map((e=>ut(this,void 0,void 0,(function*(){yield t.dapi.tables.uploadDataFrame(s.outputs[e.name]),yield t.dapi.permissions.grant(s.outputs[e.name].getTableInfo(),r,!1)})))));const a=p()(s.inputParams.values()).filter((t=>t.property.propertyType===i.TYPE.DATA_FRAME&&!!s.inputs[t.name]));return yield Promise.all(a.map((e=>ut(this,void 0,void 0,(function*(){yield t.dapi.tables.uploadDataFrame(s.inputs[e.name]),yield t.dapi.permissions.grant(s.inputs[e.name].getTableInfo(),r,!1)}))))),yield t.dapi.functions.calls.allPackageVersions().save(s)}))},e.deleteRun=function(e){return ut(this,void 0,void 0,(function*(){e.options.isDeleted=!0,yield t.dapi.functions.calls.allPackageVersions().save(e)}))},e.pullRuns=function(e){return ut(this,arguments,void 0,(function*(e,r={},n={}){let i=`func.id="${e}"`;return i+=r.author?` and session.user.id="${r.author.id}"`:"",i+=r.date?ct(r.date):"",t.dapi.functions.calls.allPackageVersions().filter(i).include("session.user, options").list(n)}))},e.pullRunsByName=function(e){return ut(this,arguments,void 0,(function*(e,r=[],n={},o=[],a=!1){let l="";for(const t of r){const e=[];t.author&&e.push(`session.user.id="${t.author.id}"`),t.date&&e.push(ct(t.date)),t.text&&e.push(`((options.title like "${t.text}") or (options.annotation like "${t.text}"))`),t.includeDeleted||e.push('((options.isDeleted != "true") or (options.isDeleted = null))');const r=e.join(" and ");""!==r&&(l+=""===l?`(${r})`:` or (${r})`)}""!==l&&(l=` and (${l})`);const u=yield t.dapi.functions.calls.allPackageVersions().filter(`func.name="${e}"${l}`).include(`${o.join(",")}`).list(n);for(const t of u)yield s(t);if((o.includes("inputs")||o.includes("func.params"))&&!a)for(const e of u){const r=p()(e.inputParams.values()).filter((t=>t.property.propertyType===i.TYPE.DATA_FRAME&&!!e.inputs[t.name]));for(const n of r)e.inputs[n.name]=yield t.dapi.tables.getTable(e.inputs[n.name])}if((o.includes("outputs")||o.includes("func.params"))&&!a)for(const e of u){const r=p()(e.outputParams.values()).filter((t=>t.property.propertyType===i.TYPE.DATA_FRAME&&!!e.outputs[t.name]));for(const n of r)e.outputs[n.name]=yield t.dapi.tables.getTable(e.outputs[n.name])}return u}))}}(ht||(ht={}));var dt=r(72),ft=r.n(dt),pt=r(825),mt=r.n(pt),bt=r(659),gt=r.n(bt),yt=r(56),vt=r.n(yt),wt=r(540),_t=r.n(wt),xt=r(113),St=r.n(xt),Ct=r(911),At={};At.styleTagTransform=St(),At.setAttributes=vt(),At.insert=gt().bind(null,"head"),At.domAPI=mt(),At.insertStyleElement=_t(),ft()(Ct.A,At),Ct.A&&Ct.A.locals&&Ct.A.locals;var kt=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};const Tt="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";class Et extends i.InputBase{get value(){return this.fileValue}set value(t){this.stringValue=(null==t?void 0:t.name)||"Drag-n-drop your file",this.fileValue=t,this.notify&&this.fireInput()}constructor(t="Drag-n-drop here",r=null,n=null,i=Tt){super(e.stringInput("Input file","",null).dart),this.initialText=t,this.initialValue=r,this.onValueChanged=n,this.fileType=i,this.uploadedFile$=new c.Subject,this.onFileUploaded=this.uploadedFile$,this.fileValue=null,this.isValid=new c.BehaviorSubject(!0),this.hiddenInput=document.createElement("input"),this.icon=e.iconFA("cloud-upload",(()=>this.hiddenInput.click())),this.subscribeOnEvents(),this.root.style.display="flex",this.isValid.subscribe((t=>{if(t){this.input.classList.remove("error"),this.input.classList.add("success");const t=e.iconFA("times",(()=>this.reset()),"Reset uploaded file");this.icon.replaceWith(t),this.icon=t}else{this.input.classList.remove("success"),this.input.classList.add("error");const t=e.iconFA("redo",(()=>this.hiddenInput.click()),"Re-upload a file");this.icon.replaceWith(t),this.icon=t}})),this.uploadedFile$.subscribe((t=>{if(this.onValueChanged&&this.onValueChanged(t),!t){const t=e.iconFA("cloud-upload",(()=>this.hiddenInput.click()),"Choose a file to upload");this.icon.replaceWith(t),this.icon=t}this.value=t})),this.reset()}subscribeOnEvents(){this.input.readOnly=!0,this.input.classList.add("default");const t=t=>kt(this,void 0,void 0,(function*(){if(t&&t.length&&this.enabled){if(t.length>1)throw this.isValid.next(!1),new Error("Please specify single input file");if(this.fileType&&t[0].type!==this.fileType)throw this.isValid.next(!1),new Error("File type is not supported");this.isValid.value?this.uploadedFile$.next(t[0]):this.uploadedFile$.next(null)}}));this.root.classList.add("fi-drop-area"),this.root.style.width="100%",this.hiddenInput.type="file",this.hiddenInput.addEventListener("change",(()=>kt(this,void 0,void 0,(function*(){return yield t(this.hiddenInput.files)}))),!1),["dragenter","dragover","dragleave","drop"].forEach((t=>{this.input.addEventListener(t,(t=>{t.preventDefault(),t.stopPropagation()}),!1)})),["dragenter","dragover"].forEach((t=>{this.input.addEventListener(t,(()=>{this.input.classList.add("drag-n-dropping")}),!1)})),["dragleave","drop"].forEach((t=>{this.input.addEventListener(t,(()=>{this.input.classList.remove("drag-n-dropping")}),!1)})),this.input.addEventListener("drop",(e=>kt(this,void 0,void 0,(function*(){const r=e.dataTransfer.files;t(r)}))),!1),this.input.addEventListener("click",(()=>this.hiddenInput.click()),!1),this.addOptions(this.icon),["drag","dragenter"].forEach((t=>{document.getElementsByClassName("layout-workarea")[0].addEventListener(t,(t=>{t.stopPropagation()}),!1)}))}reset(){this.input.classList.value="ui-input-editor default",this.hiddenInput.value="",this.uploadedFile$.next(null)}}var Mt=r(703),Rt={};Rt.styleTagTransform=St(),Rt.setAttributes=vt(),Rt.insert=gt().bind(null,"head"),Rt.domAPI=mt(),Rt.insertStyleElement=_t(),ft()(Mt.A,Rt),Mt.A&&Mt.A.locals&&Mt.A.locals;var It=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};class Ot extends i.Dialog{constructor(r,n){var s,o,a;super(e.dialog({title:"Edit run metadata"}).dart),this._onMetadataEdit=new c.Subject,this.onMetadataEdit=this._onMetadataEdit.asObservable();let l=null!==(s=r.options.title)&&void 0!==s?s:"",u=null!==(o=r.options.description)&&void 0!==o?o:"",h=n;const d=e.stringInput("Title",l,(t=>l=t)),f=e.stringInput(" ",""),p=i.TagEditor.create();(null!==(a=r.options.tags)&&void 0!==a?a:[]).forEach((t=>{p.addTag(t)})),f.input.replaceWith(p.root);const m=()=>{""===b.value||p.tags.includes(b.value)||(p.addTag(b.value),b.value="")},b=e.stringInput("Tag","").addOptions(e.iconFA("plus",m,"Add this tag")),g=(0,c.fromEvent)(b.input,"onkeydown").subscribe((t=>{"Enter"==t.key&&(t.stopPropagation(),m())}));this.sub(g),this.add(e.form([d,e.stringInput("Description",u,(t=>u=t)),e.boolInput("Favorites",h,(t=>h=t)),b,f])),this.addButton("Save",(()=>It(this,void 0,void 0,(function*(){if(""!==b.value)return void t.shell.info(`Dialog has unsaved tags: ${b.value}`);let e="same";h&&!n&&(e="favorited"),!h&&n&&(e="unfavorited");const r={title:""!==l?l:null,description:""!==u?u:null,tags:p.tags.map((t=>t)),favorite:e};this._onMetadataEdit.next(r),this.close()}))))}}class jt extends i.Dialog{constructor(t){super(e.dialog({title:`Delete ${t.size>1?t.size:""} ${t.size>1?"runs":"run"}`}).dart),this._onFuncCallDelete=new c.Subject,this.onFuncCallDelete=this._onFuncCallDelete.asObservable(),this.add(e.divText(`Deleted ${t.size>1?t.size:""} ${t.size>1?"runs":"run"} ${t.size>1?"are":"is"} impossible to restore. Are you sure?`)),this.onOK((()=>It(this,void 0,void 0,(function*(){return this._onFuncCallDelete.next(t)}))))}}var Pt=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};function Nt(t,r){r?(a()(t).addClass("ui-box").css({width:"auto",height:"auto"}),e.setUpdateIndicator(t,!0)):(e.setUpdateIndicator(t,!1),a()(t).removeClass("ui-box"))}const Bt=t=>{const e=t.options[g];return void 0!==e?{name:t.name,config:JSON.parse(e,((t,e)=>{if("true"===e)return!0;if("false"===e)return!1;if("type"===t)return m[e]||e;if(!t.toLowerCase().includes("color")){const t=Number.parseFloat(e);if(!Number.isNaN(t))return t}return e}))}:{name:t.name,config:[]}},Ft=t=>{try{return t.started.toDate().toLocaleString("en-us",{month:"short",day:"numeric",hour:"numeric",minute:"numeric"})}catch(t){return"Not completed"}};var Dt=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};const Lt=Object.values(i.COLUMN_TYPE).filter((t=>t!==i.TYPE.DATA_FRAME)),Vt=t=>t.replace(/([A-Z])/g,(t=>` ${t.toLowerCase()}`)).trim().replace(/^./,(t=>t.toUpperCase())),zt=new i.LruCache;class Ut extends i.Widget{storageName(t){return`${E}_${[...t.values()][0].func.name}_Fav`}get onRunsDfChanged(){return this._onRunsDfChanged.asObservable()}get onChosen(){return this._onChosen.asObservable()}get chosen(){return this._onChosen.value}set chosen(t){var e;this.chosenById=null!==(e=null==t?void 0:t.id)&&void 0!==e?e:null}set chosenById(t){if(t){for(let e=0;e<this.currentDf.rowCount;e++)if(this.currentDf.getCol(Wt).get(e)===t){this.currentDf.currentRowIdx=e;break}}else this.currentDf.currentRowIdx=-1}get selected(){return this._onSelectedChanged.value}get runs(){return this.onRunsChanged.value}get onSelectedChanged(){return this._onSelectedChanged.asObservable()}saveIsFavorite(e,r){return Dt(this,void 0,void 0,(function*(){const n=`${E}_${e.func.name}_Fav`;return r?t.dapi.userDataStorage.postValue(n,e.id,""):t.dapi.userDataStorage.remove(n,e.id)}))}getRunByIdx(t){return this.runs.get(this.currentDf.get(Wt,t))}showEditDialog(e,r){const n=new Ot(e,r),i=n.onMetadataEdit.subscribe((r=>Dt(this,void 0,void 0,(function*(){var n;if(null===(n=this.options)||void 0===n?void 0:n.isHistory)return("same"!==r.favorite?this.saveIsFavorite(e,"favorited"===r.favorite):Promise.resolve()).then((()=>ht.loadRun(e.id,!1))).then((t=>(r.title&&(t.options.title=r.title),r.description&&(t.options.description=r.description),r.tags&&(t.options.tags=r.tags),[ht.saveRun(t),t]))).then((([,t])=>{this.updateRun(t),this.onMetadataEdit.next(t),i.unsubscribe()})).catch((e=>{t.shell.error(e)}));this.updateRun(e)}))));n.show({center:!0,width:500})}visibleProps(t){var e,r,n;return null!==(n=null!==(r=null===(e=this.options)||void 0===e?void 0:e.visibleProps)&&void 0!==r?r:Q(t))&&void 0!==n?n:t.inputs.filter((t=>Lt.includes(t.propertyType))).map((t=>t.name))}constructor(r,n){var s,o,l,u,h,f,m;super(e.div([],{style:{height:"100%",width:"100%"}})),this.initialRuns=r,this.options=n,this.onRunsChanged=new c.BehaviorSubject(this.initialRuns.reduce(((t,e)=>(t.set(e.id,e),t)),new Map)),this._onRunsDfChanged=new c.BehaviorSubject(i.DataFrame.fromColumns([i.Column.bool(M,0),...(null===(s=this.options)||void 0===s?void 0:s.isHistory)?[i.Column.bool(R,0)]:[],...(null===(o=this.options)||void 0===o?void 0:o.showActions)?[i.Column.string(O,0)]:[],i.Column.bool(I,0),i.Column.dateTime(P,0),i.Column.string(j,0),i.Column.string(F,0),i.Column.string(N,0),i.Column.string(B,0),i.Column.fromStrings(Wt,[])])),this._historyFilters=i.Viewer.filters(this._onRunsDfChanged.value,{title:"Filters",columnNames:[]}),this._historyGrid=i.Viewer.grid(this._onRunsDfChanged.value,{showRowHeader:!1,showColumnGridlines:!1,allowEdit:!1}),this.onComparisonCalled=new c.Subject,this.onMetadataEdit=new c.Subject,this._onChosen=new c.BehaviorSubject(null),this.onDelete=new c.Subject,this._onSelectedChanged=new c.BehaviorSubject(new Set([])),this.layout=e.splitH([],null,!0),this.defaultGridText=e.divText(null!==(u=null===(l=this.options)||void 0===l?void 0:l.fallbackText)&&void 0!==u?u:"No historical runs found","hp-no-elements-label"),this.defaultFiltersText=e.divText("No filters to show","hp-no-elements-label"),this.filterWithText=e.divH([this.defaultFiltersText,this._historyFilters.root],"ui-box"),this.trashIcon=e.div(e.iconFA("trash-alt",(()=>{const t=this.currentDf.selection.getSelectedIndexes(),e=new Set;t.forEach((t=>e.add(this.getRunByIdx(t))));const r=new jt(e),n=r.onFuncCallDelete.subscribe((t=>Dt(this,void 0,void 0,(function*(){yield Promise.all(p()(t.values()).map((t=>Dt(this,void 0,void 0,(function*(){return yield this.deleteRun(t.id),Promise.resolve()}))))),n.unsubscribe()}))));r.show({center:!0,width:500,modal:!0})}),"Delete selected runs"),{style:{"padding-top":"5px"}}),this.compareIcon=e.div(e.iconFA("exchange",(()=>Dt(this,void 0,void 0,(function*(){const t=this.currentDf.selection.getSelectedIndexes(),e=[];t.forEach((t=>{e.push(this.currentDf.getCol(Wt).get(t))})),this.onComparisonCalled.next(e)}))),"Compare selected runs"),{style:{"padding-top":"5px"}}),this._isFilterHidden=new c.BehaviorSubject(!1),this.showFiltersIcon=e.div(e.iconFA("filter",(()=>{this._isFilterHidden.next(!this._isFilterHidden.value)}),"Toggle filters"),{style:{"padding-top":"4px"}}),this._compactMode=new c.BehaviorSubject(null!==(f=null===(h=this.options)||void 0===h?void 0:h.isHistory)&&void 0!==f&&f),this.toggleCompactMode=e.div(e.iconFA("expand-alt",(()=>{this.compactMode=!this.compactMode}),"Toggle compact mode"),{style:{"padding-top":"4px"}}),this.showMetadataIcon=e.switchInput("Metadata",!0,(()=>{this.styleHistoryGrid(),this.styleHistoryFilters()})),this.showInputsIcon=e.switchInput("Params",!1,(t=>Dt(this,void 0,void 0,(function*(){var e;0!==this.runs.size&&(t&&(null===(e=this.options)||void 0===e?void 0:e.isHistory)?((yield Promise.all([...this.runs.values()].map((t=>Dt(this,void 0,void 0,(function*(){if(zt.has(t.id))return zt.get(t.id);{const e=yield ht.loadRun(t.id,!0);return zt.set(e.id,e),e}})))))).forEach((t=>{this.runs.set(t.id,t)})),this.onRunsChanged.next(this.runs)):(this.styleHistoryGrid(),this.styleHistoryFilters()))}))));const b=e.divH([e.divH([...(null==n?void 0:n.isHistory)?[this.toggleCompactMode]:[],this.showFiltersIcon,this.showMetadataIcon.root,this.showInputsIcon.root],{style:{gap:"5px",padding:"5px"}}),e.divH((null===(m=this.options)||void 0===m?void 0:m.showBatchActions)?[this.trashIcon,this.compareIcon]:[],{style:{gap:"5px",padding:"5px"}})],{style:{"justify-content":"space-between",padding:"0px 5px"}});b.style.setProperty("overflow-y","hidden","important");const g=e.divV([this.defaultGridText,b,this._historyGrid.root],"ui-box");a()(g).removeClass("ui-div"),a()(g).css("width","100%"),this.root.appendChild(this.layout),e.setDisplayAll([this._historyGrid.root,this._historyFilters.root,this.toggleCompactMode,this.trashIcon,this.compareIcon,this.showFiltersIcon],!1),this.setGridCellRendering();const y=this.onRunsChanged.subscribe((r=>Dt(this,void 0,void 0,(function*(){var n,s,o;const a=[...r.values()],l=t=>{var e,r;return t.propertyType===i.TYPE.DATE_TIME?i.Column.dateTime(null!==(e=t.caption)&&void 0!==e?e:Vt(t.name),a.length).init((e=>window.grok_DayJs_To_DateTime(a[e].inputs[t.name]))):i.Column.fromType(t.propertyType,null!==(r=t.caption)&&void 0!==r?r:Vt(t.name),a.length).init((e=>{var r,n,i,s;return null!==(s=null===(i=null===(n=null===(r=this.options)||void 0===r?void 0:r.propFuncs)||void 0===n?void 0:n[t.name])||void 0===i?void 0:i.call(n,a[e]))&&void 0!==s?s:J(a[e],t.name)}))},u=t=>t===P?i.Column.dateTime(Vt(t),a.length).init((t=>window.grok_DayJs_To_DateTime(Z(a[t])?a[t].started:d().unix(a[t].options.createdOn)))):t===I?i.Column.bool(Vt(t),a.length).init((t=>Z(a[t]))):i.Column.fromStrings(Vt(t),a.map((e=>{var r,n,i,s;return null!==(s=null===(i=null===(n=null===(r=this.options)||void 0===r?void 0:r.propFuncs)||void 0===n?void 0:n[t])||void 0===i?void 0:i.call(n,e))&&void 0!==s?s:J(e,t)})));if(r.size>0){const c=null!==(n=yield t.dapi.userDataStorage.get(this.storageName(r)))&&void 0!==n?n:{},h=Object.keys(c),d=[...this.runs.values()][0].func,f=t=>{var e;const r=null!==(e=d.inputs.find((e=>e.name===t)))&&void 0!==e?e:d.outputs.find((e=>e.name===t));return r?l(r):u(t)},p=i.DataFrame.fromColumns([i.Column.string(M,a.length).init((t=>{const e=a[t].options.immutable_tags;return e&&e.includes(_)?"Experimental":"Simulated"})),...(null===(s=this.options)||void 0===s?void 0:s.isHistory)?[i.Column.bool(R,a.length).init((t=>h.includes(a[t].id)))]:[],...(null===(o=this.options)||void 0===o?void 0:o.showActions)?[i.Column.string(O,a.length).init("")]:[],u(P),u(I),u(j),i.Column.string(F,a.length).init((t=>a[t].options.tags?a[t].options.tags.join(","):"")),i.Column.string(N,a.length).init((t=>a[t].options.title)),i.Column.string(B,a.length).init((t=>a[t].options.description))]);this.visibleProps(d).map((t=>f(t))).forEach((t=>{t.name=p.columns.getUnusedName(t.name),p.columns.add(t,!1)})),p.columns.add(i.Column.fromStrings(Wt,a.map((t=>t.id)))),e.setDisplayAll([this.defaultGridText,this.defaultFiltersText],!1),e.setDisplayAll([this._historyGrid.root,this._historyFilters.root,this.toggleCompactMode,this.showMetadataIcon.root,this.trashIcon,this.compareIcon,this.showFiltersIcon],!0),e.setDisplay(this.showInputsIcon.root,this.visibleProps(d).length>0),this._onRunsDfChanged.next(p)}else e.setDisplayAll([this.defaultGridText,this.defaultFiltersText],!0),e.setDisplayAll([this._historyGrid.root,this._historyFilters.root,this.showMetadataIcon.root,this.showInputsIcon.root,this.toggleCompactMode,this.trashIcon,this.compareIcon,this.showFiltersIcon],!1)})))),v=this._onRunsDfChanged.subscribe((t=>{this._historyFilters.dataFrame=t,this._historyGrid.dataFrame=t,this.currentDf.getCol(F).setTag(i.TAGS.MULTI_VALUE_SEPARATOR,","),this.styleHistoryGrid(),this.styleHistoryFilters();const e=t.onCurrentRowChanged.subscribe((()=>{var t;this.currentDf.rows.select((()=>!1)),this._onChosen.next(null!==(t=this.getRunByIdx(this.currentDf.currentRowIdx))&&void 0!==t?t:null)})),r=t.onSelectionChanged.subscribe((()=>{const e=[...t.selection.getSelectedIndexes()].map((t=>this.getRunByIdx(t)));this._onSelectedChanged.next(new Set(e)),this.redrawSelectionState()}));this.redrawSelectionState(),this.subs.push(e,r)})),w=this._isFilterHidden.subscribe((t=>{t?(a()(this.showFiltersIcon.firstChild).addClass("fal"),a()(this.showFiltersIcon.firstChild).removeClass("fad"),e.setDisplay(this.filterWithText,!1)):(a()(this.showFiltersIcon.firstChild).addClass("fad"),a()(this.showFiltersIcon.firstChild).removeClass("fal"),a()(this.filterWithText).css(this.compactMode?"height":"width","320px"),a()(this.filterWithText).css(this.compactMode?"width":"height","100%"),e.setDisplay(this.filterWithText,!0))})),x=this._compactMode.subscribe((t=>{const r=[g,this.filterWithText];a()(this.filterWithText).removeClass("ui-div");const n={style:{width:"100%",height:"100%"}};a()(this.toggleCompactMode.firstChild).addClass(t?"fa-expand-alt":"fa-compress-alt"),a()(this.toggleCompactMode.firstChild).removeClass(t?"fa-compress-alt":"fa-expand-alt");const i=t?e.splitV(r,n,!0):e.splitH(r,n,!0);this.layout.replaceWith(i),this.layout=i,e.tools.waitForElementInDom(this.layout).then((t=>{a()(t).css(this.compactMode?"height":"width","100%"),a()(this._historyFilters.root).css(Object.assign({},this.compactMode?{width:"100%"}:{height:"100%"})),a()(this.filterWithText).css(Object.assign({},this.compactMode?{height:"310px",width:"100%"}:{width:"310px",height:"100%"})),a()(g).css(Object.assign({},this.compactMode?{width:"100%"}:{height:"100%"})),setTimeout((()=>{this.styleHistoryGrid(),this.styleHistoryFilters()}),100)}))}));this.subs.push(y,x,v,w)}setGridColumnsRendering(){const t=this._historyGrid.columns.byName(O);t&&(t.cellType="html",t.width=35);const e=this._historyGrid.columns.byName(R);e&&(e.cellType="html",e.width=20);const r=this._historyGrid.columns.byName(M);r.cellType="html",r.width=20;const n=this._historyGrid.columns.byName(F);n.cellType="html",n.width=90,this._historyGrid.columns.byName(P).width=110,this._historyGrid.columns.byName(Wt).cellType="html"}isFavoriteByIndex(t){return this.currentDf.get(R,t)}setGridCellRendering(){this._historyGrid.onCellPrepare((r=>{var n,i,s,o,l,u,c,h,d,f,m;if(r.isColHeader&&(null===(n=r.tableColumn)||void 0===n?void 0:n.name)&&[O,M,R].includes(r.tableColumn.name)&&(r.customText=""),!r.isColHeader){if((null===(i=r.tableColumn)||void 0===i?void 0:i.name)===O){r.customText="";const t=this.getRunByIdx(r.tableRowIndex);r.element=e.divH([e.iconFA("trash",(()=>{const t=new Set([this.getRunByIdx(r.tableRowIndex)]),e=new jt(t),n=e.onFuncCallDelete.subscribe((()=>Dt(this,void 0,void 0,(function*(){yield Promise.all(p()(t.values()).map((t=>Dt(this,void 0,void 0,(function*(){return yield this.deleteRun(t.id),Promise.resolve()}))))),n.unsubscribe()}))));e.show({center:!0,width:500})}),"Remove run from history"),e.iconFA("edit",(()=>this.showEditDialog(t,this.isFavoriteByIndex(r.tableRowIndex))),"Edit run metadata")],{style:{padding:"6px 0px",gap:"6px","justify-content":"space-between"}})}if((null===(s=r.tableColumn)||void 0===s?void 0:s.name)===R){r.customText="";const t=this.getRunByIdx(r.tableRowIndex),n=e.iconFA("star",(()=>this.saveIsFavorite(t,!1).then((()=>this.updateRun(t)))),"Unfavorite");a()(n).addClass("fas"),r.element=e.div(r.cell.value?n:e.iconFA("star",(()=>this.saveIsFavorite(t,!0).then((()=>this.updateRun(t)))),"Favorite"),{style:{padding:"5px 0px"}})}if((null===(o=r.tableColumn)||void 0===o?void 0:o.name)===M){r.customText="";const t=e.iconFA("flask",null,"Experimental run");a()(t).addClass("fad fa-sm"),a()(t).removeClass("fal"),r.element=r.cell.value&&"Experimental"===r.cell.value?e.div(t,{style:{padding:"5px"}}):e.div()}if((null===(l=r.tableColumn)||void 0===l?void 0:l.name)===F){r.customText="";const t=r.cell.value.length>0?e.div(null===(u=r.cell.value)||void 0===u?void 0:u.split(",").map((t=>e.span([t],"d4-tag"))),"d4-tag-editor"):e.div();a()(t).css({padding:"3px","background-color":"transparent"}),r.element=t}if((null===(c=r.tableColumn)||void 0===c?void 0:c.name)===Wt){r.customText="";const n=this.getRunByIdx(r.tableRowIndex);if(!n)return;const i=n.author.picture;a()(i).css({width:"25px",height:"25px",fontSize:"20px"}),e.bind(n.author,i);const s=e.iconFA("flask",null,"Experimental run");s.classList.add("fad","fa-sm"),s.classList.remove("fal"),s.style.marginLeft="3px";const o=n.options.immutable_tags,l=e.span([e.label(null!==(f=null!==(h=n.options.title)&&void 0!==h?h:null===(d=n.author)||void 0===d?void 0:d.friendlyName)&&void 0!==f?f:t.shell.user.friendlyName,{style:{color:"var(--blue-1)"}}),...o&&o.includes(_)?[s]:[]]),u=e.iconFA("edit",(t=>{t.stopPropagation(),this.showEditDialog(n,this.isFavoriteByIndex(r.tableRowIndex))}),"Edit run metadata");u.classList.add("hp-funccall-card-icon","hp-funccall-card-hover-icon");const c=e.iconFA("trash-alt",(t=>Dt(this,void 0,void 0,(function*(){t.stopPropagation();const e=new Set([this.getRunByIdx(r.tableRowIndex)]),n=new jt(e),i=n.onFuncCallDelete.subscribe((()=>Dt(this,void 0,void 0,(function*(){yield Promise.all(p()(e.values()).map((t=>Dt(this,void 0,void 0,(function*(){return yield this.deleteRun(t.id),Promise.resolve()}))))),i.unsubscribe()}))));n.show({center:!0,width:500})}))),"Delete run");c.classList.add("hp-funccall-card-icon","hp-funccall-card-hover-icon");const b=e.iconFA("star",(t=>{t.stopPropagation(),this.saveIsFavorite(n,!1).then((()=>this.updateRun(n)))}),"Unfavorite");b.classList.add("fas","hp-funccall-card-icon");const g=e.iconFA("star",(t=>{t.stopPropagation(),this.saveIsFavorite(n,!0).then((()=>this.updateRun(n)))}),"Favorite");g.classList.add("hp-funccall-card-icon","hp-funccall-card-hover-icon"),this.isFavoriteByIndex(r.tableRowIndex)?(e.setDisplay(g,!1),e.setDisplay(b,!0)):(e.setDisplay(b,!1),e.setDisplay(g,!0));const y=Ft(n),v=e.divH([e.divH([i,e.divV([l,e.span([y]),...n.options.tags&&n.options.tags.length>0?[e.div(n.options.tags.map((t=>e.span([t],"d4-tag"))))]:[]],"hp-card-content")]),e.divH([...(null===(m=this.options)||void 0===m?void 0:m.showActions)?[b,g,u,c]:[]])],"hp-funccall-card"),w=r.tableRowIndex;v.addEventListener("mouseover",(()=>{r.grid.dataFrame.mouseOverRowIdx=w})),v.addEventListener("click",(t=>{t.shiftKey?r.grid.dataFrame.selection.set(w,!0):t.ctrlKey?r.grid.dataFrame.selection.set(w,!1):r.grid.dataFrame.currentRowIdx=w})),r.element=v}}}))}deleteRun(e){return Dt(this,void 0,void 0,(function*(){return ht.loadRun(e,!0).then((t=>{var e;return[(null===(e=this.options)||void 0===e?void 0:e.isHistory)?ht.deleteRun(t):Promise.resolve(),t]})).then((([,t])=>{var r;return this.runs.delete(e),this.onRunsChanged.next(this.runs),(null===(r=this.options)||void 0===r?void 0:r.isHistory)&&this.onDelete.next(t),t})).then((t=>{this.saveIsFavorite(t,!1)})).catch((e=>{t.shell.error(e)}))}))}editRun(t){this.showEditDialog(t,!1)}updateRun(t){this.runs.set(t.id,t),this.onRunsChanged.next(this.onRunsChanged.value)}addRun(t){this.runs.set(t.id,t),this.onRunsChanged.next(this.onRunsChanged.value)}updateRuns(t){this.onRunsChanged.next(t.reduce(((t,e)=>(t.set(e.id,e),t)),new Map))}get isFilterHidden(){return this._isFilterHidden.value}set isFilterHidden(t){this._isFilterHidden.next(t)}get compactMode(){return this._compactMode.value}set compactMode(t){this._compactMode.next(t)}get onCompactModeChanged(){return this._compactMode.asObservable()}styleHistoryGrid(){var t;this._historyGrid.setOptions({showCurrentRowIndicator:!0,showCurrentCellOutline:!1,allowEdit:!1,allowBlockSelection:!1,showRowHeader:!1,showColumnLabels:!this.compactMode,extendLastColumn:this.compactMode}),this._historyGrid.sort([P],[!1]);for(let e=0;e<this._historyGrid.columns.length;e++){const r=this._historyGrid.columns.byIndex(e);r&&(null===(t=r.column)||void 0===t?void 0:t.type)===i.TYPE.DATE_TIME&&(r.format="MMM d HH:mm")}if(this.setGridColumnsRendering(),0!==this.runs.size)if(this.compactMode)this._historyGrid.columns.setVisible([Wt]),this._historyGrid.props.rowHeight=70,this._historyGrid.invalidate();else{this._historyGrid.props.rowHeight=28;const t=[...this.runs.values()][0].func,e=this.showMetadataIcon.value,r=this.currentDf.getCol(F);this._historyGrid.columns.setVisible([M,R,O,...e?[P]:[],...e?[j]:[],...e&&r.stats.missingValueCount<r.length?[F]:[],...e?[N]:[],...e?[B]:[],...this.showInputsIcon.value?this.visibleProps(t).map((e=>{var r,n;const i=null!==(r=t.inputs.find((t=>t.name===e)))&&void 0!==r?r:t.outputs.find((t=>t.name===e));return i?null!==(n=i.caption)&&void 0!==n?n:Vt(i.name):Vt(e)})):[]])}}get currentDf(){return this._onRunsDfChanged.value}styleHistoryFilters(){var t,r;if(this.runs.size>0){const n=[...this.runs.values()][0].func,i=this.currentDf.getCol(F),s=this.showMetadataIcon.value,o=[...s&&this.currentDf.getCol(M).categories.length>1?[M]:[],...s&&(null!==(r=null===(t=this.currentDf.col(R))||void 0===t?void 0:t.categories.length)&&void 0!==r?r:0)>1?[R]:[],...s?[P,I]:[],...s&&this.currentDf.getCol(j).categories.length>1?[j]:[],...s&&i.stats.missingValueCount<i.length?[F]:[],...s&&this.currentDf.getCol(N).categories.length>1?[N]:[],...s&&this.currentDf.getCol(B).categories.length>1?[B]:[],...this.showInputsIcon.value?this.visibleProps(n).map((t=>{var e,r;const i=null!==(e=n.inputs.find((e=>e.name===t)))&&void 0!==e?e:n.outputs.find((e=>e.name===t));return i?null!==(r=i.caption)&&void 0!==r?r:Vt(i.name):Vt(t)})).filter((t=>{var e;return!(null===(e=this.options)||void 0===e?void 0:e.isHistory)||this.currentDf.getCol(t).categories.length>1})).map((t=>t)):[]];o.length>0?(a()(this.filterWithText).css({paddingTop:"10px"}),e.setDisplay(this.defaultFiltersText,!1),e.setDisplay(this._historyFilters.root,!0),this._historyFilters.setOptions({columnNames:o,showHeader:!1,showBoolCombinedFitler:!1})):(e.setDisplay(this.defaultFiltersText,!0),e.setDisplay(this._historyFilters.root,!1))}}redrawSelectionState(){const t=this.currentDf.selection.trueCount;t<2?this.compareIcon.firstChild.classList.add("hp-disabled"):this.compareIcon.firstChild.classList.remove("hp-disabled"),0===t?this.trashIcon.firstChild.classList.add("hp-disabled"):this.trashIcon.firstChild.classList.remove("hp-disabled")}}var $t=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};class Ht{static getHistoryRuns(e){return(0,c.from)((()=>$t(this,void 0,void 0,(function*(){return yield ht.pullRunsByName(e,[{author:t.shell.user}],{order:"started"},["func.params","session.user","options"],!0)})))())}}const Wt="ID";class qt extends i.InputBase{constructor(t,r,n){var i,o;const a=e.stringInput(t,"",null);super(a.dart),this.label=t,this._funcName=r,this.options=n,this.onHistoricalRunChosen=new c.BehaviorSubject(null),this.experimentRunsUpdate=new c.Subject,this.store={experimentRuns:new c.Observable,isExperimentRunsLoading:new c.Subject,experimentRunData:new c.BehaviorSubject("")},this._historyList=new Ut([],{fallbackText:"No runs are found in history",showActions:!1,showBatchActions:!1,isHistory:!1,visibleProps:null===(i=this.options)||void 0===i?void 0:i.mainProps,propFuncs:null===(o=this.options)||void 0===o?void 0:o.propFuncs}),this._historyDialog=this.getHistoryDialog(),this._visibleInput=e.stringInput(this.label,"",null),this._visibleIcon=e.iconFA("search",(()=>this.showSelectionDialog())),this._chosenRun=null,this._chosenRunId=null,this._visibleInput=a,this._visibleInput.readOnly=!0,this._visibleInput.input.addEventListener("click",(()=>this.showSelectionDialog())),this._visibleInput.addOptions(this._visibleIcon),this.store.experimentRuns=this.experimentRunsUpdate.pipe((0,s.tap)((()=>this.toggleLoaderExpRuns(!0))),(0,s.switchMap)((()=>Ht.getHistoryRuns(this._funcName).pipe((0,s.catchError)((t=>(console.error(t),c.EMPTY))),(0,s.finalize)((()=>this.toggleLoaderExpRuns(!1)))))),(0,s.shareReplay)(1)),this.store.experimentRuns.subscribe((t=>{this._historyList.updateRuns(t.filter((t=>!K(t))))})),this.store.isExperimentRunsLoading.subscribe((t=>{e.setUpdateIndicator(this._visibleInput.root,t),e.setUpdateIndicator(this._historyList.root,t)})),this.experimentRunsUpdate.next()}setCurrentRow(){this.getValue()?this._historyList.chosen=this.getValue():this.chosenRunId&&(this._historyList.chosenById=this.chosenRunId)}showSelectionDialog(){this.renderGridAndFilters(),this._historyDialog.getButton("OK").disabled=1!==this._historyList.selected.size,this._historyDialog.show({modal:!0,fullScreen:!0,center:!0,width:window.innerWidth-50,height:window.innerHeight-50})}renderGridAndFilters(){var t,e;const r=new Ut([...this._historyList.runs.values()],Object.assign(Object.assign({},this.options),{visibleProps:null===(t=this.options)||void 0===t?void 0:t.mainProps,propFuncs:null===(e=this.options)||void 0===e?void 0:e.propFuncs}));this._historyList.root.replaceWith(r.root),this._historyList=r,this._historyList.onChosen.subscribe((t=>{this._historyDialog.getButton("OK").disabled=!t})),this._historyList.onRunsDfChanged.pipe((0,s.filter)((t=>t.rowCount>0)),(0,s.take)(1)).subscribe((t=>{this.setCurrentRow()}))}getHistoryDialog(){const t=e.dialog();return a()(t.root.querySelector(".d4-dialog-contents")).removeClass("ui-form"),t.onOK((()=>$t(this,void 0,void 0,(function*(){const t=this._historyList.chosen;t&&this.setValue(t),this.fireInput()})))),t.addButton("Refresh",(()=>{this.experimentRunsUpdate.next()}),2,"Reload list of runs"),t.addButton("Discard",(()=>{this.setValue(null),this.fireInput(),t.close()}),1,"Discard the previous choice"),a()(t.getButton("CANCEL")).hide(),t.add(this._historyList.root),t}setValue(t){var e,r,n,i,s,o,a;this._chosenRun=t,this._chosenRunId=null!==(r=null===(e=this._chosenRun)||void 0===e?void 0:e.id)&&void 0!==r?r:null,this.onHistoricalRunChosen.next(t),this.stringValue=t?(null===(n=this.options)||void 0===n?void 0:n.stringValueFunc)?null===(i=this.options)||void 0===i?void 0:i.stringValueFunc(t):[`${Ft(t)} \\ ${t.author.name}`,(null!==(a=null!==(o=null===(s=this.options)||void 0===s?void 0:s.mainProps)&&void 0!==o?o:Q(t.func))&&void 0!==a?a:[]).map((e=>J(t,e))).join(" \\ ")].join(" \\ "):"No run chosen",this.notify&&this.fireChanged()}getValue(){return this._chosenRun}get chosenRun(){return this._chosenRun}get chosenRunId(){return this._chosenRunId}set chosenRunId(t){this._chosenRunId=t}get root(){return this._visibleInput.root}set stringValue(t){this._visibleInput.value=t,this._visibleInput.setTooltip(this._visibleInput.value)}get stringValue(){return this._visibleInput.value}get iconRoot(){return this._visibleIcon}toggleLoaderExpRuns(t){this.store.isExperimentRunsLoading.next(t)}}class Yt extends qt{set value(t){this.setValue(t)}get value(){return this.getValue()}}class Xt extends qt{get value(){const t=this.getValue();return t?JSON.stringify({visualValue:this.stringValue,id:t.id.split("-")}):null}set value(t){this.setValue(null),this.stringValue=t?JSON.parse(t).visualValue:"No run is chosen",this.chosenRunId=t?JSON.parse(t).id.join("-"):""}}var Gt=r(565),Kt={};Kt.styleTagTransform=St(),Kt.setAttributes=vt(),Kt.insert=gt().bind(null,"head"),Kt.domAPI=mt(),Kt.insertStyleElement=_t(),ft()(Gt.A,Kt),Gt.A&&Gt.A.locals&&Gt.A.locals;var Zt;class Jt extends i.Widget{updateHistoryPane(t){this.historyList.updateRuns(t)}showEditDialog(t){this.historyList.editRun(t)}addRun(t){this.historyList.addRun(t)}get history(){return this.historyList.runs}get onCompactModeChanged(){return this.historyList.onCompactModeChanged}get compactMode(){return this.historyList.compactMode}constructor(r){super(e.box(e.divText("No historical runs loaded","hp-no-elements-label"),{style:{width:"100%",height:"100%"}})),this.func=r,this.onRunChosen=new c.Subject,this.onComparison=new c.Subject,this.afterRunEdited=new c.Subject,this.afterRunDeleted=new c.Subject,this.allRunsFetch=new c.Subject,this.historyList=new Ut([],{fallbackText:"No runs are found in history",showActions:!0,showBatchActions:!0,isHistory:!0}),this.panel=this.historyList.root;const n=this.historyList.onChosen.pipe((0,s.filter)((t=>!!t))).subscribe((t=>this.onRunChosen.next(t.id))),i=this.historyList.onComparisonCalled.subscribe((t=>this.onComparison.next(t))),o=this.allRunsFetch.subscribe((()=>{return r=this,n=void 0,s=function*(){e.setUpdateIndicator(this.root,!0),ht.pullRunsByName(this.func.name,[{author:t.shell.user}],{},["session.user","options"]).then((t=>{e.empty(this.root),this.root.appendChild(this.panel),this.updateHistoryPane(t)})).catch((e=>t.shell.error(e))).finally((()=>e.setUpdateIndicator(this.root,!1)))},new((i=void 0)||(i=Promise))((function(t,e){function o(t){try{l(s.next(t))}catch(t){e(t)}}function a(t){try{l(s.throw(t))}catch(t){e(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(o,a)}l((s=s.apply(r,n||[])).next())}));var r,n,i,s})),a=this.historyList.onMetadataEdit.subscribe((t=>{this.afterRunEdited.next(t)})),l=this.historyList.onDelete.subscribe((t=>{this.afterRunDeleted.next(t)}));this.subs.push(n,o,a,i,l),this.allRunsFetch.next()}}!function(t){t.fileInput=function(t="Drag-n-drop here",e=null,r=null,n=Tt){return new Et(t,e,r,n)},t.historyInput=function(t,e,r){return new Yt(t,e,r)},t.historyInputJSON=function(t,e,r){return new Xt(t,e,r)},t.historyPanel=function(t){return new Jt(t)}}(Zt||(Zt={}));var Qt=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};const te=window;class ee extends i.TableView{static fromComparedRuns(r,n){return Qt(this,arguments,void 0,(function*(r,n,s={parentView:void 0,parentCall:void 0}){const o=((r,n,s={parentView:void 0,parentCall:void 0})=>{var o,l;const u=n,c=[...u.inputs,...u.outputs].map((t=>Bt(t))).reduce(((t,e)=>(t[e.name]?t[e.name].push(...e.config):t[e.name]=e.config,t)),{}),h=t=>{var e;if(t.propertyType===i.TYPE.DATA_FRAME){const e=c[t.name].map((e=>{var n;let s=null!==(n=t.caption)&&void 0!==n?n:t.name;const o=i.Column.fromType(i.TYPE.DATA_FRAME,s,r.length);o.init((e=>{var n;return null!==(n=r[e].inputs[t.name])&&void 0!==n?n:r[e].outputs[t.name]}));const a=d.columns.getUnusedName(`${o.name} (${e.type})`);return o.name=a,s=a,o.temp[g]=e,d.columns.add(o),o}));return e}{let n=null!==(e=t.caption)&&void 0!==e?e:t.name;const s=i.Column.fromType(t.propertyType,n,r.length);s.init((e=>{var n;return null!==(n=r[e].inputs[t.name])&&void 0!==n?n:r[e].outputs[t.name]}));const o=d.columns.getUnusedName(s.name);return s.name=o,n=o,d.columns.add(s),[s]}},d=i.DataFrame.create(r.length),f=[];return r.forEach((t=>{var e;let r=null!==(e=t.options.title)&&void 0!==e?e:`${t.func.name} - ${Ft(t)}`,n=2;for(;f.includes(r);)r=`${t.func.name} - ${Ft(t)})\n .toLocaleString('en-us', {month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric'})} - ${n}`,n++;f.push(r)})),d.columns.add(i.Column.fromStrings(x,f)),d.name=(null===(o=s.parentCall)||void 0===o?void 0:o.func.name)?`${null===(l=s.parentCall)||void 0===l?void 0:l.func.name} - comparison`:`${n.name} - comparison`,u.inputs.forEach((t=>h(t))),u.outputs.forEach((t=>h(t))),t.events.onCurrentObjectChanged.subscribe((({sender:r})=>{if(r instanceof i.Column&&r.type===i.TYPE.DATA_FRAME&&t.shell.tv&&t.shell.tv.temp.isComparison&&[i.VIEWER.LINE_CHART,i.VIEWER.SCATTER_PLOT,i.VIEWER.HISTOGRAM,i.VIEWER.BOX_PLOT].includes(r.temp[g].type)){t.shell.windows.showProperties=!0;const n=t=>{const e=t.get(0).clone();e.columns.addNew(S,i.TYPE.STRING).init(t.dataFrame.get(x,0));for(let r=1;r<t.length;r++){const n=t.get(r).clone();n.columns.addNew(S,i.TYPE.STRING).init(t.dataFrame.get(x,r));const s=[i.COLUMN_TYPE.INT,i.COLUMN_TYPE.FLOAT];for(let t=0;t<n.columns.length;t++){const r=n.columns.byIndex(t),o=e.columns.byIndex(t);r.type!==o.type&&s.includes(r.type)&&s.includes(o.type)&&(r.type!==i.COLUMN_TYPE.FLOAT&&n.columns.replace(r,r.convertTo(i.COLUMN_TYPE.FLOAT)),o.type!==i.COLUMN_TYPE.FLOAT&&e.columns.replace(o,o.convertTo(i.COLUMN_TYPE.FLOAT)))}e.append(n,!0)}return e},s=r.temp[g].look;setTimeout((()=>{switch(r.temp[g].type){case i.VIEWER.LINE_CHART:const o=e.waitBox((()=>Pt(void 0,void 0,void 0,(function*(){var t;const e=null!==(t=r.temp.unitedDf)&&void 0!==t?t:n(r);return r.temp.unitedDf=e,e.plot.line(Object.assign(Object.assign({},s),{split:S})).root}))));a()(o).css({width:"100%"}),t.shell.o=o;break;case i.VIEWER.SCATTER_PLOT:const l=e.waitBox((()=>Pt(void 0,void 0,void 0,(function*(){var t;const e=null!==(t=r.temp.unitedDf)&&void 0!==t?t:n(r);return r.temp.unitedDf=e,e.plot.scatter(Object.assign(Object.assign({},s),{color:S})).root}))));t.shell.o=l,a()(l).css({width:"100%"});break;case i.VIEWER.HISTOGRAM:const u=e.waitBox((()=>Pt(void 0,void 0,void 0,(function*(){var t;const e=null!==(t=r.temp.unitedDf)&&void 0!==t?t:n(r);return r.temp.unitedDf=e,e.plot.histogram(Object.assign(Object.assign({},s),{split:S})).root}))));t.shell.o=u,a()(u).css({width:"100%"});break;case i.VIEWER.BOX_PLOT:const c=e.waitBox((()=>Pt(void 0,void 0,void 0,(function*(){var t;const e=null!==(t=r.temp.unitedDf)&&void 0!==t?t:n(r);return r.temp.unitedDf=e,e.plot.box(Object.assign(Object.assign({},s),{category:S})).root}))));t.shell.o=c,a()(c).css({width:"100%"})}}))}})),d})(r,n,s),l=[...t.shell.views].find((t=>t.type===b||"scripts"===t.type||"functions"===t.type));return l&&(t.shell.v=l),new this(o,s)}))}constructor(e,r={}){super(te.grok_TableView(e.dart,!1)),r.parentView&&(this.parentView=r.parentView),this.parentCall=r.parentCall||t.functions.getCurrentCall()}showAllColumns(){const t=this.dataFrame.columns.names();this.grid.columns.setVisible(t)}showChangingColumns(){const t=this.dataFrame.columns.names().filter((t=>i.TYPES_SCALAR.has(this.dataFrame.getCol(t).type)&&this.dataFrame.getCol(t).categories.length>1||!i.TYPES_SCALAR.has(this.dataFrame.getCol(t).type)));this.grid.columns.setVisible(t)}defaultCustomize(){var r;const n=e.iconFA("compress-alt",(()=>{this.showChangingColumns(),a()(s).show(),a()(n).hide()}),"Hide constant parameters"),s=e.iconFA("expand-arrows-alt",(()=>{this.showAllColumns(),a()(s).hide(),a()(n).show()}),"Show all parameters");a()(n).hide(),this.setRibbonPanels([...this.getRibbonPanels(),[n,s]]),this.showChangingColumns(),this.root.style.removeProperty("width"),this.root.firstChild.style.removeProperty("width"),this.root.firstChild.firstChild.style.removeProperty("width"),this.grid.props.rowHeight=180,this.grid.props.showAddNewRowIcon=!1,this.grid.props.allowEdit=!1,this.grid.columns.byName(x).width=70;for(let t=0;t<this.grid.columns.length;t++){const e=this.grid.columns.byIndex(t);(null===(r=e.column)||void 0===r?void 0:r.temp[g])&&(e.width=350,e.cellType="html")}const o=new i.LruCache;this.grid.onCellPrepare((t=>Qt(this,void 0,void 0,(function*(){if(!t.isColHeader&&!t.isRowHeader){if(t.tableColumn.name===x){t.customText="";const r=t.cell.value.split(" - "),n=r.length>1?[r[0],e.element("br"),r[1]]:r;return t.element=e.div(n,{style:{"writing-mode":"vertical-rl","text-orientation":"mixed",margin:"auto"}}),void(t.element.parentElement.style.display="flex")}if(t.tableColumn&&t.tableColumn.temp[g]){const e=t.cell.value,r=t.tableColumn.temp[g],n=r.type,s=()=>Qt(this,void 0,void 0,(function*(){const s=Object.values(m).includes(n)?i.Viewer.fromType(n,e):yield e.plot.fromType(n);return t.tableColumn.temp[g].look?s.setOptions(t.tableColumn.temp[g].look):(s.setOptions(r),t.tableColumn.temp[g]=s.getOptions()),s.root})),a=`${e.id}_${n}`;if(o.get(a))t.element=o.get(a);else{const e=yield s();o.set(a,e),t.element=e}t.element.style.width="100%",t.element.style.height="100%"}}}))));const l=e.box(e.div([],{style:{"min-height":"100px"}})),u=t.events.onCurrentViewChanged.subscribe((()=>{t.shell.v.id===this.id?t.shell.dockManager.dock(l,"down",null,"Comparison chart",.25):t.shell.dockManager.close(l)})),c=this.grid.onCellClick.subscribe((r=>{var n;if(t.shell.v.id===this.id&&r.isColHeader&&(null===(n=r.tableColumn)||void 0===n?void 0:n.type)===i.TYPE.DATA_FRAME&&[i.VIEWER.LINE_CHART,i.VIEWER.SCATTER_PLOT,i.VIEWER.HISTOGRAM,i.VIEWER.BOX_PLOT].includes(r.tableColumn.temp[g].type)){t.shell.dockManager.findNode(l)||t.shell.dockManager.dock(l,"down",null,"Comparison chart",.25);const n=t=>{const e=i.toJs(t.get(0)).clone();e.columns.addNew(S,i.TYPE.STRING).init(t.dataFrame.get(x,0));for(let r=1;r<t.length;r++){const n=i.toJs(t.get(r)).clone();n.columns.addNew(S,i.TYPE.STRING).init(t.dataFrame.get(x,r));const s=[i.COLUMN_TYPE.INT,i.COLUMN_TYPE.FLOAT];for(let t=0;t<n.columns.length;t++){const r=n.columns.byIndex(t),o=e.columns.byIndex(t);r.type!==o.type&&s.includes(r.type)&&s.includes(o.type)&&(r.type!==i.COLUMN_TYPE.FLOAT&&n.columns.replace(r,r.convertTo(i.COLUMN_TYPE.FLOAT)),o.type!==i.COLUMN_TYPE.FLOAT&&e.columns.replace(o,o.convertTo(i.COLUMN_TYPE.FLOAT)))}e.append(n,!0)}return e},s=(t,e,n)=>{var s;switch(null===(s=r.tableColumn)||void 0===s?void 0:s.temp[g].type){case i.VIEWER.LINE_CHART:return n.plot.line(Object.assign(Object.assign({},e),{split:S})).root;case i.VIEWER.SCATTER_PLOT:return n.plot.scatter(Object.assign(Object.assign({},e),{color:S})).root;case i.VIEWER.HISTOGRAM:return n.plot.histogram(Object.assign(Object.assign({},e),{split:S})).root;case i.VIEWER.BOX_PLOT:return n.plot.box(Object.assign(Object.assign({},e),{category:S})).root}};e.setUpdateIndicator(l,!0),setTimeout((()=>{var t;if(!r.tableColumn.temp.unitedPlot){const i=r.tableColumn.temp[g].look,o=n(r.tableColumn);r.tableColumn.temp.unitedPlot=s(null===(t=r.tableColumn)||void 0===t?void 0:t.temp[g].type,i,o),e.setUpdateIndicator(l,!1)}e.empty(l),l.appendChild(r.tableColumn.temp.unitedPlot)}),10)}else t.shell.dockManager.close(l)}));this.subs.push(c,u)}}const re="_DG_CUSTOM_SERIALIZED_TOKEN_";function ne(t,e){if(e&&e[re]&&e.value)switch(e[re]){case"DataFrame":return i.DataFrame.fromByteArray(new Uint8Array(e.value));case"ArrayBuffer":return new Uint8Array(e.value).buffer;case"Map":return new Map(e.value);case"Set":return new Set(e.value)}return e}const ie=[{name:"Null",predicate:function(t,e){return null==t&&null==e},checker:function(){}},{name:"Boolean",predicate:function(t,e){return"boolean"==typeof t&&"boolean"==typeof e},checker:oe},{name:"String",predicate:function(t,e){return"string"==typeof t&&"string"==typeof e},checker:oe},{name:"Integer",predicate:function(t,e){return Number.isInteger(t)&&Number.isInteger(e)},checker:oe},{name:"Float",predicate:function(t,e){return"number"==typeof t&&"number"==typeof e},checker:function(t,e,r){if(!(t===Number.POSITIVE_INFINITY&&e===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&e===Number.NEGATIVE_INFINITY||isNaN(t)&&isNaN(e)))return Math.abs(t-e)<r.options.floatTolerance?void 0:[{msg:`Expected ${e}, got ${t} (tolerance = ${r.options.floatTolerance})`}]}},{name:"Map",predicate:function(t,e){return t instanceof Map&&e instanceof Map},checker:function(t,e,r,n){const i=[];if(t.size!==e.size){const r={msg:`Maps are of different size: actual map size is ${t.size} and expected map size is ${e.size}`};i.push(r)}for(const r of e.keys()){const i=t.get(r),s=e.get(r);n([String(r)],i,s)}return i}},{name:"Set",predicate:function(t,e){return t instanceof Set&&e instanceof Set},checker:function(t,e,r,n){const i=[];if(t.size!==e.size){const r={msg:`Sets are of different size: actual set size is ${t.size} and expected set size is ${e.size}`};i.push(r)}for(const r of e.values()){const e=t.has(r);n([String(r)],e,!0)}return i}},{name:"ArrayBuffer",predicate:function(t,e){return t instanceof ArrayBuffer&&e instanceof ArrayBuffer},checker:function(t,e,r,n){return ae(Array.from(new Uint8Array(t)),Array.from(new Uint8Array(e)),0,n)}},{name:"Array",predicate:function(t,e){return t instanceof Array&&e instanceof Array},checker:ae},{name:"DataFrame",predicate:function(t,e){return t instanceof i.DataFrame&&e instanceof i.DataFrame},checker:function(t,e,r,n){const i=[];if(t.rowCount!==e.rowCount){const r={msg:`Dataframes has different row count: actual row count is ${t.rowCount} and expected row count is ${e.rowCount}`};i.push(r)}for(const r of e.columns){const s=t.columns.byName(r.name);if(s)if(s.type===r.type)for(let t=0;t<e.rowCount;t++){const e=s.get(t),i=r.get(t);n([r.name,String(t)],e,i)}else{const t={msg:`Column ${r.name} type expected ${r.type} got ${s.type}`};i.push(t)}else{const t={msg:`Column ${r.name} not found`};i.push(t)}}return i}},{name:"Object",predicate:function(t,e){return"object"==typeof t&&"object"==typeof e},checker:function(t,e,r,n){for(const[r,i]of Object.entries(e))n([r],t[r],i);return[]}}];class se extends Error{}function oe(t,e){if(t!==e)return[{msg:`Expected ${e}, got ${t}`}]}function ae(t,e,r,n){const i=[];if(t.length!==e.length){const r={msg:`Arrays are of different length: actual array length is ${t.length} and expected array length is ${e.length}`};i.push(r)}for(let r=0;r<t.length;r++)n([String(r)],t[r],e[r]);return i}const le={floatTolerance:.001,maxErrorsReport:5,maxDepth:128,checkersSeq:ie,prefix:""};class ue{constructor(t={}){this.options=Object.assign(Object.assign({},le),t),this.state={errors:[],currentPath:[],options:this.options}}run(t,e){this.matchChecker(t,e),this.checkErrorsLimit(0)}checkDeep(t,e,r){const n=t.length;if(this.state.currentPath.push(...t),this.state.currentPath.length>this.options.maxDepth)throw new se(`Max depth ${this.options.maxDepth} is exceeded, potentially a circular structure`);this.matchChecker(e,r),this.state.currentPath.splice(-n)}matchChecker(t,e){let r=!1;for(const{predicate:n,checker:i}of this.options.checkersSeq)if(n(t,e)){r=!0;const n=i(t,e,this.state,this.checkDeep.bind(this));n&&n.map((t=>this.addError(t)));break}if(!r){const r={msg:`Type mismatch or no checker defined: expected ${e}, got ${t}`};this.addError(r)}}addError(t){var e,r;const n={path:[...null!==(e=this.state.currentPath)&&void 0!==e?e:[],...null!==(r=t.path)&&void 0!==r?r:[]],msg:t.msg};this.state.errors.push(n),this.checkErrorsLimit()}checkErrorsLimit(t=this.options.maxErrorsReport){if(this.state.errors.length>t){const t=this.makeReport();throw new se(t)}}makeReport(){const t=this.state.errors.map((t=>{var e;const r=(null!==(e=t.path)&&void 0!==e?e:[]).map((t=>`['${String(t)}']`)).join("."),n=r?`${r}: ${t.msg}`:t.msg;return this.options.prefix?`${this.options.prefix}: ${n}`:n})).slice(0,this.options.maxErrorsReport).join("\n");return t}}var ce=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};function he(e,r){return ce(this,arguments,void 0,(function*(e,r,n={}){var i;yield function(t,e){return ce(this,void 0,void 0,(function*(){if(!(yield t.isReady.pipe((0,s.takeUntil)((0,c.of)(null).pipe((0,s.delay)(e))),(0,s.takeWhile)((t=>!t),!0),(0,s.last)()).toPromise()))throw new Error(`Waiting for view ${t.name} timeout`)}))}(r,null!==(i=n.initWaitTimeout)&&void 0!==i?i:2e4);const o=()=>ce(this,void 0,void 0,(function*(){var e;if(n.parent){const r=null!==(e=n.parentWaitTimeout)&&void 0!==e?e:5e3,i=yield n.parent.isUpdating.pipe((0,s.map)((()=>n.parent.getRunningUpdates())),(0,s.debounceTime)(100),(0,s.takeUntil)((0,c.of)(null).pipe((0,s.delay)(r))),(0,s.takeWhile)((t=>0!==t.length),!0),(0,s.last)()).toPromise();if(null==i?void 0:i.length){const e=`{options.prefix}: parent updates failed to complete in ${r}ms, updates: ${i.join(",")}`,s=new Error(e);throw n.interactive&&t.shell.error(String(s)),s}}}));yield o();for(const[t,i]of Object.entries(e.inputs)){const e=r.funcCall.inputParams[t].property.propertyType;n.updateMode?null==r.funcCall.inputs[t]&&(r.funcCall.inputs[t]=yield lt(e,i)):r.funcCall.inputs[t]=yield lt(e,i)}if(yield o(),yield(()=>ce(this,void 0,void 0,(function*(){var e;if(r instanceof dr){const i=null!==(e=n.validatorsWaitTimeout)&&void 0!==e?e:5e3,o=yield r.pendingValidations.pipe((0,s.map)((t=>Object.keys(t))),(0,s.debounceTime)(100),(0,s.takeUntil)((0,c.of)(null).pipe((0,s.delay)(i))),(0,s.takeWhile)((()=>!r.isValid()),!0),(0,s.last)()).toPromise();if(null==o?void 0:o.length){const e=`{options.prefix}: validators failed to accept input in ${i}ms, inputs: ${o.join(",")}`,r=new Error(e);throw n.interactive&&t.shell.error(String(r)),r}}})))(),console.log(`running ${r.func.nqName}`),yield r.run(),!n.updateMode){console.log(`checking ${r.func.nqName} results`);try{!function(t,e,r){new ue(r).run(t,e)}(r.funcCall.outputs,e.outputs,n),!n.parent&&n.interactive&&t.shell.info(`${r.name} test passed`)}catch(e){throw n.interactive&&t.shell.error(String(e)),e}console.log(`${r.func.nqName} ok`)}}))}var de=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};const fe=new URL(t.shell.startUri),pe="Run Data JSON",me=()=>de(void 0,void 0,void 0,(function*(){const t=yield navigator.mediaDevices.getDisplayMedia({video:!0,audio:!1,selfBrowserSurface:"include"}),e=new MediaRecorder(t),r=[];e.ondataavailable=t=>r.push(t.data),e.onstop=()=>{const e=new Blob(r,{type:r[0].type});t.getVideoTracks()[0].stop(),i.Utils.download(`Recording ${(new Date).toLocaleString("en-us",{month:"short",day:"numeric",hour:"numeric",minute:"numeric"})}.mkv`,e,r[0].type)},e.start()}));class be extends i.ViewBase{constructor(r,n={historyEnabled:!0,isTabbed:!1,skipInit:!1}){var s,o,a,l,u;super(),this.initValue=r,this.options=n,this._type="function",this.funcCallReplaced=new c.Subject,this.isReady=new c.BehaviorSubject(!1),this.exportConfig=null,this.getMocks=null,this.getTemplates=null,this.getHelp=null,this.reportBug=null,this.requestFeature=null,this.getAbout=null,this.historyBlock=null,this.isHistorical=new c.BehaviorSubject(!1),this.historyRoot=e.div(),this.consistencyState=new c.BehaviorSubject("consistent"),this.defaultExportFilename=(t,e)=>`${this.name} - ${(new Date).toLocaleString("en-US").replaceAll(/:|\//g,"-")}.${null!=e?e:this.exportConfig.supportedExtensions[t]}`,this.defaultSupportedExportExtensions=()=>({Excel:"xlsx"}),this.defaultSupportedExportFormats=()=>["Excel"],this.helpCache=null,this.box=!0,this.parentCall=t.functions.getCurrentCall(),r instanceof i.FuncCall&&(this.parentCall=r),this.parentView=null===(a=null===(o=null===(s=this.parentCall)||void 0===s?void 0:s.parentCall)||void 0===o?void 0:o.aux)||void 0===a?void 0:a.view,(null===(u=null===(l=this.parentCall)||void 0===l?void 0:l.func)||void 0===u?void 0:u.name)&&(this.basePath=`/${this.parentCall.func.name}`),n.skipInit||this.init()}onFuncCallReady(){return de(this,void 0,void 0,(function*(){if(yield ht.augmentCallWithFunc(this.funcCall,!1),!this.options.isTabbed){this.name&&"New view"!==this.name||(this.name=this.funcCall.func.friendlyName);try{this.func.package&&(yield this.getPackageData())}catch(t){console.log(t)}}this.build();const t=this.getStartId();if(t&&!this.options.isTabbed&&(e.setUpdateIndicator(this.root,!0),this.loadRun(t),e.setUpdateIndicator(this.root,!1),this.setAsLoaded()),this.isHistoryEnabled&&this.func){const t=this.options.isTabbed?this.isHistorical.subscribe((t=>{t||(this.funcCall.id=null)})):this.isHistorical.subscribe((t=>{var e,r;if(t){this.path=`?id=${this.funcCall.id}`;const t=Ft(this.funcCall);this.name.indexOf(" — ")<0?this.name=`${this.name} — ${null!==(e=this.funcCall.options.title)&&void 0!==e?e:t}`:this.name=`${this.name.substring(0,this.name.indexOf(" — "))} — ${null!==(r=this.funcCall.options.title)&&void 0!==r?r:t}`}else this.path="",this.funcCall.id=null,this.name=`${this.name.substring(0,this.name.indexOf(" — ")>0?this.name.indexOf(" — "):void 0)}`}));this.subs.push(t)}}))}getStartId(){return t.shell.getVar("isLoaded")?void 0:fe.searchParams.get("id")}setAsLoaded(){return t.shell.setVar("isLoaded",!0)}get funcCall(){return this._funcCall}get func(){var t;return null===(t=this.funcCall)||void 0===t?void 0:t.func}get lastCall(){return this._lastCall}set lastCall(t){this._lastCall=t}get type(){return this._type}getPackageData(){return de(this,void 0,void 0,(function*(){var t,e;const r=this.func.package;if(!r)return;const n=null===(t=yield null==r?void 0:r.getProperties())||void 0===t?void 0:t.REPORT_BUG_URL;n&&!this.reportBug&&(this.reportBug=()=>de(this,void 0,void 0,(function*(){window.open(n,"_blank")})));const i=null===(e=yield null==r?void 0:r.getProperties())||void 0===e?void 0:e.REQUEST_FEATURE_URL;i&&!this.requestFeature&&(this.requestFeature=()=>de(this,void 0,void 0,(function*(){window.open(i,"_blank")})));const s=`${r.friendlyName}.\nLast updated on ${d()(r.updatedOn).format("YYYY MMM D, HH:mm")}`;this.getAbout||(this.getAbout=()=>de(this,void 0,void 0,(function*(){return s})))}))}linkFunccall(t){this._funcCall=t,this.funcCallReplaced.next(!0)}loadFuncCallById(){return de(this,void 0,void 0,(function*(){if(this.initValue instanceof i.FuncCall)return yield new Promise((t=>setTimeout(t,0))),void this.linkFunccall(this.initValue);e.setUpdateIndicator(this.root,!0);const r=this.getStartId();if(r&&!this.options.isTabbed)this.linkFunccall(yield ht.loadRun(r));else{const e=yield t.functions.eval(this.initValue);this.linkFunccall(e.prepare({}))}e.setUpdateIndicator(this.root,!1)}))}init(){return de(this,void 0,void 0,(function*(){yield this.loadFuncCallById(),yield this.onFuncCallReady(),this.isReady.next(!0)}))}build(){e.empty(this.root),this.root.appendChild(this.buildIO()),this.options.historyEnabled&&this.isHistoryEnabled&&this.buildHistoryBlock(),this.buildRibbonMenu(),this.buildRibbonPanels()}onComparisonLaunch(e){return de(this,void 0,void 0,(function*(){const r=this.comparatorFunc;if(r){const n=yield t.functions.eval(r),i=(yield n.prepare({params:{comparedRuns:e}}).call()).outputs.comparisonView;return void t.shell.addView(i)}const n=t.shell.v.parentCall,i=[...t.shell.views].find((t=>t.type===b)),s=yield ee.fromComparedRuns(e,this.func,{parentView:i,parentCall:n});t.shell.addView(s),s.defaultCustomize();const o=this.compareCustomizer;if(o){const e=yield t.functions.eval(o);yield e.prepare({params:{defaultView:s}}).call()}}))}onSaveClick(){return de(this,void 0,void 0,(function*(){yield this.saveRun(this.funcCall)}))}buildHistoryBlock(){const r=Zt.historyPanel(this.func);let n=!1;return this.subs.push(r.onCompactModeChanged.subscribe((e=>{const r=t.shell.dockManager.findNode(this.historyRoot);r&&(t.shell.dockManager.close(r),e?t.shell.dockManager.dock(this.historyRoot,"right",null,"History",.3):t.shell.dockManager.dock(this.historyRoot,"down",null,"History",.3))})),r.onRunChosen.subscribe((t=>de(this,void 0,void 0,(function*(){e.setUpdateIndicator(this.root,!0),yield this.loadRun(t),e.setUpdateIndicator(this.root,!1)})))),r.onComparison.subscribe((t=>de(this,void 0,void 0,(function*(){Nt(r.root,!0);const e=yield Promise.all(t.map((t=>ht.loadRun(t))));yield this.onComparisonLaunch(e),Nt(r.root,!1)})))),r.afterRunEdited.subscribe((t=>{var e,r;if(t.id===this.funcCall.id&&t.options.title){this.path=`?id=${this.funcCall.id}`;const n=Ft(t);this.name.indexOf(" — ")<0?this.name=`${this.name} — ${null!==(e=t.options.title)&&void 0!==e?e:n}`:this.name=`${this.name.substring(0,this.name.indexOf(" — "))} — ${null!==(r=t.options.title)&&void 0!==r?r:n}`}})),t.events.onCurrentViewChanged.subscribe((()=>{var e;if(t.shell.v==this)n&&((null===(e=this.historyBlock)||void 0===e?void 0:e.compactMode)?t.shell.dockManager.dock(this.historyRoot,"right",null,"History",.3):t.shell.dockManager.dock(this.historyRoot,"down",null,"History",.3));else{const e=t.shell.dockManager.findNode(this.historyRoot);e?(t.shell.dockManager.close(e),n=!0):n=!1}}))),e.empty(this.historyRoot),this.historyRoot.style.removeProperty("justify-content"),this.historyRoot.append(r.root),this.historyBlock=r,r.root}buildRibbonPanels(){const r=e.iconFA("history",(()=>{var e;t.shell.dockManager.findNode(this.historyRoot)||((null===(e=this.historyBlock)||void 0===e?void 0:e.compactMode)?t.shell.dockManager.dock(this.historyRoot,"right",null,"History",.3):t.shell.dockManager.dock(this.historyRoot,"down",null,"History",.3),this.historyRoot.parentElement.classList.add("ui-box"),this.historyRoot.classList.add("ui-box"))})),n=e.iconFA("save",(()=>de(this,void 0,void 0,(function*(){yield this.onSaveClick()}))),"Save current state"),i=e.comboPopup(e.iconFA("arrow-to-bottom"),this.getFormats(),this.exportRun.bind(this)),o=e.iconFA("edit",(()=>{this.historyBlock&&this.lastCall&&this.historyBlock.showEditDialog(this.historyBlock.history.get(this.funcCall.id))}),"Edit this run metadata"),l=this.isHistorical.subscribe((t=>{t?(e.setDisplay(i,!K(this.funcCall)),e.setDisplay(o,!0)):(a()(i).hide(),a()(o).hide())}));if(this.subs.push(l),e.tooltip.bind(i,(()=>"inconsistent"===this.consistencyState.value&&this.mandatoryConsistent?"Current run is inconsistent. Export feature is disabled.":null)),!this.options.isTabbed&&this.mandatoryConsistent){const t=this.consistencyState.pipe((0,s.distinctUntilChanged)()).subscribe((t=>{"inconsistent"===t?(a()(i).addClass("d4-disabled"),a()(i.lastChild).css("color","unset")):(a()(i).removeClass("d4-disabled"),a()(i.lastChild).removeProp("color"))}));this.subs.push(t)}const u=[[...!this.options.isTabbed&&this.isHistoryEnabled&&this.options.historyEnabled?[r]:[],...!this.options.isTabbed&&this.isHistoryEnabled?[n]:[],...!this.options.isTabbed&&this.isExportEnabled&&this.exportConfig&&this.exportConfig.supportedFormats.length>0?[i]:[],...this.options.isTabbed?[]:[o]]];return this.setRibbonPanels(u),u}buildRibbonMenu(){if(this.ribbonMenu.clear(),!(this.exportConfig||this.reportBug||this.requestFeature||this.getHelp||this.getMocks||this.getTemplates))return;const t=this.ribbonMenu.group("Model");if(this.getMocks&&this.getMocks.length>0)if(1===this.getMocks.length)t.item("Input data mock",this.getMocks[0].action);else{const e=t.group("Input data mocks");this.getMocks.forEach((t=>{e.item(t.mockName,t.action)})),t.endGroup()}if(this.getTemplates&&this.getTemplates.length>0)if(1===this.getTemplates.length)t.item("Input data template",this.getTemplates[0].action);else{const e=t.group("Input data templates");this.getTemplates.forEach((t=>{e.item(t.name,t.action)})),t.endGroup()}this.isExportEnabled&&this.exportConfig&&this.exportConfig.supportedFormats.length>0&&t.group("Export").items(this.getFormats(),this.exportRun.bind(this)).endGroup(),this.reportBug&&t.item("Report a bug",(()=>this.reportBug())),this.requestFeature&&t.item("Request a feature",(()=>this.requestFeature())),this.getHelp&&t.item("Help",(()=>this.getHelp()));const r=t.group("Test runner");r.item("Execute Test JSON",(()=>this.importRunJsonDialog())),r.item("Update Test JSON",(()=>this.importRunJsonDialog(!0))),t.endGroup(),t.item("Record the screen",me),this.getAbout&&t.item("About",(()=>de(this,void 0,void 0,(function*(){const t=yield this.getAbout();if(t){const r=e.dialog("Current version");t.split("\n").forEach((t=>r.add(e.label(t)))),r.onOK((()=>{})),r.getButton("CANCEL").style.display="none",r.show({center:!0})}}))))}exportRun(t){return de(this,void 0,void 0,(function*(){if(t!==pe)i.Utils.download(this.exportConfig.filename(t),yield this.exportConfig.export(t));else{const t=yield this.exportRunJson();t&&i.Utils.download(this.defaultExportFilename("","json"),t)}}))}getFormats(){var t,e;return[...null!==(e=null===(t=this.exportConfig)||void 0===t?void 0:t.supportedFormats)&&void 0!==e?e:[],pe]}onBeforeSaveRun(t){return de(this,void 0,void 0,(function*(){}))}onAfterSaveRun(t){return de(this,void 0,void 0,(function*(){}))}saveRun(e){return de(this,void 0,void 0,(function*(){let r=et(e);var n;yield this.onBeforeSaveRun(r),K(e)&&(r=yield(n=e,G(void 0,void 0,void 0,(function*(){const e=(yield t.functions.eval(n.func.nqName)).prepare([...n.inputs].reduce(((t,[e,r])=>(t[e]=r,t)),{}));return n.options.forEach((t=>e.options[t]=n.options[t])),e})))),r.id&&r.newId();const i=yield ht.saveRun(r),s=yield ht.loadRun(i.id);return this.options.historyEnabled&&this.isHistoryEnabled&&this.historyBlock&&this.historyBlock.addRun(s),this.linkFunccall(s),this.isHistorical.next(!0),yield this.onAfterSaveRun(i),i}))}onBeforeDeleteRun(t){return de(this,void 0,void 0,(function*(){}))}onAfterDeleteRun(t){return de(this,void 0,void 0,(function*(){}))}deleteRun(t){return de(this,void 0,void 0,(function*(){return yield this.onBeforeDeleteRun(t),yield ht.deleteRun(t),yield this.onAfterDeleteRun(t),t.id}))}onBeforeLoadRun(){return de(this,void 0,void 0,(function*(){}))}onAfterLoadRun(t){return de(this,void 0,void 0,(function*(){}))}loadRun(t){return de(this,void 0,void 0,(function*(){yield this.onBeforeLoadRun();const e=yield ht.loadRun(t);return this.lastCall=et(e),this.linkFunccall(e),this.isHistorical.next(!0),yield this.onAfterLoadRun(e),e}))}onBeforeRun(t){return de(this,void 0,void 0,(function*(){}))}onAfterRun(t){return de(this,void 0,void 0,(function*(){}))}run(){return de(this,void 0,void 0,(function*(){if(!this.funcCall)throw new Error("The correspoding function is not specified");yield this.onBeforeRun(this.funcCall);const e=i.TaskBarProgressIndicator.create("Calculating...");try{this.funcCall.newId(),yield this.funcCall.call(),yield this.onAfterRun(this.funcCall),this.lastCall=et(this.funcCall),this.options.isTabbed||this.runningOnInput||!this.isHistoryEnabled||(yield this.saveRun(this.funcCall))}catch(e){t.shell.error(e.toString())}finally{e.close()}}))}exportRunJson(){return de(this,void 0,void 0,(function*(){if(this._lastCall)return function(t,e=2){return JSON.stringify(t,((t,e)=>e instanceof i.DataFrame?{[re]:"DataFrame",value:Array.from(e.toByteArray())}:e instanceof ArrayBuffer?{[re]:"ArrayBuffer",value:Array.from(new Uint8Array(e))}:e instanceof Map?{[re]:"Map",value:Array.from(e)}:e instanceof Set?{[re]:"Set",value:Array.from(e)}:e),e)}(yield function(t,e){return G(this,void 0,void 0,(function*(){const r={};for(const[n,i]of Object.entries(t.inputs)){const{property:t}=e.funcCall.inputParams[n];r[n]=yield at(t,i,e)}return{inputs:r,outputs:t.outputs}}))}(this._lastCall,this),0)}))}importRunJsonDialog(){return de(this,arguments,void 0,(function*(t=!1){const r=new Et("JSON file",null,null,"application/json"),n={modal:!0,fullScreen:!0,width:500,height:200,center:!0};if(!(yield new Promise(((t,i)=>{e.dialog({title:"Import Run JSON"}).add(e.div([e.inputs([r])])).onOK((()=>t(!0))).onCancel((()=>t(!1))).show(n)})))||!r.value)return;const i=(o=yield r.value.text(),JSON.parse(o,ne));var o;t?(yield this.executeTest(i,!0),yield this.isHistorical.pipe((0,s.filter)((t=>t)),(0,s.take)(1),(0,s.delay)(0)).toPromise(),yield this.exportRun(pe)):yield this.executeTest(i)}))}executeTest(t){return de(this,arguments,void 0,(function*(t,e=!1){yield he(t,this,{updateMode:e,interactive:!0})}))}get compareCustomizer(){var t;return null!==(t=this.func.options.compareCustomizer)&&void 0!==t?t:null}get comparatorFunc(){var t;return null!==(t=this.func.options.comparatorFunc)&&void 0!==t?t:null}get uploadFunc(){var t;return null!==(t=this.func.options.uploadFunc)&&void 0!==t?t:null}get runningOnInput(){return"true"===this.func.options.runOnInput}get runningOnStart(){return"true"===this.func.options.runOnOpen}get mainParams(){return this.func.options.mainParams?JSON.parse(this.func.options.mainParams):null}get mandatoryConsistent(){var t;return"true"===(null===(t=this.parentCall)||void 0===t?void 0:t.func.options.mandatoryConsistent)}get hasContextHelp(){return!!this.func.options.help}getContextHelp(){return de(this,void 0,void 0,(function*(){const e=this.func.options.help;if(!e)return null;if(this.helpCache)return this.helpCache;const r=`System:AppData/${e}`;if(yield t.dapi.files.exists(r)){const e=yield t.dapi.files.readAsText(r);return this.helpCache=e,e}const n=`${t.shell.user.name}.home/${e}`;if(yield t.dapi.files.exists(n)){const e=yield t.dapi.files.readAsText(n);return this.helpCache=e,e}return null}))}get features(){var t;return JSON.parse(null!==(t=this.func.options.features)&&void 0!==t?t:"{}")}getFeature(t,e){var r;return this.features instanceof Array?this.features.includes(t):this.features instanceof Object&&null!==(r=this.features[t])&&void 0!==r?r:e}get isExportEnabled(){return this.getFeature("export",!0)}get isHistoryEnabled(){return this.getFeature("history",!0)}get isSaEnabled(){return this.getFeature("sens-analysis",!1)}get hasUploadMode(){return this.getFeature("upload",!1)}}var ge=Uint8Array,ye=Uint16Array,ve=Uint32Array,we=new ge([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_e=new ge([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xe=(new ge([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),function(t,e){for(var r=new ye(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];var i=new ve(r[30]);for(n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return[r,i]}),Se=xe(we,2),Ce=Se[0],Ae=Se[1];Ce[28]=258,Ae[258]=28;for(var ke=xe(_e,0),Te=(ke[0],ke[1],new ye(32768)),Ee=0;Ee<32768;++Ee){var Me=(43690&Ee)>>>1|(21845&Ee)<<1;Me=(61680&(Me=(52428&Me)>>>2|(13107&Me)<<2))>>>4|(3855&Me)<<4,Te[Ee]=((65280&Me)>>>8|(255&Me)<<8)>>>1}var Re=new ge(288);for(Ee=0;Ee<144;++Ee)Re[Ee]=8;for(Ee=144;Ee<256;++Ee)Re[Ee]=9;for(Ee=256;Ee<280;++Ee)Re[Ee]=7;for(Ee=280;Ee<288;++Ee)Re[Ee]=8;var Ie=new ge(32);for(Ee=0;Ee<32;++Ee)Ie[Ee]=5;var Oe=new ge(0),je="undefined"!=typeof TextDecoder&&new TextDecoder;try{je.decode(Oe,{stream:!0})}catch(t){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout,r(974);var Pe=r(933),Ne={};Ne.styleTagTransform=St(),Ne.setAttributes=vt(),Ne.insert=gt().bind(null,"head"),Ne.domAPI=mt(),Ne.insertStyleElement=_t(),ft()(Pe.A,Ne),Pe.A&&Pe.A.locals&&Pe.A.locals;var Be=r(362),Fe={};Fe.styleTagTransform=St(),Fe.setAttributes=vt(),Fe.insert=gt().bind(null,"head"),Fe.domAPI=mt(),Fe.insertStyleElement=_t(),ft()(Be.A,Fe),Be.A&&Be.A.locals&&Be.A.locals;var De,Le;!function(t){t.INCORRECT_SIZE_TYPE="Size must be an integer.",t.SIZE_MUST_BE_POSITIVE="Size must be positive."}(De||(De={})),function(t){t[t.BATCH_SIZE=100]="BATCH_SIZE",t[t.MS_TO_SLEEP=10]="MS_TO_SLEEP"}(Le||(Le={}));const Ve=t=>new Promise(((e,r)=>setTimeout(e,t)));function ze(t){if(!Number.isInteger(t))throw new Error(De.INCORRECT_SIZE_TYPE);if(t<1)throw new Error(De.SIZE_MUST_BE_POSITIVE)}function Ue(t){return e=this,r=void 0,s=function*(){const e=[],r=i.TaskBarProgressIndicator.create("Running sensitivity analysis...");r.cancelable=!0;let n=0;const s=t.length;for(let i=0;i<s&&(e.push(yield t[i].call()),1===i&&(r.update(100*i/s,"Running sensitivity analysis..."),yield Ve(10*Le.MS_TO_SLEEP)),++n,!r.canceled);++i)n>=Le.BATCH_SIZE&&(r.update(100*i/s,"Running sensitivity analysis..."),yield Ve(Le.MS_TO_SLEEP),n=0);return r.close(),e},new((n=void 0)||(n=Promise))((function(t,i){function o(t){try{l(s.next(t))}catch(t){i(t)}}function a(t){try{l(s.throw(t))}catch(t){i(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(o,a)}l((s=s.apply(e,r||[])).next())}));var e,r,n,s}class $e{constructor(t=1,e=1){ze(t),ze(e),this.N=t,this.d=e,this.A=this.generateMatrix(t,e),this.B=this.generateMatrix(t,e),this.AB=this.createMixMatrax(this.A,this.B)}generateMatrix(t,e){const r=new Array(e);for(let n=0;n<e;++n){r[n]=new Float32Array(t);for(let e=0;e<t;++e)r[n][e]=Math.random()}return r}createMixMatrax(t,e){const r=this.d,n=new Array(r);for(let i=0;i<r;++i){n[i]=new Array(0);for(let s=0;s<r;++s)i!==s?n[i].push(t[s]):n[i].push(e[s])}return n}getRow(t,e){const r=new Float32Array(this.d);for(let n=0;n<this.d;++n)r[n]=t[n][e];return r}getRowOfMatrixA(t){return this.getRow(this.A,t)}getRowOfMatrixB(t){return this.getRow(this.B,t)}getRowOfMatrixAB(t,e){return this.getRow(this.AB[t],e)}getConcatenatedColumns(){const t=new Array(0),e=this.N,r=this.d;for(let n=0;n<r;++n){const i=new Float32Array(e*(r+2));i.set(this.A[n]),i.set(this.B[n],e);for(let t=0;t<r;++t)i.set(this.AB[t][n],2*e+e*t);t.push(i)}return t}}const He="Unsupported output type.";function We(e,r){const n=e.rowCount,s=r.value.row;if(null!==s)return e.columns.names().map((t=>({idx:s,columnName:t})));const o=e.col(r.value.colName);if(null===o)return t.shell.warning(`Output dataframe "${e.name}" doesn't contain the "${r.value.colName}" column. The last row is analyzed.`),e.columns.names().map((t=>({idx:n-1,columnName:t})));if(o.type!==i.COLUMN_TYPE.INT&&o.type!==i.COLUMN_TYPE.FLOAT)return t.shell.warning(`Non-supported type of the "${r.value.colName}" column: ${o.type}. Last row of the output dataframe "${e.name}" is analyzed.`),e.columns.names().map((t=>({idx:n-1,columnName:t})));const a=o.getRawData(),l=r.value.colValue;let u,c=0,h=Math.abs(a[0]-l);for(let t=1;t<n;++t)u=Math.abs(a[t]-l),u<h&&(h=u,c=t);return e.columns.names().map((t=>({idx:c,columnName:t})))}function qe(t,e){var r,n,s;if(t.length<1)throw new Error("Funccall array is empty.");const o=t.length,a=function(t,e){const r=[];for(const n of e)n.prop.propertyType==i.TYPE.DATA_FRAME?r.push({prop:n.prop,elements:We(t.outputs[n.prop.name],n)}):r.push({prop:n.prop,elements:[]});return r}(t[0],e),l=function(t,e,r){var n;const s=[];for(const o of e){const e=o.prop,a=e.name;switch(e.propertyType){case i.TYPE.BIG_INT:case i.TYPE.INT:case i.TYPE.FLOAT:s.push(i.Column.fromType(e.propertyType,a,r));break;case i.TYPE.DATA_FRAME:const l=t.outputs[a];if(o.elements)for(const t of o.elements)s.push(i.Column.fromType(null===(n=l.col(t.columnName))||void 0===n?void 0:n.type,t.columnName,r));break;default:throw new Error(He)}}return i.DataFrame.fromColumns(s)}(t[0],a,o);for(let e=0;e<o;++e)for(const o of a){const a=o.prop,u=a.name,c=t[e];switch(a.propertyType){case i.TYPE.BIG_INT:case i.TYPE.INT:case i.TYPE.FLOAT:null===(r=l.col(u))||void 0===r||r.set(e,c.outputs[u]);break;case i.TYPE.DATA_FRAME:const t=c.outputs[u],a=t.rowCount-1;if(o.elements)for(const r of o.elements)null===(n=l.col(r.columnName))||void 0===n||n.set(e,null===(s=t.col(r.columnName))||void 0===s?void 0:s.get(-1!==r.idx?r.idx:a));break;default:throw new Error(He)}}return l}function Ye(t,e){const r=function(t,e){return e.forEach((e=>{t.forEach((t=>{t.name===e.name&&(t.name=`${t.name} (input)`,e.name=`${e.name} (output)`)}))})),t.concat(e)}(t,e),n=r.length;if(0===n)return i.DataFrame.create();const s=i.DataFrame.fromColumns([r[0]]);for(let t=1;t<n;++t)r[t].name=s.columns.getUnusedName(r[t].name),s.columns.add(r[t]);return s}class Xe{constructor(t,e,r,n,s){ze(s),this.samplesCount=s,this.fixedInputs=e,this.func=t;const o=function(t,e){const r=e.length,n=function(t,e){return new $e(t,e).getConcatenatedColumns()}(t,r);return[...Array(r).keys()].map((t=>function(t,e){var r;const n=e.length,s=i.Column.fromType(t.prop.propertyType,null!==(r=t.prop.caption)&&void 0!==r?r:t.prop.name,n),o=s.getRawData(),a=t.max-t.min;for(let r=0;r<n;++r)o[r]=t.min+a*e[r];return s}(e[t],n[t])))}(s,r);this.dimension=r.length,this.variedInputs=[...Array(this.dimension).keys()].map((t=>({prop:r[t].prop,min:r[t].min,max:r[t].max,column:o[t]}))),this.runsCount=s*(this.dimension+2),this.funcCalls=[];for(let r=0;r<this.runsCount;++r){const n={};for(const t of e)n[t.name]=t.value;for(const t of this.variedInputs)n[t.prop.name]=t.column.get(r);this.funcCalls.push(t.prepare(n))}this.outputsOfInterest=n}getSobolIndeces(t){const e=this.dimension,r=this.samplesCount,n=new Float32Array(e),s=new Float32Array(e),o=t.getRawData(),a=2*r;let l=0,u=0;for(let t=0;t<a;++t)l+=o[t],u+=o[t]*o[t];const c=l/a,h=u/a-c*c;if(0===h)n.fill(0),s.fill(0);else for(let t=0;t<e;++t){let e=0,i=0,a=0;for(let n=0;n<r;++n)a=o[(2+t)*r+n]-o[n],e+=o[r+n]*a,i+=a*a;n[t]=e/(r*h),s[t]=i/(2*r*h)}return{firstOrder:i.Column.fromFloat32Array(t.name,n),totalOrder:i.Column.fromFloat32Array(t.name,s)}}perform(){return t=this,e=void 0,n=function*(){this.funcCalls=yield Ue(this.funcCalls);const t=this.variedInputs.map((t=>t.column)),e=qe(this.funcCalls,this.outputsOfInterest).columns.toList(),r=Ye(t,e);r.name=`Sensitivity Analysis of ${this.func.friendlyName}`;const n=e.map((t=>this.getSobolIndeces(t))),s=i.Column.fromStrings("input",t.map((t=>t.name))),o=[s],a=[s];for(const t of n)o.push(t.firstOrder),a.push(t.totalOrder);const l=i.DataFrame.fromColumns(o);l.name="First order Sobol' indices";const u=i.DataFrame.fromColumns(a);return u.name="Total order Sobol' indices",{funcEvalResults:r,funcCalls:this.funcCalls,firstOrderSobolIndices:l,totalOrderSobolIndices:u}},new((r=void 0)||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}));var t,e,r,n}}class Ge{constructor(t,e,r,n,s){ze(s),this.func=t;const o=function(t,e){var r;const n=[];for(const s of e){const e=i.Column.fromType(s.prop.propertyType,null!==(r=s.prop.caption)&&void 0!==r?r:s.prop.name,t),o=e.getRawData(),a=s.max-s.min;for(let e=0;e<t;++e)o[e]=s.min+a*Math.random();n.push(e)}return n}(s,r);this.dimension=r.length,this.variedInputs=[...Array(this.dimension).keys()].map((t=>({prop:r[t].prop,min:r[t].min,max:r[t].max,column:o[t]}))),this.funcCalls=[];for(let r=0;r<s;++r){const n={};for(const t of e)n[t.name]=t.value;for(const t of this.variedInputs)n[t.prop.name]=t.column.get(r);this.funcCalls.push(t.prepare(n))}this.outputsOfInterest=n}perform(){return t=this,e=void 0,n=function*(){this.funcCalls=yield Ue(this.funcCalls);const t=Ye(this.variedInputs.map((t=>t.column)),qe(this.funcCalls,this.outputsOfInterest).columns.toList());return t.name=`Sensitivity Analysis of ${this.func.friendlyName}`,{funcEvalResults:t,funcCalls:this.funcCalls}},new((r=void 0)||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}));var t,e,r,n}}var Ke,Ze,Je=r(993),Qe={};Qe.styleTagTransform=St(),Qe.setAttributes=vt(),Qe.insert=gt().bind(null,"head"),Qe.domAPI=mt(),Qe.insertStyleElement=_t(),ft()(Je.A,Qe),Je.A&&Je.A.locals&&Je.A.locals,function(t){t[t.COR_PLOT=.5]="COR_PLOT",t[t.PC_PLOT=.6]="PC_PLOT",t[t.GRAPH=.6]="GRAPH",t[t.BAR_CHART=.2]="BAR_CHART"}(Ke||(Ke={})),function(t){t.METHOD="`Method`",t.SAMPLES="`Samples`"}(Ze||(Ze={}));const tr=`# Sensitivity Analysis\n\nSensitivity Analysis runs the computation multiple times with varying inputs, \nand analyzes the relationship between inputs and outputs.\n\nUse one of the following methods:\n\n* [Monte Carlo](https://en.wikipedia.org/wiki/Monte_Carlo_method) explores a function \nat randomly taken points\n\n* [Sobol](https://en.wikipedia.org/wiki/Variance-based_sensitivity_analysis)\ndecomposes output variance into fractions, which can be attributed to inputs\n\n* **Grid** studies a function at the points of a grid with the specified step\n\n## Monte Carlo\n\nOnce you've chosen it in ${Ze.METHOD}\n\n* Set in ${Ze.SAMPLES} the number of random points \n\n* Use switchers to specify varied inputs and outputs to be analyzed\n\n* Press **Run** or <i class="fas fa-play"></i> on the top panel. You will get \n\n * [Correlation plot](https://datagrok.ai/help/visualize/viewers/correlation-plot) for exploring\ncorrelations between varied inputs and the specified outputs\n\n * [PC plot](https://datagrok.ai/help/visualize/viewers/pc-plot) visualizing multivariate data\nand providing variations of the selected inputs & outputs\n\n * [Line chart](https://datagrok.ai/help/visualize/viewers/line-chart) or \n[Scatterplot](https://datagrok.ai/help/visualize/viewers/scatter-plot) (dependently on the varied\ninputs count) showing a behavior of each output separately\n\n * [Grid](https://datagrok.ai/help/visualize/viewers/grid) containing inputs and outputs values \nof each function evaluation\n\n* Press <i class="grok-icon fal fa-question"></i> on the top panel to learn more about \n[Sensitivity Analysis](https://datagrok.ai/help/compute/#sensitivity-analysis)\n\n## Sobol\n\nThis method performs \n[variance-based sensitivity analysis](https://en.wikipedia.org/wiki/Variance-based_sensitivity_analysis). \nIt provides the same visualizations \nas **Monte Carlo** and [bar charts](https://datagrok.ai/help/visualize/viewers/bar-chart) showing \nSobol' indices:\n\n* First-order indices indicate the contribution to the output variance of varying each input alone\n\n* Total-order indices measure the contribution to the output variance of each input,\n including all variance caused by its interactions with any other inputs\n \n ## Grid\n \n This method provides the same visualization as the previous ones. Unlike them, it evaluates a function \n at the points of uniform grid within the specified ranges.`;var er=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};const rr=[i.TYPE.INT,i.TYPE.BIG_INT,i.TYPE.FLOAT,i.TYPE.BOOL,i.TYPE.DATA_FRAME],nr=[i.TYPE.INT,i.TYPE.BIG_INT,i.TYPE.FLOAT,i.TYPE.BOOL,i.TYPE.DATA_FRAME];var ir,sr;!function(t){t.GRID_ANALYSIS="Grid",t.RANDOM_ANALYSIS="Monte Carlo",t.SOBOL_ANALYSIS="Sobol"}(ir||(ir={})),function(t){t.LAST_ROW="Last row",t.FIRST_ROW="First row",t.ALL_COLUMNS="",t.BY_COL_VAL="By value in column"}(sr||(sr={}));const or=()=>e.div([],"sa-switch-input");class ar{static fromEmpty(e){return er(this,arguments,void 0,(function*(e,r={parentView:void 0,parentCall:void 0}){const n=[...t.shell.views].find((t=>t.type===b)),i=yield ee.fromComparedRuns([],e,{parentView:n,parentCall:r.parentCall});t.shell.addView(i),new this(e,i,r)}))}constructor(t,r,n={parentView:void 0,parentCall:void 0,configFunc:void 0}){this.func=t,this.options=n,this.generateInputFields=t=>{const r={analysisType:{input:e.choiceInput("Method",ir.RANDOM_ANALYSIS,[ir.RANDOM_ANALYSIS,ir.SOBOL_ANALYSIS,ir.GRID_ANALYSIS],(t=>{r.analysisType.value.next(t),this.updateRunWidgetsState(),this.setAnalysisInputTooltip(),this.store.analysisInputs.samplesCount.input.setTooltip(this.samplesCountTooltip())})),value:new c.BehaviorSubject(ir.RANDOM_ANALYSIS)},samplesCount:{input:e.intInput("Samples",10,(t=>{r.samplesCount.value=t,this.updateRunWidgetsState()})),value:10}};r.analysisType.input.root.insertBefore(or(),r.analysisType.input.captionLabel),r.samplesCount.input.root.insertBefore(or(),r.samplesCount.input.captionLabel);const n=(t,e)=>void 0===t.options[e]?t.defaultValue:Number(t.options[e]),s=(t,r,n=!0)=>{const i=e.switchInput(" ",t,r);return a()(i.root).addClass("sa-switch-input"),a()(i.captionLabel).hide(),e.tooltip.bind(i.root,(()=>n?i.value?"Switch to mark input as immutable":"Switch to mark input as mutable":i.value?"Switch to mark output as not requiring analysis":"Switch to mark output as requiring analysis")),i},o=t.inputs.reduce(((t,o)=>{switch(o.propertyType){case i.TYPE.INT:case i.TYPE.BIG_INT:case i.TYPE.FLOAT:const l=s(!1,(t=>{f.isChanging.next(t),this.updateRunWidgetsState()})),u=s(!1,(t=>{f.isChanging.next(t),this.updateRunWidgetsState()})),h={type:o.propertyType,prop:o,const:{input:(()=>{var t;const r=e.intInput(null!==(t=o.caption)&&void 0!==t?t:o.name,o.defaultValue,(t=>f.const.value=t));return r.root.insertBefore(u.root,r.captionLabel),r.addPostfix(o.options.units),r})(),value:o.defaultValue},min:{input:(()=>{var t;const r=e.floatInput(`${null!==(t=o.caption)&&void 0!==t?t:o.name} min`,n(o,"min"),(t=>f.min.value=t));return r.root.insertBefore(l.root,r.captionLabel),r.addPostfix(o.options.units),r})(),value:n(o,"min")},max:{input:(()=>{var t;const r=e.floatInput(`${null!==(t=o.caption)&&void 0!==t?t:o.name} max`,n(o,"max"),(t=>f.max.value=t));return r.addPostfix(o.options.units),r})(),value:n(o,"max")},lvl:{input:e.intInput("Samples",3,(t=>{f.lvl.value=t,this.updateRunWidgetsState()})),value:3},isChanging:new c.BehaviorSubject(!1)};[h.max.input,h.lvl.input].forEach((t=>{t.root.insertBefore(or(),t.captionLabel),a()(t.root).removeProp("display")}));const d=[h.lvl.input];t[o.name]=Object.assign(Object.assign({},h),{constForm:[h.const.input],saForm:[h.min.input,h.max.input,...d]});const f=t[o.name];f.isChanging.subscribe((t=>{l.notify=!1,l.value=t,l.notify=!0,u.notify=!1,u.value=t,u.notify=!0})),(0,c.combineLatest)([h.isChanging,r.analysisType.value]).subscribe((([t,e])=>{t?(f.constForm.forEach((t=>a()(t.root).hide())),f.saForm.forEach((t=>a()(t.root).css("display","flex"))),d.forEach((t=>e===ir.GRID_ANALYSIS?a()(t.root).css("display","flex"):a()(t.root).hide()))):(f.constForm.forEach((t=>a()(t.root).css("display","flex"))),f.saForm.forEach((t=>a()(t.root).hide())))}));break;case i.TYPE.BOOL:const p=s(!1,(t=>{b.isChanging.next(t),this.updateRunWidgetsState()})),m={type:o.propertyType,prop:o,const:{input:(()=>{var t,r;const n=e.boolInput(`${null!==(t=o.caption)&&void 0!==t?t:o.name}`,null!==(r=o.defaultValue)&&void 0!==r&&r,(t=>b.const.value=t));return n.root.insertBefore(p.root,n.captionLabel),n})(),value:!1},isChanging:new c.BehaviorSubject(!1),lvl:1};t[o.name]=Object.assign(Object.assign({},m),{constForm:[m.const.input],saForm:[]});const b=t[o.name];b.isChanging.subscribe((t=>{b.lvl=t?2:1}));break;default:const g=or(),y={input:(()=>{const t=e.input.forProperty(o,void 0,{onValueChanged:t=>y.value=t.value});return t.root.insertBefore(g,t.captionLabel),t.addPostfix(o.options.units),t})(),value:o.defaultValue};t[o.name]={const:y,constForm:[y.input],saForm:[],type:o.propertyType,prop:o,isChanging:new c.BehaviorSubject(!1)}}return t}),{}),l=t.outputs.reduce(((t,r)=>{const n={prop:r,input:(()=>{var t;const o=null!==(t=r.caption)&&void 0!==t?t:r.name;let a;r.propertyType===i.TYPE.DATA_FRAME?(a=e.choiceInput(o,sr.LAST_ROW,[sr.LAST_ROW,sr.FIRST_ROW,sr.BY_COL_VAL],(t=>{n.value.returning=t,n.analysisInputs.forEach((e=>{e.root.hidden=t!==sr.BY_COL_VAL})),a.setTooltip(this.getOutputTooltip(o,t))})),a.setTooltip(this.getOutputTooltip(o,sr.LAST_ROW))):(a=e.input.forProperty(r),a.setTooltip("Scalar")),a.addCaption(o);const l=nr.includes(r.propertyType)?s(!0,(t=>{n.isInterest.next(t),n.analysisInputs.forEach((t=>{t.root.hidden=n.value.returning!==sr.BY_COL_VAL})),this.updateRunWidgetsState(),r.propertyType===i.TYPE.DATA_FRAME&&a.setTooltip(t?this.getOutputTooltip(o,sr.LAST_ROW):"Dataframe")}),!1).root:or();return a.root.insertBefore(l,a.captionLabel),a})(),analysisInputs:r.propertyType===i.TYPE.DATA_FRAME?[(()=>{var t;const i=e.stringInput("Column",sr.ALL_COLUMNS,(t=>{n.value.colName=t}));return i.root.insertBefore(or(),i.captionLabel),i.root.hidden=!0,i.setTooltip(`Name of column of the '${null!==(t=r.caption)&&void 0!==t?t:r.name}' dataframe`),i})(),(()=>{var t;const i=e.floatInput("Value",0,(t=>{n.value.colValue=t}));return i.root.insertBefore(or(),i.captionLabel),i.root.hidden=!0,i.setTooltip(`Value specifying the '${null!==(t=r.caption)&&void 0!==t?t:r.name}' dataframe row`),i})()]:[],value:{returning:sr.LAST_ROW,colName:sr.ALL_COLUMNS,colValue:0},isInterest:new c.BehaviorSubject(!0)};return a()(n.input.input).css("visibility","hidden"),n.prop.propertyType===i.TYPE.DATA_FRAME&&n.isInterest.subscribe((t=>{n.analysisInputs.forEach((e=>t?a()(e.root).show():a()(e.root).hide())),a()(n.input.input).css("visibility",t?"visible":"hidden")})),t[r.name]=n,t}),{});return{analysisInputs:r,inputs:o,outputs:l}},this.openedViewers=[],this.gridSubscription=null,this.store=this.generateInputFields(this.func),this.runButton=e.bigButton("Run",(()=>er(this,void 0,void 0,(function*(){return yield this.runAnalysis()})))),this.runIcon=e.iconFA("play",(()=>er(this,void 0,void 0,(function*(){return yield this.runAnalysis()})))),this.runIcon.style.color="var(--green-2)",this.runIcon.classList.add("fas"),this.helpIcon=e.iconFA("question",(()=>{window.open("https://datagrok.ai/help/compute.md#sensitivity-analysis","_blank")}),"Open help in a new tab");const s=this.buildFormWithBtn();this.runButton.disabled=!this.canEvaluationBeRun(),this.runIcon.hidden=this.runButton.disabled,this.addTooltips(),this.comparisonView=r,this.comparisonView.dockManager.dock(s,i.DOCK_TYPE.LEFT,null,`${this.func.name} - Sensitivity Analysis`,.25),this.comparisonView.grid.columns.byName("Run name").visible=!1;const o=this.comparisonView.getRibbonPanels();o.push([this.helpIcon,this.runIcon]),this.comparisonView.setRibbonPanels(o),this.comparisonView.helpUrl="https://datagrok.ai/help/compute.md#sensitivity-analysis",this.tableDockNode=this.comparisonView.dockManager.findNode(this.comparisonView.grid.root);const l=e.markdown(tr);l.style.padding="10px",l.style.overflow="auto",this.helpMdNode=this.comparisonView.dockManager.dock(l,i.DOCK_TYPE.FILL,this.tableDockNode,"About")}closeOpenedViewers(){for(const t of this.openedViewers)t.close();this.openedViewers.splice(0),this.helpMdNode&&(this.helpMdNode.detachFromParent(),this.helpMdNode.container.destroy(),this.helpMdNode=void 0),this.gridSubscription&&(this.gridSubscription.unsubscribe(),this.gridSubscription=null)}getFuncCallCount(t,e){let r=0;switch(t.analysisType.value.value){case ir.GRID_ANALYSIS:let n=1;const s=t=>t.type===i.TYPE.INT||t.type===i.TYPE.BIG_INT||t.type===i.TYPE.FLOAT;for(const t of Object.values(e))t.isChanging.value&&(n*=s(t)?t.lvl.value:t.lvl,++r);return 0===r?0:n;case ir.RANDOM_ANALYSIS:return t.samplesCount.value;case ir.SOBOL_ANALYSIS:for(const t of Object.keys(e))e[t].isChanging.value&&++r;return 0===r?0:(r+2)*t.samplesCount.value;default:return 0}}getFuncCallCountAsString(){if(!this.canEvaluationBeRun())return"0";const t=this.getFuncCallCount(this.store.analysisInputs,this.store.inputs);return t<1e3?String(t):t<1e6?String(Math.ceil(t/10)/100)+"k":t<1e9?String(Math.ceil(t/1e4)/100)+"m":String(Math.ceil(t/1e7)/100)+"b"}updateRunWidgetsState(){this.runButton.textContent=`Run (${this.getFuncCallCountAsString()})`,this.runButton.disabled=!this.canEvaluationBeRun(),this.runIcon.hidden=this.runButton.disabled}buildFormWithBtn(){let t="Misc";const r=Object.values(this.store.inputs).reduce(((r,n)=>{const i=n.prop;return i.category!==t&&(r.append(e.h2(i.category)),t=i.category),r.append(...n.constForm.map((t=>t.root)),...n.saForm.map((t=>t.root))),r}),e.div([this.store.analysisInputs.analysisType.input,this.store.analysisInputs.samplesCount.input],{style:{"overflow-y":"scroll",width:"100%"}}));a()(r).addClass("ui-form");const n=e.h2("Outputs");r.appendChild(n),t="Misc";const i=Object.values(this.store.outputs).reduce(((r,n)=>{const i=n.prop;return i.category!==t&&(r.append(e.h2(i.category)),t=i.category),r.append(n.input.root,...n.analysisInputs.map((t=>t.root))),r}),r);this.store.analysisInputs.analysisType.value.subscribe((t=>{t===ir.GRID_ANALYSIS?a()(this.store.analysisInputs.samplesCount.input.root).hide():(a()(n).show(),a()(i).show(),a()(this.store.analysisInputs.samplesCount.input.root).show())}));let s=!1;for(const t of Object.keys(this.store.outputs))if(!0===this.store.outputs[t].isInterest.value){s=!0;break}s||this.store.outputs[Object.keys(this.store.outputs)[0]].isInterest.next(!0),this.updateRunWidgetsState();const o=e.buttonsInput([this.runButton]);return r.appendChild(o),a()(r).css({"padding-left":"12px","overflow-y":"scroll","padding-right":"4px"}),r}setAnalysisInputTooltip(){let t;switch(this.store.analysisInputs.analysisType.value.value){case ir.GRID_ANALYSIS:t="Grid analysis: the function is evaluated with respect to the selected inputs varying within the specified ranges";break;case ir.RANDOM_ANALYSIS:t="Monte Carlo simulation: the function is evaluated with respect to random variation of the selected inputs within the specified ranges";break;case ir.SOBOL_ANALYSIS:t="Variance-based sensitivity analysis: the Sobol' indices are computed";break;default:t="Unknown method!"}this.store.analysisInputs.analysisType.input.setTooltip(t)}getOutputTooltip(t,e){switch(e){case sr.FIRST_ROW:return`To analyze first row of the '${t}' dataframe`;case sr.LAST_ROW:return`To analyze last row of the '${t}' dataframe`;case sr.BY_COL_VAL:return`To analyze "${t}"'s row defined by custom value in column`;default:return""}}samplesCountTooltip(){switch(this.store.analysisInputs.analysisType.value.value){case ir.RANDOM_ANALYSIS:return"Input sets count";case ir.SOBOL_ANALYSIS:return"Sample size for the Sobol' indices computation";default:return"Unknown method!"}}addTooltips(){var t;this.setAnalysisInputTooltip(),e.tooltip.bind(this.runButton,(()=>`Run sensitivity analysis: the function is evaluated ${this.getFuncCallCount(this.store.analysisInputs,this.store.inputs)} times`)),e.tooltip.bind(this.runIcon,(()=>`Run sensitivity analysis: the function is evaluated ${this.getFuncCallCount(this.store.analysisInputs,this.store.inputs)} times`)),this.store.analysisInputs.samplesCount.input.setTooltip(this.samplesCountTooltip());for(const e of Object.keys(this.store.inputs)){const r=this.store.inputs[e].prop.propertyType;if(r===i.TYPE.BOOL||r===i.TYPE.STRING)continue;const n=this.store.inputs[e],s=null!==(t=n.prop.caption)&&void 0!==t?t:n.prop.name;n.const.input.setTooltip(`'${s}' value`),n.min.input.setTooltip(`Min value of '${s}'`),n.max.input.setTooltip(`Max value of '${s}'`),n.lvl.input.setTooltip(`Number of samples along the axis '${s}'`)}}isAnyInputSelected(){for(const t of Object.keys(this.store.inputs))if(!0===this.store.inputs[t].isChanging.value)return!0;return!1}isAnyOutputSelected(){for(const t of Object.keys(this.store.outputs))if(!0===this.store.outputs[t].isInterest.value)return!0;return!1}canEvaluationBeRun(){return this.isAnyInputSelected()&&this.isAnyOutputSelected()}runAnalysis(){return er(this,void 0,void 0,(function*(){if(this.canEvaluationBeRun())switch(this.store.analysisInputs.analysisType.value.value){case ir.GRID_ANALYSIS:yield this.runGridAnalysis();break;case ir.RANDOM_ANALYSIS:yield this.runRandomAnalysis();break;case ir.SOBOL_ANALYSIS:yield this.runSobolAnalysis()}}))}getFixedInputColumns(t){return Object.values(this.store.inputs).filter((t=>!rr.includes(t.type)||!t.isChanging.value)).map((e=>{var r;return i.Column.fromList(e.type,null!==(r=e.prop.caption)&&void 0!==r?r:e.prop.name,Array(t).fill(e.const.value))}))}runSobolAnalysis(){return er(this,void 0,void 0,(function*(){const r={func:this.func,fixedInputs:this.getFixedInputs().map((t=>({name:t,value:this.store.inputs[t].const.value}))),variedInputs:this.getVariedInputs().map((t=>{const e=this.store.inputs[t];return{prop:e.prop,min:e.min.value,max:e.max.value}})),samplesCount:this.store.analysisInputs.samplesCount.value||1},n=this.getOutputsOfInterest(),s=new Xe(r.func,r.fixedInputs,r.variedInputs,n,r.samplesCount),o=yield s.perform();this.closeOpenedViewers();const l=o.funcEvalResults,u=o.funcCalls,c=o.firstOrderSobolIndices,h=o.totalOrderSobolIndices,d=c.columns.names();this.comparisonView.dataFrame=l;const f=l.columns.names(),p=this.getFixedInputColumns(l.rowCount);for(const t of p)t.name=l.columns.getUnusedName(`${t.name} (fixed)`),l.columns.add(t);this.comparisonView.grid.columns.setVisible([f[0]]),this.comparisonView.grid.columns.setVisible(f),this.comparisonView.grid.props.rowHeight=25;const m=i.Viewer.correlationPlot(l,{xColumnNames:f,yColumnNames:f}),b=this.comparisonView.dockManager.dock(m,i.DOCK_TYPE.LEFT,this.tableDockNode,"",Ke.COR_PLOT);this.openedViewers.push(m);const g=i.Viewer.pcPlot(l,{columnNames:f});this.comparisonView.dockManager.dock(g,i.DOCK_TYPE.DOWN,b,"",Ke.PC_PLOT),this.openedViewers.push(g);const y=this.getOutputNameForScatterPlot(f,l,r.variedInputs.length),v=1===r.variedInputs.length?i.Viewer.lineChart(l,this.getLineChartOpt(f)):i.Viewer.scatterPlot(l,this.getScatterOpt(f,y));this.openedViewers.push(v),this.comparisonView.dockManager.dock(v,i.DOCK_TYPE.DOWN,this.tableDockNode,"",Ke.GRAPH);const w=i.Viewer.barChart(c,this.getBarChartOpt(c.name,d[0],y)),_=this.comparisonView.dockManager.dock(w,i.DOCK_TYPE.RIGHT,void 0,"",Ke.BAR_CHART),x=i.Viewer.barChart(h,this.getBarChartOpt(h.name,d[0],y));this.comparisonView.dockManager.dock(x,i.DOCK_TYPE.DOWN,_),this.openedViewers=this.openedViewers.concat([w,x]),this.gridSubscription=this.comparisonView.grid.onCellClick.subscribe((r=>{var n;const s=u[null!==(n=r.tableRowIndex)&&void 0!==n?n:0],o=[...s.outputParams.values()].filter((t=>i.TYPES_SCALAR.has(t.property.propertyType))),l=i.HtmlTable.create(o,(t=>{var e;return[null!==(e=t.property.caption)&&void 0!==e?e:t.property.name,s.outputs[t.property.name],t.property.options.units]})).root,c=[...s.outputParams.values()].filter((t=>t.property.propertyType===i.TYPE.DATA_FRAME)).reduce(((t,e)=>{var r;const n=Bt(e.property).config,o=s.outputs[e.name],l=null!==(r=e.property.caption)&&void 0!==r?r:e.property.name;return n.map((e=>{const r=e.type,n=i.Viewer.fromType(r,o);n.setOptions(e),a()(n.root).css({width:"100%"}),t[l]?t[l].push(n.root):t[l]=[n.root]})),t}),{});let h,d;o.length>0?(d=1,h=Object.assign({"Output scalars":[l]},c)):(d=0,h=Object.assign({},c));const f=e.accordion();a()(f.root).css({width:"100%"}),Object.entries(h).map((t=>{f.addPane(t[0],(()=>e.divV(t[1])))})),f.panes[d].expanded=!0,t.shell.o=f.root}))}))}getFixedInputs(){return Object.keys(this.store.inputs).filter((t=>!rr.includes(this.store.inputs[t].type)||!this.store.inputs[t].isChanging.value))}getVariedInputs(){return Object.keys(this.store.inputs).filter((t=>!!rr.includes(this.store.inputs[t].type)&&this.store.inputs[t].isChanging.value))}runRandomAnalysis(){return er(this,void 0,void 0,(function*(){const r={func:this.func,fixedInputs:this.getFixedInputs().map((t=>({name:t,value:this.store.inputs[t].const.value}))),variedInputs:this.getVariedInputs().map((t=>{const e=this.store.inputs[t];return{prop:e.prop,min:e.min.value,max:e.max.value}})),samplesCount:this.store.analysisInputs.samplesCount.value||1},n=this.getOutputsOfInterest(),s=new Ge(r.func,r.fixedInputs,r.variedInputs,n,r.samplesCount),o=yield s.perform(),l=o.funcEvalResults,u=o.funcCalls;this.closeOpenedViewers(),this.comparisonView.dataFrame=l;const c=l.columns.names(),h=this.getFixedInputColumns(l.rowCount);for(const t of h)t.name=l.columns.getUnusedName(`${t.name} (fixed)`),l.columns.add(t);this.comparisonView.grid.columns.setVisible([c[0]]),this.comparisonView.grid.columns.setVisible(c),this.comparisonView.grid.props.rowHeight=25;const d=i.Viewer.correlationPlot(l,{xColumnNames:c,yColumnNames:c}),f=this.comparisonView.dockManager.dock(d,i.DOCK_TYPE.LEFT,this.tableDockNode,"",Ke.COR_PLOT);this.openedViewers.push(d);const p=i.Viewer.pcPlot(l,{columnNames:c});this.comparisonView.dockManager.dock(p,i.DOCK_TYPE.DOWN,f,"",Ke.PC_PLOT),this.openedViewers.push(p);const m=this.getOutputNameForScatterPlot(c,l,r.variedInputs.length),b=1===r.variedInputs.length?i.Viewer.lineChart(l,this.getLineChartOpt(c)):i.Viewer.scatterPlot(l,this.getScatterOpt(c,m));this.openedViewers.push(b),this.comparisonView.dockManager.dock(b,i.DOCK_TYPE.DOWN,this.tableDockNode,"",Ke.GRAPH),this.gridSubscription=this.comparisonView.grid.onCellClick.subscribe((r=>{var n;const s=u[null!==(n=r.tableRowIndex)&&void 0!==n?n:0],o=[...s.outputParams.values()].filter((t=>i.TYPES_SCALAR.has(t.property.propertyType))),l=i.HtmlTable.create(o,(t=>{var e;return[null!==(e=t.property.caption)&&void 0!==e?e:t.property.name,s.outputs[t.property.name],t.property.options.units]})).root,c=[...s.outputParams.values()].filter((t=>t.property.propertyType===i.TYPE.DATA_FRAME)).reduce(((t,e)=>{var r;const n=Bt(e.property).config,o=s.outputs[e.name],l=null!==(r=e.property.caption)&&void 0!==r?r:e.property.name;return n.map((e=>{const r=e.type,n=i.Viewer.fromType(r,o);n.setOptions(e),a()(n.root).css({width:"100%"}),t[l]?t[l].push(n.root):t[l]=[n.root]})),t}),{});let h,d;o.length>0?(d=1,h=Object.assign({"Output scalars":[l]},c)):(d=0,h=Object.assign({},c));const f=e.accordion();a()(f.root).css({width:"100%"}),Object.entries(h).map((t=>{f.addPane(t[0],(()=>e.divV(t[1])))})),f.panes[d].expanded=!0,t.shell.o=f.root}))}))}runGridAnalysis(){return er(this,void 0,void 0,(function*(){var r,n;const s=Object.keys(this.store.inputs).reduce(((t,e)=>{switch(this.store.inputs[e].type){case i.TYPE.INT:case i.TYPE.BIG_INT:const r=this.store.inputs[e],n=(r.max.value-r.min.value)/(r.lvl.value-1);t[e]=r.isChanging.value?Array.from({length:r.lvl.value},((t,e)=>Math.round(r.min.value+e*n))):[r.const.value];break;case i.TYPE.FLOAT:const s=this.store.inputs[e],o=(s.max.value-s.min.value)/(s.lvl.value-1);t[e]=s.isChanging.value?Array.from({length:s.lvl.value},((t,e)=>s.min.value+e*o)):[s.const.value];break;case i.TYPE.BOOL:const a=this.store.inputs[e];t[e]=a.isChanging.value?[a.const.value,!a.const.value]:[a.const.value];break;default:const l=this.store.inputs[e];t[e]=[l.const.value]}return t}),{});let o=Object.values(s)[0].map((t=>[t]));for(let t=1;t<Object.values(s).length;t++){const e=Object.values(s)[t],r=[];for(const t of o)for(const n of e)r.push([...t,n]);o=r}const l=o.map((t=>this.func.prepare(this.func.inputs.map(((t,e)=>({name:t.name,idx:e}))).reduce(((e,{name:r,idx:n})=>(e[r]=t[n],e)),{})))),u=yield Ue(l);this.closeOpenedViewers();const c=[],h=u.length,d=this.getFixedInputColumns(h);for(const t of Object.keys(this.store.inputs)){const e=this.store.inputs[t],n=e.prop;e.isChanging.value&&c.push(i.Column.fromType(n.propertyType,null!==(r=n.caption)&&void 0!==r?r:n.name,h))}const f=[...c],p=f.length,m=i.DataFrame.fromColumns([f[0]]);for(let t=1;t<p;++t)f[t].name=m.columns.getUnusedName(f[t].name),m.columns.add(f[t]);for(let t=0;t<h;++t)for(const e of Object.keys(this.store.inputs)){const r=this.store.inputs[e],i=r.prop;r.isChanging.value&&m.set(null!==(n=i.caption)&&void 0!==n?n:i.name,t,u[t].inputs[e])}const b=this.getOutputsOfInterest(),g=qe(u,b).columns;for(const t of g)f.forEach((e=>{e.name===t.name&&(e.name=`${e.name} (input)`,t.name=`${t.name} (output)`)})),t.name=m.columns.getUnusedName(t.name),m.columns.add(t);const y=m.columns.names();for(const t of d)t.name=m.columns.getUnusedName(`${t.name} (fixed)`),m.columns.add(t);this.comparisonView.dataFrame=m,this.gridSubscription=this.comparisonView.grid.onCellClick.subscribe((r=>{var n;const s=u[null!==(n=r.tableRowIndex)&&void 0!==n?n:0],o=[...s.outputParams.values()].filter((t=>i.TYPES_SCALAR.has(t.property.propertyType))),l=i.HtmlTable.create(o,(t=>{var e;return[null!==(e=t.property.caption)&&void 0!==e?e:t.property.name,s.outputs[t.property.name],t.property.options.units]})).root,c=[...s.outputParams.values()].filter((t=>t.property.propertyType===i.TYPE.DATA_FRAME)).reduce(((t,e)=>{var r;const n=Bt(e.property).config,o=s.outputs[e.name],l=null!==(r=e.property.caption)&&void 0!==r?r:e.property.name;return n.map((e=>{const r=e.type,n=i.Viewer.fromType(r,o);n.setOptions(e),a()(n.root).css({width:"100%"}),t[l]?t[l].push(n.root):t[l]=[n.root]})),t}),{});let h,d;o.length>0?(d=1,h=Object.assign({"Output scalars":[l]},c)):(d=0,h=Object.assign({},c));const f=e.accordion();a()(f.root).css({width:"100%"}),Object.entries(h).map((t=>{f.addPane(t[0],(()=>e.divV(t[1])))})),f.panes[d].expanded=!0,t.shell.o=f.root})),this.comparisonView.grid.columns.setVisible([y[0]]),this.comparisonView.grid.columns.setVisible(y),this.comparisonView.grid.props.rowHeight=25;const v=i.Viewer.correlationPlot(m,{xColumnNames:y,yColumnNames:y}),w=this.comparisonView.dockManager.dock(v,i.DOCK_TYPE.LEFT,this.tableDockNode,"",Ke.COR_PLOT);this.openedViewers.push(v);const _=i.Viewer.pcPlot(m,{columnNames:y});this.comparisonView.dockManager.dock(_,i.DOCK_TYPE.DOWN,w,"",Ke.PC_PLOT),this.openedViewers.push(_);const x=this.getOutputNameForScatterPlot(y,m,c.length),S=1===c.length?i.Viewer.lineChart(m,this.getLineChartOpt(y)):i.Viewer.scatterPlot(m,this.getScatterOpt(y,x));this.openedViewers.push(S),this.comparisonView.dockManager.dock(S,i.DOCK_TYPE.DOWN,this.tableDockNode,"",Ke.GRAPH)}))}getOutputNameForScatterPlot(t,e,r){var n,i,s,o;for(let a=r;a<t.length;++a)if((null!==(i=null===(n=e.col(t[a]))||void 0===n?void 0:n.min)&&void 0!==i?i:0)<(null!==(o=null===(s=e.col(t[a]))||void 0===s?void 0:s.max)&&void 0!==o?o:0))return t[a];return t[r]}getOutputsOfInterest(){const t=[];for(const e of Object.keys(this.store.outputs)){const r=this.store.outputs[e];if(r.isInterest.value){let e;switch(r.value.returning){case sr.LAST_ROW:e=-1;break;case sr.FIRST_ROW:e=0;break;default:e=null}t.push({prop:r.prop,value:{row:e,colName:r.value.colName,colValue:r.value.colValue}})}}return t}getScatterOpt(t,e){return{xColumnName:t[0],yColumnName:t[1],color:e,size:e,markerMaxSize:12,jitterSize:5}}getLineChartOpt(t){return{xColumnName:t[0],yColumnNames:t.slice(1,Math.min(t.length,8)),markerSize:1,markerType:i.MARKER_TYPE.GRADIENT,sharex:!0,multiAxis:!0,multiAxisLegendPosition:"RightCenter"}}getBarChartOpt(t,e,r){return{description:t,splitColumnName:e,valueColumnName:r,valueAggrType:i.AGG.AVG,showTitle:!1,showCategorySelector:!1,showStackSelector:!1,showValueAxis:!1}}}var lr,ur=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};!function(t){t.INPUTS="inputs",t.OUTPUTS="outputs"}(lr||(lr={}));const cr={[lr.INPUTS]:"inputParams",[lr.OUTPUTS]:"outputParams"},hr=()=>e.divText("[No data to display]",{style:{"text-align":"center","align-content":"center",width:"100%",height:"100%"}});class dr extends be{static fromFuncCall(t,e={historyEnabled:!0,isTabbed:!1}){return new this(t,e)}constructor(t,r={historyEnabled:!0,isTabbed:!1}){super(t,r),this.options=r,this.validationRequests=new c.Subject,this.validationUpdates=new c.Subject,this.runRequests=new c.Subject,this.isRunning=new c.BehaviorSubject(!1),this.isUploadMode=new c.BehaviorSubject(!1),this.inputsOverride={},this.inputsMap={},this.validators={},this.validationState={},this.externalValidatorsUpdates=new c.Subject,this.externalValidatorsState={},this.pendingValidations=this.validationUpdates.pipe((0,s.startWith)(null),(0,s.map)((()=>this.validationState))),this._isOutputOutdated=new c.BehaviorSubject(!0),this.isOutputOutdated=this._isOutputOutdated.pipe((0,s.distinctUntilChanged)()),this.blockRuns=new c.BehaviorSubject(!1),this.prevOpenedTab=null,this.beforeInputPropertyRender=new c.Subject,this.afterInputPropertyRender=new c.Subject,this.afterOutputPropertyRender=new c.Subject,this.afterOutputSacalarTableRender=new c.Subject,this.formButtons=e.div(),this.additionalBtns=[],this.navBtns=[],this.tabsElem=e.tabControl(),this.dfToViewerMapping={},this.focusedInput=null,this.foldedCategoryInputs={},this.sheetNamesCache={},this.richFunctionExport=t=>ur(this,void 0,void 0,(function*(){if("Excel"===t)try{const e=this.lastCall;if(!e)throw new Error("Function was not called");if(!this.exportConfig.supportedFormats.includes(t))throw new Error(`Format "${t}" is not supported.`);if(!this.func)throw new Error("The correspoding function is not specified");yield i.Utils.loadJsCss(["/js/common/exceljs.min.js"]);const r=window.ExcelJS,n="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8",s=new r.Workbook,o=t=>i.TYPES_SCALAR.has(t),a=t=>t.propertyType===i.TYPE.DATA_FRAME,l=this.func.inputs.filter((t=>a(t))),u=this.func.inputs.filter((t=>o(t.propertyType))),c=this.func.outputs.filter((t=>a(t))),h=this.func.outputs.filter((t=>o(t.propertyType)));if(l.forEach((t=>{var r;const n=t.options.caption||t.name,i=null!==(r=s.worksheets.find((t=>t.name===this.getSheetName(n,s))))&&void 0!==r?r:s.addWorksheet(this.getSheetName(n,s)),o=e.inputs[t.name];st(i,o)})),u.length){const t=s.addWorksheet("Input scalars");nt(t,u.map((t=>{var r,n,i;return{caption:null!==(r=t.options.caption)&&void 0!==r?r:t.name,value:null!==(n=e.inputs[t.name])&&void 0!==n?n:"",units:null!==(i=t.options.units)&&void 0!==i?i:""}})))}if(c.forEach((t=>{var r;const n=t.options.caption||t.name,i=null!==(r=s.worksheets.find((t=>t.name===this.getSheetName(n,s))))&&void 0!==r?r:s.addWorksheet(this.getSheetName(n,s)),o=e.outputs[t.name];st(i,o)})),h.length){const t=s.addWorksheet("Output scalars");nt(t,h.map((t=>{var r,n,i;return{caption:null!==(r=t.options.caption)&&void 0!==r?r:t.name,value:null!==(n=e.outputs[t.name])&&void 0!==n?n:"",units:null!==(i=t.options.units)&&void 0!==i?i:""}})))}const d=this.tabsElem;for(const t of this.inputTabsLabels)for(const r of this.categoryToDfParamMap.inputs[t].filter((t=>a(t)))){const n=this.dfToViewerMapping[r.name].filter((t=>t.type!==i.VIEWER.GRID)).filter((t=>Object.values(m).includes(t.type)));if(0===n.length)continue;d.currentPane=d.getPane(t),yield new Promise((t=>setTimeout(t,100)));const o=r.options.caption||r.name,a=e.inputs[r.name];for(const[t,e]of n.entries())yield ot(s,s.getWorksheet(this.getSheetName(o,s)),e.root,a.columns.length+2,t>0?Math.ceil(n[t-1].root.clientHeight/20)+1:0)}for(const t of this.outputTabsLabels)for(const r of this.categoryToDfParamMap.outputs[t].filter((t=>a(t)))){const n=this.dfToViewerMapping[r.name].filter((t=>t.type!==i.VIEWER.GRID)).filter((t=>Object.values(m).includes(t.type)));if(0===n.length)continue;d.currentPane=d.getPane(t),yield new Promise((t=>setTimeout(t,100)));const o=r.options.caption||r.name,a=e.outputs[r.name];for(const[t,e]of n.entries())if(e.type===i.VIEWER.STATISTICS){const e=a.columns.length,r=i.DataFrame.fromColumns([i.Column.string("Name",e).init((t=>a.columns.byIndex(t).name)),i.Column.int("Values",e).init((t=>a.columns.byIndex(t).stats.valueCount)),i.Column.int("Nulls",e).init((t=>a.columns.byIndex(t).stats.missingValueCount)),i.Column.float("Min",e).init((t=>a.columns.byIndex(t).stats.min)),i.Column.float("Max",e).init((t=>a.columns.byIndex(t).stats.max)),i.Column.float("Avg",e).init((t=>a.columns.byIndex(t).stats.avg)),i.Column.float("Stdev",e).init((t=>a.columns.byIndex(t).stats.stdev))]);st(s.getWorksheet(this.getSheetName(o,s)),r,a.columns.length+2,t>0?Math.ceil(n[t-1].root.clientHeight/20)+1:0)}else yield ot(s,s.getWorksheet(this.getSheetName(o,s)),e.root,a.columns.length+2,t>0?Math.ceil(n[t-1].root.clientHeight/20)+1:0)}const f=yield s.xlsx.writeBuffer();return new Blob([f],{type:n})}catch(t){console.log(t)}if("DataUrl images"===t){const t={},e=t=>t.propertyType===i.TYPE.DATA_FRAME,r=this.tabsElem;yield i.Utils.loadJsCss(["/js/common/html2canvas.min.js"]);const n=window.html2canvas;for(const s of this.tabsLabels.filter((t=>this.inputTabsLabels.includes(t))))for(const o of this.categoryToDfParamMap.inputs[s].filter((t=>e(t)))){const e=this.dfToViewerMapping[o.name].filter((t=>t.type!==i.VIEWER.GRID&&t.type!==i.VIEWER.STATISTICS)).filter((t=>Object.values(m).includes(t.type)));if(0!==e.length){r.currentPane=r.getPane(s),yield new Promise((t=>setTimeout(t,100)));for(const[r,i]of e.entries()){const e=(yield n(i.root,{logging:!1})).toDataURL();t[o.name]||(t[o.name]={}),t[o.name][r]={dataUrl:e,width:i.root.clientWidth,height:i.root.clientHeight}}}}for(const s of this.tabsLabels.filter((t=>this.outputTabsLabels.includes(t))))for(const o of this.categoryToDfParamMap.outputs[s].filter((t=>e(t)))){const e=this.dfToViewerMapping[o.name].filter((t=>t.type!==i.VIEWER.GRID&&t.type!==i.VIEWER.STATISTICS)).filter((t=>Object.values(m).includes(t.type)));if(0!==e.length){r.currentPane=r.getPane(s),yield new Promise((t=>setTimeout(t,100)));for(const[r,i]of e.entries()){const e=(yield n(i.root,{logging:!1})).toDataURL();t[o.name]||(t[o.name]={}),t[o.name][r]={dataUrl:e,width:i.root.clientWidth,height:i.root.clientHeight}}}}return new Blob([JSON.stringify(t)],{type:"text/plain"})}throw new Error("Format is not supported")})),this.exportConfig={supportedExtensions:this.richFunctionViewExportExtensions(),supportedFormats:this.richFunctionViewSupportedFormats(),export:this.richFunctionExport,filename:this.defaultExportFilename}}onFuncCallReady(){const r=Object.create(null,{onFuncCallReady:{get:()=>super.onFuncCallReady}});return ur(this,void 0,void 0,(function*(){yield this.loadInputsOverrides(),yield this.loadInputsValidators(),yield r.onFuncCallReady.call(this);const n=this.funcCallReplaced.subscribe((()=>this.validationRequests.next({isRevalidation:!1})));this.subs.push(n);const i=this.validationRequests.pipe((0,s.groupBy)((t=>t.field)),(0,s.mergeMap)((t=>t.pipe((0,s.tap)((t=>this.setValidationPending(t.field))),(0,s.switchMap)((t=>{const e=new AbortController,r=e.signal;let n=!1;return new c.Observable((i=>{const s=(0,c.from)(this.runValidation(Object.assign({},t),r)).subscribe((t=>{n=!0,i.next(t)}));return()=>{n||e.abort(),s.unsubscribe()}})).pipe((0,s.tap)((e=>{this.setValidationResults(e),this.runRevalidations(t,e),this.validationUpdates.next(null)})),(0,s.mapTo)(t))})))))).subscribe((t=>{t.field&&this.runningOnInput&&this.isRunnable()&&this.doRun()}));this.subs.push(i);const o=this.externalValidatorsUpdates.subscribe((t=>{this.updateInputValidationReuslts(t)}));this.subs.push(o);const a=(0,c.combineLatest)([this.runRequests.pipe((0,s.switchMap)((()=>(0,c.of)(!1).pipe((0,s.delay)(500),(0,s.startWith)(!0))))),this.validationUpdates.pipe((0,s.debounceTime)(0))]).pipe((0,s.filter)((([t])=>t&&this.isRunnable()))).subscribe((()=>this.doRun()));this.subs.push(a);const l=this.options.isTabbed?null:yield this.loadLastInputs();if(l)t.shell.info(e.div([e.divText("Do you want to load last inputs?"),e.divH([e.bigButton("Load",(()=>{for(const[t,e]of Object.entries(l)){const r=this.getInput(t);r.notify=!1,r.value=e,r.notify=!0}t.shell.info(e.divText("Change the loaded inputs to run computations"))}))])]));else{const t=new AbortController,e=yield this.runValidation({isRevalidation:!1},t.signal);this.setValidationResults(e),this.runRevalidations({isRevalidation:!1},e),this.validationUpdates.next(null),this.runningOnStart&&this.isRunnable()&&(yield this.doRun())}}))}onBeforeRun(){return this.tabsElem.currentPane&&(this.prevOpenedTab=this.inputTabsLabels.includes(this.tabsElem.currentPane.name)?null:this.tabsElem.currentPane),Promise.resolve()}onAfterRun(){if(this.showOutput(),this.tabsElem.panes.forEach((t=>{a()(t.header).show()})),this.prevOpenedTab)return this.tabsElem.currentPane=this.prevOpenedTab,Promise.resolve();const t=this.tabsElem.panes.find((t=>this.outputTabsLabels.includes(t.name)));return t&&(this.tabsElem.currentPane=t),Promise.resolve()}getRunButton(t="Run"){var r;const n=e.bigButton(null!==(r=this.func.options.runLabel)&&void 0!==r?r:t,(()=>ur(this,void 0,void 0,(function*(){return yield this.doRun()})))),i=(0,c.merge)(this.validationUpdates,this.externalValidatorsUpdates,this.isRunning,this.blockRuns).subscribe((()=>{const t=this.isRunnable();n.disabled=!t}));return this.subs.push(i),n}loadInputsOverrides(){return ur(this,void 0,void 0,(function*(){const e=[...this.funcCall.inputParams.values()];yield Promise.all(e.map((e=>ur(this,void 0,void 0,(function*(){if(e.property.options.input){const r=(yield t.functions.eval(e.property.options.input)).prepare({params:JSON.parse(e.property.options.inputOptions||"{}")});yield r.call(),this.inputsOverride[e.name]=r.outputs.input}})))))}))}loadInputsValidators(){return ur(this,void 0,void 0,(function*(){const e=[...this.funcCall.inputParams.values()];yield Promise.all(e.map((e=>ur(this,void 0,void 0,(function*(){if(e.property.options.validatorFunc){const r=(yield t.functions.eval(e.property.options.validatorFunc)).prepare({params:JSON.parse(e.property.options.validatorFuncOptions||"{}")});yield r.call(),this.validators[e.name]=r.outputs.validator}})))))}))}keepOutput(){var t;return"true"===(null===(t=this.func)||void 0===t?void 0:t.options.keepOutput)}getSaveButton(t="Save"){const r=e.bigButton(t,(()=>ur(this,void 0,void 0,(function*(){return yield this.saveExperimentalRun(this.funcCall)}))),"Save uploaded data"),n=this.isUploadMode.subscribe((t=>{this.buildRibbonPanels(),t?a()(r).show():a()(r).hide()}));return this.subs.push(n),r}getStandardButtons(){const t=this.getRunButton(),r=e.div([t]);e.tooltip.bind(r,(()=>t.disabled?this.isRunning.value?"Computations are in progress":this.getValidationMessage():""));const n=this.getSaveButton();return[...this.isHistoryEnabled&&!this.options.isTabbed?[n]:[],...this.runningOnInput?[]:[r]]}buildFormButtons(){var t;const r=this.getStandardButtons(),n=e.buttonsInput();return a()(n.firstChild).css({display:"none"}),null===(t=n.lastChild)||void 0===t||t.replaceWith(e.div([...this.navBtns,...this.additionalBtns,...r],"ui-input-editor")),a()(n).addClass("rfv-buttons"),a()(n).css({"max-width":"100%"}),this.formButtons.replaceWith(n),this.formButtons=n,n}setAdditionalButtons(t){this.additionalBtns=t,this.buildFormButtons()}setNavigationButtons(t){this.navBtns=t}buildIO(){const{inputBlock:t,inputForm:r,outputForm:n,controlsWrapper:i}=this.buildInputBlock(),s=[...Array.from(r.childNodes),...this.isUploadMode.value?[Array.from(n.childNodes)]:[]];e.tools.handleResize(t,(()=>{a()(t).width()<300?(a()(r).addClass("ui-form-condensed"),a()(n).addClass("ui-form-condensed"),a()(i).addClass("ui-form-condensed"),s.forEach((t=>a()(t).css("min-width","100px")))):(a()(r).removeClass("ui-form-condensed"),a()(n).removeClass("ui-form-condensed"),a()(i).removeClass("ui-form-condensed"),s.forEach((t=>a()(t).css("min-width","100%"))))}));const o=this.buildOutputBlock();o.style.height="100%",o.style.width="100%",this.hideOutput();const l=e.splitH([t,e.panel([o],{style:{"padding-top":"0px"}})],null,!0);return l.style.padding="0 12px",t.style.maxWidth="360px",l}buildInputBlock(){const t=this.renderInputForm(),r=this.renderOutputForm();this.buildFormButtons();const n=e.div(this.formButtons,"ui-form ui-form-wide");a()(n).css({"padding-left":"0px","padding-bottom":"0px","padding-right":"6px","max-width":"100%","min-height":"50px"});const i=e.switchInput("",this.isUploadMode.value,(t=>this.isUploadMode.next(t))),s=this.isUploadMode.subscribe((t=>{i.notify=!1,i.value=t,i.notify=!0,t?a()(r).show():a()(r).hide()}));return this.subs.push(s),{inputBlock:e.divV([t,...this.hasUploadMode&&!this.uploadFunc?[e.divH([e.h2("Experimental data"),i.root],{style:{"flex-grow":"0"}}),r]:[],n],"ui-box rfv-form"),inputForm:t,outputForm:r,controlsWrapper:n}}processCustomDataUpload(){return ur(this,void 0,void 0,(function*(){const r=()=>{const t=i.Dialog.create({title:"Select to compare"}),r=new Ut(d.length>0?d:[...this.historyBlock.history.values()],{fallbackText:"No historical runs found",showActions:!(d.length>0),showBatchActions:!(d.length>0)}),n=new Ut(h,{fallbackText:"No runs uploaded",showActions:!1,showBatchActions:!1});t.add(e.divV([e.divV([e.label("Uploaded runs"),e.element("div","splitbar-horizontal"),n.root],{style:{height:"50%","overflow-y":"hidden"}}),e.divV([e.label(d.length>0?"Simulated":"History",{style:{padding:"0px 10px 0px 9px"}}),e.element("div","splitbar-horizontal"),r.root],{style:{height:"50%","overflow-y":"hidden"}})],{style:{"justify-content":"space-between",gap:"10px","overflow-y":"scroll",height:"100%"}})),a()(t.root.querySelector(".d4-dialog-contents")).removeClass("ui-form");const s="Compare selected";return 0===d.length?t.addButton(s,(()=>ur(this,void 0,void 0,(function*(){const e=yield Promise.all([...r.selected].map((t=>ht.loadRun(t.id))));this.onComparisonLaunch([...e,...n.selected.values()]),t.close()})))):t.addButton(s,(()=>ur(this,void 0,void 0,(function*(){this.onComparisonLaunch([...r.selected.values(),...n.selected.values()]),t.close()})))),t.getButton(s).disabled=!0,this.subs.push((0,c.merge)(r.onSelectedChanged,n.onSelectedChanged).subscribe((()=>{r.selected.size+n.selected.size>1?t.getButton(s).disabled=!1:t.getButton(s).disabled=!0}))),this.isHistorical.value&&t.addButton(g,(()=>ur(this,void 0,void 0,(function*(){this.onComparisonLaunch([this.funcCall,...n.selected.values()]),t.close()})))),a()(t.getButton("CANCEL")).hide(),t},n=yield t.functions.eval(this.uploadFunc),o=yield n.prepare({params:{func:this.func}}).call(),l=o.outputs.uploadWidget,u=o.outputs.uploadFuncCall;let h=[],d=[];const f=i.Dialog.create({title:"Upload"});a()(f.root.querySelector(".d4-dialog-contents")).removeClass("ui-form");const m=i.Dialog.create({title:"Review uploaded runs"});a()(m.root.querySelector(".d4-dialog-contents")).removeClass("ui-form");const b="Save to history",g="Compare w/ current";f.add(l.root),f.addButton(b,(()=>ur(this,void 0,void 0,(function*(){return Nt(f.root,!0),h.forEach((t=>{t.options.immutable_tags?t.options.immutable_tags.push(_):t.options.immutable_tags=[_]})),Promise.all(h.map((t=>ur(this,void 0,void 0,(function*(){const e=yield this.getValidExpRun(t);return ht.saveRun(e)}))))).then((t=>Promise.all(t.map((t=>ht.loadRun(t.id)))))).then((t=>{t.forEach((t=>this.historyBlock.addRun(t)))})).catch((e=>{t.shell.error(e)})).finally((()=>{Nt(f.root,!1),f.close();const t=new Ut(h,{fallbackText:"No runs uploaded",showActions:!0,showBatchActions:!0});m.add(t),m.show({modal:!0,fullScreen:!0})}))})))),f.addButton("Next",(()=>{f.close(),h.forEach((t=>{t.options.immutable_tags?t.options.immutable_tags.push(_):t.options.immutable_tags=[_]}));const t=new Ut(h,{fallbackText:"No runs uploaded",showActions:!0,showBatchActions:!0});m.add(t.root),m.show({modal:!0,fullScreen:!0})})),a()(f.getButton("CANCEL")).hide(),f.getButton(b).disabled=!0,f.getButton("Next").disabled=!0,a()(m.getButton("CANCEL")).hide(),m.addButton("Simulate w/ same inputs",(()=>{Nt(f.root,!0),Promise.all(h.map((t=>this.func.prepare((t=>{const e=t.clone(),r=p()(t.outputParams.values()).filter((e=>e.property.propertyType===i.TYPE.DATA_FRAME&&!!t.outputs[e.name]));for(const n of r)e.outputs[n.name]=t.outputs[n.name].clone();const n=p()(t.inputParams.values()).filter((e=>e.property.propertyType===i.TYPE.DATA_FRAME&&!!t.inputs[e.name]));for(const r of n)e.inputs[r.name]=t.inputs[r.name].clone();return e})(t).inputs).call()))).then((t=>{d=t,m.close(),r().show({modal:!0,fullScreen:!0})})).catch((e=>{t.shell.error(e)})).finally((()=>{Nt(f.root,!1)}))})),m.addButton("Compare w/ history",(()=>{m.close(),r().show({modal:!0,fullScreen:!0})}));const y=t.functions.onAfterRunAction.pipe((0,s.filter)((t=>t.id===u.id))).subscribe((()=>{h=u.outputs.uploadedCalls,f.getButton(b).disabled=!1,f.getButton("Next").disabled=!1})),v=f.onClose.subscribe((()=>{this.isUploadMode.next(!1)}));f.subs.push(v,y),f.show({modal:!0,center:!0,resizable:!0})}))}onSaveClick(){return ur(this,void 0,void 0,(function*(){this.isUploadMode.value?yield this.saveExperimentalRun(this.funcCall):yield this.saveRun(this.funcCall)}))}buildRibbonPanels(){super.buildRibbonPanels();const r=e.iconFA("play",(()=>ur(this,void 0,void 0,(function*(){return yield this.doRun()}))),"Run computations");r.classList.add("fas");const n=e.iconFA("arrow-to-top",(()=>ur(this,void 0,void 0,(function*(){this.uploadFunc?yield this.processCustomDataUpload():(this.isUploadMode.next(!this.isUploadMode.value),n.classList.toggle("d4-current"))}))),"Upload experimental data");n.classList.add("d4-toggle-button",...this.isUploadMode.value?["d4-current"]:[]);const i=e.iconFA("analytics",(()=>ur(this,void 0,void 0,(function*(){return yield this.onSALaunch()}))),"Run sensitivity analysis"),s=e.iconFA("info",(()=>ur(this,void 0,void 0,(function*(){this.hasContextHelp&&(t.shell.windows.help.visible=!0,yield new Promise((t=>setTimeout(t,100))),t.shell.windows.help.showHelp(e.markdown(yield this.getContextHelp())))})))),o=[[...super.buildRibbonPanels().flat(),...this.runningOnInput||this.options.isTabbed?[]:[r],...this.hasUploadMode?[n]:[],...this.isSaEnabled?[i]:[],...this.hasContextHelp?[s]:[]]];return this.setRibbonPanels(o),o}showOutput(){e.setDisplay(this.tabsElem.root,!0),this._isOutputOutdated.next(!1)}buildOutputBlock(){this.tabsElem.root.style.width="100%",this.tabsLabels.forEach((r=>{const[n,o]=this.categoryToDfParamMap.outputs[r]?[this.categoryToDfParamMap.outputs[r],!1]:[this.categoryToDfParamMap.inputs[r],!0],l=n.filter((t=>t.propertyType===i.TYPE.DATA_FRAME||t.propertyType===i.TYPE.GRAPHICS)),u=n.filter((t=>t.propertyType!==i.TYPE.DATA_FRAME&&t.propertyType!==i.TYPE.GRAPHICS)),h=l.map((t=>rt(t).config));let d="";const f=l.reduce(((r,n,l)=>{var u,c;this.dfToViewerMapping[n.name]=[];const f=h[l].map(((r,s)=>ur(this,void 0,void 0,(function*(){var s,o,a,l;const u=null!==(l=null!==(o=null===(s=this.funcCall.outputs[n.name])||void 0===s?void 0:s.value)&&void 0!==o?o:null===(a=this.funcCall.inputParams[n.name])||void 0===a?void 0:a.value)&&void 0!==l?l:t.data.demo.demog(0),c=r.type,h=Object.values(m).includes(c)?i.Viewer.fromType(c,u):yield u.plot.fromType(c);h.setOptions(r),this.dfToViewerMapping[n.name].push(h),this.afterOutputPropertyRender.next({prop:n,output:h});const d=hr();return 0===u.rowCount&&"demog 0"===u.name&&(e.setDisplay(h.root,!1),e.setDisplay(d,!0)),{viewer:h,stub:d}})))).map(((t,r)=>t.then((({viewer:t,stub:i})=>{const o=this.funcCallReplaced.pipe((0,s.startWith)(null),(0,s.switchMap)((()=>{var t;return(null!==(t=this.funcCall.outputParams[n.name])&&void 0!==t?t:this.funcCall.inputParams[n.name]).onChanged.pipe((0,s.startWith)(null))})),(0,s.skip)(1)).subscribe((()=>ur(this,void 0,void 0,(function*(){var s;const o=null!==(s=this.funcCall.outputParams[n.name])&&void 0!==s?s:this.funcCall.inputParams[n.name];if(o.value){if(e.setDisplay(t.root,!0),e.setDisplay(i,!1),Object.values(m).includes(t.type))t.dataFrame=o.value;else{const e=yield o.value.plot.fromType(t.type);t.root.replaceWith(e.root),t=e}Object.keys(h[l][r]).includes("color")&&t.setOptions({color:h[l][r].color}),this.afterOutputPropertyRender.next({prop:n,output:t})}else e.setDisplay(t.root,!1),e.setDisplay(i,!0)}))));return this.subs.push(o),{loadedViewer:t,stub:i}})))),p=d!==(null!==(u=n.options.caption)&&void 0!==u?u:n.name)?null!==(c=n.options.caption)&&void 0!==c?c:n.name:" ";if(d=p,o){const t=this.funcCallReplaced.pipe((0,s.switchMap)((()=>{var t;return(null!==(t=this.funcCall.outputParams[n.name])&&void 0!==t?t:this.funcCall.inputParams[n.name]).onChanged}))).subscribe((()=>{this.showOutput(),this.inputTabsLabels.forEach((t=>{a()(this.tabsElem.getPane(t).header).show()}))}));this.subs.push(t)}const b=f.map(((t,r)=>{const n=h[l][r].block,i=e.wait((()=>ur(this,void 0,void 0,(function*(){const r=yield t;return a()(r.loadedViewer.root).css({height:"100%",width:"100%"}),e.divV([r.loadedViewer.root,r.stub],{style:{width:"100%"}})}))));return a()(i).css({"min-height":"300px","flex-grow":"1"}),e.divV([e.h2(0===r?p:" ",{style:{"white-space":"pre"}}),i],{style:Object.assign({},n?{width:`${n}%`,"max-width":`${n}%`,"max-height":"100%"}:{"flex-grow":"1"})})}));if(n.propertyType===i.TYPE.GRAPHICS){const t=n.options.block,i=hr();i.classList.add("grok-scripting-image-container");const o=e.divV([e.h2(p,{style:{"white-space":"pre"}}),i],{style:Object.assign({},t?{width:`${t}%`,"max-width":`${t}%`,"max-height":"100%"}:{"flex-grow":"1"})}),a=()=>{var t;const e=null!==(t=this.funcCall.outputParams[n.name])&&void 0!==t?t:this.funcCall.inputParams[n.name];e.value?(i.style.backgroundImage=`url("data:image/png;base64,${e.value}")`,i.textContent=""):(i.style.removeProperty("background-image"),i.textContent="[No data to display]")},l=this.funcCallReplaced.pipe((0,s.startWith)(null),(0,s.switchMap)((()=>{var t;return(null!==(t=this.funcCall.outputParams[n.name])&&void 0!==t?t:this.funcCall.inputParams[n.name]).onChanged.pipe((0,s.startWith)(null))})),(0,s.skip)(1)).subscribe(a);this.subs.push(l),r.append(o)}return r.append(...b),r}),e.divH([],{style:{"flex-wrap":"wrap","flex-grow":"1","max-height":"100%"}})),p=()=>{const t=i.HtmlTable.create(u,(t=>{var e;const r=t.options.precision,n=r&&t.propertyType===i.TYPE.FLOAT&&this.funcCall.outputs[t.name]?this.funcCall.outputs[t.name].toPrecision(r):this.funcCall.outputs[t.name],s=t.options.units?` [${t.options.units}]`:"";return[`${null!==(e=t.caption)&&void 0!==e?e:t.name}${s}`,null!=n?n:"[No value]"]})).root;return a()(t).addClass("rfv-scalar-table"),this.afterOutputSacalarTableRender.next(t),t};let b=p();const g=(0,c.merge)(this.funcCallReplaced,this.isRunning.pipe((0,s.filter)((t=>!1===t)),(0,s.skip)(1))).subscribe((()=>{const t=p();b.replaceWith(t),b=t,a()(this.tabsElem.getPane(r).header).show()}));this.subs.push(g),this.tabsElem.addPane(r,(()=>e.divV([...l.length?[f]:[],...u.length?[b]:[]])))}));const r=e.box();return r.append(this.tabsElem.root),r}onAfterLoadRun(t){return ur(this,void 0,void 0,(function*(){this.showOutput()}))}get tabsLabels(){return[...this.inputTabsLabels,...this.outputTabsLabels]}get outputTabsLabels(){return Object.keys(this.categoryToDfParamMap.outputs)}get inputTabsLabels(){return Object.keys(this.categoryToDfParamMap.inputs)}get categoryToDfParamMap(){const t={inputs:{},outputs:{}};return this.func.inputs.filter((t=>t.propertyType===i.TYPE.DATA_FRAME&&0!==rt(t).config.length)).forEach((e=>{const r="Misc"===e.category?"Input":e.category;t.inputs[r]?t.inputs[r].push(e):t.inputs[r]=[e]})),this.func.outputs.forEach((e=>{const r="Misc"===e.category?"Output":e.category;e.propertyType===i.TYPE.DATA_FRAME&&0===rt(e).config.length||(t.outputs[r]?t.outputs[r].push(e):t.outputs[r]=[e])})),t}get inputsStorage(){return`RFV_LastInputs_${this.funcCall.func.name}`}saveLastInputs(){return ur(this,void 0,void 0,(function*(){try{const e=yield p()(this.funcCall.inputParams.values()).reduce(((e,r)=>ur(this,void 0,void 0,(function*(){const n=r.property.propertyType!==i.TYPE.DATA_FRAME?this.funcCall.inputs[r.name]:yield t.dapi.tables.uploadDataFrame(this.funcCall.inputs[r.name]);return Object.assign(Object.assign({},yield e),{[r.name]:JSON.stringify(n)})}))),Promise.resolve({}));return yield t.dapi.userDataStorage.put(this.inputsStorage,e)}catch(e){t.shell.error(e.toString())}}))}loadLastInputs(){return ur(this,void 0,void 0,(function*(){try{const e=yield t.dapi.userDataStorage.get(this.inputsStorage);return 0===Object.keys(e).length?null:yield p()(this.funcCall.inputParams.values()).reduce(((r,n)=>ur(this,void 0,void 0,(function*(){const s=n.property.propertyType!==i.TYPE.DATA_FRAME?JSON.parse(e[n.name]):yield t.dapi.tables.getTable(JSON.parse(e[n.name]));return Object.assign(Object.assign({},yield r),{[n.name]:s})}))),Promise.resolve({}))}catch(e){t.shell.error(e.toString())}}))}deleteLastInputs(){return ur(this,void 0,void 0,(function*(){try{return yield t.dapi.userDataStorage.put(this.inputsStorage,{})}catch(e){t.shell.error(e.toString())}}))}doRun(){return ur(this,void 0,void 0,(function*(){this.isRunning.next(!0);try{this.options.isTabbed||(yield this.saveLastInputs()),yield this.run(),this.options.isTabbed||(yield this.deleteLastInputs())}catch(e){t.shell.error(e.toString()),console.log(e)}finally{this.isRunning.next(!1),this.validationRequests.next({isRevalidation:!1,isNewOutput:!0})}}))}setExternalValidationResults(t,e){this.externalValidatorsState[t]=e,this.externalValidatorsUpdates.next(t)}saveInputLockState(t,e,r){"restricted"===r&&(this.funcCall.options[y]=Object.assign(Object.assign({},this.funcCall.options[y]),{[t]:e})),r&&(this.funcCall.options[v]=Object.assign(Object.assign({},this.funcCall.options[v]),{[t]:r})),this.updateConsistencyState()}getInputLockState(t){var e;return null===(e=this.funcCall.options[v])||void 0===e?void 0:e[t]}updateConsistencyState(){const t=Object.values(this.funcCall.options[v]).some((t=>"inconsistent"===t));this.consistencyState.next(t?"inconsistent":"consistent")}getInput(t){return this.inputsMap[t]}setInput(t,e,r){const n=this.getInput(t);if(!n)throw new Error(`No input named ${t}`);if(this.funcCall.inputParams[t].property.propertyType===i.TYPE.DATA_FRAME&&"restricted"===r)throw new Error(`Param ${t} is dataframe. Restricted state is not supported for them.`);r||(r=this.funcCall.inputParams[t].property.propertyType===i.TYPE.DATA_FRAME?"disabled":"restricted"),this.funcCall.inputs[t]=e,this.setInputLockState(n,t,e,r)}getParamChanges(t){const e=this.funcCall.inputParams[t]?"inputParams":"outputParams";return this.funcCallReplaced.pipe((0,s.startWith)(null),(0,s.filter)((()=>!!this.funcCall)),(0,s.switchMap)((()=>this.funcCall[e][t].onChanged.pipe((0,s.startWith)(null)))),(0,s.map)((()=>this.funcCall[e][t].value)))}getParamValue(t){var e,r;const n=(null===(e=this.funcCall)||void 0===e?void 0:e.inputParams[t])?"inputParams":"outputParams";return null===(r=this.funcCall)||void 0===r?void 0:r[n][t].value}setInputLockState(t,e,r,n){n&&this.saveInputLockState(e,r,n),V(t)&&("disabled"===n&&t.setDisabled(),"restricted"===n&&t.setRestricted(),"restricted unlocked"===n&&t.setRestrictedUnlocked(),"inconsistent"===n&&t.setInconsistent(),"user input"===n&&t.setUserInput())}getRestrictedValue(t){var e;return null===(e=this.funcCall.options[y])||void 0===e?void 0:e[t]}renderOutputForm(){return this.renderIOForm(lr.OUTPUTS)}onSALaunch(){return ur(this,void 0,void 0,(function*(){yield ar.fromEmpty(this.func)}))}renderInputForm(){return this.renderIOForm(lr.INPUTS)}renderIOForm(t){const r=e.divH([],"ui-form ui-form-wide");a()(r).css({"flex-wrap":"wrap","flex-grow":"0","padding-right":"12px","padding-top":"0px","padding-left":"0px","max-width":"100%",gap:"4px"});let n="Misc";const i=this.funcCall[cr[t]].values();return p()(i).filter((t=>!!t)).forEach((e=>{const i=e.property;this.beforeInputPropertyRender.next(i);const s=this.getInputForVal(e);s?(this.inputsMap[e.property.name]=s,t===lr.INPUTS&&(this.syncInput(e,s,t),this.checkForMapping(e,s),this.runningOnInput||this.disableInputsOnRun(e.property.name,s),this.bindOnHotkey(s)),this.renderCategory(r,e.property.category,n),this.renderInput(r,e,s),this.afterInputPropertyRender.next({prop:i,input:s}),n=i.category):n=i.category})),Object.keys(this.foldedCategoryInputs).forEach((t=>this.foldedCategoryInputs[t].forEach((t=>a()(t.input.root).hide())))),r.classList.remove("ui-panel"),r}saveFocusedElement(t){this.focusedInput=t}restoreFocusedElement(){var t;null===(t=this.focusedInput)||void 0===t||t.focus()}disableInputsOnRun(t,e){const r=this.isRunning.subscribe((r=>{"user input"!==this.getInputLockState(t)&&this.getInputLockState(t)||(r?(tt(e)&&a()(e.input).is(":focus")&&this.saveFocusedElement(e.input),e.enabled=!1):(e.enabled=!0,tt(e)&&this.restoreFocusedElement()))}));this.subs.push(r)}checkForMapping(t,e){if(!e.hasOwnProperty("_chosenRun"))return;const r=t.property.options.funccallMapping;if(!r)return;const n=JSON.parse(r),i=this.funcCallReplaced.pipe((0,s.startWith)(!0),(0,s.switchMap)((()=>this.funcCall.inputParams[t.property.name].onChanged))).subscribe((()=>{Object.entries(n).forEach((([t,r])=>this.setInput(t,e.chosenRun?(t=>{var r,n,i,s,o,a;return null!==(a=null!==(s=null!==(n=null===(r=e.chosenRun)||void 0===r?void 0:r.inputs[t])&&void 0!==n?n:null===(i=e.chosenRun)||void 0===i?void 0:i.outputs[t])&&void 0!==s?s:null===(o=e.chosenRun)||void 0===o?void 0:o.options[t])&&void 0!==a?a:null})(r):this.funcCall.inputParams[t].property.defaultValue,e.chosenRun?"restricted":"user input")))}));this.subs.push(i)}getInputForVal(r){var n,s,o;const a=r.property;if(this.inputsOverride[r.property.name])return this.inputsOverride[r.property.name];if(a.propertyType===i.TYPE.STRING&&a.options.choices&&!a.options.propagateChoice)return e.choiceInput(null!==(n=a.caption)&&void 0!==n?n:a.name,a.defaultValue,JSON.parse(a.options.choices));switch(a.propertyType){case i.TYPE.DATA_FRAME:return e.tableInput(null!==(s=a.caption)&&void 0!==s?s:a.name,null,t.shell.tables);case"file":return Zt.fileInput(null!==(o=a.caption)&&void 0!==o?o:a.name,null,null,null);case i.TYPE.FLOAT:const r=e.input.forProperty(a),n=a.options.format;return n&&(r.format=n),r;default:return e.input.forProperty(a)}}bindOnHotkey(t){tt(t)&&(t.input.onkeydown=t=>ur(this,void 0,void 0,(function*(){"Enter"==t.key&&this.runRequests.next()})))}get foldedCategories(){var t;return JSON.parse(null!==(t=this.func.options.foldedCategories)&&void 0!==t?t:"[]")}getCategoryWarningIcon(t){const r=e.iconFA("exclamation-circle",null,"This category has inconsistent inputs");a()(r).css({color:"var(--orange-2)","padding-left":"5px"}).hide();const n=this.funcCallReplaced.subscribe((()=>{this.foldedCategoryInputs[t].some((t=>"inconsistent"===this.getInputLockState(t.paramName)&&t.input.value!==this.getRestrictedValue(t.paramName)))?a()(r).show():a()(r).hide()}));return this.subs.push(n),r}renderCategory(t,r,n){if(r!==n)if(this.foldedCategories.includes(r)){const n=this.getCategoryWarningIcon(r),i=e.iconFA("chevron-right",(()=>{var t;a()(s).show(),a()(i).hide(),a()(n).hide(),(null!==(t=this.foldedCategoryInputs[r])&&void 0!==t?t:[]).forEach((t=>a()(t.input.root).css({display:""})))}),"Open category");a()(i).css("padding-right","5px");const s=e.iconFA("chevron-down",(()=>{var t;a()(s).hide(),a()(i).show(),this.foldedCategoryInputs[r].some((t=>"inconsistent"===this.getInputLockState(t.paramName)))?a()(n).show():a()(n).hide(),(null!==(t=this.foldedCategoryInputs[r])&&void 0!==t?t:[]).forEach((t=>a()(t.input.root).hide()))}),"Close category");a()(s).css("padding-right","5px"),t.append(e.h2([i,s,e.h2(r,{style:{display:"inline"}}),n],{style:{width:"100%"}})),a()(s).hide()}else t.append(e.h2(r,{style:{width:"100%"}}))}renderInput(t,r,n){var i;const s=r.property;this.foldedCategories.includes(s.category)&&(this.foldedCategoryInputs[s.category]=[...null!==(i=this.foldedCategoryInputs[s.category])&&void 0!==i?i:[],{paramName:r.property.name,input:n}]),this.injectLockIcons(r,n),(t=>{if(V(t))return;const e=t;e.setDisabled=function(){t.enabled=!1,a()(t.root).removeClass("rfv-restricted-unlocked-input"),a()(t.root).removeClass("rfv-inconsistent-input"),a()(t.root).removeClass("rfv-restricted-input")},e.setRestricted=function(){t.enabled=!1,tt(t)&&(t.input.disabled=!1),a()(t.root).addClass("rfv-restricted-input"),a()(t.root).removeClass("rfv-restricted-unlocked-input"),a()(t.root).removeClass("rfv-inconsistent-input")},e.setRestrictedUnlocked=function(){t.enabled=!0,a()(t.root).addClass("rfv-restricted-unlocked-input"),a()(t.root).removeClass("rfv-restricted-input"),a()(t.root).removeClass("rfv-inconsistent-input")},e.setInconsistent=function(){t.enabled=!0,a()(t.root).addClass("rfv-inconsistent-input"),a()(t.root).removeClass("rfv-restricted-input"),a()(t.root).removeClass("rfv-restricted-unlocked-input")},e.setUserInput=function(){t.enabled=!0,a()(t.root).removeClass("rfv-inconsistent-input"),a()(t.root).removeClass("rfv-restricted-input"),a()(t.root).removeClass("rfv-restricted-unlocked-input")}})(n),tt(n)&&(((t,e)=>{var r;const n=t.property;a()(e.root).css({width:`calc(${null!==(r=n.options.block)&&void 0!==r?r:"100"}% - ${n.options.block?"2":"0"}px)`,"box-sizing":"border-box"})})(r,n),this.bindTooltips(r,n),(t=>{const r=e.element("i");t.addOptions(r),t.setValidation=function(n){for(;r.firstChild&&r.removeChild(r.firstChild););const[i,s]=function(t){let r,n;return(null==t?void 0:t.pending)&&(n=e.iconFA("spinner",(()=>{Y(t,n,r)}))),(null==t?void 0:t.errors)&&t.errors.length?(n=e.iconFA("exclamation-circle",(()=>{Y(t,n,r)})),n.style.color="var(--red-3)"):(null==t?void 0:t.warnings)&&t.warnings.length?(n=e.iconFA("exclamation-circle",(()=>{Y(t,n,r)})),n.style.color="var(--orange-2)"):(null==t?void 0:t.notifications)&&t.notifications.length&&(n=e.iconFA("info-circle",(()=>{Y(t,n,r)})),n.style.color="var(--blue-1)"),n&&(n.classList.remove("fal"),n.classList.add("far"),r=function(t){const r=e.div([],"d4-tooltip");return function(t){t.popover="auto",t.style.fontStyle="normal",t.style.pointerEvents="all"}(r),t.appendChild(r),r}(n)),[n,r]}(n);i&&s&&(r.appendChild(i),r.appendChild(s)),t.input.classList.remove("d4-invalid"),t.input.classList.remove("d4-partially-invalid"),(null==n?void 0:n.errors)&&n.errors.length||(null==n?void 0:n.warnings)&&n.warnings.length||(null==n?void 0:n.notifications)&&n.notifications.length||(null==n?void 0:n.pending)?a()(r).css("display","flex"):a()(r).hide(),(null==n?void 0:n.errors)&&n.errors.length?t.input.classList.add("d4-invalid"):(null==n?void 0:n.warnings)&&n.warnings.length&&t.input.classList.add("d4-partially-invalid")}})(n)),t.append(n.root)}bindTooltips(t,r){const n=t.property.name;e.tooltip.bind(r.root,(()=>{const r=t.property.description?`${t.property.description}.`:null,i=(()=>"disabled"===this.getInputLockState(n)?"Input is disabled to prevent inconsistency.":"inconsistent"===this.getInputLockState(n)?"The entered value is inconsistent to the computed value.":"restricted"===this.getInputLockState(n)?"The value is dependent and computed automatically. Click to edit":null)();return r||i?e.divV([...r?[e.divText(r)]:[],...i?[e.divText(i)]:[]],{style:{"max-width":"300px"}}):null}))}injectLockIcons(t,r){const n=t.property.name;r.root.addEventListener("click",(()=>{"restricted"===this.getInputLockState(n)&&this.setInputLockState(r,t.name,t.value,"restricted unlocked")}));const s=e.iconFA("lock");a()(s).addClass("rfv-icon-lock"),a()(s).css({color:"var(--grey-2)"});const o=e.iconFA("lock-open");a()(o).addClass("rfv-icon-unlock"),a()(o).css({color:"var(--grey-2)"});const l=e.iconFA("undo",(e=>{this.setInput(t.name,this.getRestrictedValue(n),"restricted"),e.stopPropagation()}),"Reset value to computed value");a()(l).addClass("rfv-icon-undo"),a()(l).css({color:"var(--blue-2)"});const u=e.iconFA("exclamation-circle",null);e.tooltip.bind(u,(()=>`Current value is incosistent. Computed value was ${i.TYPES_SCALAR.has(t.property.propertyType)?this.getRestrictedValue(n):"different"}`)),a()(u).addClass("rfv-icon-warning"),a()(u).css({color:"var(--orange-2)"});const c=r;c.placeLockStateIcons||(c.placeLockStateIcons=function(t,e,n,i){tt(r)&&(r.addOptions(t),r.addOptions(e),r.addOptions(n),r.addOptions(i))}),c.placeLockStateIcons(s,o,l,u)}syncInput(t,e,r){const n=t.name;let o=!1;const a=this.funcCallReplaced.pipe((0,s.startWith)(!0)).subscribe((()=>{var t,s;const o=this.funcCall[cr[r]][n],a=o.property.propertyType===i.TYPE.STRING&&o.property.defaultValue?o.property.defaultValue.substring(1,o.property.defaultValue.length-1):o.property.defaultValue,l=null!==(s=null!==(t=this.funcCall[r][n])&&void 0!==t?t:a)&&void 0!==s?s:null;e.notify=!1,e.value=l,e.notify=!0,this.funcCall[r][n]=l,this.setInputLockState(e,n,l,this.getInputLockState(n))}));this.subs.push(a);const l=this.funcCallReplaced.pipe((0,s.startWith)(!0),(0,s.switchMap)((()=>{const t=this.funcCall[cr[r]][n];return t.onChanged.pipe((0,s.mapTo)(t))}))).subscribe((t=>{const n=this.funcCall[r][t.name];if(o||(e.notify=!1,e.value=n,e.notify=!0),r===lr.INPUTS){this.isHistorical.next(!1),this.hideOutput(),this.validationRequests.next({field:t.name,isRevalidation:!1});const r=this.getInputLockState(t.name);"restricted unlocked"!==r&&"inconsistent"!==r||this.setInputLockState(e,t.name,n,n===this.getRestrictedValue(t.name)?"restricted unlocked":"inconsistent")}}));this.subs.push(l);const u=this.funcCallReplaced.pipe((0,s.startWith)(!0),(0,s.switchMap)((()=>{const t=this.funcCall[cr[r]][n];return t.onChanged.pipe((0,s.mapTo)(t),(0,s.startWith)(t))})),(0,s.filter)((t=>t.property.propertyType===i.TYPE.DATA_FRAME&&t.value)),(0,s.switchMap)((t=>t.value.onDataChanged.pipe((0,s.mapTo)(t))))).subscribe((t=>{this.validationRequests.next({field:t.name,isRevalidation:!1})}));this.subs.push(u);const h=(d=e.onInput.bind(e),new c.Observable((t=>{const e=d((e=>{t.next(e)}));return()=>e.unsubscribe()}))).pipe((0,s.debounceTime)(250)).subscribe((()=>{try{o=!0,this.funcCall[r][t.name]=e.value}finally{o=!1}}));var d;this.subs.push(h)}isRunnable(){return!this.isRunning.value&&!this.blockRuns.value&&this.isValid()}isValid(){for(const[t,e]of Object.entries(this.validationState))if(!z(e))return!1;for(const[t,e]of Object.entries(this.externalValidatorsState))if(!z(e))return!1;return!0}getValidationState(){return this.validationState}getValidationMessage(){const t=[];for(const[e,r]of Object.entries(this.validationState))z(r)||t.push(`${e}: ${H(r)}`);return t.join("\n")}runValidation(t,e){return ur(this,void 0,void 0,(function*(){const r=t.field,n=this.getValidatedNames(r),i=yield Promise.all(n.map((r=>ur(this,void 0,void 0,(function*(){const n=this.funcCall.inputs[r],i=yield(u=n,this._funcCall,this.lastCall,t.isNewOutput,t.isRevalidation,s=void 0,o=void 0,a=void 0,l=function*(){if(null==u)return W({errors:["Missing value"]})},new(a||(a=Promise))((function(t,e){function r(t){try{i(l.next(t))}catch(t){e(t)}}function n(t){try{i(l.throw(t))}catch(t){e(t)}}function i(e){var i;e.done?t(e.value):(i=e.value,i instanceof a?i:new a((function(t){t(i)}))).then(r,n)}i((l=l.apply(s,o||[])).next())})));var s,o,a,l,u;let c;const h=this.validators[r];return h&&(c=yield h(n,{param:r,funcCall:this._funcCall,lastCall:this.lastCall,signal:e,isNewOutput:!!t.isNewOutput,isRevalidation:t.isRevalidation,context:t.context,view:this})),[r,q(...this.funcCall.inputParams[r].property.options.nullable?[]:[i],c)]})))));return Object.fromEntries(i)}))}setValidationPending(t){const e=this.getValidatedNames(t);for(const t of e){this.validationState[t]={pending:!0};const e=this.inputsMap[t];L(e)&&e.setValidation({pending:!0})}this.validationUpdates.next(null)}setValidationResults(t){for(const[e,r]of Object.entries(t))this.validationState[e]=r,this.updateInputValidationReuslts(e)}updateInputValidationReuslts(t){const e=q(this.validationState[t],this.externalValidatorsState[t]),r=this.inputsMap[t];L(r)&&r.setValidation(e)}runRevalidations(t,e){if(!t.isRevalidation)for(const[,t]of Object.entries(e))if(null==t?void 0:t.revalidate)for(const e of t.revalidate)this.validationRequests.next({field:e,context:t.context,isRevalidation:!0})}getValidatedNames(t){return t?[t]:[...this.funcCall.inputs.keys()]}getValidExpRun(e){return ur(this,void 0,void 0,(function*(){const r=yield(yield t.functions.eval("Sin")).prepare({x:1}).call();e.dart.r2=r.dart.r2;const n=e.options.immutable_tags||[];return e.options.immutable_tags=n.includes(_)?n:[...n,_],e.newId(),e}))}saveExperimentalRun(t){return ur(this,void 0,void 0,(function*(){const e=yield this.getValidExpRun(t);yield this.saveRun(e)}))}hideOutput(){if(this._isOutputOutdated.next(!0),this.keepOutput())return;this.outputTabsLabels.forEach((t=>a()(this.tabsElem.getPane(t).header).hide()));const t=this.tabsElem.panes.find((t=>this.inputTabsLabels.includes(t.name)));t?this.tabsElem.currentPane=t:a()(this.tabsElem.root).hide()}getSheetName(t,e){if(this.sheetNamesCache[t])return this.sheetNamesCache[t];let r=`${t}`;r.length>31&&(r=`${r.slice(0,31)}`);let n=1;for(;e.worksheets.some((t=>t.name===r));){let e=`${t}`;e.length>31-`-${n}`.length&&(e=`${t.slice(0,31-`-${n}`.length)}`),r=`${e}-${n}`,n++}return this.sheetNamesCache[t]=r,r}richFunctionViewSupportedFormats(){return["Excel","DataUrl images"]}richFunctionViewExportExtensions(){return{Excel:"xlsx","DataUrl images":"txt"}}}r(693),Error;var fr=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};function pr(e){return()=>fr(this,void 0,void 0,(function*(){try{const r=yield t.dapi.groups.filter(`friendlyName="${e}"`).list();if(0===r.length)throw new Error("group with specified name is not found");if(r.length>1)throw new Error("found more than one group with specified name");const n=r[0];fetch(`${window.location.origin}/api/groups/${n.id}/requests/${t.shell.user.group.id}`,{method:"POST"})}catch(e){t.shell.error(e.toString())}}))}class mr extends i.ObjectHandler{get type(){return"Model"}getById(e){return fr(this,void 0,void 0,(function*(){return yield t.dapi.functions.find(e)}))}refresh(t){return fr(this,void 0,void 0,(function*(){return yield this.getById(t.id)}))}static openHelp(r){return fr(this,void 0,void 0,(function*(){if(null!=r.options.readme){t.shell.windows.showHelp=!0,yield new Promise((t=>setTimeout(t,100)));const n=`System:AppData/${r.package.name}/${r.options.readme}`;t.dapi.files.readAsText(n).then((r=>{t.shell.windows.help.showHelp(e.markdown(r))}))}}))}static openModel(t){t.prepare().edit()}static openModelFromFunccall(t){t.edit()}isApplicable(t){const e=i.toJs(t);return e instanceof i.Func&&e.hasTag("model")}constructor(){super(),this.userGroups=new c.BehaviorSubject(void 0)}getLanguageIcon(t){return"grok"==t?e.iconSvg("project"):e.iconImage("script",`/images/entities/${t}.png`)}renderMarkup(r){const n=e.divH([],{style:{"justify-content":"space-between",width:"100%"}});return setTimeout((()=>fr(this,void 0,void 0,(function*(){const i=yield this.awaitUserGroups(),s=JSON.parse(r.options.mandatoryUserGroups?`${r.options.mandatoryUserGroups}`:"[]").filter((t=>!i.map((t=>t.friendlyName)).includes(t.name))),o=s.length>0,a=e.iconFA("exclamation-triangle",null);a.classList.remove("grok-icon");const l=()=>{const t=e.iconFA("times");return t.style.marginRight="6px",t.classList.remove("grok-icon"),t},u=e.div(e.divV([e.label("You should be a member of the following group(s):",{style:{marginLeft:"0px"}}),...s.map((t=>e.divV([e.span([l(),t.name],{style:{"font-weight":600}}),...t.help?[e.span([t.help],{style:{marginLeft:"16px"}})]:[],e.link("Request group membership",pr(t.name),void 0,{style:{marginLeft:"16px"}})])))],{style:{gap:"10px"}})),c=e.span([this.renderIcon(r),e.label(r.friendlyName)]);var h;n.onclick=()=>{t.shell.windows.help.visible&&mr.openHelp(r)},o?c.classList.add("d4-disabled"):n.ondblclick=()=>{mr.openModel(r)},o&&(function(t){t.popover="auto",t.style.cursor="default",t.style.padding="10px",t.style.background="#fdffe5",t.style.border="1px solid #E4E6CE",t.style.borderRadius="2px",t.style.boxShadow="0 0 5px #E4E6CE",t.style.maxWidth="500px",t.style.color="var(--gray-6)"}(h=u),document.body.append(h),n.addEventListener("click",(()=>{!function(t,e){!function(t,e){const r=t.getBoundingClientRect().toJSON();e.style.inset="unset",e.style.top=r.y+"px",e.style.left=r.x+20+"px"}(t,e),e.showPopover()}(a,u)}))),n.append(c),o&&n.append(e.span([a]))})))),n}renderIcon(t){if(null!=t.options.icon&&(t.options.icon.startsWith("http://")||t.options.icon.startsWith("https://")))return e.iconImage("model-icon",t.options.icon);if(t instanceof i.Script)return this.getLanguageIcon(t.language);let r=(t=i.Func.find({package:t.package.name,name:t.name})[0]).package.getIconUrl();if(null!=t.options.icon){const e=r.split("/");e.pop(),e.push(t.options.icon),r=e.join("/")}return e.iconImage(t.package.name,r)}renderPreview(e){const r=Object.create(null,{renderPreview:{get:()=>super.renderPreview}});return fr(this,void 0,void 0,(function*(){var n;const s=null!==(n=e.options.editor)&&void 0!==n?n:"Compute:RichFunctionViewEditor",o=yield t.functions.find(s);if(null!==o&&o instanceof i.Func){const t=o.prepare({call:e.prepare()});yield t.call(!1,void 0,{processed:!0});const r=t.getOutputParamValue();if(r instanceof i.View)return r}return r.renderPreview.call(this,e)}))}renderProperties(t){const r=e.accordion("ComputeModel");r.context=t;const n=e.div([e.span([this.renderIcon(t),e.label(t.friendlyName),e.contextActions(t),e.star(t.id)])]);return r.addTitle(n),null!=t.description&&n.appendChild(e.div([e.markdown(t.description)],"model-catalog-description")),n.appendChild(e.tags(t)),null!=t.options["dev.status"]&&n.appendChild(e.tableFromMap({Status:t.options["dev.status"]})),r.end(),r.root}renderTooltip(t){const r=e.span([this.renderIcon(t),e.label(t.friendlyName)]);return r.classList.add("d4-link-label"),e.bind(t,e.divV([e.h2(r),e.divV([e.divText(t.description,"ui-description")],{style:{lineHeight:"150%"}})]))}renderCard(t){const r=this.renderMarkup(t);return r.classList.add("d4-link-label"),e.bind(t,e.h2(r))}init(){this.registerParamFunc("Help",(t=>{mr.openHelp(i.toJs(t))})),setTimeout((()=>fr(this,void 0,void 0,(function*(){const t=yield(yield fetch(`${window.location.origin}/api/groups/all_parents`)).json();this.userGroups.next(t)}))))}awaitUserGroups(){return fr(this,void 0,void 0,(function*(){return this.userGroups.pipe((0,s.filter)((t=>!!t)),(0,s.map)((t=>t)),(0,s.take)(1)).toPromise()}))}}var br=r(847),gr={};gr.styleTagTransform=St(),gr.setAttributes=vt(),gr.insert=gt().bind(null,"head"),gr.domAPI=mt(),gr.insertStyleElement=_t(),ft()(br.A,gr),br.A&&br.A.locals&&br.A.locals;class yr extends i.CustomCardView{static findOrCreateCatalogView(t,e,r){var n;return null!==(n=this.findModelCatalogView(e))&&void 0!==n?n:this.createModelCatalogView(t,e,r)}static createModelCatalogView(t,e,r){const n=i.Func.find({package:r.name,name:e})[0].prepare(),s=new this(t,e);return s.parentCall=n,s}static findModelCatalogView(e){return p()(t.shell.views).find((t=>{var r;return(null===(r=t.parentCall)||void 0===r?void 0:r.func.name)==e}))}bindModel(t){var e;t.aux.showOnTaskBar=!1;const r=this.parentCall;null!=r&&(r.aux.view=null!==(e=yr.findModelCatalogView(this.funcName))&&void 0!==e?e:this,t.parentCall=r)}constructor(e,r){if(super({dataSource:t.dapi.functions,permanentFilter:"#model"}),this.funcName=r,this.isHelpOpen=!1,this.root.classList.add("model-catalog-view"),this.meta=new mr,this.name=e,this.permanentFilter="#model",this.renderMode=i.RENDER_MODE.BRIEF,this.objectType="Func",this.categoryFilters={"options.department":"Department","options.HL_process":"HL_process","options.process":"Process",tag:"Tags"},this.filters={All:"",Favorites:"starredBy = @current","Used by me":"usedBy = @current"},this.hierarchy=["options.department","options.HL_process","options.process"],this.hierarchyProperties={"options.department":"Department","options.HL_process":"HL_process","options.process":"Process"},this.showTree=!0,this.initRibbon(),this.initMenu(),t.shell.windows.showProperties=!1,t.shell.windows.showHelp=this.isHelpOpen,!yr.findModelCatalogView(this.funcName)){const e=t.functions.onBeforeRunAction.subscribe((t=>{var e,r;t.func.hasTag("model")?this.bindModel(t):(null===(r=null===(e=t.inputs)||void 0===e?void 0:e.call)||void 0===r?void 0:r.func)instanceof i.Func&&t.inputs.call.func.hasTag("model")&&this.bindModel(t.inputs.call)})),r=t.events.onCurrentViewChanged.subscribe((()=>{return e=this,r=void 0,i=function*(){t.shell.v===this&&(t.shell.windows.showHelp=this.isHelpOpen)},new((n=void 0)||(n=Promise))((function(t,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(o,a)}l((i=i.apply(e,r||[])).next())}));var e,r,n,i}));this.subs.push(e,r)}}initRibbon(){}initMenu(){this.ribbonMenu.group("Help").item("Compute Engine",(()=>window.open("https://github.com/datagrok-ai/public/tree/master/packages/Compute","_blank"))).item("Developing Models",(()=>window.open("https://datagrok.ai/help/compute/scripting","_blank"))).endGroup()}}var vr=function(t,e,r,n){return new(r||(r=Promise))((function(i,s){function o(t){try{l(n.next(t))}catch(t){s(t)}}function a(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}l((n=n.apply(t,e||[])).next())}))};let wr=!1;const _r=new i.Package;function xr(t){mr.openModelFromFunccall(t)}function Sr(){return new u}function Cr(t){return dr.fromFuncCall(t,{historyEnabled:!0,isTabbed:!1})}function Ar(t){return dr.fromFuncCall(t,{historyEnabled:!1,isTabbed:!0})}function kr(r){return vr(this,void 0,void 0,(function*(){let n={};r.inputs.forEach((t=>n[t.name]=null));let s=`\ncurl --location --request POST '${t.settings.apiUrl}/v1/func/${r.nqName}/run' \\\n--header 'Authorization: ${Tr("auth")}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '${JSON.stringify(n)}'`,o=`\nvar myHeaders = new Headers();\nmyHeaders.append("Authorization", "${Tr("auth")}");\nmyHeaders.append("Content-Type", "application/json");\n\nvar raw = JSON.stringify(${JSON.stringify(n)});\n\nvar requestOptions = {\n method: 'POST',\n headers: myHeaders,\n body: raw,\n redirect: 'follow'\n};\n\nfetch("${t.settings.apiUrl}/v1/func/${r.nqName}/run", requestOptions)\n .then(response => response.text())\n .then(result => console.log(result))\n .catch(error => console.log('error', error));`,a=e.tabControl({CURL:e.div([e.divText(s)]),JS:e.div([e.divText(o)])});return i.Widget.fromRoot(a.root)}))}function Tr(t){let e=document.cookie.match(new RegExp("(?:^|; )"+t.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function Er(t){return vr(this,void 0,void 0,(function*(){return yield new Promise((t=>setTimeout(t,1e3))),[yield t.prepare({ambTemp:22,initTemp:100,desiredTemp:30,area:.06,heatCap:4200,heatTransferCoeff:8.3,simTime:21600}).call()]}))}function Mr(r){return vr(this,void 0,void 0,(function*(){const n=(yield t.functions.eval("Compute:CustomDataUploader")).prepare({func:r.func}),o=e.bigButton("Click me to get mock calls",(()=>n.call())),a=i.Widget.fromRoot(e.panel([e.divV([e.label("This part of dialog comes from my custom data uploader"),e.divH([o],{style:{"justify-content":"center"}})])])),l=t.functions.onBeforeRunAction.pipe((0,s.filter)((t=>t.id===n.id))).subscribe((()=>{e.setUpdateIndicator(o,!0)})),u=t.functions.onAfterRunAction.pipe((0,s.filter)((t=>t.id===n.id))).subscribe((()=>{e.setUpdateIndicator(o,!1)}));return a.subs.push(l,u),{uploadWidget:a,uploadFuncCall:n}}))}function Rr(t){t.defaultView.scatterPlot({xColumnName:"Initial temperature",yColumnName:"Time to cool"})}function Ir(){wr||(i.ObjectHandler.list().find((t=>"Model"===t.type))||i.ObjectHandler.register(new mr),t.events.onAccordionConstructed.subscribe((t=>{const r=t.context;null!=r&&"script"==r.type&&(t.getPane("REST")||t.addPane("REST",(()=>e.wait((()=>vr(this,void 0,void 0,(function*(){return(yield kr(r)).root})))))))})),wr=!0)}let Or=!1;function jr(){const e=t.shell.startUri.indexOf("?"),r=t.shell.startUri.substring(8,e>0?e:void 0).split("/");if(!Or&&r.includes("Compute")){const e=yr.findOrCreateCatalogView("Model Catalog","modelCatalog",_r);return t.shell.addView(e),Or=!0,void(r.length>3&&t.dapi.functions.filter(`shortName = "${r[3]}" and #model`).list().then((t=>{1==t.length&&mr.openModel(t[0])})))}const n=window.location.href.indexOf("?"),i=window.location.href.substring(8,n>0?n:void 0).split("/");if(i.includes("browse")){const e=yr.findModelCatalogView("modelCatalog");return e&&(t.shell.v=e),yr.createModelCatalogView("Model Catalog","modelCatalog",_r)}if(i.includes("apps")){const e=yr.findModelCatalogView("modelCatalog");if(e)t.shell.v=e;else{const e=yr.createModelCatalogView("Model Catalog","modelCatalog",_r);t.shell.addView(e)}}}function Pr(t){const{reasonableMin:e,reasonableMax:r}=t;return t=>W({warnings:t<e||t>r?[`Minimum reasonable time is ${e}. Maximum reasonable time is ${r}`]:void 0,errors:t<0?["Time should be strictly positive"]:void 0})}function Nr(t){return(t,e)=>{const r=e.funcCall.inputs.ambTemp,n=e.funcCall.inputs.initTemp;return W({errors:[...t<r?[U(`Desired temperature cannot be less than ambient temperature (${r}). \n`,[{actionName:"Set desired equal to ambient",action:()=>e.funcCall.inputs.desiredTemp=r}])]:[],...t>n?[`Desired temperature cannot be higher than initial temperature (${n})`]:[]]})}}function Br(t){return(t,e)=>{const r=e.funcCall.inputs.ambTemp;return W({errors:[...t<r?[`Initial temperature cannot be less than ambient temperature (${r}).`]:[]]})}}function Fr(t){return(t,e)=>{const r=e.funcCall.inputs.initTemp;return W({errors:[...t>r?[`Ambient temperature cannot be higher than initial temperature (${r})`]:[]]})}}function Dr(t){return(t,e)=>W({errors:[...t<=0?["Heat capacity must be greater than zero."]:[]],notifications:[U("Heat capacity is only dependent on the object material.",[{actionName:"Google it",action:()=>{window.open("http://google.com")}}])]})}function Lr(t){const r=e.stringInput("Custom input","");return r.root.style.backgroundColor="aqua",r.input.style.backgroundColor="aqua",r}function Vr(t){return Zt.historyInputJSON("Previous run","ObjectCooling")}})(),compute=n})();
|
|
1
|
+
var compute;(()=>{var t={933:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(354),o=n.n(i),s=n(314),r=n.n(s)()(o());r.push([t.id,".pipeline-view .d4-ribbon-name.selected {\n color: var(--grey-6)\n}\n\n.pipeline-view .d4-ribbon-name {\n color: var(--blue-1);\n margin: 12px 6px;\n font-weight: normal;\n place-content: center;\n}\n\n.pipeline-view .d4-ribbon-name + .d4-ribbon-name::before {\n color: var(--grey-3);\n}\n\n.pipeline-view .d4-ribbon-name.d4-disabled {\n cursor: default;\n pointer-events: none;\n color: var(--grey-3);\n}\n\n.ui-input-editor button.ui-btn-nav.ui-btn.d4-disabled {\n color: var(--grey-3)\n}","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/function-views/css/pipeline-view.css"],names:[],mappings:"AAAA;EACE;AACF;;AAEA;EACE,oBAAoB;EACpB,gBAAgB;EAChB,mBAAmB;EACnB,qBAAqB;AACvB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,eAAe;EACf,oBAAoB;EACpB,oBAAoB;AACtB;;AAEA;EACE;AACF",sourcesContent:[".pipeline-view .d4-ribbon-name.selected {\n color: var(--grey-6)\n}\n\n.pipeline-view .d4-ribbon-name {\n color: var(--blue-1);\n margin: 12px 6px;\n font-weight: normal;\n place-content: center;\n}\n\n.pipeline-view .d4-ribbon-name + .d4-ribbon-name::before {\n color: var(--grey-3);\n}\n\n.pipeline-view .d4-ribbon-name.d4-disabled {\n cursor: default;\n pointer-events: none;\n color: var(--grey-3);\n}\n\n.ui-input-editor button.ui-btn-nav.ui-btn.d4-disabled {\n color: var(--grey-3)\n}"],sourceRoot:""}]);const a=r},362:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(354),o=n.n(i),s=n(314),r=n.n(s)()(o());r.push([t.id,".ui-form .ui-input-buttons.rfv-buttons {\n margin-top: 0px;\n position: sticky;\n}\n\n.ui-form .ui-input-buttons.rfv-buttons .ui-input-editor {\n flex-wrap: wrap;\n}\n\n.ui-input-root.rfv-restricted-input.d4-disabled {\n pointer-events: all;\n cursor: pointer!important;\n}\n\n/* Hide all state icons by default */\n.ui-input-root > .ui-input-options .rfv-icon-lock,\n.ui-input-root > .ui-input-options .rfv-icon-unlock,\n.ui-input-root > .ui-input-options .rfv-icon-undo,\n.ui-input-root > .ui-input-options .rfv-icon-warning {\n display: none;\n}\n\n/* Show warning icon if input is on warning state */\n.ui-input-root.rfv-inconsistent-input > .ui-input-options .rfv-icon-warning {\n display: inherit;\n}\n\n/* Show undo icon if input is on inconstent state and hovered */\n.ui-input-root.rfv-restricted-unlocked-input:hover .rfv-icon-undo, .ui-input-root.rfv-inconsistent-input:hover .rfv-icon-undo {\n display: inherit;\n}\n\n/* Show/hide lock-unlock icons on input hover */\n.ui-input-root.rfv-restricted-input:hover .rfv-icon-lock {\n display: none;\n}\n.ui-input-root.rfv-restricted-input .rfv-icon-lock {\n display: inherit;\n}\n.ui-input-root.rfv-restricted-input .rfv-icon-unlock {\n display: none;\n}\n.ui-input-root.rfv-restricted-input:hover .rfv-icon-unlock {\n display: inherit;\n}\n\n.ui-form-condensed .rfv-buttons > .ui-label {\n margin-right: 0px!important;\n}\n\n.rfv-form .ui-form .rfv-buttons > .ui-input-editor {\n gap: 5px;\n justify-content: flex-end;\n}\n\ndiv.ui-box > div.ui-box.rfv-form > div.ui-div {\n overflow: visible!important;\n}\n\n.rfv-scalar-table {\n border-collapse: collapse;\n margin: 10px;\n}\n\n.rfv-scalar-table td {\n width: max-content;\n white-space: nowrap;\n}\n\n.rfv-scalar-table tr{\n min-height: 30px;\n border-bottom: 1pt solid var(--grey-12);\n}\n\n.rfv-scalar-table tr:nth-child(odd) {\n background-color: var(--grey-1);\n}\n\n.rfv-scalar-table td:last-child {\n width: 100%;\n}","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/function-views/css/rich-function-view.css"],names:[],mappings:"AAAA;IACI,eAAe;IACf,gBAAgB;AACpB;;AAEA;IACI,eAAe;AACnB;;AAEA;IACI,mBAAmB;IACnB,yBAAyB;AAC7B;;AAEA,oCAAoC;AACpC;;;;IAII,aAAa;AACjB;;AAEA,mDAAmD;AACnD;IACI,gBAAgB;AACpB;;AAEA,+DAA+D;AAC/D;IACI,gBAAgB;AACpB;;AAEA,+CAA+C;AAC/C;IACI,aAAa;AACjB;AACA;IACI,gBAAgB;AACpB;AACA;IACI,aAAa;AACjB;AACA;IACI,gBAAgB;AACpB;;AAEA;IACI,2BAA2B;AAC/B;;AAEA;IACI,QAAQ;IACR,yBAAyB;AAC7B;;AAEA;IACI,2BAA2B;AAC/B;;AAEA;IACI,yBAAyB;IACzB,YAAY;AAChB;;AAEA;IACI,kBAAkB;IAClB,mBAAmB;AACvB;;AAEA;IACI,gBAAgB;IAChB,uCAAuC;AAC3C;;AAEA;IACI,+BAA+B;AACnC;;AAEA;IACI,WAAW;AACf",sourcesContent:[".ui-form .ui-input-buttons.rfv-buttons {\n margin-top: 0px;\n position: sticky;\n}\n\n.ui-form .ui-input-buttons.rfv-buttons .ui-input-editor {\n flex-wrap: wrap;\n}\n\n.ui-input-root.rfv-restricted-input.d4-disabled {\n pointer-events: all;\n cursor: pointer!important;\n}\n\n/* Hide all state icons by default */\n.ui-input-root > .ui-input-options .rfv-icon-lock,\n.ui-input-root > .ui-input-options .rfv-icon-unlock,\n.ui-input-root > .ui-input-options .rfv-icon-undo,\n.ui-input-root > .ui-input-options .rfv-icon-warning {\n display: none;\n}\n\n/* Show warning icon if input is on warning state */\n.ui-input-root.rfv-inconsistent-input > .ui-input-options .rfv-icon-warning {\n display: inherit;\n}\n\n/* Show undo icon if input is on inconstent state and hovered */\n.ui-input-root.rfv-restricted-unlocked-input:hover .rfv-icon-undo, .ui-input-root.rfv-inconsistent-input:hover .rfv-icon-undo {\n display: inherit;\n}\n\n/* Show/hide lock-unlock icons on input hover */\n.ui-input-root.rfv-restricted-input:hover .rfv-icon-lock {\n display: none;\n}\n.ui-input-root.rfv-restricted-input .rfv-icon-lock {\n display: inherit;\n}\n.ui-input-root.rfv-restricted-input .rfv-icon-unlock {\n display: none;\n}\n.ui-input-root.rfv-restricted-input:hover .rfv-icon-unlock {\n display: inherit;\n}\n\n.ui-form-condensed .rfv-buttons > .ui-label {\n margin-right: 0px!important;\n}\n\n.rfv-form .ui-form .rfv-buttons > .ui-input-editor {\n gap: 5px;\n justify-content: flex-end;\n}\n\ndiv.ui-box > div.ui-box.rfv-form > div.ui-div {\n overflow: visible!important;\n}\n\n.rfv-scalar-table {\n border-collapse: collapse;\n margin: 10px;\n}\n\n.rfv-scalar-table td {\n width: max-content;\n white-space: nowrap;\n}\n\n.rfv-scalar-table tr{\n min-height: 30px;\n border-bottom: 1pt solid var(--grey-12);\n}\n\n.rfv-scalar-table tr:nth-child(odd) {\n background-color: var(--grey-1);\n}\n\n.rfv-scalar-table td:last-child {\n width: 100%;\n}"],sourceRoot:""}]);const a=r},993:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(354),o=n.n(i),s=n(314),r=n.n(s)()(o());r.push([t.id,".ui-form .ui-input-root .sa-switch-input {\n max-width: 50px;\n min-width: 50px;\n}\n\n.ui-form.ui-form-condensed .ui-input-root .sa-switch-input {\n order: -3;\n top: -5px;\n position: relative;\n}\n\n.ui-form.ui-form-condensed .ui-input-root > .sa-switch-input + label.ui-input-label:not(:empty) {\n width: unset;\n}\n\n.ui-form.ui-form-condensed .ui-input-root > .sa-switch-input ~ .ui-input-editor {\n margin-left: 50px;\n}","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/function-views/css/sens-analysis.css"],names:[],mappings:"AAAA;IACI,eAAe;IACf,eAAe;AACnB;;AAEA;IACI,SAAS;IACT,SAAS;IACT,kBAAkB;AACtB;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,iBAAiB;AACrB",sourcesContent:[".ui-form .ui-input-root .sa-switch-input {\n max-width: 50px;\n min-width: 50px;\n}\n\n.ui-form.ui-form-condensed .ui-input-root .sa-switch-input {\n order: -3;\n top: -5px;\n position: relative;\n}\n\n.ui-form.ui-form-condensed .ui-input-root > .sa-switch-input + label.ui-input-label:not(:empty) {\n width: unset;\n}\n\n.ui-form.ui-form-condensed .ui-input-root > .sa-switch-input ~ .ui-input-editor {\n margin-left: 50px;\n}"],sourceRoot:""}]);const a=r},847:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(354),o=n.n(i),s=n(314),r=n.n(s)()(o());r.push([t.id,'.model-catalog-view .d4-gallery-card.entity-model i.grok-icon {\n height: 64px;\n width: 64px;\n position: initial;\n flex-shrink: 0;\n}\n\n.model-catalog-view .d4-gallery-card.entity-model .d4-link-label i.grok-icon + label {\n margin-left: 6px;\n align-items: center;\n display: inline-flex;\n white-space: normal;\n}\n\n.model-catalog-view .d4-gallery-card.entity-model {\n padding: 0 8px;\n align-items: center;\n display: flex;\n margin: 0;\n height: 94px;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .grok-gallery-grid {\n flex-direction: row!important;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .d4-link-label i.grok-icon {\n width: 32px;\n height: 32px;\n position: initial;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .d4-link-label label {\n margin-left: 8px;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .grok-gallery-grid .d4-link-label {\n min-width: 250px;\n margin-bottom: 9px;\n color: var(--grey-6);\n padding: 10px;\n width: initial;\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-node {\n font-size: 20px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-node {\n font-size: 16px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group .d4-tree-view-node {\n font-size: 14px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-video {\n width: 80%;\n height: 0;\n padding-bottom: 50%;\n margin: 10px 10px 0 0;\n border: 1px solid var(--grey-2);\n position: relative;\n background-size: cover;\n background-repeat: no-repeat;\n}\n\n.model-catalog-video i {\n position: absolute;\n right: 0;\n left: 0;\n bottom: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n color: var(--grey-2);\n font-size: 42px;\n}\n\n.model-catalog-video i:hover {\n color: var(--grey-1);\n}\n\n.model-catalog-description {\n padding: 10px 0 0 0;\n}',"",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/model-catalog/css/model-card.css"],names:[],mappings:"AAAA;IACI,YAAY;IACZ,WAAW;IACX,iBAAiB;IACjB,cAAc;AAClB;;AAEA;IACI,gBAAgB;IAChB,mBAAmB;IACnB,oBAAoB;IACpB,mBAAmB;AACvB;;AAEA;IACI,cAAc;IACd,mBAAmB;IACnB,aAAa;IACb,SAAS;IACT,YAAY;AAChB;;AAEA;IACI,6BAA6B;AACjC;;AAEA;IACI,WAAW;IACX,YAAY;IACZ,iBAAiB;AACrB;;AAEA;IACI,gBAAgB;AACpB;;AAEA;IACI,gBAAgB;IAChB,kBAAkB;IAClB,oBAAoB;IACpB,aAAa;IACb,cAAc;AAClB;;AAEA;IACI,eAAe;IACf,cAAc;IACd,oBAAoB;AACxB;;AAEA;IACI,eAAe;IACf,cAAc;IACd,oBAAoB;AACxB;;AAEA;IACI,eAAe;IACf,cAAc;IACd,oBAAoB;AACxB;;AAEA;IACI,UAAU;IACV,SAAS;IACT,mBAAmB;IACnB,qBAAqB;IACrB,+BAA+B;IAC/B,kBAAkB;IAClB,sBAAsB;IACtB,4BAA4B;AAChC;;AAEA;IACI,kBAAkB;IAClB,QAAQ;IACR,OAAO;IACP,SAAS;IACT,MAAM;IACN,aAAa;IACb,mBAAmB;IACnB,uBAAuB;IACvB,gBAAgB;IAChB,oBAAoB;IACpB,eAAe;AACnB;;AAEA;IACI,oBAAoB;AACxB;;AAEA;IACI,mBAAmB;AACvB",sourcesContent:['.model-catalog-view .d4-gallery-card.entity-model i.grok-icon {\n height: 64px;\n width: 64px;\n position: initial;\n flex-shrink: 0;\n}\n\n.model-catalog-view .d4-gallery-card.entity-model .d4-link-label i.grok-icon + label {\n margin-left: 6px;\n align-items: center;\n display: inline-flex;\n white-space: normal;\n}\n\n.model-catalog-view .d4-gallery-card.entity-model {\n padding: 0 8px;\n align-items: center;\n display: flex;\n margin: 0;\n height: 94px;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .grok-gallery-grid {\n flex-direction: row!important;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .d4-link-label i.grok-icon {\n width: 32px;\n height: 32px;\n position: initial;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .d4-link-label label {\n margin-left: 8px;\n}\n\n.model-catalog-view .grok-gallery-grid[mode="Brief"] .grok-gallery-grid .d4-link-label {\n min-width: 250px;\n margin-bottom: 9px;\n color: var(--grey-6);\n padding: 10px;\n width: initial;\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-node {\n font-size: 20px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-node {\n font-size: 16px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-view .d4-tree-view-root > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group > .d4-tree-view-group-host > .d4-tree-view-group .d4-tree-view-node {\n font-size: 14px;\n padding: 4px 0;\n color: var(--grey-6);\n}\n\n.model-catalog-video {\n width: 80%;\n height: 0;\n padding-bottom: 50%;\n margin: 10px 10px 0 0;\n border: 1px solid var(--grey-2);\n position: relative;\n background-size: cover;\n background-repeat: no-repeat;\n}\n\n.model-catalog-video i {\n position: absolute;\n right: 0;\n left: 0;\n bottom: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n color: var(--grey-2);\n font-size: 42px;\n}\n\n.model-catalog-video i:hover {\n color: var(--grey-1);\n}\n\n.model-catalog-description {\n padding: 10px 0 0 0;\n}'],sourceRoot:""}]);const a=r},911:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(354),o=n.n(i),s=n(314),r=n.n(s)()(o());r.push([t.id,".fi-drop-area {\n position: relative;\n}\n\n.fi-drop-area .default {\n color: var(--grey-2);\n}\n\n.fi-drop-area .drag-n-dropping {\n background-color: var(--steel-1);\n border: 1px dashed var(--blue-1);\n color: var(--grey-3);\n}\n\n.fi-drop-area .error {\n color: var(--red-3);\n}\n\n.fi-drop-area .success {\n color: var(--grey-6);\n}\n","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/shared-components/css/file-input.css"],names:[],mappings:"AAAA;EACE,kBAAkB;AACpB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,gCAAgC;EAChC,gCAAgC;EAChC,oBAAoB;AACtB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,oBAAoB;AACtB",sourcesContent:[".fi-drop-area {\n position: relative;\n}\n\n.fi-drop-area .default {\n color: var(--grey-2);\n}\n\n.fi-drop-area .drag-n-dropping {\n background-color: var(--steel-1);\n border: 1px dashed var(--blue-1);\n color: var(--grey-3);\n}\n\n.fi-drop-area .error {\n color: var(--red-3);\n}\n\n.fi-drop-area .success {\n color: var(--grey-6);\n}\n"],sourceRoot:""}]);const a=r},703:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(354),o=n.n(i),s=n(314),r=n.n(s)()(o());r.push([t.id,"","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]);const a=r},565:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var i=n(354),o=n.n(i),s=n(314),r=n.n(s)()(o());r.push([t.id,".hp-no-elements-label {\n margin: 12px;\n}\n\n.grok-icon.hp-disabled {\n pointer-events: none;\n opacity: 0.6;\n}\n\n.hp-funccall-card-hover-icon {\n display: none;\n}\n\n.hp-funccall-card:hover .hp-funccall-card-hover-icon {\n display: flex;\n margin: 0px 0px 0px 5px;\n}\n\n.hp-funccall-card {\n margin: 2px 1px;\n padding: 5px;\n justify-content: space-between;\n}\n\n.hp-funccall-card .hp-card-content {\n justify-content: space-around;\n margin-left: 5px;\n}\n\n.hp-funccall-card .hp-card-content * {\n margin-bottom: 3px;\n}\n\n.hp-funccall-card .description {\n margin-bottom: 2px;\n color: var(--grey-3);\n}\n\n.hp-funccall-card .date {\n color: var(--grey-3);\n margin-left: 5px;\n}\n","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/compute-utils/shared-components/css/history-panel.css"],names:[],mappings:"AAAA;IACI,YAAY;AAChB;;AAEA;IACI,oBAAoB;IACpB,YAAY;AAChB;;AAEA;IACI,aAAa;AACjB;;AAEA;IACI,aAAa;IACb,uBAAuB;AAC3B;;AAEA;IACI,eAAe;IACf,YAAY;IACZ,8BAA8B;AAClC;;AAEA;IACI,6BAA6B;IAC7B,gBAAgB;AACpB;;AAEA;IACI,kBAAkB;AACtB;;AAEA;IACI,kBAAkB;IAClB,oBAAoB;AACxB;;AAEA;IACI,oBAAoB;IACpB,gBAAgB;AACpB",sourcesContent:[".hp-no-elements-label {\n margin: 12px;\n}\n\n.grok-icon.hp-disabled {\n pointer-events: none;\n opacity: 0.6;\n}\n\n.hp-funccall-card-hover-icon {\n display: none;\n}\n\n.hp-funccall-card:hover .hp-funccall-card-hover-icon {\n display: flex;\n margin: 0px 0px 0px 5px;\n}\n\n.hp-funccall-card {\n margin: 2px 1px;\n padding: 5px;\n justify-content: space-between;\n}\n\n.hp-funccall-card .hp-card-content {\n justify-content: space-around;\n margin-left: 5px;\n}\n\n.hp-funccall-card .hp-card-content * {\n margin-bottom: 3px;\n}\n\n.hp-funccall-card .description {\n margin-bottom: 2px;\n color: var(--grey-3);\n}\n\n.hp-funccall-card .date {\n color: var(--grey-3);\n margin-left: 5px;\n}\n"],sourceRoot:""}]);const a=r},314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(i)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(r[l]=!0)}for(var u=0;u<t.length;u++){var c=[].concat(t[u]);i&&r[c[0]]||(void 0!==s&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),e.push(c))}},e}},354:t=>{"use strict";t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var i=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(i),s="/*# ".concat(o," */");return[e].concat([s]).join("\n")}return[e].join("\n")}},693:(t,e,n)=>{t=n.nmd(t);var i="__lodash_hash_undefined__",o=9007199254740991,s="[object Arguments]",r="[object Boolean]",a="[object Date]",l="[object Function]",u="[object GeneratorFunction]",c="[object Map]",d="[object Number]",p="[object Object]",h="[object Promise]",f="[object RegExp]",m="[object Set]",v="[object String]",g="[object Symbol]",y="[object WeakMap]",b="[object ArrayBuffer]",A="[object DataView]",C="[object Float32Array]",w="[object Float64Array]",I="[object Int8Array]",x="[object Int16Array]",T="[object Int32Array]",E="[object Uint8Array]",R="[object Uint8ClampedArray]",S="[object Uint16Array]",O="[object Uint32Array]",P=/\w*$/,B=/^\[object .+?Constructor\]$/,_=/^(?:0|[1-9]\d*)$/,k={};k[s]=k["[object Array]"]=k[b]=k[A]=k[r]=k[a]=k[C]=k[w]=k[I]=k[x]=k[T]=k[c]=k[d]=k[p]=k[f]=k[m]=k[v]=k[g]=k[E]=k[R]=k[S]=k[O]=!0,k["[object Error]"]=k[l]=k[y]=!1;var F="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,L="object"==typeof self&&self&&self.Object===Object&&self,V=F||L||Function("return this")(),M=e&&!e.nodeType&&e,N=M&&t&&!t.nodeType&&t,D=N&&N.exports===M;function j(t,e){return t.set(e[0],e[1]),t}function $(t,e){return t.add(e),t}function H(t,e,n,i){var o=-1,s=t?t.length:0;for(i&&s&&(n=t[++o]);++o<s;)n=e(n,t[o],o,t);return n}function U(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function Y(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}function W(t,e){return function(n){return t(e(n))}}function G(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var z,J=Array.prototype,q=Function.prototype,K=Object.prototype,Z=V["__core-js_shared__"],X=(z=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"",Q=q.toString,tt=K.hasOwnProperty,et=K.toString,nt=RegExp("^"+Q.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),it=D?V.Buffer:void 0,ot=V.Symbol,st=V.Uint8Array,rt=W(Object.getPrototypeOf,Object),at=Object.create,lt=K.propertyIsEnumerable,ut=J.splice,ct=Object.getOwnPropertySymbols,dt=it?it.isBuffer:void 0,pt=W(Object.keys,Object),ht=Vt(V,"DataView"),ft=Vt(V,"Map"),mt=Vt(V,"Promise"),vt=Vt(V,"Set"),gt=Vt(V,"WeakMap"),yt=Vt(Object,"create"),bt=$t(ht),At=$t(ft),Ct=$t(mt),wt=$t(vt),It=$t(gt),xt=ot?ot.prototype:void 0,Tt=xt?xt.valueOf:void 0;function Et(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Rt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function St(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Ot(t){this.__data__=new Rt(t)}function Pt(t,e,n){var i=t[e];tt.call(t,e)&&Ht(i,n)&&(void 0!==n||e in t)||(t[e]=n)}function Bt(t,e){for(var n=t.length;n--;)if(Ht(t[n][0],e))return n;return-1}function _t(t,e,n,i,o,h,y){var B;if(i&&(B=h?i(t,o,h,y):i(t)),void 0!==B)return B;if(!zt(t))return t;var _=Ut(t);if(_){if(B=function(t){var e=t.length,n=t.constructor(e);return e&&"string"==typeof t[0]&&tt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!e)return function(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}(t,B)}else{var F=Nt(t),L=F==l||F==u;if(Wt(t))return function(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}(t,e);if(F==p||F==s||L&&!h){if(U(t))return h?t:{};if(B=function(t){return"function"!=typeof t.constructor||jt(t)?{}:zt(e=rt(t))?at(e):{};var e}(L?{}:t),!e)return function(t,e){return Ft(t,Mt(t),e)}(t,function(t,e){return t&&Ft(e,Jt(e),t)}(B,t))}else{if(!k[F])return h?t:{};B=function(t,e,n,i){var o,s=t.constructor;switch(e){case b:return kt(t);case r:case a:return new s(+t);case A:return function(t,e){var n=e?kt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,i);case C:case w:case I:case x:case T:case E:case R:case S:case O:return function(t,e){var n=e?kt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,i);case c:return function(t,e,n){return H(e?n(Y(t),!0):Y(t),j,new t.constructor)}(t,i,n);case d:case v:return new s(t);case f:return function(t){var e=new t.constructor(t.source,P.exec(t));return e.lastIndex=t.lastIndex,e}(t);case m:return function(t,e,n){return H(e?n(G(t),!0):G(t),$,new t.constructor)}(t,i,n);case g:return o=t,Tt?Object(Tt.call(o)):{}}}(t,F,_t,e)}}y||(y=new Ot);var V=y.get(t);if(V)return V;if(y.set(t,B),!_)var M=n?function(t){return function(t,e,n){var i=e(t);return Ut(t)?i:function(t,e){for(var n=-1,i=e.length,o=t.length;++n<i;)t[o+n]=e[n];return t}(i,n(t))}(t,Jt,Mt)}(t):Jt(t);return function(t,e){for(var n=-1,i=t?t.length:0;++n<i&&!1!==e(t[n],n););}(M||t,(function(o,s){M&&(o=t[s=o]),Pt(B,s,_t(o,e,n,i,s,t,y))})),B}function kt(t){var e=new t.constructor(t.byteLength);return new st(e).set(new st(t)),e}function Ft(t,e,n,i){n||(n={});for(var o=-1,s=e.length;++o<s;){var r=e[o],a=i?i(n[r],t[r],r,n,t):void 0;Pt(n,r,void 0===a?t[r]:a)}return n}function Lt(t,e){var n,i,o=t.__data__;return("string"==(i=typeof(n=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Vt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!zt(t)||(e=t,X&&X in e))&&(Gt(t)||U(t)?nt:B).test($t(t));var e}(n)?n:void 0}Et.prototype.clear=function(){this.__data__=yt?yt(null):{}},Et.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Et.prototype.get=function(t){var e=this.__data__;if(yt){var n=e[t];return n===i?void 0:n}return tt.call(e,t)?e[t]:void 0},Et.prototype.has=function(t){var e=this.__data__;return yt?void 0!==e[t]:tt.call(e,t)},Et.prototype.set=function(t,e){return this.__data__[t]=yt&&void 0===e?i:e,this},Rt.prototype.clear=function(){this.__data__=[]},Rt.prototype.delete=function(t){var e=this.__data__,n=Bt(e,t);return!(n<0||(n==e.length-1?e.pop():ut.call(e,n,1),0))},Rt.prototype.get=function(t){var e=this.__data__,n=Bt(e,t);return n<0?void 0:e[n][1]},Rt.prototype.has=function(t){return Bt(this.__data__,t)>-1},Rt.prototype.set=function(t,e){var n=this.__data__,i=Bt(n,t);return i<0?n.push([t,e]):n[i][1]=e,this},St.prototype.clear=function(){this.__data__={hash:new Et,map:new(ft||Rt),string:new Et}},St.prototype.delete=function(t){return Lt(this,t).delete(t)},St.prototype.get=function(t){return Lt(this,t).get(t)},St.prototype.has=function(t){return Lt(this,t).has(t)},St.prototype.set=function(t,e){return Lt(this,t).set(t,e),this},Ot.prototype.clear=function(){this.__data__=new Rt},Ot.prototype.delete=function(t){return this.__data__.delete(t)},Ot.prototype.get=function(t){return this.__data__.get(t)},Ot.prototype.has=function(t){return this.__data__.has(t)},Ot.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Rt){var i=n.__data__;if(!ft||i.length<199)return i.push([t,e]),this;n=this.__data__=new St(i)}return n.set(t,e),this};var Mt=ct?W(ct,Object):function(){return[]},Nt=function(t){return et.call(t)};function Dt(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||_.test(t))&&t>-1&&t%1==0&&t<e}function jt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||K)}function $t(t){if(null!=t){try{return Q.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ht(t,e){return t===e||t!=t&&e!=e}(ht&&Nt(new ht(new ArrayBuffer(1)))!=A||ft&&Nt(new ft)!=c||mt&&Nt(mt.resolve())!=h||vt&&Nt(new vt)!=m||gt&&Nt(new gt)!=y)&&(Nt=function(t){var e=et.call(t),n=e==p?t.constructor:void 0,i=n?$t(n):void 0;if(i)switch(i){case bt:return A;case At:return c;case Ct:return h;case wt:return m;case It:return y}return e});var Ut=Array.isArray;function Yt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}(t.length)&&!Gt(t)}var Wt=dt||function(){return!1};function Gt(t){var e=zt(t)?et.call(t):"";return e==l||e==u}function zt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(t){return Yt(t)?function(t,e){var n=Ut(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Yt(t)}(t)&&tt.call(t,"callee")&&(!lt.call(t,"callee")||et.call(t)==s)}(t)?function(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}(t.length,String):[],i=n.length,o=!!i;for(var r in t)!e&&!tt.call(t,r)||o&&("length"==r||Dt(r,i))||n.push(r);return n}(t):function(t){if(!jt(t))return pt(t);var e=[];for(var n in Object(t))tt.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}t.exports=function(t,e){return _t(t,!0,!0,e)}},72:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i<e.length;i++)if(e[i].identifier===t){n=i;break}return n}function i(t,i){for(var s={},r=[],a=0;a<t.length;a++){var l=t[a],u=i.base?l[0]+i.base:l[0],c=s[u]||0,d="".concat(u," ").concat(c);s[u]=c+1;var p=n(d),h={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)e[p].references++,e[p].updater(h);else{var f=o(h,i);i.byIndex=a,e.splice(a,0,{identifier:d,updater:f,references:1})}r.push(d)}return r}function o(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var s=i(t=t||[],o=o||{});return function(t){t=t||[];for(var r=0;r<s.length;r++){var a=n(s[r]);e[a].references--}for(var l=i(t,o),u=0;u<s.length;u++){var c=n(s[u]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}s=l}}},659:t=>{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},56:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var s=e[i]={id:i,loaded:!1,exports:{}};return t[i](s,s.exports,n),s.loaded=!0,s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),n.nc=void 0;var i={};(()=>{"use strict";n.r(i),n.d(i,{AmbTempValidator:()=>Nn,CustomCustomizer:()=>Bn,CustomDataUploader:()=>On,CustomStringInput:()=>jn,CustomUploader:()=>Pn,DesiredTempValidator:()=>Vn,HeatCapValidator:()=>Dn,InitialTempValidator:()=>Mn,ObjectCoolingSelector:()=>$n,OutliersSelection:()=>xn,PipelineStepEditor:()=>En,RichFunctionViewEditor:()=>Tn,SimTimeValidator:()=>Ln,_package:()=>wn,init:()=>_n,modelCatalog:()=>Fn,openModelFromFuncall:()=>In,renderRestPanel:()=>Rn});const t=grok,e=ui,o=DG,s=rxjs.operators,r=$;var a=n.n(r);const l=()=>document.querySelector(".d4-balloon-container");class u extends o.JsViewer{constructor(){super()}onFrameAttached(t){this.render()}onTableAttached(){this.render()}render(){if(!this.dataFrame||this.dataFrame.rowCount<=0)return void(this.root.innerHTML="");const n=this.dataFrame,i="isOutlier",s="Rationale",r="Count",u="isConfirmed";n.columns.byName(i)||n.columns.add(o.Column.fromBitSet(i,o.BitSet.create(n.rowCount,(()=>!1)))),n.columns.byName(s)||n.columns.add(o.Column.fromStrings(s,Array.from({length:n.rowCount},(()=>""))));const c=()=>o.DataFrame.fromColumns([o.Column.fromStrings(s,[]),o.Column.fromInt32Array(r,new Int32Array([])),o.Column.fromStrings("Actions",[]),o.Column.fromBitSet(u,o.BitSet.create(0,(()=>!1)))]),d=o.Viewer.grid(c());d.root.style.width="100%",d.root.style.minWidth="230px",d.columns.setVisible([s,r,"Actions"]),this.root.append(e.divV([e.divV([d.root],{style:{height:"75%"}})],{style:{height:"100%"}}));const p=()=>{var t,e;if(!d.dataFrame)return;null===(t=n.col(i))||void 0===t||t.markers.assign("true",o.MARKER_TYPE.OUTLIER);const r=null===(e=d.dataFrame)||void 0===e?void 0:e.cell(d.dataFrame.rowCount-1,s).value;n.selection.getSelectedIndexes().forEach((t=>{n.col(i).set(t,!0,!1),n.col(s).set(t,r,!1)})),n.selection.setAll(!1),n.fireValuesChanged(),a()(l()).empty()},h=()=>{d.dataFrame&&(d.dataFrame.rows.removeAt(d.dataFrame.rowCount-1),n.selection.setAll(!1),a()(l()).empty())};d.onCellPrepare((t=>{var o,r,a;t.isTableCell&&("Actions"===t.gridColumn.name&&(t.gridColumn.cellType="html",t.style.element=e.divH([...(null===(o=t.grid.dataFrame)||void 0===o?void 0:o.get(u,t.gridRow))?[(a=null===(r=t.grid.dataFrame)||void 0===r?void 0:r.get(s,t.gridRow),e.div(e.icons.delete((()=>{for(let t=0;t<n.rowCount;t++)n.columns.byName(s).get(t)===a&&(n.columns.byName(s).set(t,"",!1),n.columns.byName(i).set(t,!1,!1));n.fireValuesChanged()}),"Remove the outliers group"),{style:{"text-align":"center",margin:"6px"}}))]:[e.div(e.iconFA("check",p,"Confirm the outliers"),{style:{"text-align":"center",margin:"6px"}}),e.div(e.iconFA("times",h,"Cancel the outliers"),{style:{"text-align":"center",margin:"6px"}})]])))})),d.onCellValueEdited.subscribe((t=>{var e,i;if(!d.dataFrame||t.gridColumn.name!==s)return;if(!d.dataFrame.columns.byName(u).get(t.gridRow))return;const o=new Set;for(let t=0;t<(null===(e=d.dataFrame)||void 0===e?void 0:e.rowCount);t++){const e=null===(i=d.dataFrame)||void 0===i?void 0:i.columns.byName(s).get(t);o.add(e)}for(let e=0;e<n.rowCount;e++){const i=n.columns.byName(s).get(e);""==i||o.has(i)||n.columns.byName(s).set(e,t.cell.value)}}));const f=()=>{if(n.columns.byName(s))for(let t=0;t<n.rowCount;t++)n.columns.byName(i).get(t)?""===n.columns.byName(s).get(t)&&n.columns.byName(s).set(t,"Manual",!1):""!==n.columns.byName(s).get(t)&&n.columns.byName(s).set(t,"",!1);const t={};if(n.columns.byName(s))for(let e=0;e<n.rowCount;e++){const i=n.columns.byName(s).get(e),o=t[i];""!=i&&(o?t[i]++:t[i]=1)}d.dataFrame=c(),d.columns.setVisible([s,r,"Actions"]),Object.keys(t).map((e=>{var n;null===(n=d.dataFrame)||void 0===n||n.rows.addNew([e,t[e],"",!0])}))};n.onDataChanged.subscribe(f),n.onSelectionChanged.subscribe((()=>{if(!d.dataFrame||!n.selection.trueCount)return;const i=l();if(i&&!a()(i).is(":empty")||t.shell.info(e.div([e.divText("Confirm selected points as outliers?"),e.divH([e.bigButton("Confirm",p),e.button("Cancel",h)])])),d.dataFrame.columns.byName(u).toList().some((t=>!1===t)))d.dataFrame.set(r,d.dataFrame.rowCount-1,n.selection.trueCount);else{const t=d.dataFrame.rows.addNew(["Manual",n.selection.trueCount,"",!1]);d.dataFrame.currentCell=d.dataFrame.cell(t.idx,s)}})),n.selection.setAll(!1),f()}}const c=rxjs,d=dayjs;var p=n.n(d);const h=wu;var f=n.n(h);const m={barchart:o.VIEWER.BAR_CHART,boxplot:o.VIEWER.BOX_PLOT,calendar:o.VIEWER.CALENDAR,corrplot:o.VIEWER.CORR_PLOT,densityplot:o.VIEWER.DENSITY_PLOT,filters:o.VIEWER.FILTERS,form:o.VIEWER.FORM,globe:o.VIEWER.GLOBE,googlemap:o.VIEWER.GOOGLE_MAP,grid:o.VIEWER.GRID,heatmap:o.VIEWER.HEAT_MAP,histogram:o.VIEWER.HISTOGRAM,linechart:o.VIEWER.LINE_CHART,markup:o.VIEWER.MARKUP,matrixplot:o.VIEWER.MATRIX_PLOT,networkdiagram:o.VIEWER.NETWORK_DIAGRAM,pcplot:o.VIEWER.PC_PLOT,piechart:o.VIEWER.PIE_CHART,scatterplot:o.VIEWER.SCATTER_PLOT,"3dscatterplot":o.VIEWER.SCATTER_PLOT_3D,shapemap:o.VIEWER.SHAPE_MAP,statistics:o.VIEWER.STATISTICS,tileviewer:o.VIEWER.TILE_VIEWER,timelines:o.VIEWER.TIMELINES,treemap:o.VIEWER.TREE_MAP,trellisplot:o.VIEWER.TRELLIS_PLOT,wordcloud:o.VIEWER.WORD_CLOUD},v="JsCardView",g="viewer",y="restrictedValues",b="editState";var A;!function(t){t.INPUT="Input",t.OUTPUT="Output"}(A||(A={}));const C="experimental",w="Run name",I="RunId";var x,T,E,R;(R=x||(x={})).HIDDEN="hidden",R.VISIBLE="visible",(E=T||(T={})).ENABLED="enabled",E.DISABLED="disabled";const S="ModelStorage",O="Source",P="Is favorite",B="Is complete",_="Delete",k="Author",F="Date",L="Title",V="Desc.",M="Tags";function N(t){return t&&t.root&&t.onInput}function D(t){return(null==t?void 0:t.setValidation)&&N(t)}function j(t){return(null==t?void 0:t.setDisabled)&&(null==t?void 0:t.setRestricted)&&(null==t?void 0:t.setRestrictedUnlocked)&&(null==t?void 0:t.setInconsistent)&&(null==t?void 0:t.setUserInput)&&N(t)}function H(t){var e;return!(null===(e=null==t?void 0:t.errors)||void 0===e?void 0:e.length)&&!(null==t?void 0:t.pending)}function U(t,e){return{description:t,actions:e}}function Y(t){if(null==t?void 0:t.errors)return t.errors.map((t=>t.description)).join("; ")}function W(t){var e,n,i;const o=t=>"string"==typeof t?U(t):t;return{errors:null===(e=null==t?void 0:t.errors)||void 0===e?void 0:e.map((t=>o(t))),warnings:null===(n=null==t?void 0:t.warnings)||void 0===n?void 0:n.map((t=>o(t))),notifications:null===(i=null==t?void 0:t.notifications)||void 0===i?void 0:i.map((t=>o(t)))}}function G(...t){var e,n,i,o,s;const r=[],a=[],l=[],u=[];let c={};for(const d of t)d&&(r.push(...null!==(e=d.errors)&&void 0!==e?e:[]),a.push(...null!==(n=d.warnings)&&void 0!==n?n:[]),l.push(...null!==(i=d.notifications)&&void 0!==i?i:[]),u.push(...null!==(o=d.revalidate)&&void 0!==o?o:[]),c=Object.assign(Object.assign({},c),null!==(s=d.context)&&void 0!==s?s:{}));return{errors:r,warnings:a,notifications:l,revalidate:u,context:c}}function z(t,n,i){if(i&&n){for(function(t,e){const n=t.getBoundingClientRect().toJSON();e.style.inset="unset",e.style.top=n.y+"px",e.style.left=n.x+20+"px"}(n,i);i.firstChild&&i.removeChild(i.firstChild););const o=function(t){var n;const i=e.divV([],{style:{gap:"10px"}});for(const o of["errors","warnings","notifications"]){const s=t[o];if(null==s?void 0:s.length)for(const t of s){const s=J(o);s.style.marginRight="4px",i.appendChild(e.divV([e.divH([s,e.span([t.description])]),...(null!==(n=t.actions)&&void 0!==n?n:[]).map((t=>e.link(t.actionName,t.action,void 0,{style:{paddingLeft:"20px"}})))]))}}return i}(t);i.appendChild(o),i.showPopover()}}function J(t){let n;return"errors"===t?(n=e.iconFA("exclamation-circle"),n.style.color="var(--red-3)"):"warnings"===t?(n=e.iconFA("exclamation-circle"),n.style.color="var(--orange-2)"):"notifications"===t&&(n=e.iconFA("info-circle"),n.style.color="var(--blue-1)"),n&&(n.classList.remove("fal"),n.classList.add("far")),n}var q=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};const K=t=>!Z(t)||!t.id,Z=t=>{try{return t.started}catch(t){return null}},X=(e,n)=>{var i,o,s,r,a,l,u;if(n===k)return null!==(o=null===(i=e.author)||void 0===i?void 0:i.friendlyName)&&void 0!==o?o:t.shell.user.friendlyName;const c=null!==(l=null!==(a=null!==(r=null!==(s=e[n])&&void 0!==s?s:e.inputs[n])&&void 0!==r?r:e.outputs[n])&&void 0!==a?a:e.options[n])&&void 0!==l?l:null;return null!==(u=null==c?void 0:c.toString())&&void 0!==u?u:""},Q=t=>t.options.mainParams?JSON.parse(t.options.mainParams):null;function tt(t){const e=t;return e.dart&&o.toJs(e.dart)instanceof o.InputBase}const et=t=>{const e=t.clone();t.options.forEach((n=>e.options[n]=t.options[n]));const n=f()(t.outputParams.values()).filter((e=>e.property.propertyType===o.TYPE.DATA_FRAME&&!!t.outputs[e.name]));for(const i of n)e.outputs[i.name]=t.outputs[i.name].clone();const i=f()(t.inputParams.values()).filter((e=>e.property.propertyType===o.TYPE.DATA_FRAME&&!!t.inputs[e.name]));for(const n of i)e.inputs[n.name]=t.inputs[n.name].clone();return e},nt=t=>{const e=t.options[g];return void 0!==e?{name:t.name,config:JSON.parse(e,((t,e)=>{if("true"===e)return!0;if("false"===e)return!1;if("type"===t)return m[e]||e;if(!t.toLowerCase().includes("color")){const t=Number.parseFloat(e);if(!Number.isNaN(t))return t}return e}))}:{name:t.name,config:[]}},it=(t,e)=>{t.addRow(["Parameter","Value","Units"]).font={bold:!0},e.forEach((e=>{t.addRow([e.caption,e.value,e.units])})),t.getColumn(1).width=1.2*Math.max(...e.map((t=>t.caption.toString().length)),9),t.getColumn(2).width=1.2*Math.max(...e.map((t=>t.value.toString().length)),5),t.getColumn(3).width=1.2*Math.max(...e.map((t=>t.units.toString().length)),5)};let ot=0;const st=(t,e,n,i)=>{const o=t.getColumn(null!=n?n:1).letter,s={name:`ID_${ot.toString()}`,ref:`${o}${null!=i?i:1}`,columns:e.columns.toList().map((t=>({name:t.name,filterButton:!1}))),rows:new Array(e.rowCount).fill(0).map(((t,n)=>[...e.row(n).cells].map((t=>t.value))))};t.addTable(s),t.columns.forEach((t=>{t.width=25,t.alignment={wrapText:!0}})),ot++},rt=(t,e,n,i,...s)=>q(void 0,[t,e,n,i,...s],void 0,(function*(t,e,n,i,s=0){yield o.Utils.loadJsCss(["/js/common/html2canvas.min.js"]);const r=window.html2canvas,a=yield r(n,{logging:!1}),l=a.toDataURL("image/png"),u=t.addImage({base64:l,extension:"png"});e.addImage(u,{tl:{col:i,row:s},ext:{width:a.width,height:a.height}})}));function at(t,e,n){return q(this,void 0,void 0,(function*(){return"file"===t.propertyType&&n.getInput?n.getInput(t.name).value.arrayBuffer():e}))}function lt(t,e){return q(this,void 0,void 0,(function*(){return"file"===t?new File([e],""):e}))}var ut=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};const ct=t=>{switch(t){case"Today":return"started > -1d";case"Yesterday":return"started > -2d and started < -1d";case"Any time":return"";case"Last year":return"started > -2y and started < -1y";case"This year":return"started > -1y";case"Last month":return"started > -2m and started < -1m";case"This month":return"started > -1m";case"Last week":return"started > -2w and started < -1w";case"This week":return"started > -1w"}};var dt;!function(e){const n={},i=new o.LruCache;function s(e){return ut(this,arguments,void 0,(function*(e,i=!0){var o;const s=e.func.id,r=t.dapi.functions.include("package").allPackageVersions().find(s),a=i&&null!==(o=n[s])&&void 0!==o?o:yield r;n[s]||(n[s]=a),e.func=a}))}e.augmentCallWithFunc=s,e.loadChildRuns=function(e){return ut(this,void 0,void 0,(function*(){const n=yield t.dapi.functions.calls.allPackageVersions().find(e);yield s(n);const i=yield t.dapi.functions.calls.allPackageVersions().include("func").filter(`options.parentCallId="${e}"`).list();return yield Promise.all(i.map((t=>ut(this,void 0,void 0,(function*(){return s(t)}))))),{parentRun:n,childRuns:i}}))},e.loadRun=function(e){return ut(this,arguments,void 0,(function*(e,n=!1){const i=yield t.dapi.functions.calls.allPackageVersions().include("session.user, inputs, outputs").find(e);if(yield s(i),!n){const e=f()(i.outputParams.values()).filter((t=>t.property.propertyType===o.TYPE.DATA_FRAME&&!!i.outputs[t.name]));yield Promise.all(e.map((e=>ut(this,void 0,void 0,(function*(){return i.outputs[e.name]=yield t.dapi.tables.getTable(i.outputs[e.name]),Promise.resolve()})))));const n=f()(i.inputParams.values()).filter((t=>t.property.propertyType===o.TYPE.DATA_FRAME&&!!i.inputs[t.name]));yield Promise.all(n.map((e=>ut(this,void 0,void 0,(function*(){return i.inputs[e.name]=yield t.dapi.tables.getTable(i.inputs[e.name]),Promise.resolve()})))))}return i}))},e.saveRun=function(e){return ut(this,void 0,void 0,(function*(){let n=i.get("All users");n||(n=yield t.dapi.groups.find(o.Group.defaultGroupsIds["All users"]),i.set("All users",n));const s=et(e);K(s)&&(s.options.createdOn=p()().unix());const r=f()(s.outputParams.values()).filter((t=>t.property.propertyType===o.TYPE.DATA_FRAME&&!!s.outputs[t.name]));yield Promise.all(r.map((e=>ut(this,void 0,void 0,(function*(){yield t.dapi.tables.uploadDataFrame(s.outputs[e.name]),yield t.dapi.permissions.grant(s.outputs[e.name].getTableInfo(),n,!1)})))));const a=f()(s.inputParams.values()).filter((t=>t.property.propertyType===o.TYPE.DATA_FRAME&&!!s.inputs[t.name]));return yield Promise.all(a.map((e=>ut(this,void 0,void 0,(function*(){yield t.dapi.tables.uploadDataFrame(s.inputs[e.name]),yield t.dapi.permissions.grant(s.inputs[e.name].getTableInfo(),n,!1)}))))),yield t.dapi.functions.calls.allPackageVersions().save(s)}))},e.deleteRun=function(e){return ut(this,void 0,void 0,(function*(){e.options.isDeleted=!0,yield t.dapi.functions.calls.allPackageVersions().save(e)}))},e.pullRuns=function(e){return ut(this,arguments,void 0,(function*(e,n={},i={}){let o=`func.id="${e}"`;return o+=n.author?` and session.user.id="${n.author.id}"`:"",o+=n.date?ct(n.date):"",t.dapi.functions.calls.allPackageVersions().filter(o).include("session.user, options").list(i)}))},e.pullRunsByName=function(e){return ut(this,arguments,void 0,(function*(e,n=[],i={},r=[],a=!1){let l="";for(const t of n){const e=[];t.author&&e.push(`session.user.id="${t.author.id}"`),t.date&&e.push(ct(t.date)),t.text&&e.push(`((options.title like "${t.text}") or (options.annotation like "${t.text}"))`),t.includeDeleted||e.push('((options.isDeleted != "true") or (options.isDeleted = null))');const n=e.join(" and ");""!==n&&(l+=""===l?`(${n})`:` or (${n})`)}""!==l&&(l=` and (${l})`);const u=yield t.dapi.functions.calls.allPackageVersions().filter(`func.name="${e}"${l}`).include(`${r.join(",")}`).list(i);for(const t of u)yield s(t);if((r.includes("inputs")||r.includes("func.params"))&&!a)for(const e of u){const n=f()(e.inputParams.values()).filter((t=>t.property.propertyType===o.TYPE.DATA_FRAME&&!!e.inputs[t.name]));for(const i of n)e.inputs[i.name]=yield t.dapi.tables.getTable(e.inputs[i.name])}if((r.includes("outputs")||r.includes("func.params"))&&!a)for(const e of u){const n=f()(e.outputParams.values()).filter((t=>t.property.propertyType===o.TYPE.DATA_FRAME&&!!e.outputs[t.name]));for(const i of n)e.outputs[i.name]=yield t.dapi.tables.getTable(e.outputs[i.name])}return u}))}}(dt||(dt={}));var pt=n(72),ht=n.n(pt),ft=n(825),mt=n.n(ft),vt=n(659),gt=n.n(vt),yt=n(56),bt=n.n(yt),At=n(540),Ct=n.n(At),wt=n(113),It=n.n(wt),xt=n(911),Tt={};Tt.styleTagTransform=It(),Tt.setAttributes=bt(),Tt.insert=gt().bind(null,"head"),Tt.domAPI=mt(),Tt.insertStyleElement=Ct(),ht()(xt.A,Tt),xt.A&&xt.A.locals&&xt.A.locals;var Et=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};const Rt="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";class St extends o.InputBase{get value(){return this.fileValue}set value(t){this.stringValue=(null==t?void 0:t.name)||"Drag-n-drop your file",this.fileValue=t,this.notify&&this.fireInput()}constructor(t="Drag-n-drop here",n=null,i=null,o=Rt){super(e.stringInput("Input file","",null).dart),this.initialText=t,this.initialValue=n,this.onValueChanged=i,this.fileType=o,this.uploadedFile$=new c.Subject,this.onFileUploaded=this.uploadedFile$,this.fileValue=null,this.isValid=new c.BehaviorSubject(!0),this.hiddenInput=document.createElement("input"),this.icon=e.iconFA("cloud-upload",(()=>this.hiddenInput.click())),this.subscribeOnEvents(),this.root.style.display="flex",this.isValid.subscribe((t=>{if(t){this.input.classList.remove("error"),this.input.classList.add("success");const t=e.iconFA("times",(()=>this.reset()),"Reset uploaded file");this.icon.replaceWith(t),this.icon=t}else{this.input.classList.remove("success"),this.input.classList.add("error");const t=e.iconFA("redo",(()=>this.hiddenInput.click()),"Re-upload a file");this.icon.replaceWith(t),this.icon=t}})),this.uploadedFile$.subscribe((t=>{if(this.onValueChanged&&this.onValueChanged(t),!t){const t=e.iconFA("cloud-upload",(()=>this.hiddenInput.click()),"Choose a file to upload");this.icon.replaceWith(t),this.icon=t}this.value=t})),this.reset()}subscribeOnEvents(){this.input.readOnly=!0,this.input.classList.add("default");const t=t=>Et(this,void 0,void 0,(function*(){if(t&&t.length&&this.enabled){if(t.length>1)throw this.isValid.next(!1),new Error("Please specify single input file");if(this.fileType&&t[0].type!==this.fileType)throw this.isValid.next(!1),new Error("File type is not supported");this.isValid.value?this.uploadedFile$.next(t[0]):this.uploadedFile$.next(null)}}));this.root.classList.add("fi-drop-area"),this.root.style.width="100%",this.hiddenInput.type="file",this.hiddenInput.addEventListener("change",(()=>Et(this,void 0,void 0,(function*(){return yield t(this.hiddenInput.files)}))),!1),["dragenter","dragover","dragleave","drop"].forEach((t=>{this.input.addEventListener(t,(t=>{t.preventDefault(),t.stopPropagation()}),!1)})),["dragenter","dragover"].forEach((t=>{this.input.addEventListener(t,(()=>{this.input.classList.add("drag-n-dropping")}),!1)})),["dragleave","drop"].forEach((t=>{this.input.addEventListener(t,(()=>{this.input.classList.remove("drag-n-dropping")}),!1)})),this.input.addEventListener("drop",(e=>Et(this,void 0,void 0,(function*(){const n=e.dataTransfer.files;t(n)}))),!1),this.input.addEventListener("click",(()=>this.hiddenInput.click()),!1),this.addOptions(this.icon),["drag","dragenter"].forEach((t=>{document.getElementsByClassName("layout-workarea")[0].addEventListener(t,(t=>{t.stopPropagation()}),!1)}))}reset(){this.input.classList.value="ui-input-editor default",this.hiddenInput.value="",this.uploadedFile$.next(null)}}var Ot=n(703),Pt={};Pt.styleTagTransform=It(),Pt.setAttributes=bt(),Pt.insert=gt().bind(null,"head"),Pt.domAPI=mt(),Pt.insertStyleElement=Ct(),ht()(Ot.A,Pt),Ot.A&&Ot.A.locals&&Ot.A.locals;var Bt=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};class _t extends o.Dialog{constructor(n,i){var s,r,a;super(e.dialog({title:"Edit run metadata"}).dart),this._onMetadataEdit=new c.Subject,this.onMetadataEdit=this._onMetadataEdit.asObservable();let l=null!==(s=n.options.title)&&void 0!==s?s:"",u=null!==(r=n.options.description)&&void 0!==r?r:"",d=i;const p=e.stringInput("Title",l,(t=>l=t)),h=e.stringInput(" ",""),f=o.TagEditor.create();(null!==(a=n.options.tags)&&void 0!==a?a:[]).forEach((t=>{f.addTag(t)})),h.input.replaceWith(f.root);const m=()=>{""===v.value||f.tags.includes(v.value)||(f.addTag(v.value),v.value="")},v=e.stringInput("Tag","").addOptions(e.iconFA("plus",m,"Add this tag")),g=(0,c.fromEvent)(v.input,"onkeydown").subscribe((t=>{"Enter"==t.key&&(t.stopPropagation(),m())}));this.sub(g),this.add(e.form([p,e.stringInput("Description",u,(t=>u=t)),e.boolInput("Favorites",d,(t=>d=t)),v,h])),this.addButton("Save",(()=>Bt(this,void 0,void 0,(function*(){if(""!==v.value)return void t.shell.info(`Dialog has unsaved tags: ${v.value}`);let e="same";d&&!i&&(e="favorited"),!d&&i&&(e="unfavorited");const n={title:""!==l?l:null,description:""!==u?u:null,tags:f.tags.map((t=>t)),favorite:e};this._onMetadataEdit.next(n),this.close()}))))}}class kt extends o.Dialog{constructor(t){super(e.dialog({title:`Delete ${t.size>1?t.size:""} ${t.size>1?"runs":"run"}`}).dart),this._onFuncCallDelete=new c.Subject,this.onFuncCallDelete=this._onFuncCallDelete.asObservable(),this.add(e.divText(`Deleted ${t.size>1?t.size:""} ${t.size>1?"runs":"run"} ${t.size>1?"are":"is"} impossible to restore. Are you sure?`)),this.onOK((()=>Bt(this,void 0,void 0,(function*(){return this._onFuncCallDelete.next(t)}))))}}var Ft=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};function Lt(t,n){n?(a()(t).addClass("ui-box").css({width:"auto",height:"auto"}),e.setUpdateIndicator(t,!0)):(e.setUpdateIndicator(t,!1),a()(t).removeClass("ui-box"))}const Vt=t=>{const e=t.options[g];return void 0!==e?{name:t.name,config:JSON.parse(e,((t,e)=>{if("true"===e)return!0;if("false"===e)return!1;if("type"===t)return m[e]||e;if(!t.toLowerCase().includes("color")){const t=Number.parseFloat(e);if(!Number.isNaN(t))return t}return e}))}:{name:t.name,config:[]}},Mt=t=>{try{return t.started.toDate().toLocaleString("en-us",{month:"short",day:"numeric",hour:"numeric",minute:"numeric"})}catch(t){return"Not completed"}};var Nt=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};const Dt=Object.values(o.COLUMN_TYPE).filter((t=>t!==o.TYPE.DATA_FRAME)),jt=t=>t.replace(/([A-Z])/g,(t=>` ${t.toLowerCase()}`)).trim().replace(/^./,(t=>t.toUpperCase())),$t=new o.LruCache;class Ht extends o.Widget{storageName(t){return`${S}_${[...t.values()][0].func.name}_Fav`}get onRunsDfChanged(){return this._onRunsDfChanged.asObservable()}get onChosen(){return this._onChosen.asObservable()}get chosen(){return this._onChosen.value}set chosen(t){var e;this.chosenById=null!==(e=null==t?void 0:t.id)&&void 0!==e?e:null}set chosenById(t){if(t){for(let e=0;e<this.currentDf.rowCount;e++)if(this.currentDf.getCol(Wt).get(e)===t){this.currentDf.currentRowIdx=e;break}}else this.currentDf.currentRowIdx=-1}get selected(){return this._onSelectedChanged.value}get runs(){return this.onRunsChanged.value}get onSelectedChanged(){return this._onSelectedChanged.asObservable()}saveIsFavorite(e,n){return Nt(this,void 0,void 0,(function*(){const i=`${S}_${e.func.name}_Fav`;return n?t.dapi.userDataStorage.postValue(i,e.id,""):t.dapi.userDataStorage.remove(i,e.id)}))}getRunByIdx(t){return this.runs.get(this.currentDf.get(Wt,t))}showEditDialog(e,n){const i=new _t(e,n),o=i.onMetadataEdit.subscribe((n=>Nt(this,void 0,void 0,(function*(){var i;if(null===(i=this.options)||void 0===i?void 0:i.isHistory)return("same"!==n.favorite?this.saveIsFavorite(e,"favorited"===n.favorite):Promise.resolve()).then((()=>dt.loadRun(e.id,!1))).then((t=>(n.title&&(t.options.title=n.title),n.description&&(t.options.description=n.description),n.tags&&(t.options.tags=n.tags),[dt.saveRun(t),t]))).then((([,t])=>{this.updateRun(t),this.onMetadataEdit.next(t),o.unsubscribe()})).catch((e=>{t.shell.error(e)}));this.updateRun(e)}))));i.show({center:!0,width:500})}visibleProps(t){var e,n,i;return null!==(i=null!==(n=null===(e=this.options)||void 0===e?void 0:e.visibleProps)&&void 0!==n?n:Q(t))&&void 0!==i?i:t.inputs.filter((t=>Dt.includes(t.propertyType))).map((t=>t.name))}constructor(n,i){var s,r,l,u,d,h,m;super(e.div([],{style:{height:"100%",width:"100%"}})),this.initialRuns=n,this.options=i,this.onRunsChanged=new c.BehaviorSubject(this.initialRuns.reduce(((t,e)=>(t.set(e.id,e),t)),new Map)),this._onRunsDfChanged=new c.BehaviorSubject(o.DataFrame.fromColumns([o.Column.bool(O,0),...(null===(s=this.options)||void 0===s?void 0:s.isHistory)?[o.Column.bool(P,0)]:[],...(null===(r=this.options)||void 0===r?void 0:r.showActions)?[o.Column.string(_,0)]:[],o.Column.bool(B,0),o.Column.dateTime(F,0),o.Column.string(k,0),o.Column.string(M,0),o.Column.string(L,0),o.Column.string(V,0),o.Column.fromStrings(Wt,[])])),this._historyFilters=o.Viewer.filters(this._onRunsDfChanged.value,{title:"Filters",columnNames:[]}),this._historyGrid=o.Viewer.grid(this._onRunsDfChanged.value,{showRowHeader:!1,showColumnGridlines:!1,allowEdit:!1}),this.onComparisonCalled=new c.Subject,this.onMetadataEdit=new c.Subject,this._onChosen=new c.BehaviorSubject(null),this.onDelete=new c.Subject,this._onSelectedChanged=new c.BehaviorSubject(new Set([])),this.layout=e.splitH([],null,!0),this.defaultGridText=e.divText(null!==(u=null===(l=this.options)||void 0===l?void 0:l.fallbackText)&&void 0!==u?u:"No historical runs found","hp-no-elements-label"),this.defaultFiltersText=e.divText("No filters to show","hp-no-elements-label"),this.filterWithText=e.divH([this.defaultFiltersText,this._historyFilters.root],"ui-box"),this.trashIcon=e.div(e.iconFA("trash-alt",(()=>{const t=this.currentDf.selection.getSelectedIndexes(),e=new Set;t.forEach((t=>e.add(this.getRunByIdx(t))));const n=new kt(e),i=n.onFuncCallDelete.subscribe((t=>Nt(this,void 0,void 0,(function*(){yield Promise.all(f()(t.values()).map((t=>Nt(this,void 0,void 0,(function*(){return yield this.deleteRun(t.id),Promise.resolve()}))))),i.unsubscribe()}))));n.show({center:!0,width:500,modal:!0})}),"Delete selected runs"),{style:{"padding-top":"5px"}}),this.compareIcon=e.div(e.iconFA("exchange",(()=>Nt(this,void 0,void 0,(function*(){const t=this.currentDf.selection.getSelectedIndexes(),e=[];t.forEach((t=>{e.push(this.currentDf.getCol(Wt).get(t))})),this.onComparisonCalled.next(e)}))),"Compare selected runs"),{style:{"padding-top":"5px"}}),this._isFilterHidden=new c.BehaviorSubject(!1),this.showFiltersIcon=e.div(e.iconFA("filter",(()=>{this._isFilterHidden.next(!this._isFilterHidden.value)}),"Toggle filters"),{style:{"padding-top":"4px"}}),this._compactMode=new c.BehaviorSubject(null!==(h=null===(d=this.options)||void 0===d?void 0:d.isHistory)&&void 0!==h&&h),this.toggleCompactMode=e.div(e.iconFA("expand-alt",(()=>{this.compactMode=!this.compactMode}),"Toggle compact mode"),{style:{"padding-top":"4px"}}),this.showMetadataIcon=e.switchInput("Metadata",!0,(()=>{this.styleHistoryGrid(),this.styleHistoryFilters()})),this.showInputsIcon=e.switchInput("Params",!1,(t=>Nt(this,void 0,void 0,(function*(){var e;0!==this.runs.size&&(t&&(null===(e=this.options)||void 0===e?void 0:e.isHistory)?((yield Promise.all([...this.runs.values()].map((t=>Nt(this,void 0,void 0,(function*(){if($t.has(t.id))return $t.get(t.id);{const e=yield dt.loadRun(t.id,!0);return $t.set(e.id,e),e}})))))).forEach((t=>{this.runs.set(t.id,t)})),this.onRunsChanged.next(this.runs)):(this.styleHistoryGrid(),this.styleHistoryFilters()))}))));const v=e.divH([e.divH([...(null==i?void 0:i.isHistory)?[this.toggleCompactMode]:[],this.showFiltersIcon,this.showMetadataIcon.root,this.showInputsIcon.root],{style:{gap:"5px",padding:"5px"}}),e.divH((null===(m=this.options)||void 0===m?void 0:m.showBatchActions)?[this.trashIcon,this.compareIcon]:[],{style:{gap:"5px",padding:"5px"}})],{style:{"justify-content":"space-between",padding:"0px 5px"}});v.style.setProperty("overflow-y","hidden","important");const g=e.divV([this.defaultGridText,v,this._historyGrid.root],"ui-box");a()(g).removeClass("ui-div"),a()(g).css("width","100%"),this.root.appendChild(this.layout),e.setDisplayAll([this._historyGrid.root,this._historyFilters.root,this.toggleCompactMode,this.trashIcon,this.compareIcon,this.showFiltersIcon],!1),this.setGridCellRendering();const y=this.onRunsChanged.subscribe((n=>Nt(this,void 0,void 0,(function*(){var i,s,r;const a=[...n.values()],l=t=>{var e,n;return t.propertyType===o.TYPE.DATE_TIME?o.Column.dateTime(null!==(e=t.caption)&&void 0!==e?e:jt(t.name),a.length).init((e=>window.grok_DayJs_To_DateTime(a[e].inputs[t.name]))):o.Column.fromType(t.propertyType,null!==(n=t.caption)&&void 0!==n?n:jt(t.name),a.length).init((e=>{var n,i,o,s;return null!==(s=null===(o=null===(i=null===(n=this.options)||void 0===n?void 0:n.propFuncs)||void 0===i?void 0:i[t.name])||void 0===o?void 0:o.call(i,a[e]))&&void 0!==s?s:X(a[e],t.name)}))},u=t=>t===F?o.Column.dateTime(jt(t),a.length).init((t=>window.grok_DayJs_To_DateTime(Z(a[t])?a[t].started:p().unix(a[t].options.createdOn)))):t===B?o.Column.bool(jt(t),a.length).init((t=>Z(a[t]))):o.Column.fromStrings(jt(t),a.map((e=>{var n,i,o,s;return null!==(s=null===(o=null===(i=null===(n=this.options)||void 0===n?void 0:n.propFuncs)||void 0===i?void 0:i[t])||void 0===o?void 0:o.call(i,e))&&void 0!==s?s:X(e,t)})));if(n.size>0){const c=null!==(i=yield t.dapi.userDataStorage.get(this.storageName(n)))&&void 0!==i?i:{},d=Object.keys(c),p=[...this.runs.values()][0].func,h=t=>{var e;const n=null!==(e=p.inputs.find((e=>e.name===t)))&&void 0!==e?e:p.outputs.find((e=>e.name===t));return n?l(n):u(t)},f=o.DataFrame.fromColumns([o.Column.string(O,a.length).init((t=>{const e=a[t].options.immutable_tags;return e&&e.includes(C)?"Experimental":"Simulated"})),...(null===(s=this.options)||void 0===s?void 0:s.isHistory)?[o.Column.bool(P,a.length).init((t=>d.includes(a[t].id)))]:[],...(null===(r=this.options)||void 0===r?void 0:r.showActions)?[o.Column.string(_,a.length).init("")]:[],u(F),u(B),u(k),o.Column.string(M,a.length).init((t=>a[t].options.tags?a[t].options.tags.join(","):"")),o.Column.string(L,a.length).init((t=>a[t].options.title)),o.Column.string(V,a.length).init((t=>a[t].options.description))]);this.visibleProps(p).map((t=>h(t))).forEach((t=>{t.name=f.columns.getUnusedName(t.name),f.columns.add(t,!1)})),f.columns.add(o.Column.fromStrings(Wt,a.map((t=>t.id)))),e.setDisplayAll([this.defaultGridText,this.defaultFiltersText],!1),e.setDisplayAll([this._historyGrid.root,this._historyFilters.root,this.toggleCompactMode,this.showMetadataIcon.root,this.trashIcon,this.compareIcon,this.showFiltersIcon],!0),e.setDisplay(this.showInputsIcon.root,this.visibleProps(p).length>0),this._onRunsDfChanged.next(f)}else e.setDisplayAll([this.defaultGridText,this.defaultFiltersText],!0),e.setDisplayAll([this._historyGrid.root,this._historyFilters.root,this.showMetadataIcon.root,this.showInputsIcon.root,this.toggleCompactMode,this.trashIcon,this.compareIcon,this.showFiltersIcon],!1)})))),b=this._onRunsDfChanged.subscribe((t=>{this._historyFilters.dataFrame=t,this._historyGrid.dataFrame=t,this.currentDf.getCol(M).setTag(o.TAGS.MULTI_VALUE_SEPARATOR,","),this.styleHistoryGrid(),this.styleHistoryFilters();const e=t.onCurrentRowChanged.subscribe((()=>{var t;this.currentDf.rows.select((()=>!1)),this._onChosen.next(null!==(t=this.getRunByIdx(this.currentDf.currentRowIdx))&&void 0!==t?t:null)})),n=t.onSelectionChanged.subscribe((()=>{const e=[...t.selection.getSelectedIndexes()].map((t=>this.getRunByIdx(t)));this._onSelectedChanged.next(new Set(e)),this.redrawSelectionState()}));this.redrawSelectionState(),this.subs.push(e,n)})),A=this._isFilterHidden.subscribe((t=>{t?(a()(this.showFiltersIcon.firstChild).addClass("fal"),a()(this.showFiltersIcon.firstChild).removeClass("fad"),e.setDisplay(this.filterWithText,!1)):(a()(this.showFiltersIcon.firstChild).addClass("fad"),a()(this.showFiltersIcon.firstChild).removeClass("fal"),a()(this.filterWithText).css(this.compactMode?"height":"width","320px"),a()(this.filterWithText).css(this.compactMode?"width":"height","100%"),e.setDisplay(this.filterWithText,!0))})),w=this._compactMode.subscribe((t=>{const n=[g,this.filterWithText];a()(this.filterWithText).removeClass("ui-div");const i={style:{width:"100%",height:"100%"}};a()(this.toggleCompactMode.firstChild).addClass(t?"fa-expand-alt":"fa-compress-alt"),a()(this.toggleCompactMode.firstChild).removeClass(t?"fa-compress-alt":"fa-expand-alt");const o=t?e.splitV(n,i,!0):e.splitH(n,i,!0);this.layout.replaceWith(o),this.layout=o,e.tools.waitForElementInDom(this.layout).then((t=>{a()(t).css(this.compactMode?"height":"width","100%"),a()(this._historyFilters.root).css(Object.assign({},this.compactMode?{width:"100%"}:{height:"100%"})),a()(this.filterWithText).css(Object.assign({},this.compactMode?{height:"310px",width:"100%"}:{width:"310px",height:"100%"})),a()(g).css(Object.assign({},this.compactMode?{width:"100%"}:{height:"100%"})),setTimeout((()=>{this.styleHistoryGrid(),this.styleHistoryFilters()}),100)}))}));this.subs.push(y,w,b,A)}setGridColumnsRendering(){const t=this._historyGrid.columns.byName(_);t&&(t.cellType="html",t.width=35);const e=this._historyGrid.columns.byName(P);e&&(e.cellType="html",e.width=20);const n=this._historyGrid.columns.byName(O);n.cellType="html",n.width=20;const i=this._historyGrid.columns.byName(M);i.cellType="html",i.width=90,this._historyGrid.columns.byName(F).width=110,this._historyGrid.columns.byName(Wt).cellType="html"}isFavoriteByIndex(t){return this.currentDf.get(P,t)}setGridCellRendering(){this._historyGrid.onCellPrepare((n=>{var i,o,s,r,l,u,c,d,p,h,m;if(n.isColHeader&&(null===(i=n.tableColumn)||void 0===i?void 0:i.name)&&[_,O,P].includes(n.tableColumn.name)&&(n.customText=""),!n.isColHeader){if((null===(o=n.tableColumn)||void 0===o?void 0:o.name)===_){n.customText="";const t=this.getRunByIdx(n.tableRowIndex);n.element=e.divH([e.iconFA("trash",(()=>{const t=new Set([this.getRunByIdx(n.tableRowIndex)]),e=new kt(t),i=e.onFuncCallDelete.subscribe((()=>Nt(this,void 0,void 0,(function*(){yield Promise.all(f()(t.values()).map((t=>Nt(this,void 0,void 0,(function*(){return yield this.deleteRun(t.id),Promise.resolve()}))))),i.unsubscribe()}))));e.show({center:!0,width:500})}),"Remove run from history"),e.iconFA("edit",(()=>this.showEditDialog(t,this.isFavoriteByIndex(n.tableRowIndex))),"Edit run metadata")],{style:{padding:"6px 0px",gap:"6px","justify-content":"space-between"}})}if((null===(s=n.tableColumn)||void 0===s?void 0:s.name)===P){n.customText="";const t=this.getRunByIdx(n.tableRowIndex),i=e.iconFA("star",(()=>this.saveIsFavorite(t,!1).then((()=>this.updateRun(t)))),"Unfavorite");a()(i).addClass("fas"),n.element=e.div(n.cell.value?i:e.iconFA("star",(()=>this.saveIsFavorite(t,!0).then((()=>this.updateRun(t)))),"Favorite"),{style:{padding:"5px 0px"}})}if((null===(r=n.tableColumn)||void 0===r?void 0:r.name)===O){n.customText="";const t=e.iconFA("flask",null,"Experimental run");a()(t).addClass("fad fa-sm"),a()(t).removeClass("fal"),n.element=n.cell.value&&"Experimental"===n.cell.value?e.div(t,{style:{padding:"5px"}}):e.div()}if((null===(l=n.tableColumn)||void 0===l?void 0:l.name)===M){n.customText="";const t=n.cell.value.length>0?e.div(null===(u=n.cell.value)||void 0===u?void 0:u.split(",").map((t=>e.span([t],"d4-tag"))),"d4-tag-editor"):e.div();a()(t).css({padding:"3px","background-color":"transparent"}),n.element=t}if((null===(c=n.tableColumn)||void 0===c?void 0:c.name)===Wt){n.customText="";const i=this.getRunByIdx(n.tableRowIndex);if(!i)return;const o=i.author.picture;a()(o).css({width:"25px",height:"25px",fontSize:"20px"}),e.bind(i.author,o);const s=e.iconFA("flask",null,"Experimental run");s.classList.add("fad","fa-sm"),s.classList.remove("fal"),s.style.marginLeft="3px";const r=i.options.immutable_tags,l=e.span([e.label(null!==(h=null!==(d=i.options.title)&&void 0!==d?d:null===(p=i.author)||void 0===p?void 0:p.friendlyName)&&void 0!==h?h:t.shell.user.friendlyName,{style:{color:"var(--blue-1)"}}),...r&&r.includes(C)?[s]:[]]),u=e.iconFA("edit",(t=>{t.stopPropagation(),this.showEditDialog(i,this.isFavoriteByIndex(n.tableRowIndex))}),"Edit run metadata");u.classList.add("hp-funccall-card-icon","hp-funccall-card-hover-icon");const c=e.iconFA("trash-alt",(t=>Nt(this,void 0,void 0,(function*(){t.stopPropagation();const e=new Set([this.getRunByIdx(n.tableRowIndex)]),i=new kt(e),o=i.onFuncCallDelete.subscribe((()=>Nt(this,void 0,void 0,(function*(){yield Promise.all(f()(e.values()).map((t=>Nt(this,void 0,void 0,(function*(){return yield this.deleteRun(t.id),Promise.resolve()}))))),o.unsubscribe()}))));i.show({center:!0,width:500})}))),"Delete run");c.classList.add("hp-funccall-card-icon","hp-funccall-card-hover-icon");const v=e.iconFA("star",(t=>{t.stopPropagation(),this.saveIsFavorite(i,!1).then((()=>this.updateRun(i)))}),"Unfavorite");v.classList.add("fas","hp-funccall-card-icon");const g=e.iconFA("star",(t=>{t.stopPropagation(),this.saveIsFavorite(i,!0).then((()=>this.updateRun(i)))}),"Favorite");g.classList.add("hp-funccall-card-icon","hp-funccall-card-hover-icon"),this.isFavoriteByIndex(n.tableRowIndex)?(e.setDisplay(g,!1),e.setDisplay(v,!0)):(e.setDisplay(v,!1),e.setDisplay(g,!0));const y=Mt(i),b=e.divH([e.divH([o,e.divV([l,e.span([y]),...i.options.tags&&i.options.tags.length>0?[e.div(i.options.tags.map((t=>e.span([t],"d4-tag"))))]:[]],"hp-card-content")]),e.divH([...(null===(m=this.options)||void 0===m?void 0:m.showActions)?[v,g,u,c]:[]])],"hp-funccall-card"),A=n.tableRowIndex;b.addEventListener("mouseover",(()=>{n.grid.dataFrame.mouseOverRowIdx=A})),b.addEventListener("click",(t=>{t.shiftKey?n.grid.dataFrame.selection.set(A,!0):t.ctrlKey?n.grid.dataFrame.selection.set(A,!1):n.grid.dataFrame.currentRowIdx=A})),n.element=b}}}))}deleteRun(e){return Nt(this,void 0,void 0,(function*(){return dt.loadRun(e,!0).then((t=>{var e;return[(null===(e=this.options)||void 0===e?void 0:e.isHistory)?dt.deleteRun(t):Promise.resolve(),t]})).then((([,t])=>{var n;return this.runs.delete(e),this.onRunsChanged.next(this.runs),(null===(n=this.options)||void 0===n?void 0:n.isHistory)&&this.onDelete.next(t),t})).then((t=>{this.saveIsFavorite(t,!1)})).catch((e=>{t.shell.error(e)}))}))}editRun(t){this.showEditDialog(t,!1)}updateRun(t){this.runs.set(t.id,t),this.onRunsChanged.next(this.onRunsChanged.value)}addRun(t){this.runs.set(t.id,t),this.onRunsChanged.next(this.onRunsChanged.value)}updateRuns(t){this.onRunsChanged.next(t.reduce(((t,e)=>(t.set(e.id,e),t)),new Map))}get isFilterHidden(){return this._isFilterHidden.value}set isFilterHidden(t){this._isFilterHidden.next(t)}get compactMode(){return this._compactMode.value}set compactMode(t){this._compactMode.next(t)}get onCompactModeChanged(){return this._compactMode.asObservable()}styleHistoryGrid(){var t;this._historyGrid.setOptions({showCurrentRowIndicator:!0,showCurrentCellOutline:!1,allowEdit:!1,allowBlockSelection:!1,showRowHeader:!1,showColumnLabels:!this.compactMode,extendLastColumn:this.compactMode}),this._historyGrid.sort([F],[!1]);for(let e=0;e<this._historyGrid.columns.length;e++){const n=this._historyGrid.columns.byIndex(e);n&&(null===(t=n.column)||void 0===t?void 0:t.type)===o.TYPE.DATE_TIME&&(n.format="MMM d HH:mm")}if(this.setGridColumnsRendering(),0!==this.runs.size)if(this.compactMode)this._historyGrid.columns.setVisible([Wt]),this._historyGrid.props.rowHeight=70,this._historyGrid.invalidate();else{this._historyGrid.props.rowHeight=28;const t=[...this.runs.values()][0].func,e=this.showMetadataIcon.value,n=this.currentDf.getCol(M);this._historyGrid.columns.setVisible([O,P,_,...e?[F]:[],...e?[k]:[],...e&&n.stats.missingValueCount<n.length?[M]:[],...e?[L]:[],...e?[V]:[],...this.showInputsIcon.value?this.visibleProps(t).map((e=>{var n,i;const o=null!==(n=t.inputs.find((t=>t.name===e)))&&void 0!==n?n:t.outputs.find((t=>t.name===e));return o?null!==(i=o.caption)&&void 0!==i?i:jt(o.name):jt(e)})):[]])}}get currentDf(){return this._onRunsDfChanged.value}styleHistoryFilters(){var t,n;if(this.runs.size>0){const i=[...this.runs.values()][0].func,o=this.currentDf.getCol(M),s=this.showMetadataIcon.value,r=[...s&&this.currentDf.getCol(O).categories.length>1?[O]:[],...s&&(null!==(n=null===(t=this.currentDf.col(P))||void 0===t?void 0:t.categories.length)&&void 0!==n?n:0)>1?[P]:[],...s?[F,B]:[],...s&&this.currentDf.getCol(k).categories.length>1?[k]:[],...s&&o.stats.missingValueCount<o.length?[M]:[],...s&&this.currentDf.getCol(L).categories.length>1?[L]:[],...s&&this.currentDf.getCol(V).categories.length>1?[V]:[],...this.showInputsIcon.value?this.visibleProps(i).map((t=>{var e,n;const o=null!==(e=i.inputs.find((e=>e.name===t)))&&void 0!==e?e:i.outputs.find((e=>e.name===t));return o?null!==(n=o.caption)&&void 0!==n?n:jt(o.name):jt(t)})).filter((t=>{var e;return!(null===(e=this.options)||void 0===e?void 0:e.isHistory)||this.currentDf.getCol(t).categories.length>1})).map((t=>t)):[]];r.length>0?(a()(this.filterWithText).css({paddingTop:"10px"}),e.setDisplay(this.defaultFiltersText,!1),e.setDisplay(this._historyFilters.root,!0),this._historyFilters.setOptions({columnNames:r,showHeader:!1,showBoolCombinedFitler:!1})):(e.setDisplay(this.defaultFiltersText,!0),e.setDisplay(this._historyFilters.root,!1))}}redrawSelectionState(){const t=this.currentDf.selection.trueCount;t<2?this.compareIcon.firstChild.classList.add("hp-disabled"):this.compareIcon.firstChild.classList.remove("hp-disabled"),0===t?this.trashIcon.firstChild.classList.add("hp-disabled"):this.trashIcon.firstChild.classList.remove("hp-disabled")}}var Ut=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};class Yt{static getHistoryRuns(e){return(0,c.from)((()=>Ut(this,void 0,void 0,(function*(){return yield dt.pullRunsByName(e,[{author:t.shell.user}],{order:"started"},["func.params","session.user","options"],!0)})))())}}const Wt="ID";class Gt extends o.InputBase{constructor(t,n,i){var o,r;const a=e.stringInput(t,"",null);super(a.dart),this.label=t,this._funcName=n,this.options=i,this.onHistoricalRunChosen=new c.BehaviorSubject(null),this.experimentRunsUpdate=new c.Subject,this.store={experimentRuns:new c.Observable,isExperimentRunsLoading:new c.Subject,experimentRunData:new c.BehaviorSubject("")},this._historyList=new Ht([],{fallbackText:"No runs are found in history",showActions:!1,showBatchActions:!1,isHistory:!1,visibleProps:null===(o=this.options)||void 0===o?void 0:o.mainProps,propFuncs:null===(r=this.options)||void 0===r?void 0:r.propFuncs}),this._historyDialog=this.getHistoryDialog(),this._visibleInput=e.stringInput(this.label,"",null),this._visibleIcon=e.iconFA("search",(()=>this.showSelectionDialog())),this._chosenRun=null,this._chosenRunId=null,this._visibleInput=a,this._visibleInput.readOnly=!0,this._visibleInput.input.addEventListener("click",(()=>this.showSelectionDialog())),this._visibleInput.addOptions(this._visibleIcon),this.store.experimentRuns=this.experimentRunsUpdate.pipe((0,s.tap)((()=>this.toggleLoaderExpRuns(!0))),(0,s.switchMap)((()=>Yt.getHistoryRuns(this._funcName).pipe((0,s.catchError)((t=>(console.error(t),c.EMPTY))),(0,s.finalize)((()=>this.toggleLoaderExpRuns(!1)))))),(0,s.shareReplay)(1)),this.store.experimentRuns.subscribe((t=>{this._historyList.updateRuns(t.filter((t=>!K(t))))})),this.store.isExperimentRunsLoading.subscribe((t=>{e.setUpdateIndicator(this._visibleInput.root,t),e.setUpdateIndicator(this._historyList.root,t)})),this.experimentRunsUpdate.next()}setCurrentRow(){this.getValue()?this._historyList.chosen=this.getValue():this.chosenRunId&&(this._historyList.chosenById=this.chosenRunId)}showSelectionDialog(){this.renderGridAndFilters(),this._historyDialog.getButton("OK").disabled=1!==this._historyList.selected.size,this._historyDialog.show({modal:!0,fullScreen:!0,center:!0,width:window.innerWidth-50,height:window.innerHeight-50})}renderGridAndFilters(){var t,e;const n=new Ht([...this._historyList.runs.values()],Object.assign(Object.assign({},this.options),{visibleProps:null===(t=this.options)||void 0===t?void 0:t.mainProps,propFuncs:null===(e=this.options)||void 0===e?void 0:e.propFuncs}));this._historyList.root.replaceWith(n.root),this._historyList=n,this._historyList.onChosen.subscribe((t=>{this._historyDialog.getButton("OK").disabled=!t})),this._historyList.onRunsDfChanged.pipe((0,s.filter)((t=>t.rowCount>0)),(0,s.take)(1)).subscribe((t=>{this.setCurrentRow()}))}getHistoryDialog(){const t=e.dialog();return a()(t.root.querySelector(".d4-dialog-contents")).removeClass("ui-form"),t.onOK((()=>Ut(this,void 0,void 0,(function*(){const t=this._historyList.chosen;t&&this.setValue(t),this.fireInput()})))),t.addButton("Refresh",(()=>{this.experimentRunsUpdate.next()}),2,"Reload list of runs"),t.addButton("Discard",(()=>{this.setValue(null),this.fireInput(),t.close()}),1,"Discard the previous choice"),a()(t.getButton("CANCEL")).hide(),t.add(this._historyList.root),t}setValue(t){var e,n,i,o,s,r,a;this._chosenRun=t,this._chosenRunId=null!==(n=null===(e=this._chosenRun)||void 0===e?void 0:e.id)&&void 0!==n?n:null,this.onHistoricalRunChosen.next(t),this.stringValue=t?(null===(i=this.options)||void 0===i?void 0:i.stringValueFunc)?null===(o=this.options)||void 0===o?void 0:o.stringValueFunc(t):[`${Mt(t)} \\ ${t.author.name}`,(null!==(a=null!==(r=null===(s=this.options)||void 0===s?void 0:s.mainProps)&&void 0!==r?r:Q(t.func))&&void 0!==a?a:[]).map((e=>X(t,e))).join(" \\ ")].join(" \\ "):"No run chosen",this.notify&&this.fireChanged()}getValue(){return this._chosenRun}get chosenRun(){return this._chosenRun}get chosenRunId(){return this._chosenRunId}set chosenRunId(t){this._chosenRunId=t}get root(){return this._visibleInput.root}set stringValue(t){this._visibleInput.value=t,this._visibleInput.setTooltip(this._visibleInput.value)}get stringValue(){return this._visibleInput.value}get iconRoot(){return this._visibleIcon}toggleLoaderExpRuns(t){this.store.isExperimentRunsLoading.next(t)}}class zt extends Gt{set value(t){this.setValue(t)}get value(){return this.getValue()}}class Jt extends Gt{get value(){const t=this.getValue();return t?JSON.stringify({visualValue:this.stringValue,id:t.id.split("-")}):null}set value(t){this.setValue(null),this.stringValue=t?JSON.parse(t).visualValue:"No run is chosen",this.chosenRunId=t?JSON.parse(t).id.join("-"):""}}var qt=n(565),Kt={};Kt.styleTagTransform=It(),Kt.setAttributes=bt(),Kt.insert=gt().bind(null,"head"),Kt.domAPI=mt(),Kt.insertStyleElement=Ct(),ht()(qt.A,Kt),qt.A&&qt.A.locals&&qt.A.locals;var Zt;class Xt extends o.Widget{updateHistoryPane(t){this.historyList.updateRuns(t)}showEditDialog(t){this.historyList.editRun(t)}addRun(t){this.historyList.addRun(t)}get history(){return this.historyList.runs}get onCompactModeChanged(){return this.historyList.onCompactModeChanged}get compactMode(){return this.historyList.compactMode}constructor(n){super(e.box(e.divText("No historical runs loaded","hp-no-elements-label"),{style:{width:"100%",height:"100%"}})),this.func=n,this.onRunChosen=new c.Subject,this.onComparison=new c.Subject,this.afterRunEdited=new c.Subject,this.afterRunDeleted=new c.Subject,this.allRunsFetch=new c.Subject,this.historyList=new Ht([],{fallbackText:"No runs are found in history",showActions:!0,showBatchActions:!0,isHistory:!0}),this.panel=this.historyList.root;const i=this.historyList.onChosen.pipe((0,s.filter)((t=>!!t))).subscribe((t=>this.onRunChosen.next(t.id))),o=this.historyList.onComparisonCalled.subscribe((t=>this.onComparison.next(t))),r=this.allRunsFetch.subscribe((()=>{return n=this,i=void 0,s=function*(){e.setUpdateIndicator(this.root,!0),dt.pullRunsByName(this.func.name,[{author:t.shell.user}],{},["session.user","options"]).then((t=>{e.empty(this.root),this.root.appendChild(this.panel),this.updateHistoryPane(t)})).catch((e=>t.shell.error(e))).finally((()=>e.setUpdateIndicator(this.root,!1)))},new((o=void 0)||(o=Promise))((function(t,e){function r(t){try{l(s.next(t))}catch(t){e(t)}}function a(t){try{l(s.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,a)}l((s=s.apply(n,i||[])).next())}));var n,i,o,s})),a=this.historyList.onMetadataEdit.subscribe((t=>{this.afterRunEdited.next(t)})),l=this.historyList.onDelete.subscribe((t=>{this.afterRunDeleted.next(t)}));this.subs.push(i,r,a,o,l),this.allRunsFetch.next()}}!function(t){t.fileInput=function(t="Drag-n-drop here",e=null,n=null,i=Rt){return new St(t,e,n,i)},t.historyInput=function(t,e,n){return new zt(t,e,n)},t.historyInputJSON=function(t,e,n){return new Jt(t,e,n)},t.historyPanel=function(t){return new Xt(t)}}(Zt||(Zt={}));var Qt=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};const te=window;class ee extends o.TableView{static fromComparedRuns(n,i){return Qt(this,arguments,void 0,(function*(n,i,s={parentView:void 0,parentCall:void 0}){const r=((n,i,s={parentView:void 0,parentCall:void 0})=>{var r,l;const u=i,c=[...u.inputs,...u.outputs].map((t=>Vt(t))).reduce(((t,e)=>(t[e.name]?t[e.name].push(...e.config):t[e.name]=e.config,t)),{}),d=t=>{var e;if(t.propertyType===o.TYPE.DATA_FRAME){const e=c[t.name].map((e=>{var i;let s=null!==(i=t.caption)&&void 0!==i?i:t.name;const r=o.Column.fromType(o.TYPE.DATA_FRAME,s,n.length);r.init((e=>{var i;return null!==(i=n[e].inputs[t.name])&&void 0!==i?i:n[e].outputs[t.name]}));const a=p.columns.getUnusedName(`${r.name} (${e.type})`);return r.name=a,s=a,r.temp[g]=e,p.columns.add(r),r}));return e}{let i=null!==(e=t.caption)&&void 0!==e?e:t.name;const s=o.Column.fromType(t.propertyType,i,n.length);s.init((e=>{var i;return null!==(i=n[e].inputs[t.name])&&void 0!==i?i:n[e].outputs[t.name]}));const r=p.columns.getUnusedName(s.name);return s.name=r,i=r,p.columns.add(s),[s]}},p=o.DataFrame.create(n.length),h=[];return n.forEach((t=>{var e;let n=null!==(e=t.options.title)&&void 0!==e?e:`${t.func.name} - ${Mt(t)}`,i=2;for(;h.includes(n);)n=`${t.func.name} - ${Mt(t)})\n .toLocaleString('en-us', {month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric'})} - ${i}`,i++;h.push(n)})),p.columns.add(o.Column.fromStrings(w,h)),p.name=(null===(r=s.parentCall)||void 0===r?void 0:r.func.name)?`${null===(l=s.parentCall)||void 0===l?void 0:l.func.name} - comparison`:`${i.name} - comparison`,u.inputs.forEach((t=>d(t))),u.outputs.forEach((t=>d(t))),t.events.onCurrentObjectChanged.subscribe((({sender:n})=>{if(n instanceof o.Column&&n.type===o.TYPE.DATA_FRAME&&t.shell.tv&&t.shell.tv.temp.isComparison&&[o.VIEWER.LINE_CHART,o.VIEWER.SCATTER_PLOT,o.VIEWER.HISTOGRAM,o.VIEWER.BOX_PLOT].includes(n.temp[g].type)){t.shell.windows.showProperties=!0;const i=t=>{const e=t.get(0).clone();e.columns.addNew(I,o.TYPE.STRING).init(t.dataFrame.get(w,0));for(let n=1;n<t.length;n++){const i=t.get(n).clone();i.columns.addNew(I,o.TYPE.STRING).init(t.dataFrame.get(w,n));const s=[o.COLUMN_TYPE.INT,o.COLUMN_TYPE.FLOAT];for(let t=0;t<i.columns.length;t++){const n=i.columns.byIndex(t),r=e.columns.byIndex(t);n.type!==r.type&&s.includes(n.type)&&s.includes(r.type)&&(n.type!==o.COLUMN_TYPE.FLOAT&&i.columns.replace(n,n.convertTo(o.COLUMN_TYPE.FLOAT)),r.type!==o.COLUMN_TYPE.FLOAT&&e.columns.replace(r,r.convertTo(o.COLUMN_TYPE.FLOAT)))}e.append(i,!0)}return e},s=n.temp[g].look;setTimeout((()=>{switch(n.temp[g].type){case o.VIEWER.LINE_CHART:const r=e.waitBox((()=>Ft(void 0,void 0,void 0,(function*(){var t;const e=null!==(t=n.temp.unitedDf)&&void 0!==t?t:i(n);return n.temp.unitedDf=e,e.plot.line(Object.assign(Object.assign({},s),{split:I})).root}))));a()(r).css({width:"100%"}),t.shell.o=r;break;case o.VIEWER.SCATTER_PLOT:const l=e.waitBox((()=>Ft(void 0,void 0,void 0,(function*(){var t;const e=null!==(t=n.temp.unitedDf)&&void 0!==t?t:i(n);return n.temp.unitedDf=e,e.plot.scatter(Object.assign(Object.assign({},s),{color:I})).root}))));t.shell.o=l,a()(l).css({width:"100%"});break;case o.VIEWER.HISTOGRAM:const u=e.waitBox((()=>Ft(void 0,void 0,void 0,(function*(){var t;const e=null!==(t=n.temp.unitedDf)&&void 0!==t?t:i(n);return n.temp.unitedDf=e,e.plot.histogram(Object.assign(Object.assign({},s),{split:I})).root}))));t.shell.o=u,a()(u).css({width:"100%"});break;case o.VIEWER.BOX_PLOT:const c=e.waitBox((()=>Ft(void 0,void 0,void 0,(function*(){var t;const e=null!==(t=n.temp.unitedDf)&&void 0!==t?t:i(n);return n.temp.unitedDf=e,e.plot.box(Object.assign(Object.assign({},s),{category:I})).root}))));t.shell.o=c,a()(c).css({width:"100%"})}}))}})),p})(n,i,s),l=[...t.shell.views].find((t=>t.type===v||"scripts"===t.type||"functions"===t.type));return l&&(t.shell.v=l),new this(r,s)}))}constructor(e,n={}){super(te.grok_TableView(e.dart,!1)),n.parentView&&(this.parentView=n.parentView),this.parentCall=n.parentCall||t.functions.getCurrentCall()}showAllColumns(){const t=this.dataFrame.columns.names();this.grid.columns.setVisible(t)}showChangingColumns(){const t=this.dataFrame.columns.names().filter((t=>o.TYPES_SCALAR.has(this.dataFrame.getCol(t).type)&&this.dataFrame.getCol(t).categories.length>1||!o.TYPES_SCALAR.has(this.dataFrame.getCol(t).type)));this.grid.columns.setVisible(t)}defaultCustomize(){var n;const i=e.iconFA("compress-alt",(()=>{this.showChangingColumns(),a()(s).show(),a()(i).hide()}),"Hide constant parameters"),s=e.iconFA("expand-arrows-alt",(()=>{this.showAllColumns(),a()(s).hide(),a()(i).show()}),"Show all parameters");a()(i).hide(),this.setRibbonPanels([...this.getRibbonPanels(),[i,s]]),this.showChangingColumns(),this.root.style.removeProperty("width"),this.root.firstChild.style.removeProperty("width"),this.root.firstChild.firstChild.style.removeProperty("width"),this.grid.props.rowHeight=180,this.grid.props.showAddNewRowIcon=!1,this.grid.props.allowEdit=!1,this.grid.columns.byName(w).width=70;for(let t=0;t<this.grid.columns.length;t++){const e=this.grid.columns.byIndex(t);(null===(n=e.column)||void 0===n?void 0:n.temp[g])&&(e.width=350,e.cellType="html")}const r=new o.LruCache;this.grid.onCellPrepare((t=>Qt(this,void 0,void 0,(function*(){if(!t.isColHeader&&!t.isRowHeader){if(t.tableColumn.name===w){t.customText="";const n=t.cell.value.split(" - "),i=n.length>1?[n[0],e.element("br"),n[1]]:n;return t.element=e.div(i,{style:{"writing-mode":"vertical-rl","text-orientation":"mixed",margin:"auto"}}),void(t.element.parentElement.style.display="flex")}if(t.tableColumn&&t.tableColumn.temp[g]){const e=t.cell.value,n=t.tableColumn.temp[g],i=n.type,s=()=>Qt(this,void 0,void 0,(function*(){const s=Object.values(m).includes(i)?o.Viewer.fromType(i,e):yield e.plot.fromType(i);return t.tableColumn.temp[g].look?s.setOptions(t.tableColumn.temp[g].look):(s.setOptions(n),t.tableColumn.temp[g]=s.getOptions()),s.root})),a=`${e.id}_${i}`;if(r.get(a))t.element=r.get(a);else{const e=yield s();r.set(a,e),t.element=e}t.element.style.width="100%",t.element.style.height="100%"}}}))));const l=e.box(e.div([],{style:{"min-height":"100px"}})),u=t.events.onCurrentViewChanged.subscribe((()=>{t.shell.v.id===this.id?t.shell.dockManager.dock(l,"down",null,"Comparison chart",.25):t.shell.dockManager.close(l)})),c=this.grid.onCellClick.subscribe((n=>{var i;if(t.shell.v.id===this.id&&n.isColHeader&&(null===(i=n.tableColumn)||void 0===i?void 0:i.type)===o.TYPE.DATA_FRAME&&[o.VIEWER.LINE_CHART,o.VIEWER.SCATTER_PLOT,o.VIEWER.HISTOGRAM,o.VIEWER.BOX_PLOT].includes(n.tableColumn.temp[g].type)){t.shell.dockManager.findNode(l)||t.shell.dockManager.dock(l,"down",null,"Comparison chart",.25);const i=t=>{const e=o.toJs(t.get(0)).clone();e.columns.addNew(I,o.TYPE.STRING).init(t.dataFrame.get(w,0));for(let n=1;n<t.length;n++){const i=o.toJs(t.get(n)).clone();i.columns.addNew(I,o.TYPE.STRING).init(t.dataFrame.get(w,n));const s=[o.COLUMN_TYPE.INT,o.COLUMN_TYPE.FLOAT];for(let t=0;t<i.columns.length;t++){const n=i.columns.byIndex(t),r=e.columns.byIndex(t);n.type!==r.type&&s.includes(n.type)&&s.includes(r.type)&&(n.type!==o.COLUMN_TYPE.FLOAT&&i.columns.replace(n,n.convertTo(o.COLUMN_TYPE.FLOAT)),r.type!==o.COLUMN_TYPE.FLOAT&&e.columns.replace(r,r.convertTo(o.COLUMN_TYPE.FLOAT)))}e.append(i,!0)}return e},s=(t,e,i)=>{var s;switch(null===(s=n.tableColumn)||void 0===s?void 0:s.temp[g].type){case o.VIEWER.LINE_CHART:return i.plot.line(Object.assign(Object.assign({},e),{split:I})).root;case o.VIEWER.SCATTER_PLOT:return i.plot.scatter(Object.assign(Object.assign({},e),{color:I})).root;case o.VIEWER.HISTOGRAM:return i.plot.histogram(Object.assign(Object.assign({},e),{split:I})).root;case o.VIEWER.BOX_PLOT:return i.plot.box(Object.assign(Object.assign({},e),{category:I})).root}};e.setUpdateIndicator(l,!0),setTimeout((()=>{var t;if(!n.tableColumn.temp.unitedPlot){const o=n.tableColumn.temp[g].look,r=i(n.tableColumn);n.tableColumn.temp.unitedPlot=s(null===(t=n.tableColumn)||void 0===t?void 0:t.temp[g].type,o,r),e.setUpdateIndicator(l,!1)}e.empty(l),l.appendChild(n.tableColumn.temp.unitedPlot)}),10)}else t.shell.dockManager.close(l)}));this.subs.push(c,u)}}const ne="_DG_CUSTOM_SERIALIZED_TOKEN_";function ie(t,e){if(e&&e[ne]&&e.value)switch(e[ne]){case"DataFrame":return o.DataFrame.fromByteArray(new Uint8Array(e.value));case"ArrayBuffer":return new Uint8Array(e.value).buffer;case"Map":return new Map(e.value);case"Set":return new Set(e.value)}return e}const oe=[{name:"Null",predicate:function(t,e){return null==t&&null==e},checker:function(){}},{name:"Boolean",predicate:function(t,e){return"boolean"==typeof t&&"boolean"==typeof e},checker:re},{name:"String",predicate:function(t,e){return"string"==typeof t&&"string"==typeof e},checker:re},{name:"Integer",predicate:function(t,e){return Number.isInteger(t)&&Number.isInteger(e)},checker:re},{name:"Float",predicate:function(t,e){return"number"==typeof t&&"number"==typeof e},checker:function(t,e,n){if(!(t===Number.POSITIVE_INFINITY&&e===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&e===Number.NEGATIVE_INFINITY||isNaN(t)&&isNaN(e)))return Math.abs(t-e)<n.options.floatTolerance?void 0:[{msg:`Expected ${e}, got ${t} (tolerance = ${n.options.floatTolerance})`}]}},{name:"Map",predicate:function(t,e){return t instanceof Map&&e instanceof Map},checker:function(t,e,n,i){const o=[];if(t.size!==e.size){const n={msg:`Maps are of different size: actual map size is ${t.size} and expected map size is ${e.size}`};o.push(n)}for(const n of e.keys()){const o=t.get(n),s=e.get(n);i([String(n)],o,s)}return o}},{name:"Set",predicate:function(t,e){return t instanceof Set&&e instanceof Set},checker:function(t,e,n,i){const o=[];if(t.size!==e.size){const n={msg:`Sets are of different size: actual set size is ${t.size} and expected set size is ${e.size}`};o.push(n)}for(const n of e.values()){const e=t.has(n);i([String(n)],e,!0)}return o}},{name:"ArrayBuffer",predicate:function(t,e){return t instanceof ArrayBuffer&&e instanceof ArrayBuffer},checker:function(t,e,n,i){return ae(Array.from(new Uint8Array(t)),Array.from(new Uint8Array(e)),0,i)}},{name:"Array",predicate:function(t,e){return t instanceof Array&&e instanceof Array},checker:ae},{name:"DataFrame",predicate:function(t,e){return t instanceof o.DataFrame&&e instanceof o.DataFrame},checker:function(t,e,n,i){const o=[];if(t.rowCount!==e.rowCount){const n={msg:`Dataframes has different row count: actual row count is ${t.rowCount} and expected row count is ${e.rowCount}`};o.push(n)}for(const n of e.columns){const s=t.columns.byName(n.name);if(s)if(s.type===n.type)for(let t=0;t<e.rowCount;t++){const e=s.get(t),o=n.get(t);i([n.name,String(t)],e,o)}else{const t={msg:`Column ${n.name} type expected ${n.type} got ${s.type}`};o.push(t)}else{const t={msg:`Column ${n.name} not found`};o.push(t)}}return o}},{name:"Object",predicate:function(t,e){return"object"==typeof t&&"object"==typeof e},checker:function(t,e,n,i){for(const[n,o]of Object.entries(e))i([n],t[n],o);return[]}}];class se extends Error{}function re(t,e){if(t!==e)return[{msg:`Expected ${e}, got ${t}`}]}function ae(t,e,n,i){const o=[];if(t.length!==e.length){const n={msg:`Arrays are of different length: actual array length is ${t.length} and expected array length is ${e.length}`};o.push(n)}for(let n=0;n<t.length;n++)i([String(n)],t[n],e[n]);return o}const le={floatTolerance:.001,maxErrorsReport:5,maxDepth:128,checkersSeq:oe,prefix:""};class ue{constructor(t={}){this.options=Object.assign(Object.assign({},le),t),this.state={errors:[],currentPath:[],options:this.options}}run(t,e){this.matchChecker(t,e),this.checkErrorsLimit(0)}checkDeep(t,e,n){const i=t.length;if(this.state.currentPath.push(...t),this.state.currentPath.length>this.options.maxDepth)throw new se(`Max depth ${this.options.maxDepth} is exceeded, potentially a circular structure`);this.matchChecker(e,n),this.state.currentPath.splice(-i)}matchChecker(t,e){let n=!1;for(const{predicate:i,checker:o}of this.options.checkersSeq)if(i(t,e)){n=!0;const i=o(t,e,this.state,this.checkDeep.bind(this));i&&i.map((t=>this.addError(t)));break}if(!n){const n={msg:`Type mismatch or no checker defined: expected ${e}, got ${t}`};this.addError(n)}}addError(t){var e,n;const i={path:[...null!==(e=this.state.currentPath)&&void 0!==e?e:[],...null!==(n=t.path)&&void 0!==n?n:[]],msg:t.msg};this.state.errors.push(i),this.checkErrorsLimit()}checkErrorsLimit(t=this.options.maxErrorsReport){if(this.state.errors.length>t){const t=this.makeReport();throw new se(t)}}makeReport(){const t=this.state.errors.map((t=>{var e;const n=(null!==(e=t.path)&&void 0!==e?e:[]).map((t=>`['${String(t)}']`)).join("."),i=n?`${n}: ${t.msg}`:t.msg;return this.options.prefix?`${this.options.prefix}: ${i}`:i})).slice(0,this.options.maxErrorsReport).join("\n");return t}}var ce=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};function de(e,n){return ce(this,arguments,void 0,(function*(e,n,i={}){var o;yield function(t,e){return ce(this,void 0,void 0,(function*(){if(!(yield t.isReady.pipe((0,s.takeUntil)((0,c.of)(null).pipe((0,s.delay)(e))),(0,s.takeWhile)((t=>!t),!0),(0,s.last)()).toPromise()))throw new Error(`Waiting for view ${t.name} timeout`)}))}(n,null!==(o=i.initWaitTimeout)&&void 0!==o?o:2e4);const r=()=>ce(this,void 0,void 0,(function*(){var e;if(i.parent){const n=null!==(e=i.parentWaitTimeout)&&void 0!==e?e:5e3,o=yield i.parent.isUpdating.pipe((0,s.map)((()=>i.parent.getRunningUpdates())),(0,s.debounceTime)(100),(0,s.takeUntil)((0,c.of)(null).pipe((0,s.delay)(n))),(0,s.takeWhile)((t=>0!==t.length),!0),(0,s.last)()).toPromise();if(null==o?void 0:o.length){const e=`{options.prefix}: parent updates failed to complete in ${n}ms, updates: ${o.join(",")}`,s=new Error(e);throw i.interactive&&t.shell.error(String(s)),s}}}));yield r();for(const[t,o]of Object.entries(e.inputs)){const e=n.funcCall.inputParams[t].property.propertyType;i.updateMode?null==n.funcCall.inputs[t]&&(n.funcCall.inputs[t]=yield lt(e,o)):n.funcCall.inputs[t]=yield lt(e,o)}if(yield r(),yield(()=>ce(this,void 0,void 0,(function*(){var e;if(n instanceof hn){const o=null!==(e=i.validatorsWaitTimeout)&&void 0!==e?e:5e3,r=yield n.pendingValidations.pipe((0,s.map)((t=>Object.keys(t))),(0,s.debounceTime)(100),(0,s.takeUntil)((0,c.of)(null).pipe((0,s.delay)(o))),(0,s.takeWhile)((()=>!n.isValid()),!0),(0,s.last)()).toPromise();if(null==r?void 0:r.length){const e=`{options.prefix}: validators failed to accept input in ${o}ms, inputs: ${r.join(",")}`,n=new Error(e);throw i.interactive&&t.shell.error(String(n)),n}}})))(),console.log(`running ${n.func.nqName}`),yield n.run(),!i.updateMode){console.log(`checking ${n.func.nqName} results`);try{!function(t,e,n){new ue(n).run(t,e)}(n.funcCall.outputs,e.outputs,i),!i.parent&&i.interactive&&t.shell.info(`${n.name} test passed`)}catch(e){throw i.interactive&&t.shell.error(String(e)),e}console.log(`${n.func.nqName} ok`)}}))}var pe=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};const he=new URL(t.shell.startUri),fe="Run Data JSON",me=()=>pe(void 0,void 0,void 0,(function*(){const t=yield navigator.mediaDevices.getDisplayMedia({video:!0,audio:!1,selfBrowserSurface:"include"}),e=new MediaRecorder(t),n=[];e.ondataavailable=t=>n.push(t.data),e.onstop=()=>{const e=new Blob(n,{type:n[0].type});t.getVideoTracks()[0].stop(),o.Utils.download(`Recording ${(new Date).toLocaleString("en-us",{month:"short",day:"numeric",hour:"numeric",minute:"numeric"})}.mkv`,e,n[0].type)},e.start()}));class ve extends o.ViewBase{constructor(n,i={historyEnabled:!0,isTabbed:!1,skipInit:!1}){var s,r,a,l,u;super(),this.initValue=n,this.options=i,this._type="function",this.funcCallReplaced=new c.Subject,this.isReady=new c.BehaviorSubject(!1),this.exportConfig=null,this.getMocks=null,this.getTemplates=null,this.getHelp=null,this.reportBug=null,this.requestFeature=null,this.getAbout=null,this.historyBlock=null,this.isHistorical=new c.BehaviorSubject(!1),this.historyRoot=e.div(),this.consistencyState=new c.BehaviorSubject("consistent"),this.defaultExportFilename=(t,e)=>`${this.name} - ${(new Date).toLocaleString("en-US").replaceAll(/:|\//g,"-")}.${null!=e?e:this.exportConfig.supportedExtensions[t]}`,this.defaultSupportedExportExtensions=()=>({Excel:"xlsx"}),this.defaultSupportedExportFormats=()=>["Excel"],this.helpCache=null,this.box=!0,this.parentCall=t.functions.getCurrentCall(),n instanceof o.FuncCall&&(this.parentCall=n),this.parentView=null===(a=null===(r=null===(s=this.parentCall)||void 0===s?void 0:s.parentCall)||void 0===r?void 0:r.aux)||void 0===a?void 0:a.view,(null===(u=null===(l=this.parentCall)||void 0===l?void 0:l.func)||void 0===u?void 0:u.name)&&(this.basePath=`/${this.parentCall.func.name}`),i.skipInit||this.init()}onFuncCallReady(){return pe(this,void 0,void 0,(function*(){if(yield dt.augmentCallWithFunc(this.funcCall,!1),!this.options.isTabbed){this.name&&"New view"!==this.name||(this.name=this.funcCall.func.friendlyName);try{this.func.package&&(yield this.getPackageData())}catch(t){console.log(t)}}this.build();const t=this.getStartId();if(t&&!this.options.isTabbed&&(e.setUpdateIndicator(this.root,!0),this.loadRun(t),e.setUpdateIndicator(this.root,!1),this.setAsLoaded()),this.isHistoryEnabled&&this.func){const t=this.options.isTabbed?this.isHistorical.subscribe((t=>{t||(this.funcCall.id=null)})):this.isHistorical.subscribe((t=>{var e,n;if(t){this.path=`?id=${this.funcCall.id}`;const t=Mt(this.funcCall);this.name.indexOf(" — ")<0?this.name=`${this.name} — ${null!==(e=this.funcCall.options.title)&&void 0!==e?e:t}`:this.name=`${this.name.substring(0,this.name.indexOf(" — "))} — ${null!==(n=this.funcCall.options.title)&&void 0!==n?n:t}`}else this.path="",this.funcCall.id=null,this.name=`${this.name.substring(0,this.name.indexOf(" — ")>0?this.name.indexOf(" — "):void 0)}`}));this.subs.push(t)}}))}getStartId(){return t.shell.getVar("isLoaded")?void 0:he.searchParams.get("id")}setAsLoaded(){return t.shell.setVar("isLoaded",!0)}get funcCall(){return this._funcCall}get func(){var t;return null===(t=this.funcCall)||void 0===t?void 0:t.func}get lastCall(){return this._lastCall}set lastCall(t){this._lastCall=t}get type(){return this._type}getPackageData(){return pe(this,void 0,void 0,(function*(){var t,e;const n=this.func.package;if(!n)return;const i=null===(t=yield null==n?void 0:n.getProperties())||void 0===t?void 0:t.REPORT_BUG_URL;i&&!this.reportBug&&(this.reportBug=()=>pe(this,void 0,void 0,(function*(){window.open(i,"_blank")})));const o=null===(e=yield null==n?void 0:n.getProperties())||void 0===e?void 0:e.REQUEST_FEATURE_URL;o&&!this.requestFeature&&(this.requestFeature=()=>pe(this,void 0,void 0,(function*(){window.open(o,"_blank")})));const s=`${n.friendlyName}.\nLast updated on ${p()(n.updatedOn).format("YYYY MMM D, HH:mm")}`;this.getAbout||(this.getAbout=()=>pe(this,void 0,void 0,(function*(){return s})))}))}linkFunccall(t){this._funcCall=t,this.funcCallReplaced.next(!0)}loadFuncCallById(){return pe(this,void 0,void 0,(function*(){if(this.initValue instanceof o.FuncCall)return yield new Promise((t=>setTimeout(t,0))),void this.linkFunccall(this.initValue);e.setUpdateIndicator(this.root,!0);const n=this.getStartId();if(n&&!this.options.isTabbed)this.linkFunccall(yield dt.loadRun(n));else{const e=yield t.functions.eval(this.initValue);this.linkFunccall(e.prepare({}))}e.setUpdateIndicator(this.root,!1)}))}init(){return pe(this,void 0,void 0,(function*(){yield this.loadFuncCallById(),yield this.onFuncCallReady(),this.isReady.next(!0)}))}build(){e.empty(this.root),this.root.appendChild(this.buildIO()),this.options.historyEnabled&&this.isHistoryEnabled&&this.buildHistoryBlock(),this.buildRibbonMenu(),this.buildRibbonPanels()}onComparisonLaunch(e){return pe(this,void 0,void 0,(function*(){const n=this.comparatorFunc;if(n){const i=yield t.functions.eval(n),o=(yield i.prepare({params:{comparedRuns:e}}).call()).outputs.comparisonView;return void t.shell.addView(o)}const i=t.shell.v.parentCall,o=[...t.shell.views].find((t=>t.type===v)),s=yield ee.fromComparedRuns(e,this.func,{parentView:o,parentCall:i});t.shell.addView(s),s.defaultCustomize();const r=this.compareCustomizer;if(r){const e=yield t.functions.eval(r);yield e.prepare({params:{defaultView:s}}).call()}}))}onSaveClick(){return pe(this,void 0,void 0,(function*(){yield this.saveRun(this.funcCall)}))}buildHistoryBlock(){const n=Zt.historyPanel(this.func);let i=!1;return this.subs.push(n.onCompactModeChanged.subscribe((e=>{const n=t.shell.dockManager.findNode(this.historyRoot);n&&(t.shell.dockManager.close(n),e?t.shell.dockManager.dock(this.historyRoot,"right",null,"History",.3):t.shell.dockManager.dock(this.historyRoot,"down",null,"History",.3))})),n.onRunChosen.subscribe((t=>pe(this,void 0,void 0,(function*(){e.setUpdateIndicator(this.root,!0),yield this.loadRun(t),e.setUpdateIndicator(this.root,!1)})))),n.onComparison.subscribe((t=>pe(this,void 0,void 0,(function*(){Lt(n.root,!0);const e=yield Promise.all(t.map((t=>dt.loadRun(t))));yield this.onComparisonLaunch(e),Lt(n.root,!1)})))),n.afterRunEdited.subscribe((t=>{var e,n;if(t.id===this.funcCall.id&&t.options.title){this.path=`?id=${this.funcCall.id}`;const i=Mt(t);this.name.indexOf(" — ")<0?this.name=`${this.name} — ${null!==(e=t.options.title)&&void 0!==e?e:i}`:this.name=`${this.name.substring(0,this.name.indexOf(" — "))} — ${null!==(n=t.options.title)&&void 0!==n?n:i}`}})),t.events.onCurrentViewChanged.subscribe((()=>{var e;if(t.shell.v==this)i&&((null===(e=this.historyBlock)||void 0===e?void 0:e.compactMode)?t.shell.dockManager.dock(this.historyRoot,"right",null,"History",.3):t.shell.dockManager.dock(this.historyRoot,"down",null,"History",.3));else{const e=t.shell.dockManager.findNode(this.historyRoot);e?(t.shell.dockManager.close(e),i=!0):i=!1}}))),e.empty(this.historyRoot),this.historyRoot.style.removeProperty("justify-content"),this.historyRoot.append(n.root),this.historyBlock=n,n.root}buildRibbonPanels(){const n=e.iconFA("history",(()=>{var e;t.shell.dockManager.findNode(this.historyRoot)||((null===(e=this.historyBlock)||void 0===e?void 0:e.compactMode)?t.shell.dockManager.dock(this.historyRoot,"right",null,"History",.3):t.shell.dockManager.dock(this.historyRoot,"down",null,"History",.3),this.historyRoot.parentElement.classList.add("ui-box"),this.historyRoot.classList.add("ui-box"))})),i=e.iconFA("save",(()=>pe(this,void 0,void 0,(function*(){yield this.onSaveClick()}))),"Save current state"),o=e.comboPopup(e.iconFA("arrow-to-bottom"),this.getFormats(),this.exportRun.bind(this)),r=e.iconFA("edit",(()=>{this.historyBlock&&this.lastCall&&this.historyBlock.showEditDialog(this.historyBlock.history.get(this.funcCall.id))}),"Edit this run metadata"),l=this.isHistorical.subscribe((t=>{t?(e.setDisplay(o,!K(this.funcCall)),e.setDisplay(r,!0)):(a()(o).hide(),a()(r).hide())}));if(this.subs.push(l),e.tooltip.bind(o,(()=>"inconsistent"===this.consistencyState.value&&this.mandatoryConsistent?"Current run is inconsistent. Export feature is disabled.":null)),!this.options.isTabbed&&this.mandatoryConsistent){const t=this.consistencyState.pipe((0,s.distinctUntilChanged)()).subscribe((t=>{"inconsistent"===t?(a()(o).addClass("d4-disabled"),a()(o.lastChild).css("color","unset")):(a()(o).removeClass("d4-disabled"),a()(o.lastChild).removeProp("color"))}));this.subs.push(t)}const u=[[...!this.options.isTabbed&&this.isHistoryEnabled&&this.options.historyEnabled?[n]:[],...!this.options.isTabbed&&this.isHistoryEnabled?[i]:[],...!this.options.isTabbed&&this.isExportEnabled&&this.exportConfig&&this.exportConfig.supportedFormats.length>0?[o]:[],...this.options.isTabbed?[]:[r]]];return this.setRibbonPanels(u),u}buildRibbonMenu(){if(this.ribbonMenu.clear(),!(this.exportConfig||this.reportBug||this.requestFeature||this.getHelp||this.getMocks||this.getTemplates))return;const t=this.ribbonMenu.group("Model");if(this.getMocks&&this.getMocks.length>0)if(1===this.getMocks.length)t.item("Input data mock",this.getMocks[0].action);else{const e=t.group("Input data mocks");this.getMocks.forEach((t=>{e.item(t.mockName,t.action)})),t.endGroup()}if(this.getTemplates&&this.getTemplates.length>0)if(1===this.getTemplates.length)t.item("Input data template",this.getTemplates[0].action);else{const e=t.group("Input data templates");this.getTemplates.forEach((t=>{e.item(t.name,t.action)})),t.endGroup()}this.isExportEnabled&&this.exportConfig&&this.exportConfig.supportedFormats.length>0&&t.group("Export").items(this.getFormats(),this.exportRun.bind(this)).endGroup(),this.reportBug&&t.item("Report a bug",(()=>this.reportBug())),this.requestFeature&&t.item("Request a feature",(()=>this.requestFeature())),this.getHelp&&t.item("Help",(()=>this.getHelp()));const n=t.group("Test runner");n.item("Execute Test JSON",(()=>this.importRunJsonDialog())),n.item("Update Test JSON",(()=>this.importRunJsonDialog(!0))),t.endGroup(),t.item("Record the screen",me),this.getAbout&&t.item("About",(()=>pe(this,void 0,void 0,(function*(){const t=yield this.getAbout();if(t){const n=e.dialog("Current version");t.split("\n").forEach((t=>n.add(e.label(t)))),n.onOK((()=>{})),n.getButton("CANCEL").style.display="none",n.show({center:!0})}}))))}exportRun(t){return pe(this,void 0,void 0,(function*(){if(t!==fe)o.Utils.download(this.exportConfig.filename(t),yield this.exportConfig.export(t));else{const t=yield this.exportRunJson();t&&o.Utils.download(this.defaultExportFilename("","json"),t)}}))}getFormats(){var t,e;return[...null!==(e=null===(t=this.exportConfig)||void 0===t?void 0:t.supportedFormats)&&void 0!==e?e:[],fe]}onBeforeSaveRun(t){return pe(this,void 0,void 0,(function*(){}))}onAfterSaveRun(t){return pe(this,void 0,void 0,(function*(){}))}saveRun(e){return pe(this,void 0,void 0,(function*(){let n=et(e);var i;yield this.onBeforeSaveRun(n),K(e)&&(n=yield(i=e,q(void 0,void 0,void 0,(function*(){const e=(yield t.functions.eval(i.func.nqName)).prepare([...i.inputs].reduce(((t,[e,n])=>(t[e]=n,t)),{}));return i.options.forEach((t=>e.options[t]=i.options[t])),e})))),n.id&&n.newId();const o=yield dt.saveRun(n),s=yield dt.loadRun(o.id);return this.options.historyEnabled&&this.isHistoryEnabled&&this.historyBlock&&this.historyBlock.addRun(s),this.linkFunccall(s),this.isHistorical.next(!0),yield this.onAfterSaveRun(o),o}))}onBeforeDeleteRun(t){return pe(this,void 0,void 0,(function*(){}))}onAfterDeleteRun(t){return pe(this,void 0,void 0,(function*(){}))}deleteRun(t){return pe(this,void 0,void 0,(function*(){return yield this.onBeforeDeleteRun(t),yield dt.deleteRun(t),yield this.onAfterDeleteRun(t),t.id}))}onBeforeLoadRun(){return pe(this,void 0,void 0,(function*(){}))}onAfterLoadRun(t){return pe(this,void 0,void 0,(function*(){}))}loadRun(t){return pe(this,void 0,void 0,(function*(){yield this.onBeforeLoadRun();const e=yield dt.loadRun(t);return this.lastCall=et(e),this.linkFunccall(e),this.isHistorical.next(!0),yield this.onAfterLoadRun(e),e}))}onBeforeRun(t){return pe(this,void 0,void 0,(function*(){}))}onAfterRun(t){return pe(this,void 0,void 0,(function*(){}))}run(){return pe(this,void 0,void 0,(function*(){if(!this.funcCall)throw new Error("The correspoding function is not specified");yield this.onBeforeRun(this.funcCall);const e=o.TaskBarProgressIndicator.create("Calculating...");try{this.funcCall.newId(),yield this.funcCall.call(),yield this.onAfterRun(this.funcCall),this.lastCall=et(this.funcCall),this.options.isTabbed||this.runningOnInput||!this.isHistoryEnabled||(yield this.saveRun(this.funcCall))}catch(e){t.shell.error(e.toString())}finally{e.close()}}))}exportRunJson(){return pe(this,void 0,void 0,(function*(){if(this._lastCall)return function(t,e=2){return JSON.stringify(t,((t,e)=>e instanceof o.DataFrame?{[ne]:"DataFrame",value:Array.from(e.toByteArray())}:e instanceof ArrayBuffer?{[ne]:"ArrayBuffer",value:Array.from(new Uint8Array(e))}:e instanceof Map?{[ne]:"Map",value:Array.from(e)}:e instanceof Set?{[ne]:"Set",value:Array.from(e)}:e),e)}(yield function(t,e){return q(this,void 0,void 0,(function*(){const n={};for(const[i,o]of Object.entries(t.inputs)){const{property:t}=e.funcCall.inputParams[i];n[i]=yield at(t,o,e)}return{inputs:n,outputs:t.outputs}}))}(this._lastCall,this),0)}))}importRunJsonDialog(){return pe(this,arguments,void 0,(function*(t=!1){const n=new St("JSON file",null,null,"application/json"),i={modal:!0,fullScreen:!0,width:500,height:200,center:!0};if(!(yield new Promise(((t,o)=>{e.dialog({title:"Import Run JSON"}).add(e.div([e.inputs([n])])).onOK((()=>t(!0))).onCancel((()=>t(!1))).show(i)})))||!n.value)return;const o=(r=yield n.value.text(),JSON.parse(r,ie));var r;t?(yield this.executeTest(o,!0),yield this.isHistorical.pipe((0,s.filter)((t=>t)),(0,s.take)(1),(0,s.delay)(0)).toPromise(),yield this.exportRun(fe)):yield this.executeTest(o)}))}executeTest(t){return pe(this,arguments,void 0,(function*(t,e=!1){yield de(t,this,{updateMode:e,interactive:!0})}))}get compareCustomizer(){var t;return null!==(t=this.func.options.compareCustomizer)&&void 0!==t?t:null}get comparatorFunc(){var t;return null!==(t=this.func.options.comparatorFunc)&&void 0!==t?t:null}get uploadFunc(){var t;return null!==(t=this.func.options.uploadFunc)&&void 0!==t?t:null}get runningOnInput(){return"true"===this.func.options.runOnInput}get runningOnStart(){return"true"===this.func.options.runOnOpen}get mainParams(){return this.func.options.mainParams?JSON.parse(this.func.options.mainParams):null}get mandatoryConsistent(){var t;return"true"===(null===(t=this.parentCall)||void 0===t?void 0:t.func.options.mandatoryConsistent)}get hasContextHelp(){return!!this.func.options.help}getContextHelp(){return pe(this,void 0,void 0,(function*(){const e=this.func.options.help;if(!e)return null;if(this.helpCache)return this.helpCache;const n=`System:AppData/${e}`;if(yield t.dapi.files.exists(n)){const e=yield t.dapi.files.readAsText(n);return this.helpCache=e,e}const i=`${t.shell.user.name}.home/${e}`;if(yield t.dapi.files.exists(i)){const e=yield t.dapi.files.readAsText(i);return this.helpCache=e,e}return null}))}get features(){var t;return JSON.parse(null!==(t=this.func.options.features)&&void 0!==t?t:"{}")}getFeature(t,e){var n;return this.features instanceof Array?this.features.includes(t):this.features instanceof Object&&null!==(n=this.features[t])&&void 0!==n?n:e}get isExportEnabled(){return this.getFeature("export",!0)}get isHistoryEnabled(){return this.getFeature("history",!0)}get isSaEnabled(){return this.getFeature("sens-analysis",!1)}get hasUploadMode(){return this.getFeature("upload",!1)}}var ge=Uint8Array,ye=Uint16Array,be=Uint32Array,Ae=new ge([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ce=new ge([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),we=(new ge([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),function(t,e){for(var n=new ye(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var o=new be(n[30]);for(i=1;i<30;++i)for(var s=n[i];s<n[i+1];++s)o[s]=s-n[i]<<5|i;return[n,o]}),Ie=we(Ae,2),xe=Ie[0],Te=Ie[1];xe[28]=258,Te[258]=28;for(var Ee=we(Ce,0),Re=(Ee[0],Ee[1],new ye(32768)),Se=0;Se<32768;++Se){var Oe=(43690&Se)>>>1|(21845&Se)<<1;Oe=(61680&(Oe=(52428&Oe)>>>2|(13107&Oe)<<2))>>>4|(3855&Oe)<<4,Re[Se]=((65280&Oe)>>>8|(255&Oe)<<8)>>>1}var Pe=new ge(288);for(Se=0;Se<144;++Se)Pe[Se]=8;for(Se=144;Se<256;++Se)Pe[Se]=9;for(Se=256;Se<280;++Se)Pe[Se]=7;for(Se=280;Se<288;++Se)Pe[Se]=8;var Be=new ge(32);for(Se=0;Se<32;++Se)Be[Se]=5;var _e=new ge(0),ke="undefined"!=typeof TextDecoder&&new TextDecoder;try{ke.decode(_e,{stream:!0})}catch(t){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;var Fe=n(933),Le={};Le.styleTagTransform=It(),Le.setAttributes=bt(),Le.insert=gt().bind(null,"head"),Le.domAPI=mt(),Le.insertStyleElement=Ct(),ht()(Fe.A,Le),Fe.A&&Fe.A.locals&&Fe.A.locals;var Ve=n(362),Me={};Me.styleTagTransform=It(),Me.setAttributes=bt(),Me.insert=gt().bind(null,"head"),Me.domAPI=mt(),Me.insertStyleElement=Ct(),ht()(Ve.A,Me),Ve.A&&Ve.A.locals&&Ve.A.locals;var Ne,De;!function(t){t.INCORRECT_SIZE_TYPE="Size must be an integer.",t.SIZE_MUST_BE_POSITIVE="Size must be positive."}(Ne||(Ne={})),function(t){t[t.BATCH_SIZE=100]="BATCH_SIZE",t[t.MS_TO_SLEEP=10]="MS_TO_SLEEP"}(De||(De={}));const je=t=>new Promise(((e,n)=>setTimeout(e,t)));function $e(t){if(!Number.isInteger(t))throw new Error(Ne.INCORRECT_SIZE_TYPE);if(t<1)throw new Error(Ne.SIZE_MUST_BE_POSITIVE)}function He(t){return e=this,n=void 0,s=function*(){const e=[],n=o.TaskBarProgressIndicator.create("Running sensitivity analysis...");n.cancelable=!0;let i=0;const s=t.length;for(let o=0;o<s&&(e.push(yield t[o].call()),1===o&&(n.update(100*o/s,"Running sensitivity analysis..."),yield je(10*De.MS_TO_SLEEP)),++i,!n.canceled);++o)i>=De.BATCH_SIZE&&(n.update(100*o/s,"Running sensitivity analysis..."),yield je(De.MS_TO_SLEEP),i=0);return n.close(),e},new((i=void 0)||(i=Promise))((function(t,o){function r(t){try{l(s.next(t))}catch(t){o(t)}}function a(t){try{l(s.throw(t))}catch(t){o(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,a)}l((s=s.apply(e,n||[])).next())}));var e,n,i,s}class Ue{constructor(t=1,e=1){$e(t),$e(e),this.N=t,this.d=e,this.A=this.generateMatrix(t,e),this.B=this.generateMatrix(t,e),this.AB=this.createMixMatrax(this.A,this.B)}generateMatrix(t,e){const n=new Array(e);for(let i=0;i<e;++i){n[i]=new Float32Array(t);for(let e=0;e<t;++e)n[i][e]=Math.random()}return n}createMixMatrax(t,e){const n=this.d,i=new Array(n);for(let o=0;o<n;++o){i[o]=new Array(0);for(let s=0;s<n;++s)o!==s?i[o].push(t[s]):i[o].push(e[s])}return i}getRow(t,e){const n=new Float32Array(this.d);for(let i=0;i<this.d;++i)n[i]=t[i][e];return n}getRowOfMatrixA(t){return this.getRow(this.A,t)}getRowOfMatrixB(t){return this.getRow(this.B,t)}getRowOfMatrixAB(t,e){return this.getRow(this.AB[t],e)}getConcatenatedColumns(){const t=new Array(0),e=this.N,n=this.d;for(let i=0;i<n;++i){const o=new Float32Array(e*(n+2));o.set(this.A[i]),o.set(this.B[i],e);for(let t=0;t<n;++t)o.set(this.AB[t][i],2*e+e*t);t.push(o)}return t}}const Ye="Unsupported output type.";function We(e,n){const i=e.rowCount,s=n.value.row;if(null!==s)return e.columns.names().map((t=>({idx:s,columnName:t})));const r=e.col(n.value.colName);if(null===r)return t.shell.warning(`Output dataframe "${e.name}" doesn't contain the "${n.value.colName}" column. The last row is analyzed.`),e.columns.names().map((t=>({idx:i-1,columnName:t})));if(r.type!==o.COLUMN_TYPE.INT&&r.type!==o.COLUMN_TYPE.FLOAT)return t.shell.warning(`Non-supported type of the "${n.value.colName}" column: ${r.type}. Last row of the output dataframe "${e.name}" is analyzed.`),e.columns.names().map((t=>({idx:i-1,columnName:t})));const a=r.getRawData(),l=n.value.colValue;let u,c=0,d=Math.abs(a[0]-l);for(let t=1;t<i;++t)u=Math.abs(a[t]-l),u<d&&(d=u,c=t);return e.columns.names().map((t=>({idx:c,columnName:t})))}function Ge(t,e){var n,i,s;if(t.length<1)throw new Error("Funccall array is empty.");const r=t.length,a=function(t,e){const n=[];for(const i of e)i.prop.propertyType==o.TYPE.DATA_FRAME?n.push({prop:i.prop,elements:We(t.outputs[i.prop.name],i)}):n.push({prop:i.prop,elements:[]});return n}(t[0],e),l=function(t,e,n){var i;const s=[];for(const r of e){const e=r.prop,a=e.name;switch(e.propertyType){case o.TYPE.BIG_INT:case o.TYPE.INT:case o.TYPE.FLOAT:s.push(o.Column.fromType(e.propertyType,a,n));break;case o.TYPE.DATA_FRAME:const l=t.outputs[a];if(r.elements)for(const t of r.elements)s.push(o.Column.fromType(null===(i=l.col(t.columnName))||void 0===i?void 0:i.type,t.columnName,n));break;default:throw new Error(Ye)}}return o.DataFrame.fromColumns(s)}(t[0],a,r);for(let e=0;e<r;++e)for(const r of a){const a=r.prop,u=a.name,c=t[e];switch(a.propertyType){case o.TYPE.BIG_INT:case o.TYPE.INT:case o.TYPE.FLOAT:null===(n=l.col(u))||void 0===n||n.set(e,c.outputs[u]);break;case o.TYPE.DATA_FRAME:const t=c.outputs[u],a=t.rowCount-1;if(r.elements)for(const n of r.elements)null===(i=l.col(n.columnName))||void 0===i||i.set(e,null===(s=t.col(n.columnName))||void 0===s?void 0:s.get(-1!==n.idx?n.idx:a));break;default:throw new Error(Ye)}}return l}function ze(t,e){const n=function(t,e){return e.forEach((e=>{t.forEach((t=>{t.name===e.name&&(t.name=`${t.name} (input)`,e.name=`${e.name} (output)`)}))})),t.concat(e)}(t,e),i=n.length;if(0===i)return o.DataFrame.create();const s=o.DataFrame.fromColumns([n[0]]);for(let t=1;t<i;++t)n[t].name=s.columns.getUnusedName(n[t].name),s.columns.add(n[t]);return s}class Je{constructor(t,e,n,i,s){$e(s),this.samplesCount=s,this.fixedInputs=e,this.func=t;const r=function(t,e){const n=e.length,i=function(t,e){return new Ue(t,e).getConcatenatedColumns()}(t,n);return[...Array(n).keys()].map((t=>function(t,e){var n;const i=e.length,s=o.Column.fromType(t.prop.propertyType,null!==(n=t.prop.caption)&&void 0!==n?n:t.prop.name,i),r=s.getRawData(),a=t.max-t.min;for(let n=0;n<i;++n)r[n]=t.min+a*e[n];return s}(e[t],i[t])))}(s,n);this.dimension=n.length,this.variedInputs=[...Array(this.dimension).keys()].map((t=>({prop:n[t].prop,min:n[t].min,max:n[t].max,column:r[t]}))),this.runsCount=s*(this.dimension+2),this.funcCalls=[];for(let n=0;n<this.runsCount;++n){const i={};for(const t of e)i[t.name]=t.value;for(const t of this.variedInputs)i[t.prop.name]=t.column.get(n);this.funcCalls.push(t.prepare(i))}this.outputsOfInterest=i}getSobolIndeces(t){const e=this.dimension,n=this.samplesCount,i=new Float32Array(e),s=new Float32Array(e),r=t.getRawData(),a=2*n;let l=0,u=0;for(let t=0;t<a;++t)l+=r[t],u+=r[t]*r[t];const c=l/a,d=u/a-c*c;if(0===d)i.fill(0),s.fill(0);else for(let t=0;t<e;++t){let e=0,o=0,a=0;for(let i=0;i<n;++i)a=r[(2+t)*n+i]-r[i],e+=r[n+i]*a,o+=a*a;i[t]=e/(n*d),s[t]=o/(2*n*d)}return{firstOrder:o.Column.fromFloat32Array(t.name,i),totalOrder:o.Column.fromFloat32Array(t.name,s)}}perform(){return t=this,e=void 0,i=function*(){this.funcCalls=yield He(this.funcCalls);const t=this.variedInputs.map((t=>t.column)),e=Ge(this.funcCalls,this.outputsOfInterest).columns.toList(),n=ze(t,e);n.name=`Sensitivity Analysis of ${this.func.friendlyName}`;const i=e.map((t=>this.getSobolIndeces(t))),s=o.Column.fromStrings("input",t.map((t=>t.name))),r=[s],a=[s];for(const t of i)r.push(t.firstOrder),a.push(t.totalOrder);const l=o.DataFrame.fromColumns(r);l.name="First order Sobol' indices";const u=o.DataFrame.fromColumns(a);return u.name="Total order Sobol' indices",{funcEvalResults:n,funcCalls:this.funcCalls,firstOrderSobolIndices:l,totalOrderSobolIndices:u}},new((n=void 0)||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}));var t,e,n,i}}class qe{constructor(t,e,n,i,s){$e(s),this.func=t;const r=function(t,e){var n;const i=[];for(const s of e){const e=o.Column.fromType(s.prop.propertyType,null!==(n=s.prop.caption)&&void 0!==n?n:s.prop.name,t),r=e.getRawData(),a=s.max-s.min;for(let e=0;e<t;++e)r[e]=s.min+a*Math.random();i.push(e)}return i}(s,n);this.dimension=n.length,this.variedInputs=[...Array(this.dimension).keys()].map((t=>({prop:n[t].prop,min:n[t].min,max:n[t].max,column:r[t]}))),this.funcCalls=[];for(let n=0;n<s;++n){const i={};for(const t of e)i[t.name]=t.value;for(const t of this.variedInputs)i[t.prop.name]=t.column.get(n);this.funcCalls.push(t.prepare(i))}this.outputsOfInterest=i}perform(){return t=this,e=void 0,i=function*(){this.funcCalls=yield He(this.funcCalls);const t=ze(this.variedInputs.map((t=>t.column)),Ge(this.funcCalls,this.outputsOfInterest).columns.toList());return t.name=`Sensitivity Analysis of ${this.func.friendlyName}`,{funcEvalResults:t,funcCalls:this.funcCalls}},new((n=void 0)||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}));var t,e,n,i}}var Ke,Ze,Xe=n(993),Qe={};Qe.styleTagTransform=It(),Qe.setAttributes=bt(),Qe.insert=gt().bind(null,"head"),Qe.domAPI=mt(),Qe.insertStyleElement=Ct(),ht()(Xe.A,Qe),Xe.A&&Xe.A.locals&&Xe.A.locals,function(t){t[t.COR_PLOT=.5]="COR_PLOT",t[t.PC_PLOT=.6]="PC_PLOT",t[t.GRAPH=.6]="GRAPH",t[t.BAR_CHART=.2]="BAR_CHART"}(Ke||(Ke={})),function(t){t.METHOD="`Method`",t.SAMPLES="`Samples`"}(Ze||(Ze={}));const tn=`# Sensitivity Analysis\n\nSensitivity Analysis runs the computation multiple times with varying inputs, \nand analyzes the relationship between inputs and outputs.\n\nUse one of the following methods:\n\n* [Monte Carlo](https://en.wikipedia.org/wiki/Monte_Carlo_method) explores a function \nat randomly taken points\n\n* [Sobol](https://en.wikipedia.org/wiki/Variance-based_sensitivity_analysis)\ndecomposes output variance into fractions, which can be attributed to inputs\n\n* **Grid** studies a function at the points of a grid with the specified step\n\n## Monte Carlo\n\nOnce you've chosen it in ${Ze.METHOD}\n\n* Set in ${Ze.SAMPLES} the number of random points \n\n* Use switchers to specify varied inputs and outputs to be analyzed\n\n* Press **Run** or <i class="fas fa-play"></i> on the top panel. You will get \n\n * [Correlation plot](https://datagrok.ai/help/visualize/viewers/correlation-plot) for exploring\ncorrelations between varied inputs and the specified outputs\n\n * [PC plot](https://datagrok.ai/help/visualize/viewers/pc-plot) visualizing multivariate data\nand providing variations of the selected inputs & outputs\n\n * [Line chart](https://datagrok.ai/help/visualize/viewers/line-chart) or \n[Scatterplot](https://datagrok.ai/help/visualize/viewers/scatter-plot) (dependently on the varied\ninputs count) showing a behavior of each output separately\n\n * [Grid](https://datagrok.ai/help/visualize/viewers/grid) containing inputs and outputs values \nof each function evaluation\n\n* Press <i class="grok-icon fal fa-question"></i> on the top panel to learn more about \n[Sensitivity Analysis](https://datagrok.ai/help/compute/#sensitivity-analysis)\n\n## Sobol\n\nThis method performs \n[variance-based sensitivity analysis](https://en.wikipedia.org/wiki/Variance-based_sensitivity_analysis). \nIt provides the same visualizations \nas **Monte Carlo** and [bar charts](https://datagrok.ai/help/visualize/viewers/bar-chart) showing \nSobol' indices:\n\n* First-order indices indicate the contribution to the output variance of varying each input alone\n\n* Total-order indices measure the contribution to the output variance of each input,\n including all variance caused by its interactions with any other inputs\n \n ## Grid\n \n This method provides the same visualization as the previous ones. Unlike them, it evaluates a function \n at the points of uniform grid within the specified ranges.`;var en=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};const nn=[o.TYPE.INT,o.TYPE.BIG_INT,o.TYPE.FLOAT,o.TYPE.BOOL,o.TYPE.DATA_FRAME],on=[o.TYPE.INT,o.TYPE.BIG_INT,o.TYPE.FLOAT,o.TYPE.BOOL,o.TYPE.DATA_FRAME];var sn,rn;!function(t){t.GRID_ANALYSIS="Grid",t.RANDOM_ANALYSIS="Monte Carlo",t.SOBOL_ANALYSIS="Sobol"}(sn||(sn={})),function(t){t.LAST_ROW="Last row",t.FIRST_ROW="First row",t.ALL_COLUMNS="",t.BY_COL_VAL="By value in column"}(rn||(rn={}));const an=()=>e.div([],"sa-switch-input");class ln{static fromEmpty(e){return en(this,arguments,void 0,(function*(e,n={parentView:void 0,parentCall:void 0}){const i=[...t.shell.views].find((t=>t.type===v)),o=yield ee.fromComparedRuns([],e,{parentView:i,parentCall:n.parentCall});t.shell.addView(o),new this(e,o,n)}))}constructor(t,n,i={parentView:void 0,parentCall:void 0,configFunc:void 0}){this.func=t,this.options=i,this.generateInputFields=t=>{const n={analysisType:{input:e.choiceInput("Method",sn.RANDOM_ANALYSIS,[sn.RANDOM_ANALYSIS,sn.SOBOL_ANALYSIS,sn.GRID_ANALYSIS],(t=>{n.analysisType.value.next(t),this.updateRunWidgetsState(),this.setAnalysisInputTooltip(),this.store.analysisInputs.samplesCount.input.setTooltip(this.samplesCountTooltip())})),value:new c.BehaviorSubject(sn.RANDOM_ANALYSIS)},samplesCount:{input:e.intInput("Samples",10,(t=>{n.samplesCount.value=t,this.updateRunWidgetsState()})),value:10}};n.analysisType.input.root.insertBefore(an(),n.analysisType.input.captionLabel),n.samplesCount.input.root.insertBefore(an(),n.samplesCount.input.captionLabel);const i=(t,e)=>void 0===t.options[e]?t.defaultValue:Number(t.options[e]),s=(t,n,i=!0)=>{const o=e.switchInput(" ",t,n);return a()(o.root).addClass("sa-switch-input"),a()(o.captionLabel).hide(),e.tooltip.bind(o.root,(()=>i?o.value?"Switch to mark input as immutable":"Switch to mark input as mutable":o.value?"Switch to mark output as not requiring analysis":"Switch to mark output as requiring analysis")),o},r=t.inputs.reduce(((t,r)=>{switch(r.propertyType){case o.TYPE.INT:case o.TYPE.BIG_INT:case o.TYPE.FLOAT:const l=s(!1,(t=>{h.isChanging.next(t),this.updateRunWidgetsState()})),u=s(!1,(t=>{h.isChanging.next(t),this.updateRunWidgetsState()})),d={type:r.propertyType,prop:r,const:{input:(()=>{var t;const n=e.intInput(null!==(t=r.caption)&&void 0!==t?t:r.name,r.defaultValue,(t=>h.const.value=t));return n.root.insertBefore(u.root,n.captionLabel),n.addPostfix(r.options.units),n})(),value:r.defaultValue},min:{input:(()=>{var t;const n=e.floatInput(`${null!==(t=r.caption)&&void 0!==t?t:r.name} min`,i(r,"min"),(t=>h.min.value=t));return n.root.insertBefore(l.root,n.captionLabel),n.addPostfix(r.options.units),n})(),value:i(r,"min")},max:{input:(()=>{var t;const n=e.floatInput(`${null!==(t=r.caption)&&void 0!==t?t:r.name} max`,i(r,"max"),(t=>h.max.value=t));return n.addPostfix(r.options.units),n})(),value:i(r,"max")},lvl:{input:e.intInput("Samples",3,(t=>{h.lvl.value=t,this.updateRunWidgetsState()})),value:3},isChanging:new c.BehaviorSubject(!1)};[d.max.input,d.lvl.input].forEach((t=>{t.root.insertBefore(an(),t.captionLabel),a()(t.root).removeProp("display")}));const p=[d.lvl.input];t[r.name]=Object.assign(Object.assign({},d),{constForm:[d.const.input],saForm:[d.min.input,d.max.input,...p]});const h=t[r.name];h.isChanging.subscribe((t=>{l.notify=!1,l.value=t,l.notify=!0,u.notify=!1,u.value=t,u.notify=!0})),(0,c.combineLatest)([d.isChanging,n.analysisType.value]).subscribe((([t,e])=>{t?(h.constForm.forEach((t=>a()(t.root).hide())),h.saForm.forEach((t=>a()(t.root).css("display","flex"))),p.forEach((t=>e===sn.GRID_ANALYSIS?a()(t.root).css("display","flex"):a()(t.root).hide()))):(h.constForm.forEach((t=>a()(t.root).css("display","flex"))),h.saForm.forEach((t=>a()(t.root).hide())))}));break;case o.TYPE.BOOL:const f=s(!1,(t=>{v.isChanging.next(t),this.updateRunWidgetsState()})),m={type:r.propertyType,prop:r,const:{input:(()=>{var t,n;const i=e.boolInput(`${null!==(t=r.caption)&&void 0!==t?t:r.name}`,null!==(n=r.defaultValue)&&void 0!==n&&n,(t=>v.const.value=t));return i.root.insertBefore(f.root,i.captionLabel),i})(),value:!1},isChanging:new c.BehaviorSubject(!1),lvl:1};t[r.name]=Object.assign(Object.assign({},m),{constForm:[m.const.input],saForm:[]});const v=t[r.name];v.isChanging.subscribe((t=>{v.lvl=t?2:1}));break;default:const g=an(),y={input:(()=>{const t=e.input.forProperty(r,void 0,{onValueChanged:t=>y.value=t.value});return t.root.insertBefore(g,t.captionLabel),t.addPostfix(r.options.units),t})(),value:r.defaultValue};t[r.name]={const:y,constForm:[y.input],saForm:[],type:r.propertyType,prop:r,isChanging:new c.BehaviorSubject(!1)}}return t}),{}),l=t.outputs.reduce(((t,n)=>{const i={prop:n,input:(()=>{var t;const r=null!==(t=n.caption)&&void 0!==t?t:n.name;let a;n.propertyType===o.TYPE.DATA_FRAME?(a=e.choiceInput(r,rn.LAST_ROW,[rn.LAST_ROW,rn.FIRST_ROW,rn.BY_COL_VAL],(t=>{i.value.returning=t,i.analysisInputs.forEach((e=>{e.root.hidden=t!==rn.BY_COL_VAL})),a.setTooltip(this.getOutputTooltip(r,t))})),a.setTooltip(this.getOutputTooltip(r,rn.LAST_ROW))):(a=e.input.forProperty(n),a.setTooltip("Scalar")),a.addCaption(r);const l=on.includes(n.propertyType)?s(!0,(t=>{i.isInterest.next(t),i.analysisInputs.forEach((t=>{t.root.hidden=i.value.returning!==rn.BY_COL_VAL})),this.updateRunWidgetsState(),n.propertyType===o.TYPE.DATA_FRAME&&a.setTooltip(t?this.getOutputTooltip(r,rn.LAST_ROW):"Dataframe")}),!1).root:an();return a.root.insertBefore(l,a.captionLabel),a})(),analysisInputs:n.propertyType===o.TYPE.DATA_FRAME?[(()=>{var t;const o=e.stringInput("Column",rn.ALL_COLUMNS,(t=>{i.value.colName=t}));return o.root.insertBefore(an(),o.captionLabel),o.root.hidden=!0,o.setTooltip(`Name of column of the '${null!==(t=n.caption)&&void 0!==t?t:n.name}' dataframe`),o})(),(()=>{var t;const o=e.floatInput("Value",0,(t=>{i.value.colValue=t}));return o.root.insertBefore(an(),o.captionLabel),o.root.hidden=!0,o.setTooltip(`Value specifying the '${null!==(t=n.caption)&&void 0!==t?t:n.name}' dataframe row`),o})()]:[],value:{returning:rn.LAST_ROW,colName:rn.ALL_COLUMNS,colValue:0},isInterest:new c.BehaviorSubject(!0)};return a()(i.input.input).css("visibility","hidden"),i.prop.propertyType===o.TYPE.DATA_FRAME&&i.isInterest.subscribe((t=>{i.analysisInputs.forEach((e=>t?a()(e.root).show():a()(e.root).hide())),a()(i.input.input).css("visibility",t?"visible":"hidden")})),t[n.name]=i,t}),{});return{analysisInputs:n,inputs:r,outputs:l}},this.openedViewers=[],this.gridSubscription=null,this.store=this.generateInputFields(this.func),this.runButton=e.bigButton("Run",(()=>en(this,void 0,void 0,(function*(){return yield this.runAnalysis()})))),this.runIcon=e.iconFA("play",(()=>en(this,void 0,void 0,(function*(){return yield this.runAnalysis()})))),this.runIcon.style.color="var(--green-2)",this.runIcon.classList.add("fas"),this.helpIcon=e.iconFA("question",(()=>{window.open("https://datagrok.ai/help/compute.md#sensitivity-analysis","_blank")}),"Open help in a new tab");const s=this.buildFormWithBtn();this.runButton.disabled=!this.canEvaluationBeRun(),this.runIcon.hidden=this.runButton.disabled,this.addTooltips(),this.comparisonView=n,this.comparisonView.dockManager.dock(s,o.DOCK_TYPE.LEFT,null,`${this.func.name} - Sensitivity Analysis`,.25),this.comparisonView.grid.columns.byName("Run name").visible=!1;const r=this.comparisonView.getRibbonPanels();r.push([this.helpIcon,this.runIcon]),this.comparisonView.setRibbonPanels(r),this.comparisonView.helpUrl="https://datagrok.ai/help/compute.md#sensitivity-analysis",this.tableDockNode=this.comparisonView.dockManager.findNode(this.comparisonView.grid.root);const l=e.markdown(tn);l.style.padding="10px",l.style.overflow="auto",this.helpMdNode=this.comparisonView.dockManager.dock(l,o.DOCK_TYPE.FILL,this.tableDockNode,"About")}closeOpenedViewers(){for(const t of this.openedViewers)t.close();this.openedViewers.splice(0),this.helpMdNode&&(this.helpMdNode.detachFromParent(),this.helpMdNode.container.destroy(),this.helpMdNode=void 0),this.gridSubscription&&(this.gridSubscription.unsubscribe(),this.gridSubscription=null)}getFuncCallCount(t,e){let n=0;switch(t.analysisType.value.value){case sn.GRID_ANALYSIS:let i=1;const s=t=>t.type===o.TYPE.INT||t.type===o.TYPE.BIG_INT||t.type===o.TYPE.FLOAT;for(const t of Object.values(e))t.isChanging.value&&(i*=s(t)?t.lvl.value:t.lvl,++n);return 0===n?0:i;case sn.RANDOM_ANALYSIS:return t.samplesCount.value;case sn.SOBOL_ANALYSIS:for(const t of Object.keys(e))e[t].isChanging.value&&++n;return 0===n?0:(n+2)*t.samplesCount.value;default:return 0}}getFuncCallCountAsString(){if(!this.canEvaluationBeRun())return"0";const t=this.getFuncCallCount(this.store.analysisInputs,this.store.inputs);return t<1e3?String(t):t<1e6?String(Math.ceil(t/10)/100)+"k":t<1e9?String(Math.ceil(t/1e4)/100)+"m":String(Math.ceil(t/1e7)/100)+"b"}updateRunWidgetsState(){this.runButton.textContent=`Run (${this.getFuncCallCountAsString()})`,this.runButton.disabled=!this.canEvaluationBeRun(),this.runIcon.hidden=this.runButton.disabled}buildFormWithBtn(){let t="Misc";const n=Object.values(this.store.inputs).reduce(((n,i)=>{const o=i.prop;return o.category!==t&&(n.append(e.h2(o.category)),t=o.category),n.append(...i.constForm.map((t=>t.root)),...i.saForm.map((t=>t.root))),n}),e.div([this.store.analysisInputs.analysisType.input,this.store.analysisInputs.samplesCount.input],{style:{"overflow-y":"scroll",width:"100%"}}));a()(n).addClass("ui-form");const i=e.h2("Outputs");n.appendChild(i),t="Misc";const o=Object.values(this.store.outputs).reduce(((n,i)=>{const o=i.prop;return o.category!==t&&(n.append(e.h2(o.category)),t=o.category),n.append(i.input.root,...i.analysisInputs.map((t=>t.root))),n}),n);this.store.analysisInputs.analysisType.value.subscribe((t=>{t===sn.GRID_ANALYSIS?a()(this.store.analysisInputs.samplesCount.input.root).hide():(a()(i).show(),a()(o).show(),a()(this.store.analysisInputs.samplesCount.input.root).show())}));let s=!1;for(const t of Object.keys(this.store.outputs))if(!0===this.store.outputs[t].isInterest.value){s=!0;break}s||this.store.outputs[Object.keys(this.store.outputs)[0]].isInterest.next(!0),this.updateRunWidgetsState();const r=e.buttonsInput([this.runButton]);return n.appendChild(r),a()(n).css({"padding-left":"12px","overflow-y":"scroll","padding-right":"4px"}),n}setAnalysisInputTooltip(){let t;switch(this.store.analysisInputs.analysisType.value.value){case sn.GRID_ANALYSIS:t="Grid analysis: the function is evaluated with respect to the selected inputs varying within the specified ranges";break;case sn.RANDOM_ANALYSIS:t="Monte Carlo simulation: the function is evaluated with respect to random variation of the selected inputs within the specified ranges";break;case sn.SOBOL_ANALYSIS:t="Variance-based sensitivity analysis: the Sobol' indices are computed";break;default:t="Unknown method!"}this.store.analysisInputs.analysisType.input.setTooltip(t)}getOutputTooltip(t,e){switch(e){case rn.FIRST_ROW:return`To analyze first row of the '${t}' dataframe`;case rn.LAST_ROW:return`To analyze last row of the '${t}' dataframe`;case rn.BY_COL_VAL:return`To analyze "${t}"'s row defined by custom value in column`;default:return""}}samplesCountTooltip(){switch(this.store.analysisInputs.analysisType.value.value){case sn.RANDOM_ANALYSIS:return"Input sets count";case sn.SOBOL_ANALYSIS:return"Sample size for the Sobol' indices computation";default:return"Unknown method!"}}addTooltips(){var t;this.setAnalysisInputTooltip(),e.tooltip.bind(this.runButton,(()=>`Run sensitivity analysis: the function is evaluated ${this.getFuncCallCount(this.store.analysisInputs,this.store.inputs)} times`)),e.tooltip.bind(this.runIcon,(()=>`Run sensitivity analysis: the function is evaluated ${this.getFuncCallCount(this.store.analysisInputs,this.store.inputs)} times`)),this.store.analysisInputs.samplesCount.input.setTooltip(this.samplesCountTooltip());for(const e of Object.keys(this.store.inputs)){const n=this.store.inputs[e].prop.propertyType;if(n===o.TYPE.BOOL||n===o.TYPE.STRING)continue;const i=this.store.inputs[e],s=null!==(t=i.prop.caption)&&void 0!==t?t:i.prop.name;i.const.input.setTooltip(`'${s}' value`),i.min.input.setTooltip(`Min value of '${s}'`),i.max.input.setTooltip(`Max value of '${s}'`),i.lvl.input.setTooltip(`Number of samples along the axis '${s}'`)}}isAnyInputSelected(){for(const t of Object.keys(this.store.inputs))if(!0===this.store.inputs[t].isChanging.value)return!0;return!1}isAnyOutputSelected(){for(const t of Object.keys(this.store.outputs))if(!0===this.store.outputs[t].isInterest.value)return!0;return!1}canEvaluationBeRun(){return this.isAnyInputSelected()&&this.isAnyOutputSelected()}runAnalysis(){return en(this,void 0,void 0,(function*(){if(this.canEvaluationBeRun())switch(this.store.analysisInputs.analysisType.value.value){case sn.GRID_ANALYSIS:yield this.runGridAnalysis();break;case sn.RANDOM_ANALYSIS:yield this.runRandomAnalysis();break;case sn.SOBOL_ANALYSIS:yield this.runSobolAnalysis()}}))}getFixedInputColumns(t){return Object.values(this.store.inputs).filter((t=>!nn.includes(t.type)||!t.isChanging.value)).map((e=>{var n;return o.Column.fromList(e.type,null!==(n=e.prop.caption)&&void 0!==n?n:e.prop.name,Array(t).fill(e.const.value))}))}runSobolAnalysis(){return en(this,void 0,void 0,(function*(){const n={func:this.func,fixedInputs:this.getFixedInputs().map((t=>({name:t,value:this.store.inputs[t].const.value}))),variedInputs:this.getVariedInputs().map((t=>{const e=this.store.inputs[t];return{prop:e.prop,min:e.min.value,max:e.max.value}})),samplesCount:this.store.analysisInputs.samplesCount.value||1},i=this.getOutputsOfInterest(),s=new Je(n.func,n.fixedInputs,n.variedInputs,i,n.samplesCount),r=yield s.perform();this.closeOpenedViewers();const l=r.funcEvalResults,u=r.funcCalls,c=r.firstOrderSobolIndices,d=r.totalOrderSobolIndices,p=c.columns.names();this.comparisonView.dataFrame=l;const h=l.columns.names(),f=this.getFixedInputColumns(l.rowCount);for(const t of f)t.name=l.columns.getUnusedName(`${t.name} (fixed)`),l.columns.add(t);this.comparisonView.grid.columns.setVisible([h[0]]),this.comparisonView.grid.columns.setVisible(h),this.comparisonView.grid.props.rowHeight=25;const m=o.Viewer.correlationPlot(l,{xColumnNames:h,yColumnNames:h}),v=this.comparisonView.dockManager.dock(m,o.DOCK_TYPE.LEFT,this.tableDockNode,"",Ke.COR_PLOT);this.openedViewers.push(m);const g=o.Viewer.pcPlot(l,{columnNames:h});this.comparisonView.dockManager.dock(g,o.DOCK_TYPE.DOWN,v,"",Ke.PC_PLOT),this.openedViewers.push(g);const y=this.getOutputNameForScatterPlot(h,l,n.variedInputs.length),b=1===n.variedInputs.length?o.Viewer.lineChart(l,this.getLineChartOpt(h)):o.Viewer.scatterPlot(l,this.getScatterOpt(h,y));this.openedViewers.push(b),this.comparisonView.dockManager.dock(b,o.DOCK_TYPE.DOWN,this.tableDockNode,"",Ke.GRAPH);const A=o.Viewer.barChart(c,this.getBarChartOpt(c.name,p[0],y)),C=this.comparisonView.dockManager.dock(A,o.DOCK_TYPE.RIGHT,void 0,"",Ke.BAR_CHART),w=o.Viewer.barChart(d,this.getBarChartOpt(d.name,p[0],y));this.comparisonView.dockManager.dock(w,o.DOCK_TYPE.DOWN,C),this.openedViewers=this.openedViewers.concat([A,w]),this.gridSubscription=this.comparisonView.grid.onCellClick.subscribe((n=>{var i;const s=u[null!==(i=n.tableRowIndex)&&void 0!==i?i:0],r=[...s.outputParams.values()].filter((t=>o.TYPES_SCALAR.has(t.property.propertyType))),l=o.HtmlTable.create(r,(t=>{var e;return[null!==(e=t.property.caption)&&void 0!==e?e:t.property.name,s.outputs[t.property.name],t.property.options.units]})).root,c=[...s.outputParams.values()].filter((t=>t.property.propertyType===o.TYPE.DATA_FRAME)).reduce(((t,e)=>{var n;const i=Vt(e.property).config,r=s.outputs[e.name],l=null!==(n=e.property.caption)&&void 0!==n?n:e.property.name;return i.map((e=>{const n=e.type,i=o.Viewer.fromType(n,r);i.setOptions(e),a()(i.root).css({width:"100%"}),t[l]?t[l].push(i.root):t[l]=[i.root]})),t}),{});let d,p;r.length>0?(p=1,d=Object.assign({"Output scalars":[l]},c)):(p=0,d=Object.assign({},c));const h=e.accordion();a()(h.root).css({width:"100%"}),Object.entries(d).map((t=>{h.addPane(t[0],(()=>e.divV(t[1])))})),h.panes[p].expanded=!0,t.shell.o=h.root}))}))}getFixedInputs(){return Object.keys(this.store.inputs).filter((t=>!nn.includes(this.store.inputs[t].type)||!this.store.inputs[t].isChanging.value))}getVariedInputs(){return Object.keys(this.store.inputs).filter((t=>!!nn.includes(this.store.inputs[t].type)&&this.store.inputs[t].isChanging.value))}runRandomAnalysis(){return en(this,void 0,void 0,(function*(){const n={func:this.func,fixedInputs:this.getFixedInputs().map((t=>({name:t,value:this.store.inputs[t].const.value}))),variedInputs:this.getVariedInputs().map((t=>{const e=this.store.inputs[t];return{prop:e.prop,min:e.min.value,max:e.max.value}})),samplesCount:this.store.analysisInputs.samplesCount.value||1},i=this.getOutputsOfInterest(),s=new qe(n.func,n.fixedInputs,n.variedInputs,i,n.samplesCount),r=yield s.perform(),l=r.funcEvalResults,u=r.funcCalls;this.closeOpenedViewers(),this.comparisonView.dataFrame=l;const c=l.columns.names(),d=this.getFixedInputColumns(l.rowCount);for(const t of d)t.name=l.columns.getUnusedName(`${t.name} (fixed)`),l.columns.add(t);this.comparisonView.grid.columns.setVisible([c[0]]),this.comparisonView.grid.columns.setVisible(c),this.comparisonView.grid.props.rowHeight=25;const p=o.Viewer.correlationPlot(l,{xColumnNames:c,yColumnNames:c}),h=this.comparisonView.dockManager.dock(p,o.DOCK_TYPE.LEFT,this.tableDockNode,"",Ke.COR_PLOT);this.openedViewers.push(p);const f=o.Viewer.pcPlot(l,{columnNames:c});this.comparisonView.dockManager.dock(f,o.DOCK_TYPE.DOWN,h,"",Ke.PC_PLOT),this.openedViewers.push(f);const m=this.getOutputNameForScatterPlot(c,l,n.variedInputs.length),v=1===n.variedInputs.length?o.Viewer.lineChart(l,this.getLineChartOpt(c)):o.Viewer.scatterPlot(l,this.getScatterOpt(c,m));this.openedViewers.push(v),this.comparisonView.dockManager.dock(v,o.DOCK_TYPE.DOWN,this.tableDockNode,"",Ke.GRAPH),this.gridSubscription=this.comparisonView.grid.onCellClick.subscribe((n=>{var i;const s=u[null!==(i=n.tableRowIndex)&&void 0!==i?i:0],r=[...s.outputParams.values()].filter((t=>o.TYPES_SCALAR.has(t.property.propertyType))),l=o.HtmlTable.create(r,(t=>{var e;return[null!==(e=t.property.caption)&&void 0!==e?e:t.property.name,s.outputs[t.property.name],t.property.options.units]})).root,c=[...s.outputParams.values()].filter((t=>t.property.propertyType===o.TYPE.DATA_FRAME)).reduce(((t,e)=>{var n;const i=Vt(e.property).config,r=s.outputs[e.name],l=null!==(n=e.property.caption)&&void 0!==n?n:e.property.name;return i.map((e=>{const n=e.type,i=o.Viewer.fromType(n,r);i.setOptions(e),a()(i.root).css({width:"100%"}),t[l]?t[l].push(i.root):t[l]=[i.root]})),t}),{});let d,p;r.length>0?(p=1,d=Object.assign({"Output scalars":[l]},c)):(p=0,d=Object.assign({},c));const h=e.accordion();a()(h.root).css({width:"100%"}),Object.entries(d).map((t=>{h.addPane(t[0],(()=>e.divV(t[1])))})),h.panes[p].expanded=!0,t.shell.o=h.root}))}))}runGridAnalysis(){return en(this,void 0,void 0,(function*(){var n,i;const s=Object.keys(this.store.inputs).reduce(((t,e)=>{switch(this.store.inputs[e].type){case o.TYPE.INT:case o.TYPE.BIG_INT:const n=this.store.inputs[e],i=(n.max.value-n.min.value)/(n.lvl.value-1);t[e]=n.isChanging.value?Array.from({length:n.lvl.value},((t,e)=>Math.round(n.min.value+e*i))):[n.const.value];break;case o.TYPE.FLOAT:const s=this.store.inputs[e],r=(s.max.value-s.min.value)/(s.lvl.value-1);t[e]=s.isChanging.value?Array.from({length:s.lvl.value},((t,e)=>s.min.value+e*r)):[s.const.value];break;case o.TYPE.BOOL:const a=this.store.inputs[e];t[e]=a.isChanging.value?[a.const.value,!a.const.value]:[a.const.value];break;default:const l=this.store.inputs[e];t[e]=[l.const.value]}return t}),{});let r=Object.values(s)[0].map((t=>[t]));for(let t=1;t<Object.values(s).length;t++){const e=Object.values(s)[t],n=[];for(const t of r)for(const i of e)n.push([...t,i]);r=n}const l=r.map((t=>this.func.prepare(this.func.inputs.map(((t,e)=>({name:t.name,idx:e}))).reduce(((e,{name:n,idx:i})=>(e[n]=t[i],e)),{})))),u=yield He(l);this.closeOpenedViewers();const c=[],d=u.length,p=this.getFixedInputColumns(d);for(const t of Object.keys(this.store.inputs)){const e=this.store.inputs[t],i=e.prop;e.isChanging.value&&c.push(o.Column.fromType(i.propertyType,null!==(n=i.caption)&&void 0!==n?n:i.name,d))}const h=[...c],f=h.length,m=o.DataFrame.fromColumns([h[0]]);for(let t=1;t<f;++t)h[t].name=m.columns.getUnusedName(h[t].name),m.columns.add(h[t]);for(let t=0;t<d;++t)for(const e of Object.keys(this.store.inputs)){const n=this.store.inputs[e],o=n.prop;n.isChanging.value&&m.set(null!==(i=o.caption)&&void 0!==i?i:o.name,t,u[t].inputs[e])}const v=this.getOutputsOfInterest(),g=Ge(u,v).columns;for(const t of g)h.forEach((e=>{e.name===t.name&&(e.name=`${e.name} (input)`,t.name=`${t.name} (output)`)})),t.name=m.columns.getUnusedName(t.name),m.columns.add(t);const y=m.columns.names();for(const t of p)t.name=m.columns.getUnusedName(`${t.name} (fixed)`),m.columns.add(t);this.comparisonView.dataFrame=m,this.gridSubscription=this.comparisonView.grid.onCellClick.subscribe((n=>{var i;const s=u[null!==(i=n.tableRowIndex)&&void 0!==i?i:0],r=[...s.outputParams.values()].filter((t=>o.TYPES_SCALAR.has(t.property.propertyType))),l=o.HtmlTable.create(r,(t=>{var e;return[null!==(e=t.property.caption)&&void 0!==e?e:t.property.name,s.outputs[t.property.name],t.property.options.units]})).root,c=[...s.outputParams.values()].filter((t=>t.property.propertyType===o.TYPE.DATA_FRAME)).reduce(((t,e)=>{var n;const i=Vt(e.property).config,r=s.outputs[e.name],l=null!==(n=e.property.caption)&&void 0!==n?n:e.property.name;return i.map((e=>{const n=e.type,i=o.Viewer.fromType(n,r);i.setOptions(e),a()(i.root).css({width:"100%"}),t[l]?t[l].push(i.root):t[l]=[i.root]})),t}),{});let d,p;r.length>0?(p=1,d=Object.assign({"Output scalars":[l]},c)):(p=0,d=Object.assign({},c));const h=e.accordion();a()(h.root).css({width:"100%"}),Object.entries(d).map((t=>{h.addPane(t[0],(()=>e.divV(t[1])))})),h.panes[p].expanded=!0,t.shell.o=h.root})),this.comparisonView.grid.columns.setVisible([y[0]]),this.comparisonView.grid.columns.setVisible(y),this.comparisonView.grid.props.rowHeight=25;const b=o.Viewer.correlationPlot(m,{xColumnNames:y,yColumnNames:y}),A=this.comparisonView.dockManager.dock(b,o.DOCK_TYPE.LEFT,this.tableDockNode,"",Ke.COR_PLOT);this.openedViewers.push(b);const C=o.Viewer.pcPlot(m,{columnNames:y});this.comparisonView.dockManager.dock(C,o.DOCK_TYPE.DOWN,A,"",Ke.PC_PLOT),this.openedViewers.push(C);const w=this.getOutputNameForScatterPlot(y,m,c.length),I=1===c.length?o.Viewer.lineChart(m,this.getLineChartOpt(y)):o.Viewer.scatterPlot(m,this.getScatterOpt(y,w));this.openedViewers.push(I),this.comparisonView.dockManager.dock(I,o.DOCK_TYPE.DOWN,this.tableDockNode,"",Ke.GRAPH)}))}getOutputNameForScatterPlot(t,e,n){var i,o,s,r;for(let a=n;a<t.length;++a)if((null!==(o=null===(i=e.col(t[a]))||void 0===i?void 0:i.min)&&void 0!==o?o:0)<(null!==(r=null===(s=e.col(t[a]))||void 0===s?void 0:s.max)&&void 0!==r?r:0))return t[a];return t[n]}getOutputsOfInterest(){const t=[];for(const e of Object.keys(this.store.outputs)){const n=this.store.outputs[e];if(n.isInterest.value){let e;switch(n.value.returning){case rn.LAST_ROW:e=-1;break;case rn.FIRST_ROW:e=0;break;default:e=null}t.push({prop:n.prop,value:{row:e,colName:n.value.colName,colValue:n.value.colValue}})}}return t}getScatterOpt(t,e){return{xColumnName:t[0],yColumnName:t[1],color:e,size:e,markerMaxSize:12,jitterSize:5}}getLineChartOpt(t){return{xColumnName:t[0],yColumnNames:t.slice(1,Math.min(t.length,8)),markerSize:1,markerType:o.MARKER_TYPE.GRADIENT,sharex:!0,multiAxis:!0,multiAxisLegendPosition:"RightCenter"}}getBarChartOpt(t,e,n){return{description:t,splitColumnName:e,valueColumnName:n,valueAggrType:o.AGG.AVG,showTitle:!1,showCategorySelector:!1,showStackSelector:!1,showValueAxis:!1}}}var un,cn=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};!function(t){t.INPUTS="inputs",t.OUTPUTS="outputs"}(un||(un={}));const dn={[un.INPUTS]:"inputParams",[un.OUTPUTS]:"outputParams"},pn=()=>e.divText("[No data to display]",{style:{"text-align":"center","align-content":"center",width:"100%",height:"100%"}});class hn extends ve{static fromFuncCall(t,e={historyEnabled:!0,isTabbed:!1}){return new this(t,e)}constructor(t,n={historyEnabled:!0,isTabbed:!1}){super(t,n),this.options=n,this.validationRequests=new c.Subject,this.validationUpdates=new c.Subject,this.runRequests=new c.Subject,this.isRunning=new c.BehaviorSubject(!1),this.isUploadMode=new c.BehaviorSubject(!1),this.inputsOverride={},this.inputsMap={},this.validators={},this.validationState={},this.externalValidatorsUpdates=new c.Subject,this.externalValidatorsState={},this.pendingValidations=this.validationUpdates.pipe((0,s.startWith)(null),(0,s.map)((()=>this.validationState))),this._isOutputOutdated=new c.BehaviorSubject(!0),this.isOutputOutdated=this._isOutputOutdated.pipe((0,s.distinctUntilChanged)()),this.blockRuns=new c.BehaviorSubject(!1),this.prevOpenedTab=null,this.beforeInputPropertyRender=new c.Subject,this.afterInputPropertyRender=new c.Subject,this.afterOutputPropertyRender=new c.Subject,this.afterOutputSacalarTableRender=new c.Subject,this.formButtons=e.div(),this.additionalBtns=[],this.navBtns=[],this.tabsElem=e.tabControl(),this.dfToViewerMapping={},this.focusedInput=null,this.foldedCategoryInputs={},this.sheetNamesCache={},this.richFunctionExport=t=>cn(this,void 0,void 0,(function*(){if("Excel"===t)try{const e=this.lastCall;if(!e)throw new Error("Function was not called");if(!this.exportConfig.supportedFormats.includes(t))throw new Error(`Format "${t}" is not supported.`);if(!this.func)throw new Error("The correspoding function is not specified");yield o.Utils.loadJsCss(["/js/common/exceljs.min.js"]);const n=window.ExcelJS,i="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8",s=new n.Workbook,r=t=>o.TYPES_SCALAR.has(t),a=t=>t.propertyType===o.TYPE.DATA_FRAME,l=this.func.inputs.filter((t=>a(t))),u=this.func.inputs.filter((t=>r(t.propertyType))),c=this.func.outputs.filter((t=>a(t))),d=this.func.outputs.filter((t=>r(t.propertyType)));if(l.forEach((t=>{var n;const i=t.options.caption||t.name,o=null!==(n=s.worksheets.find((t=>t.name===this.getSheetName(i,s))))&&void 0!==n?n:s.addWorksheet(this.getSheetName(i,s)),r=e.inputs[t.name];st(o,r)})),u.length){const t=s.addWorksheet("Input scalars");it(t,u.map((t=>{var n,i,o;return{caption:null!==(n=t.options.caption)&&void 0!==n?n:t.name,value:null!==(i=e.inputs[t.name])&&void 0!==i?i:"",units:null!==(o=t.options.units)&&void 0!==o?o:""}})))}if(c.forEach((t=>{var n;const i=t.options.caption||t.name,o=null!==(n=s.worksheets.find((t=>t.name===this.getSheetName(i,s))))&&void 0!==n?n:s.addWorksheet(this.getSheetName(i,s)),r=e.outputs[t.name];st(o,r)})),d.length){const t=s.addWorksheet("Output scalars");it(t,d.map((t=>{var n,i,o;return{caption:null!==(n=t.options.caption)&&void 0!==n?n:t.name,value:null!==(i=e.outputs[t.name])&&void 0!==i?i:"",units:null!==(o=t.options.units)&&void 0!==o?o:""}})))}const p=this.tabsElem;for(const t of this.inputTabsLabels)for(const n of this.categoryToDfParamMap.inputs[t].filter((t=>a(t)))){const i=this.dfToViewerMapping[n.name].filter((t=>t.type!==o.VIEWER.GRID)).filter((t=>Object.values(m).includes(t.type)));if(0===i.length)continue;p.currentPane=p.getPane(t),yield new Promise((t=>setTimeout(t,100)));const r=n.options.caption||n.name,a=e.inputs[n.name];for(const[t,e]of i.entries())yield rt(s,s.getWorksheet(this.getSheetName(r,s)),e.root,a.columns.length+2,t>0?Math.ceil(i[t-1].root.clientHeight/20)+1:0)}for(const t of this.outputTabsLabels)for(const n of this.categoryToDfParamMap.outputs[t].filter((t=>a(t)))){const i=this.dfToViewerMapping[n.name].filter((t=>t.type!==o.VIEWER.GRID)).filter((t=>Object.values(m).includes(t.type)));if(0===i.length)continue;p.currentPane=p.getPane(t),yield new Promise((t=>setTimeout(t,100)));const r=n.options.caption||n.name,a=e.outputs[n.name];for(const[t,e]of i.entries())if(e.type===o.VIEWER.STATISTICS){const e=a.columns.length,n=o.DataFrame.fromColumns([o.Column.string("Name",e).init((t=>a.columns.byIndex(t).name)),o.Column.int("Values",e).init((t=>a.columns.byIndex(t).stats.valueCount)),o.Column.int("Nulls",e).init((t=>a.columns.byIndex(t).stats.missingValueCount)),o.Column.float("Min",e).init((t=>a.columns.byIndex(t).stats.min)),o.Column.float("Max",e).init((t=>a.columns.byIndex(t).stats.max)),o.Column.float("Avg",e).init((t=>a.columns.byIndex(t).stats.avg)),o.Column.float("Stdev",e).init((t=>a.columns.byIndex(t).stats.stdev))]);st(s.getWorksheet(this.getSheetName(r,s)),n,a.columns.length+2,t>0?Math.ceil(i[t-1].root.clientHeight/20)+1:0)}else yield rt(s,s.getWorksheet(this.getSheetName(r,s)),e.root,a.columns.length+2,t>0?Math.ceil(i[t-1].root.clientHeight/20)+1:0)}const h=yield s.xlsx.writeBuffer();return new Blob([h],{type:i})}catch(t){console.log(t)}if("DataUrl images"===t){const t={},e=t=>t.propertyType===o.TYPE.DATA_FRAME,n=this.tabsElem;yield o.Utils.loadJsCss(["/js/common/html2canvas.min.js"]);const i=window.html2canvas;for(const s of this.tabsLabels.filter((t=>this.inputTabsLabels.includes(t))))for(const r of this.categoryToDfParamMap.inputs[s].filter((t=>e(t)))){const e=this.dfToViewerMapping[r.name].filter((t=>t.type!==o.VIEWER.GRID&&t.type!==o.VIEWER.STATISTICS)).filter((t=>Object.values(m).includes(t.type)));if(0!==e.length){n.currentPane=n.getPane(s),yield new Promise((t=>setTimeout(t,100)));for(const[n,o]of e.entries()){const e=(yield i(o.root,{logging:!1})).toDataURL();t[r.name]||(t[r.name]={}),t[r.name][n]={dataUrl:e,width:o.root.clientWidth,height:o.root.clientHeight}}}}for(const s of this.tabsLabels.filter((t=>this.outputTabsLabels.includes(t))))for(const r of this.categoryToDfParamMap.outputs[s].filter((t=>e(t)))){const e=this.dfToViewerMapping[r.name].filter((t=>t.type!==o.VIEWER.GRID&&t.type!==o.VIEWER.STATISTICS)).filter((t=>Object.values(m).includes(t.type)));if(0!==e.length){n.currentPane=n.getPane(s),yield new Promise((t=>setTimeout(t,100)));for(const[n,o]of e.entries()){const e=(yield i(o.root,{logging:!1})).toDataURL();t[r.name]||(t[r.name]={}),t[r.name][n]={dataUrl:e,width:o.root.clientWidth,height:o.root.clientHeight}}}}return new Blob([JSON.stringify(t)],{type:"text/plain"})}throw new Error("Format is not supported")})),this.exportConfig={supportedExtensions:this.richFunctionViewExportExtensions(),supportedFormats:this.richFunctionViewSupportedFormats(),export:this.richFunctionExport,filename:this.defaultExportFilename}}onFuncCallReady(){const n=Object.create(null,{onFuncCallReady:{get:()=>super.onFuncCallReady}});return cn(this,void 0,void 0,(function*(){yield this.loadInputsOverrides(),yield this.loadInputsValidators(),yield n.onFuncCallReady.call(this);const i=this.funcCallReplaced.subscribe((()=>this.validationRequests.next({isRevalidation:!1})));this.subs.push(i);const o=this.validationRequests.pipe((0,s.groupBy)((t=>t.field)),(0,s.mergeMap)((t=>t.pipe((0,s.tap)((t=>this.setValidationPending(t.field))),(0,s.switchMap)((t=>{const e=new AbortController,n=e.signal;let i=!1;return new c.Observable((o=>{const s=(0,c.from)(this.runValidation(Object.assign({},t),n)).subscribe((t=>{i=!0,o.next(t)}));return()=>{i||e.abort(),s.unsubscribe()}})).pipe((0,s.tap)((e=>{this.setValidationResults(e),this.runRevalidations(t,e),this.validationUpdates.next(null)})),(0,s.mapTo)(t))})))))).subscribe((t=>{t.field&&this.runningOnInput&&this.isRunnable()&&this.doRun()}));this.subs.push(o);const r=this.externalValidatorsUpdates.subscribe((t=>{this.updateInputValidationReuslts(t)}));this.subs.push(r);const a=(0,c.combineLatest)([this.runRequests.pipe((0,s.switchMap)((()=>(0,c.of)(!1).pipe((0,s.delay)(500),(0,s.startWith)(!0))))),this.validationUpdates.pipe((0,s.debounceTime)(0))]).pipe((0,s.filter)((([t])=>t&&this.isRunnable()))).subscribe((()=>this.doRun()));this.subs.push(a);const l=this.options.isTabbed?null:yield this.loadLastInputs();if(l)t.shell.info(e.div([e.divText("Do you want to load last inputs?"),e.divH([e.bigButton("Load",(()=>{for(const[t,e]of Object.entries(l)){const n=this.getInput(t);n.notify=!1,n.value=e,n.notify=!0}t.shell.info(e.divText("Change the loaded inputs to run computations"))}))])]));else{const t=new AbortController,e=yield this.runValidation({isRevalidation:!1},t.signal);this.setValidationResults(e),this.runRevalidations({isRevalidation:!1},e),this.validationUpdates.next(null),this.runningOnStart&&this.isRunnable()&&(yield this.doRun())}}))}onBeforeRun(){return this.tabsElem.currentPane&&(this.prevOpenedTab=this.inputTabsLabels.includes(this.tabsElem.currentPane.name)?null:this.tabsElem.currentPane),Promise.resolve()}onAfterRun(){if(this.showOutput(),this.tabsElem.panes.forEach((t=>{a()(t.header).show()})),this.prevOpenedTab)return this.tabsElem.currentPane=this.prevOpenedTab,Promise.resolve();const t=this.tabsElem.panes.find((t=>this.outputTabsLabels.includes(t.name)));return t&&(this.tabsElem.currentPane=t),Promise.resolve()}getRunButton(t="Run"){var n;const i=e.bigButton(null!==(n=this.func.options.runLabel)&&void 0!==n?n:t,(()=>cn(this,void 0,void 0,(function*(){return yield this.doRun()})))),o=(0,c.merge)(this.validationUpdates,this.externalValidatorsUpdates,this.isRunning,this.blockRuns).subscribe((()=>{const t=this.isRunnable();i.disabled=!t}));return this.subs.push(o),i}loadInputsOverrides(){return cn(this,void 0,void 0,(function*(){const e=[...this.funcCall.inputParams.values()];yield Promise.all(e.map((e=>cn(this,void 0,void 0,(function*(){if(e.property.options.input){const n=(yield t.functions.eval(e.property.options.input)).prepare({params:JSON.parse(e.property.options.inputOptions||"{}")});yield n.call(),this.inputsOverride[e.name]=n.outputs.input}})))))}))}loadInputsValidators(){return cn(this,void 0,void 0,(function*(){const e=[...this.funcCall.inputParams.values()];yield Promise.all(e.map((e=>cn(this,void 0,void 0,(function*(){if(e.property.options.validatorFunc){const n=(yield t.functions.eval(e.property.options.validatorFunc)).prepare({params:JSON.parse(e.property.options.validatorFuncOptions||"{}")});yield n.call(),this.validators[e.name]=n.outputs.validator}})))))}))}keepOutput(){var t;return"true"===(null===(t=this.func)||void 0===t?void 0:t.options.keepOutput)}getSaveButton(t="Save"){const n=e.bigButton(t,(()=>cn(this,void 0,void 0,(function*(){return yield this.saveExperimentalRun(this.funcCall)}))),"Save uploaded data"),i=this.isUploadMode.subscribe((t=>{this.buildRibbonPanels(),t?a()(n).show():a()(n).hide()}));return this.subs.push(i),n}getStandardButtons(){const t=this.getRunButton(),n=e.div([t]);e.tooltip.bind(n,(()=>t.disabled?this.isRunning.value?"Computations are in progress":this.getValidationMessage():""));const i=this.getSaveButton();return[...this.isHistoryEnabled&&!this.options.isTabbed?[i]:[],...this.runningOnInput?[]:[n]]}buildFormButtons(){var t;const n=this.getStandardButtons(),i=e.buttonsInput();return a()(i.firstChild).css({display:"none"}),null===(t=i.lastChild)||void 0===t||t.replaceWith(e.div([...this.navBtns,...this.additionalBtns,...n],"ui-input-editor")),a()(i).addClass("rfv-buttons"),a()(i).css({"max-width":"100%"}),this.formButtons.replaceWith(i),this.formButtons=i,i}setAdditionalButtons(t){this.additionalBtns=t,this.buildFormButtons()}setNavigationButtons(t){this.navBtns=t}buildIO(){const{inputBlock:t,inputForm:n,outputForm:i,controlsWrapper:o}=this.buildInputBlock(),s=[...Array.from(n.childNodes),...this.isUploadMode.value?[Array.from(i.childNodes)]:[]];e.tools.handleResize(t,(()=>{a()(t).width()<300?(a()(n).addClass("ui-form-condensed"),a()(i).addClass("ui-form-condensed"),a()(o).addClass("ui-form-condensed"),s.forEach((t=>a()(t).css("min-width","100px")))):(a()(n).removeClass("ui-form-condensed"),a()(i).removeClass("ui-form-condensed"),a()(o).removeClass("ui-form-condensed"),s.forEach((t=>a()(t).css("min-width","100%"))))}));const r=this.buildOutputBlock();r.style.height="100%",r.style.width="100%",this.hideOutput();const l=e.splitH([t,e.panel([r],{style:{"padding-top":"0px"}})],null,!0);return l.style.padding="0 12px",t.style.maxWidth="360px",l}buildInputBlock(){const t=this.renderInputForm(),n=this.renderOutputForm();this.buildFormButtons();const i=e.div(this.formButtons,"ui-form ui-form-wide");a()(i).css({"padding-left":"0px","padding-bottom":"0px","padding-right":"6px","max-width":"100%","min-height":"50px"});const o=e.switchInput("",this.isUploadMode.value,(t=>this.isUploadMode.next(t))),s=this.isUploadMode.subscribe((t=>{o.notify=!1,o.value=t,o.notify=!0,t?a()(n).show():a()(n).hide()}));return this.subs.push(s),{inputBlock:e.divV([t,...this.hasUploadMode&&!this.uploadFunc?[e.divH([e.h2("Experimental data"),o.root],{style:{"flex-grow":"0"}}),n]:[],i],"ui-box rfv-form"),inputForm:t,outputForm:n,controlsWrapper:i}}processCustomDataUpload(){return cn(this,void 0,void 0,(function*(){const n=()=>{const t=o.Dialog.create({title:"Select to compare"}),n=new Ht(p.length>0?p:[...this.historyBlock.history.values()],{fallbackText:"No historical runs found",showActions:!(p.length>0),showBatchActions:!(p.length>0)}),i=new Ht(d,{fallbackText:"No runs uploaded",showActions:!1,showBatchActions:!1});t.add(e.divV([e.divV([e.label("Uploaded runs"),e.element("div","splitbar-horizontal"),i.root],{style:{height:"50%","overflow-y":"hidden"}}),e.divV([e.label(p.length>0?"Simulated":"History",{style:{padding:"0px 10px 0px 9px"}}),e.element("div","splitbar-horizontal"),n.root],{style:{height:"50%","overflow-y":"hidden"}})],{style:{"justify-content":"space-between",gap:"10px","overflow-y":"scroll",height:"100%"}})),a()(t.root.querySelector(".d4-dialog-contents")).removeClass("ui-form");const s="Compare selected";return 0===p.length?t.addButton(s,(()=>cn(this,void 0,void 0,(function*(){const e=yield Promise.all([...n.selected].map((t=>dt.loadRun(t.id))));this.onComparisonLaunch([...e,...i.selected.values()]),t.close()})))):t.addButton(s,(()=>cn(this,void 0,void 0,(function*(){this.onComparisonLaunch([...n.selected.values(),...i.selected.values()]),t.close()})))),t.getButton(s).disabled=!0,this.subs.push((0,c.merge)(n.onSelectedChanged,i.onSelectedChanged).subscribe((()=>{n.selected.size+i.selected.size>1?t.getButton(s).disabled=!1:t.getButton(s).disabled=!0}))),this.isHistorical.value&&t.addButton(g,(()=>cn(this,void 0,void 0,(function*(){this.onComparisonLaunch([this.funcCall,...i.selected.values()]),t.close()})))),a()(t.getButton("CANCEL")).hide(),t},i=yield t.functions.eval(this.uploadFunc),r=yield i.prepare({params:{func:this.func}}).call(),l=r.outputs.uploadWidget,u=r.outputs.uploadFuncCall;let d=[],p=[];const h=o.Dialog.create({title:"Upload"});a()(h.root.querySelector(".d4-dialog-contents")).removeClass("ui-form");const m=o.Dialog.create({title:"Review uploaded runs"});a()(m.root.querySelector(".d4-dialog-contents")).removeClass("ui-form");const v="Save to history",g="Compare w/ current";h.add(l.root),h.addButton(v,(()=>cn(this,void 0,void 0,(function*(){return Lt(h.root,!0),d.forEach((t=>{t.options.immutable_tags?t.options.immutable_tags.push(C):t.options.immutable_tags=[C]})),Promise.all(d.map((t=>cn(this,void 0,void 0,(function*(){const e=yield this.getValidExpRun(t);return dt.saveRun(e)}))))).then((t=>Promise.all(t.map((t=>dt.loadRun(t.id)))))).then((t=>{t.forEach((t=>this.historyBlock.addRun(t)))})).catch((e=>{t.shell.error(e)})).finally((()=>{Lt(h.root,!1),h.close();const t=new Ht(d,{fallbackText:"No runs uploaded",showActions:!0,showBatchActions:!0});m.add(t),m.show({modal:!0,fullScreen:!0})}))})))),h.addButton("Next",(()=>{h.close(),d.forEach((t=>{t.options.immutable_tags?t.options.immutable_tags.push(C):t.options.immutable_tags=[C]}));const t=new Ht(d,{fallbackText:"No runs uploaded",showActions:!0,showBatchActions:!0});m.add(t.root),m.show({modal:!0,fullScreen:!0})})),a()(h.getButton("CANCEL")).hide(),h.getButton(v).disabled=!0,h.getButton("Next").disabled=!0,a()(m.getButton("CANCEL")).hide(),m.addButton("Simulate w/ same inputs",(()=>{Lt(h.root,!0),Promise.all(d.map((t=>this.func.prepare((t=>{const e=t.clone(),n=f()(t.outputParams.values()).filter((e=>e.property.propertyType===o.TYPE.DATA_FRAME&&!!t.outputs[e.name]));for(const i of n)e.outputs[i.name]=t.outputs[i.name].clone();const i=f()(t.inputParams.values()).filter((e=>e.property.propertyType===o.TYPE.DATA_FRAME&&!!t.inputs[e.name]));for(const n of i)e.inputs[n.name]=t.inputs[n.name].clone();return e})(t).inputs).call()))).then((t=>{p=t,m.close(),n().show({modal:!0,fullScreen:!0})})).catch((e=>{t.shell.error(e)})).finally((()=>{Lt(h.root,!1)}))})),m.addButton("Compare w/ history",(()=>{m.close(),n().show({modal:!0,fullScreen:!0})}));const y=t.functions.onAfterRunAction.pipe((0,s.filter)((t=>t.id===u.id))).subscribe((()=>{d=u.outputs.uploadedCalls,h.getButton(v).disabled=!1,h.getButton("Next").disabled=!1})),b=h.onClose.subscribe((()=>{this.isUploadMode.next(!1)}));h.subs.push(b,y),h.show({modal:!0,center:!0,resizable:!0})}))}onSaveClick(){return cn(this,void 0,void 0,(function*(){this.isUploadMode.value?yield this.saveExperimentalRun(this.funcCall):yield this.saveRun(this.funcCall)}))}buildRibbonPanels(){super.buildRibbonPanels();const n=e.iconFA("play",(()=>cn(this,void 0,void 0,(function*(){return yield this.doRun()}))),"Run computations");n.classList.add("fas");const i=e.iconFA("arrow-to-top",(()=>cn(this,void 0,void 0,(function*(){this.uploadFunc?yield this.processCustomDataUpload():(this.isUploadMode.next(!this.isUploadMode.value),i.classList.toggle("d4-current"))}))),"Upload experimental data");i.classList.add("d4-toggle-button",...this.isUploadMode.value?["d4-current"]:[]);const o=e.iconFA("analytics",(()=>cn(this,void 0,void 0,(function*(){return yield this.onSALaunch()}))),"Run sensitivity analysis"),s=e.iconFA("info",(()=>cn(this,void 0,void 0,(function*(){this.hasContextHelp&&(t.shell.windows.help.visible=!0,yield new Promise((t=>setTimeout(t,100))),t.shell.windows.help.showHelp(e.markdown(yield this.getContextHelp())))})))),r=[[...super.buildRibbonPanels().flat(),...this.runningOnInput||this.options.isTabbed?[]:[n],...this.hasUploadMode?[i]:[],...this.isSaEnabled?[o]:[],...this.hasContextHelp?[s]:[]]];return this.setRibbonPanels(r),r}showOutput(){e.setDisplay(this.tabsElem.root,!0),this._isOutputOutdated.next(!1)}buildOutputBlock(){this.tabsElem.root.style.width="100%",this.tabsLabels.forEach((n=>{const[i,r]=this.categoryToDfParamMap.outputs[n]?[this.categoryToDfParamMap.outputs[n],!1]:[this.categoryToDfParamMap.inputs[n],!0],l=i.filter((t=>t.propertyType===o.TYPE.DATA_FRAME||t.propertyType===o.TYPE.GRAPHICS)),u=i.filter((t=>t.propertyType!==o.TYPE.DATA_FRAME&&t.propertyType!==o.TYPE.GRAPHICS)),d=l.map((t=>nt(t).config));let p="";const h=l.reduce(((n,i,l)=>{var u,c;this.dfToViewerMapping[i.name]=[];const h=d[l].map(((n,s)=>cn(this,void 0,void 0,(function*(){var s,r,a,l;const u=null!==(l=null!==(r=null===(s=this.funcCall.outputs[i.name])||void 0===s?void 0:s.value)&&void 0!==r?r:null===(a=this.funcCall.inputParams[i.name])||void 0===a?void 0:a.value)&&void 0!==l?l:t.data.demo.demog(0),c=n.type,d=Object.values(m).includes(c)?o.Viewer.fromType(c,u):yield u.plot.fromType(c);d.setOptions(n),this.dfToViewerMapping[i.name].push(d),this.afterOutputPropertyRender.next({prop:i,output:d});const p=pn();return 0===u.rowCount&&"demog 0"===u.name&&(e.setDisplay(d.root,!1),e.setDisplay(p,!0)),{viewer:d,stub:p}})))).map(((t,n)=>t.then((({viewer:t,stub:o})=>{const r=this.funcCallReplaced.pipe((0,s.startWith)(null),(0,s.switchMap)((()=>{var t;return(null!==(t=this.funcCall.outputParams[i.name])&&void 0!==t?t:this.funcCall.inputParams[i.name]).onChanged.pipe((0,s.startWith)(null))})),(0,s.skip)(1)).subscribe((()=>cn(this,void 0,void 0,(function*(){var s;const r=null!==(s=this.funcCall.outputParams[i.name])&&void 0!==s?s:this.funcCall.inputParams[i.name];if(r.value){if(e.setDisplay(t.root,!0),e.setDisplay(o,!1),Object.values(m).includes(t.type))t.dataFrame=r.value;else{const e=yield r.value.plot.fromType(t.type);t.root.replaceWith(e.root),t=e}Object.keys(d[l][n]).includes("color")&&t.setOptions({color:d[l][n].color}),this.afterOutputPropertyRender.next({prop:i,output:t})}else e.setDisplay(t.root,!1),e.setDisplay(o,!0)}))));return this.subs.push(r),{loadedViewer:t,stub:o}})))),f=p!==(null!==(u=i.options.caption)&&void 0!==u?u:i.name)?null!==(c=i.options.caption)&&void 0!==c?c:i.name:" ";if(p=f,r){const t=this.funcCallReplaced.pipe((0,s.switchMap)((()=>{var t;return(null!==(t=this.funcCall.outputParams[i.name])&&void 0!==t?t:this.funcCall.inputParams[i.name]).onChanged}))).subscribe((()=>{this.showOutput(),this.inputTabsLabels.forEach((t=>{a()(this.tabsElem.getPane(t).header).show()}))}));this.subs.push(t)}const v=h.map(((t,n)=>{const i=d[l][n].block,o=e.wait((()=>cn(this,void 0,void 0,(function*(){const n=yield t;return a()(n.loadedViewer.root).css({height:"100%",width:"100%"}),e.divV([n.loadedViewer.root,n.stub],{style:{width:"100%"}})}))));return a()(o).css({"min-height":"300px","flex-grow":"1"}),e.divV([e.h2(0===n?f:" ",{style:{"white-space":"pre"}}),o],{style:Object.assign({},i?{width:`${i}%`,"max-width":`${i}%`,"max-height":"100%"}:{"flex-grow":"1"})})}));if(i.propertyType===o.TYPE.GRAPHICS){const t=i.options.block,o=pn();o.classList.add("grok-scripting-image-container");const r=e.divV([e.h2(f,{style:{"white-space":"pre"}}),o],{style:Object.assign({},t?{width:`${t}%`,"max-width":`${t}%`,"max-height":"100%"}:{"flex-grow":"1"})}),a=()=>{var t;const e=null!==(t=this.funcCall.outputParams[i.name])&&void 0!==t?t:this.funcCall.inputParams[i.name];e.value?(o.style.backgroundImage=`url("data:image/png;base64,${e.value}")`,o.textContent=""):(o.style.removeProperty("background-image"),o.textContent="[No data to display]")},l=this.funcCallReplaced.pipe((0,s.startWith)(null),(0,s.switchMap)((()=>{var t;return(null!==(t=this.funcCall.outputParams[i.name])&&void 0!==t?t:this.funcCall.inputParams[i.name]).onChanged.pipe((0,s.startWith)(null))})),(0,s.skip)(1)).subscribe(a);this.subs.push(l),n.append(r)}return n.append(...v),n}),e.divH([],{style:{"flex-wrap":"wrap","flex-grow":"1","max-height":"100%"}})),f=()=>{const t=o.HtmlTable.create(u,(t=>{var e;const n=t.options.precision,i=n&&t.propertyType===o.TYPE.FLOAT&&this.funcCall.outputs[t.name]?this.funcCall.outputs[t.name].toPrecision(n):this.funcCall.outputs[t.name],s=t.options.units?` [${t.options.units}]`:"";return[`${null!==(e=t.caption)&&void 0!==e?e:t.name}${s}`,null!=i?i:"[No value]"]})).root;return a()(t).addClass("rfv-scalar-table"),this.afterOutputSacalarTableRender.next(t),t};let v=f();const g=(0,c.merge)(this.funcCallReplaced,this.isRunning.pipe((0,s.filter)((t=>!1===t)),(0,s.skip)(1))).subscribe((()=>{const t=f();v.replaceWith(t),v=t,a()(this.tabsElem.getPane(n).header).show()}));this.subs.push(g),this.tabsElem.addPane(n,(()=>e.divV([...l.length?[h]:[],...u.length?[v]:[]])))}));const n=e.box();return n.append(this.tabsElem.root),n}onAfterLoadRun(t){return cn(this,void 0,void 0,(function*(){this.showOutput()}))}get tabsLabels(){return[...this.inputTabsLabels,...this.outputTabsLabels]}get outputTabsLabels(){return Object.keys(this.categoryToDfParamMap.outputs)}get inputTabsLabels(){return Object.keys(this.categoryToDfParamMap.inputs)}get categoryToDfParamMap(){const t={inputs:{},outputs:{}};return this.func.inputs.filter((t=>t.propertyType===o.TYPE.DATA_FRAME&&0!==nt(t).config.length)).forEach((e=>{const n="Misc"===e.category?"Input":e.category;t.inputs[n]?t.inputs[n].push(e):t.inputs[n]=[e]})),this.func.outputs.forEach((e=>{const n="Misc"===e.category?"Output":e.category;e.propertyType===o.TYPE.DATA_FRAME&&0===nt(e).config.length||(t.outputs[n]?t.outputs[n].push(e):t.outputs[n]=[e])})),t}get inputsStorage(){return`RFV_LastInputs_${this.funcCall.func.name}`}saveLastInputs(){return cn(this,void 0,void 0,(function*(){try{const e=yield f()(this.funcCall.inputParams.values()).reduce(((e,n)=>cn(this,void 0,void 0,(function*(){const i=n.property.propertyType!==o.TYPE.DATA_FRAME?this.funcCall.inputs[n.name]:yield t.dapi.tables.uploadDataFrame(this.funcCall.inputs[n.name]);return Object.assign(Object.assign({},yield e),{[n.name]:JSON.stringify(i)})}))),Promise.resolve({}));return yield t.dapi.userDataStorage.put(this.inputsStorage,e)}catch(e){t.shell.error(e.toString())}}))}loadLastInputs(){return cn(this,void 0,void 0,(function*(){try{const e=yield t.dapi.userDataStorage.get(this.inputsStorage);return 0===Object.keys(e).length?null:yield f()(this.funcCall.inputParams.values()).reduce(((n,i)=>cn(this,void 0,void 0,(function*(){const s=i.property.propertyType!==o.TYPE.DATA_FRAME?JSON.parse(e[i.name]):yield t.dapi.tables.getTable(JSON.parse(e[i.name]));return Object.assign(Object.assign({},yield n),{[i.name]:s})}))),Promise.resolve({}))}catch(e){t.shell.error(e.toString())}}))}deleteLastInputs(){return cn(this,void 0,void 0,(function*(){try{return yield t.dapi.userDataStorage.put(this.inputsStorage,{})}catch(e){t.shell.error(e.toString())}}))}doRun(){return cn(this,void 0,void 0,(function*(){this.isRunning.next(!0);try{this.options.isTabbed||(yield this.saveLastInputs()),yield this.run(),this.options.isTabbed||(yield this.deleteLastInputs())}catch(e){t.shell.error(e.toString()),console.log(e)}finally{this.isRunning.next(!1),this.validationRequests.next({isRevalidation:!1,isNewOutput:!0})}}))}setExternalValidationResults(t,e){this.externalValidatorsState[t]=e,this.externalValidatorsUpdates.next(t)}saveInputLockState(t,e,n){"restricted"===n&&(this.funcCall.options[y]=Object.assign(Object.assign({},this.funcCall.options[y]),{[t]:e})),n&&(this.funcCall.options[b]=Object.assign(Object.assign({},this.funcCall.options[b]),{[t]:n})),this.updateConsistencyState()}getInputLockState(t){var e;return null===(e=this.funcCall.options[b])||void 0===e?void 0:e[t]}updateConsistencyState(){const t=Object.values(this.funcCall.options[b]).some((t=>"inconsistent"===t));this.consistencyState.next(t?"inconsistent":"consistent")}getInput(t){return this.inputsMap[t]}setInput(t,e,n){const i=this.getInput(t);if(!i)throw new Error(`No input named ${t}`);if(this.funcCall.inputParams[t].property.propertyType===o.TYPE.DATA_FRAME&&"restricted"===n)throw new Error(`Param ${t} is dataframe. Restricted state is not supported for them.`);n||(n=this.funcCall.inputParams[t].property.propertyType===o.TYPE.DATA_FRAME?"disabled":"restricted"),this.funcCall.inputs[t]=e,this.setInputLockState(i,t,e,n)}getParamChanges(t){const e=this.funcCall.inputParams[t]?"inputParams":"outputParams";return this.funcCallReplaced.pipe((0,s.startWith)(null),(0,s.filter)((()=>!!this.funcCall)),(0,s.switchMap)((()=>this.funcCall[e][t].onChanged.pipe((0,s.startWith)(null)))),(0,s.map)((()=>this.funcCall[e][t].value)))}getParamValue(t){var e,n;const i=(null===(e=this.funcCall)||void 0===e?void 0:e.inputParams[t])?"inputParams":"outputParams";return null===(n=this.funcCall)||void 0===n?void 0:n[i][t].value}setInputLockState(t,e,n,i){i&&this.saveInputLockState(e,n,i),j(t)&&("disabled"===i&&t.setDisabled(),"restricted"===i&&t.setRestricted(),"restricted unlocked"===i&&t.setRestrictedUnlocked(),"inconsistent"===i&&t.setInconsistent(),"user input"===i&&t.setUserInput())}getRestrictedValue(t){var e;return null===(e=this.funcCall.options[y])||void 0===e?void 0:e[t]}renderOutputForm(){return this.renderIOForm(un.OUTPUTS)}onSALaunch(){return cn(this,void 0,void 0,(function*(){yield ln.fromEmpty(this.func)}))}renderInputForm(){return this.renderIOForm(un.INPUTS)}renderIOForm(t){const n=e.divH([],"ui-form ui-form-wide");a()(n).css({"flex-wrap":"wrap","flex-grow":"0","padding-right":"12px","padding-top":"0px","padding-left":"0px","max-width":"100%",gap:"4px"});let i="Misc";const o=this.funcCall[dn[t]].values();return f()(o).filter((t=>!!t)).forEach((e=>{const o=e.property;this.beforeInputPropertyRender.next(o);const s=this.getInputForVal(e);s?(this.inputsMap[e.property.name]=s,t===un.INPUTS&&(this.syncInput(e,s,t),this.checkForMapping(e,s),this.runningOnInput||this.disableInputsOnRun(e.property.name,s),this.bindOnHotkey(s)),this.renderCategory(n,e.property.category,i),this.renderInput(n,e,s),this.afterInputPropertyRender.next({prop:o,input:s}),i=o.category):i=o.category})),Object.keys(this.foldedCategoryInputs).forEach((t=>this.foldedCategoryInputs[t].forEach((t=>a()(t.input.root).hide())))),n.classList.remove("ui-panel"),n}saveFocusedElement(t){this.focusedInput=t}restoreFocusedElement(){var t;null===(t=this.focusedInput)||void 0===t||t.focus()}disableInputsOnRun(t,e){const n=this.isRunning.subscribe((n=>{"user input"!==this.getInputLockState(t)&&this.getInputLockState(t)||(n?(tt(e)&&a()(e.input).is(":focus")&&this.saveFocusedElement(e.input),e.enabled=!1):(e.enabled=!0,tt(e)&&this.restoreFocusedElement()))}));this.subs.push(n)}checkForMapping(t,e){if(!e.hasOwnProperty("_chosenRun"))return;const n=t.property.options.funccallMapping;if(!n)return;const i=JSON.parse(n),o=this.funcCallReplaced.pipe((0,s.startWith)(!0),(0,s.switchMap)((()=>this.funcCall.inputParams[t.property.name].onChanged))).subscribe((()=>{Object.entries(i).forEach((([t,n])=>this.setInput(t,e.chosenRun?(t=>{var n,i,o,s,r,a;return null!==(a=null!==(s=null!==(i=null===(n=e.chosenRun)||void 0===n?void 0:n.inputs[t])&&void 0!==i?i:null===(o=e.chosenRun)||void 0===o?void 0:o.outputs[t])&&void 0!==s?s:null===(r=e.chosenRun)||void 0===r?void 0:r.options[t])&&void 0!==a?a:null})(n):this.funcCall.inputParams[t].property.defaultValue,e.chosenRun?"restricted":"user input")))}));this.subs.push(o)}getInputForVal(n){var i,s,r;const a=n.property;if(this.inputsOverride[n.property.name])return this.inputsOverride[n.property.name];if(a.propertyType===o.TYPE.STRING&&a.options.choices&&!a.options.propagateChoice)return e.choiceInput(null!==(i=a.caption)&&void 0!==i?i:a.name,a.defaultValue,JSON.parse(a.options.choices));switch(a.propertyType){case o.TYPE.DATA_FRAME:return e.tableInput(null!==(s=a.caption)&&void 0!==s?s:a.name,null,t.shell.tables);case"file":return Zt.fileInput(null!==(r=a.caption)&&void 0!==r?r:a.name,null,null,null);case o.TYPE.FLOAT:const n=e.input.forProperty(a),i=a.options.format;return i&&(n.format=i),n;default:return e.input.forProperty(a)}}bindOnHotkey(t){tt(t)&&(t.input.onkeydown=t=>cn(this,void 0,void 0,(function*(){"Enter"==t.key&&this.runRequests.next()})))}get foldedCategories(){var t;return JSON.parse(null!==(t=this.func.options.foldedCategories)&&void 0!==t?t:"[]")}getCategoryWarningIcon(t){const n=e.iconFA("exclamation-circle",null,"This category has inconsistent inputs");a()(n).css({color:"var(--orange-2)","padding-left":"5px"}).hide();const i=this.funcCallReplaced.subscribe((()=>{this.foldedCategoryInputs[t].some((t=>"inconsistent"===this.getInputLockState(t.paramName)&&t.input.value!==this.getRestrictedValue(t.paramName)))?a()(n).show():a()(n).hide()}));return this.subs.push(i),n}renderCategory(t,n,i){if(n!==i)if(this.foldedCategories.includes(n)){const i=this.getCategoryWarningIcon(n),o=e.iconFA("chevron-right",(()=>{var t;a()(s).show(),a()(o).hide(),a()(i).hide(),(null!==(t=this.foldedCategoryInputs[n])&&void 0!==t?t:[]).forEach((t=>a()(t.input.root).css({display:""})))}),"Open category");a()(o).css("padding-right","5px");const s=e.iconFA("chevron-down",(()=>{var t;a()(s).hide(),a()(o).show(),this.foldedCategoryInputs[n].some((t=>"inconsistent"===this.getInputLockState(t.paramName)))?a()(i).show():a()(i).hide(),(null!==(t=this.foldedCategoryInputs[n])&&void 0!==t?t:[]).forEach((t=>a()(t.input.root).hide()))}),"Close category");a()(s).css("padding-right","5px"),t.append(e.h2([o,s,e.h2(n,{style:{display:"inline"}}),i],{style:{width:"100%"}})),a()(s).hide()}else t.append(e.h2(n,{style:{width:"100%"}}))}renderInput(t,n,i){var o;const s=n.property;this.foldedCategories.includes(s.category)&&(this.foldedCategoryInputs[s.category]=[...null!==(o=this.foldedCategoryInputs[s.category])&&void 0!==o?o:[],{paramName:n.property.name,input:i}]),this.injectLockIcons(n,i),(t=>{if(j(t))return;const e=t;e.setDisabled=function(){t.enabled=!1,a()(t.root).removeClass("rfv-restricted-unlocked-input"),a()(t.root).removeClass("rfv-inconsistent-input"),a()(t.root).removeClass("rfv-restricted-input")},e.setRestricted=function(){t.enabled=!1,tt(t)&&(t.input.disabled=!1),a()(t.root).addClass("rfv-restricted-input"),a()(t.root).removeClass("rfv-restricted-unlocked-input"),a()(t.root).removeClass("rfv-inconsistent-input")},e.setRestrictedUnlocked=function(){t.enabled=!0,a()(t.root).addClass("rfv-restricted-unlocked-input"),a()(t.root).removeClass("rfv-restricted-input"),a()(t.root).removeClass("rfv-inconsistent-input")},e.setInconsistent=function(){t.enabled=!0,a()(t.root).addClass("rfv-inconsistent-input"),a()(t.root).removeClass("rfv-restricted-input"),a()(t.root).removeClass("rfv-restricted-unlocked-input")},e.setUserInput=function(){t.enabled=!0,a()(t.root).removeClass("rfv-inconsistent-input"),a()(t.root).removeClass("rfv-restricted-input"),a()(t.root).removeClass("rfv-restricted-unlocked-input")}})(i),tt(i)&&(((t,e)=>{var n;const i=t.property;a()(e.root).css({width:`calc(${null!==(n=i.options.block)&&void 0!==n?n:"100"}% - ${i.options.block?"2":"0"}px)`,"box-sizing":"border-box"})})(n,i),this.bindTooltips(n,i),(t=>{const n=e.element("i");t.addOptions(n),t.setValidation=function(i){for(;n.firstChild&&n.removeChild(n.firstChild););const[o,s]=function(t){let n,i;return(null==t?void 0:t.pending)&&(i=e.iconFA("spinner",(()=>{z(t,i,n)}))),(null==t?void 0:t.errors)&&t.errors.length?(i=e.iconFA("exclamation-circle",(()=>{z(t,i,n)})),i.style.color="var(--red-3)"):(null==t?void 0:t.warnings)&&t.warnings.length?(i=e.iconFA("exclamation-circle",(()=>{z(t,i,n)})),i.style.color="var(--orange-2)"):(null==t?void 0:t.notifications)&&t.notifications.length&&(i=e.iconFA("info-circle",(()=>{z(t,i,n)})),i.style.color="var(--blue-1)"),i&&(i.classList.remove("fal"),i.classList.add("far"),n=function(t){const n=e.div([],"d4-tooltip");return function(t){t.popover="auto",t.style.fontStyle="normal",t.style.pointerEvents="all"}(n),t.appendChild(n),n}(i)),[i,n]}(i);o&&s&&(n.appendChild(o),n.appendChild(s)),t.input.classList.remove("d4-invalid"),t.input.classList.remove("d4-partially-invalid"),(null==i?void 0:i.errors)&&i.errors.length||(null==i?void 0:i.warnings)&&i.warnings.length||(null==i?void 0:i.notifications)&&i.notifications.length||(null==i?void 0:i.pending)?a()(n).css("display","flex"):a()(n).hide(),(null==i?void 0:i.errors)&&i.errors.length?t.input.classList.add("d4-invalid"):(null==i?void 0:i.warnings)&&i.warnings.length&&t.input.classList.add("d4-partially-invalid")}})(i)),t.append(i.root)}bindTooltips(t,n){const i=t.property.name;e.tooltip.bind(n.root,(()=>{const n=t.property.description?`${t.property.description}.`:null,o=(()=>"disabled"===this.getInputLockState(i)?"Input is disabled to prevent inconsistency.":"inconsistent"===this.getInputLockState(i)?"The entered value is inconsistent to the computed value.":"restricted"===this.getInputLockState(i)?"The value is dependent and computed automatically. Click to edit":null)();return n||o?e.divV([...n?[e.divText(n)]:[],...o?[e.divText(o)]:[]],{style:{"max-width":"300px"}}):null}))}injectLockIcons(t,n){const i=t.property.name;n.root.addEventListener("click",(()=>{"restricted"===this.getInputLockState(i)&&this.setInputLockState(n,t.name,t.value,"restricted unlocked")}));const s=e.iconFA("lock");a()(s).addClass("rfv-icon-lock"),a()(s).css({color:"var(--grey-2)"});const r=e.iconFA("lock-open");a()(r).addClass("rfv-icon-unlock"),a()(r).css({color:"var(--grey-2)"});const l=e.iconFA("undo",(e=>{this.setInput(t.name,this.getRestrictedValue(i),"restricted"),e.stopPropagation()}),"Reset value to computed value");a()(l).addClass("rfv-icon-undo"),a()(l).css({color:"var(--blue-2)"});const u=e.iconFA("exclamation-circle",null);e.tooltip.bind(u,(()=>`Current value is incosistent. Computed value was ${o.TYPES_SCALAR.has(t.property.propertyType)?this.getRestrictedValue(i):"different"}`)),a()(u).addClass("rfv-icon-warning"),a()(u).css({color:"var(--orange-2)"});const c=n;c.placeLockStateIcons||(c.placeLockStateIcons=function(t,e,i,o){tt(n)&&(n.addOptions(t),n.addOptions(e),n.addOptions(i),n.addOptions(o))}),c.placeLockStateIcons(s,r,l,u)}syncInput(t,e,n){const i=t.name;let r=!1;const a=this.funcCallReplaced.pipe((0,s.startWith)(!0)).subscribe((()=>{var t,s;const r=this.funcCall[dn[n]][i],a=r.property.propertyType===o.TYPE.STRING&&r.property.defaultValue?r.property.defaultValue.substring(1,r.property.defaultValue.length-1):r.property.defaultValue,l=null!==(s=null!==(t=this.funcCall[n][i])&&void 0!==t?t:a)&&void 0!==s?s:null;e.notify=!1,e.value=l,e.notify=!0,this.funcCall[n][i]=l,this.setInputLockState(e,i,l,this.getInputLockState(i))}));this.subs.push(a);const l=this.funcCallReplaced.pipe((0,s.startWith)(!0),(0,s.switchMap)((()=>{const t=this.funcCall[dn[n]][i];return t.onChanged.pipe((0,s.mapTo)(t))}))).subscribe((t=>{const i=this.funcCall[n][t.name];if(r||(e.notify=!1,e.value=i,e.notify=!0),n===un.INPUTS){this.isHistorical.next(!1),this.hideOutput(),this.validationRequests.next({field:t.name,isRevalidation:!1});const n=this.getInputLockState(t.name);"restricted unlocked"!==n&&"inconsistent"!==n||this.setInputLockState(e,t.name,i,i===this.getRestrictedValue(t.name)?"restricted unlocked":"inconsistent")}}));this.subs.push(l);const u=this.funcCallReplaced.pipe((0,s.startWith)(!0),(0,s.switchMap)((()=>{const t=this.funcCall[dn[n]][i];return t.onChanged.pipe((0,s.mapTo)(t),(0,s.startWith)(t))})),(0,s.filter)((t=>t.property.propertyType===o.TYPE.DATA_FRAME&&t.value)),(0,s.switchMap)((t=>t.value.onDataChanged.pipe((0,s.mapTo)(t))))).subscribe((t=>{this.validationRequests.next({field:t.name,isRevalidation:!1})}));this.subs.push(u);const d=(p=e.onInput.bind(e),new c.Observable((t=>{const e=p((e=>{t.next(e)}));return()=>e.unsubscribe()}))).pipe((0,s.debounceTime)(250)).subscribe((()=>{try{r=!0,this.funcCall[n][t.name]=e.value}finally{r=!1}}));var p;this.subs.push(d)}isRunnable(){return!this.isRunning.value&&!this.blockRuns.value&&this.isValid()}isValid(){for(const[t,e]of Object.entries(this.validationState))if(!H(e))return!1;for(const[t,e]of Object.entries(this.externalValidatorsState))if(!H(e))return!1;return!0}getValidationState(){return this.validationState}getValidationMessage(){const t=[];for(const[e,n]of Object.entries(this.validationState))H(n)||t.push(`${e}: ${Y(n)}`);return t.join("\n")}runValidation(t,e){return cn(this,void 0,void 0,(function*(){const n=t.field,i=this.getValidatedNames(n),o=yield Promise.all(i.map((n=>cn(this,void 0,void 0,(function*(){const i=this.funcCall.inputs[n],o=yield(u=i,this._funcCall,this.lastCall,t.isNewOutput,t.isRevalidation,s=void 0,r=void 0,a=void 0,l=function*(){if(null==u)return W({errors:["Missing value"]})},new(a||(a=Promise))((function(t,e){function n(t){try{o(l.next(t))}catch(t){e(t)}}function i(t){try{o(l.throw(t))}catch(t){e(t)}}function o(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,i)}o((l=l.apply(s,r||[])).next())})));var s,r,a,l,u;let c;const d=this.validators[n];return d&&(c=yield d(i,{param:n,funcCall:this._funcCall,lastCall:this.lastCall,signal:e,isNewOutput:!!t.isNewOutput,isRevalidation:t.isRevalidation,context:t.context,view:this})),[n,G(...this.funcCall.inputParams[n].property.options.nullable?[]:[o],c)]})))));return Object.fromEntries(o)}))}setValidationPending(t){const e=this.getValidatedNames(t);for(const t of e){this.validationState[t]={pending:!0};const e=this.inputsMap[t];D(e)&&e.setValidation({pending:!0})}this.validationUpdates.next(null)}setValidationResults(t){for(const[e,n]of Object.entries(t))this.validationState[e]=n,this.updateInputValidationReuslts(e)}updateInputValidationReuslts(t){const e=G(this.validationState[t],this.externalValidatorsState[t]),n=this.inputsMap[t];D(n)&&n.setValidation(e)}runRevalidations(t,e){if(!t.isRevalidation)for(const[,t]of Object.entries(e))if(null==t?void 0:t.revalidate)for(const e of t.revalidate)this.validationRequests.next({field:e,context:t.context,isRevalidation:!0})}getValidatedNames(t){return t?[t]:[...this.funcCall.inputs.keys()]}getValidExpRun(e){return cn(this,void 0,void 0,(function*(){const n=yield(yield t.functions.eval("Sin")).prepare({x:1}).call();e.dart.r2=n.dart.r2;const i=e.options.immutable_tags||[];return e.options.immutable_tags=i.includes(C)?i:[...i,C],e.newId(),e}))}saveExperimentalRun(t){return cn(this,void 0,void 0,(function*(){const e=yield this.getValidExpRun(t);yield this.saveRun(e)}))}hideOutput(){if(this._isOutputOutdated.next(!0),this.keepOutput())return;this.outputTabsLabels.forEach((t=>a()(this.tabsElem.getPane(t).header).hide()));const t=this.tabsElem.panes.find((t=>this.inputTabsLabels.includes(t.name)));t?this.tabsElem.currentPane=t:a()(this.tabsElem.root).hide()}getSheetName(t,e){if(this.sheetNamesCache[t])return this.sheetNamesCache[t];let n=`${t}`;n.length>31&&(n=`${n.slice(0,31)}`);let i=1;for(;e.worksheets.some((t=>t.name===n));){let e=`${t}`;e.length>31-`-${i}`.length&&(e=`${t.slice(0,31-`-${i}`.length)}`),n=`${e}-${i}`,i++}return this.sheetNamesCache[t]=n,n}richFunctionViewSupportedFormats(){return["Excel","DataUrl images"]}richFunctionViewExportExtensions(){return{Excel:"xlsx","DataUrl images":"txt"}}}n(693),Error;var fn=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};function mn(e){return()=>fn(this,void 0,void 0,(function*(){try{const n=yield t.dapi.groups.filter(`friendlyName="${e}"`).list();if(0===n.length)throw new Error("group with specified name is not found");if(n.length>1)throw new Error("found more than one group with specified name");const i=n[0];fetch(`${window.location.origin}/api/groups/${i.id}/requests/${t.shell.user.group.id}`,{method:"POST"})}catch(e){t.shell.error(e.toString())}}))}class vn extends o.ObjectHandler{get type(){return"Model"}getById(e){return fn(this,void 0,void 0,(function*(){return yield t.dapi.functions.find(e)}))}refresh(t){return fn(this,void 0,void 0,(function*(){return yield this.getById(t.id)}))}static openHelp(n){return fn(this,void 0,void 0,(function*(){if(null!=n.options.readme){t.shell.windows.showHelp=!0,yield new Promise((t=>setTimeout(t,100)));const i=`System:AppData/${n.package.name}/${n.options.readme}`;t.dapi.files.readAsText(i).then((n=>{t.shell.windows.help.showHelp(e.markdown(n))}))}}))}static openModel(t){t.prepare().edit()}static openModelFromFunccall(t){t.edit()}isApplicable(t){const e=o.toJs(t);return e instanceof o.Func&&e.hasTag("model")}constructor(){super(),this.userGroups=new c.BehaviorSubject(void 0)}getLanguageIcon(t){return"grok"==t?e.iconSvg("project"):e.iconImage("script",`/images/entities/${t}.png`)}renderMarkup(n){const i=e.divH([],{style:{"justify-content":"space-between",width:"100%"}});return setTimeout((()=>fn(this,void 0,void 0,(function*(){const o=yield this.awaitUserGroups(),s=JSON.parse(n.options.mandatoryUserGroups?`${n.options.mandatoryUserGroups}`:"[]").filter((t=>!o.map((t=>t.friendlyName)).includes(t.name))),r=s.length>0,a=e.iconFA("exclamation-triangle",null);a.classList.remove("grok-icon");const l=()=>{const t=e.iconFA("times");return t.style.marginRight="6px",t.classList.remove("grok-icon"),t},u=e.div(e.divV([e.label("You should be a member of the following group(s):",{style:{marginLeft:"0px"}}),...s.map((t=>e.divV([e.span([l(),t.name],{style:{"font-weight":600}}),...t.help?[e.span([t.help],{style:{marginLeft:"16px"}})]:[],e.link("Request group membership",mn(t.name),void 0,{style:{marginLeft:"16px"}})])))],{style:{gap:"10px"}})),c=e.span([this.renderIcon(n),e.label(n.friendlyName)]);var d;i.onclick=()=>{t.shell.windows.help.visible&&vn.openHelp(n)},r?c.classList.add("d4-disabled"):i.ondblclick=()=>{vn.openModel(n)},r&&(function(t){t.popover="auto",t.style.cursor="default",t.style.padding="10px",t.style.background="#fdffe5",t.style.border="1px solid #E4E6CE",t.style.borderRadius="2px",t.style.boxShadow="0 0 5px #E4E6CE",t.style.maxWidth="500px",t.style.color="var(--gray-6)"}(d=u),document.body.append(d),i.addEventListener("click",(()=>{!function(t,e){!function(t,e){const n=t.getBoundingClientRect().toJSON();e.style.inset="unset",e.style.top=n.y+"px",e.style.left=n.x+20+"px"}(t,e),e.showPopover()}(a,u)}))),i.append(c),r&&i.append(e.span([a]))})))),i}renderIcon(t){if(null!=t.options.icon&&(t.options.icon.startsWith("http://")||t.options.icon.startsWith("https://")))return e.iconImage("model-icon",t.options.icon);if(t instanceof o.Script)return this.getLanguageIcon(t.language);let n=(t=o.Func.find({package:t.package.name,name:t.name})[0]).package.getIconUrl();if(null!=t.options.icon){const e=n.split("/");e.pop(),e.push(t.options.icon),n=e.join("/")}return e.iconImage(t.package.name,n)}renderPreview(e){const n=Object.create(null,{renderPreview:{get:()=>super.renderPreview}});return fn(this,void 0,void 0,(function*(){var i;const s=null!==(i=e.options.editor)&&void 0!==i?i:"Compute:RichFunctionViewEditor",r=yield t.functions.find(s);if(null!==r&&r instanceof o.Func){const t=r.prepare({call:e.prepare()});yield t.call(!1,void 0,{processed:!0});const n=t.getOutputParamValue();if(n instanceof o.View)return n}return n.renderPreview.call(this,e)}))}renderProperties(t){const n=e.accordion("ComputeModel");n.context=t;const i=e.div([e.span([this.renderIcon(t),e.label(t.friendlyName),e.contextActions(t),e.star(t.id)])]);return n.addTitle(i),null!=t.description&&i.appendChild(e.div([e.markdown(t.description)],"model-catalog-description")),i.appendChild(e.tags(t)),null!=t.options["dev.status"]&&i.appendChild(e.tableFromMap({Status:t.options["dev.status"]})),n.end(),n.root}renderTooltip(t){const n=e.span([this.renderIcon(t),e.label(t.friendlyName)]);return n.classList.add("d4-link-label"),e.bind(t,e.divV([e.h2(n),e.divV([e.divText(t.description,"ui-description")],{style:{lineHeight:"150%"}})]))}renderCard(t){const n=this.renderMarkup(t);return n.classList.add("d4-link-label"),e.bind(t,e.h2(n))}init(){this.registerParamFunc("Help",(t=>{vn.openHelp(o.toJs(t))})),setTimeout((()=>fn(this,void 0,void 0,(function*(){const t=yield(yield fetch(`${window.location.origin}/api/groups/all_parents`)).json();this.userGroups.next(t)}))))}awaitUserGroups(){return fn(this,void 0,void 0,(function*(){return this.userGroups.pipe((0,s.filter)((t=>!!t)),(0,s.map)((t=>t)),(0,s.take)(1)).toPromise()}))}}var gn=n(847),yn={};yn.styleTagTransform=It(),yn.setAttributes=bt(),yn.insert=gt().bind(null,"head"),yn.domAPI=mt(),yn.insertStyleElement=Ct(),ht()(gn.A,yn),gn.A&&gn.A.locals&&gn.A.locals;class bn extends o.CustomCardView{static findOrCreateCatalogView(t,e,n){var i;return null!==(i=this.findModelCatalogView(e))&&void 0!==i?i:this.createModelCatalogView(t,e,n)}static createModelCatalogView(t,e,n){const i=o.Func.find({package:n.name,name:e})[0].prepare(),s=new this(t,e);return s.parentCall=i,s}static findModelCatalogView(e){return f()(t.shell.views).find((t=>{var n;return(null===(n=t.parentCall)||void 0===n?void 0:n.func.name)==e}))}bindModel(t){var e;t.aux.showOnTaskBar=!1;const n=this.parentCall;null!=n&&(n.aux.view=null!==(e=bn.findModelCatalogView(this.funcName))&&void 0!==e?e:this,t.parentCall=n)}constructor(e,n){if(super({dataSource:t.dapi.functions,permanentFilter:"#model"}),this.funcName=n,this.isHelpOpen=!1,this.root.classList.add("model-catalog-view"),this.meta=new vn,this.name=e,this.permanentFilter="#model",this.renderMode=o.RENDER_MODE.BRIEF,this.objectType="Func",this.categoryFilters={"options.department":"Department","options.HL_process":"HL_process","options.process":"Process",tag:"Tags"},this.filters={All:"",Favorites:"starredBy = @current","Used by me":"usedBy = @current"},this.hierarchy=["options.department","options.HL_process","options.process"],this.hierarchyProperties={"options.department":"Department","options.HL_process":"HL_process","options.process":"Process"},this.showTree=!0,this.initRibbon(),this.initMenu(),t.shell.windows.showProperties=!1,t.shell.windows.showHelp=this.isHelpOpen,!bn.findModelCatalogView(this.funcName)){const e=t.functions.onBeforeRunAction.subscribe((t=>{var e,n;t.func.hasTag("model")?this.bindModel(t):(null===(n=null===(e=t.inputs)||void 0===e?void 0:e.call)||void 0===n?void 0:n.func)instanceof o.Func&&t.inputs.call.func.hasTag("model")&&this.bindModel(t.inputs.call)})),n=t.events.onCurrentViewChanged.subscribe((()=>{return e=this,n=void 0,o=function*(){t.shell.v===this&&(t.shell.windows.showHelp=this.isHelpOpen)},new((i=void 0)||(i=Promise))((function(t,s){function r(t){try{l(o.next(t))}catch(t){s(t)}}function a(t){try{l(o.throw(t))}catch(t){s(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,a)}l((o=o.apply(e,n||[])).next())}));var e,n,i,o}));this.subs.push(e,n)}}initRibbon(){}initMenu(){this.ribbonMenu.group("Help").item("Compute Engine",(()=>window.open("https://github.com/datagrok-ai/public/tree/master/packages/Compute","_blank"))).item("Developing Models",(()=>window.open("https://datagrok.ai/help/compute/scripting","_blank"))).endGroup()}}var An=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))};let Cn=!1;const wn=new o.Package;function In(t){vn.openModelFromFunccall(t)}function xn(){return new u}function Tn(t){return hn.fromFuncCall(t,{historyEnabled:!0,isTabbed:!1})}function En(t){return hn.fromFuncCall(t,{historyEnabled:!1,isTabbed:!0})}function Rn(n){return An(this,void 0,void 0,(function*(){let i={};n.inputs.forEach((t=>i[t.name]=null));let s=`\ncurl --location --request POST '${t.settings.apiUrl}/v1/func/${n.nqName}/run' \\\n--header 'Authorization: ${Sn("auth")}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '${JSON.stringify(i)}'`,r=`\nvar myHeaders = new Headers();\nmyHeaders.append("Authorization", "${Sn("auth")}");\nmyHeaders.append("Content-Type", "application/json");\n\nvar raw = JSON.stringify(${JSON.stringify(i)});\n\nvar requestOptions = {\n method: 'POST',\n headers: myHeaders,\n body: raw,\n redirect: 'follow'\n};\n\nfetch("${t.settings.apiUrl}/v1/func/${n.nqName}/run", requestOptions)\n .then(response => response.text())\n .then(result => console.log(result))\n .catch(error => console.log('error', error));`,a=e.tabControl({CURL:e.div([e.divText(s)]),JS:e.div([e.divText(r)])});return o.Widget.fromRoot(a.root)}))}function Sn(t){let e=document.cookie.match(new RegExp("(?:^|; )"+t.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function On(t){return An(this,void 0,void 0,(function*(){return yield new Promise((t=>setTimeout(t,1e3))),[yield t.prepare({ambTemp:22,initTemp:100,desiredTemp:30,area:.06,heatCap:4200,heatTransferCoeff:8.3,simTime:21600}).call()]}))}function Pn(n){return An(this,void 0,void 0,(function*(){const i=(yield t.functions.eval("Compute:CustomDataUploader")).prepare({func:n.func}),r=e.bigButton("Click me to get mock calls",(()=>i.call())),a=o.Widget.fromRoot(e.panel([e.divV([e.label("This part of dialog comes from my custom data uploader"),e.divH([r],{style:{"justify-content":"center"}})])])),l=t.functions.onBeforeRunAction.pipe((0,s.filter)((t=>t.id===i.id))).subscribe((()=>{e.setUpdateIndicator(r,!0)})),u=t.functions.onAfterRunAction.pipe((0,s.filter)((t=>t.id===i.id))).subscribe((()=>{e.setUpdateIndicator(r,!1)}));return a.subs.push(l,u),{uploadWidget:a,uploadFuncCall:i}}))}function Bn(t){t.defaultView.scatterPlot({xColumnName:"Initial temperature",yColumnName:"Time to cool"})}function _n(){Cn||(o.ObjectHandler.list().find((t=>"Model"===t.type))||o.ObjectHandler.register(new vn),t.events.onAccordionConstructed.subscribe((t=>{const n=t.context;null!=n&&"script"==n.type&&(t.getPane("REST")||t.addPane("REST",(()=>e.wait((()=>An(this,void 0,void 0,(function*(){return(yield Rn(n)).root})))))))})),Cn=!0)}let kn=!1;function Fn(){const e=t.shell.startUri.indexOf("?"),n=t.shell.startUri.substring(8,e>0?e:void 0).split("/");if(!kn&&n.includes("Compute")){const e=bn.findOrCreateCatalogView("Model Catalog","modelCatalog",wn);return t.shell.addView(e),kn=!0,void(n.length>3&&t.dapi.functions.filter(`shortName = "${n[3]}" and #model`).list().then((t=>{1==t.length&&vn.openModel(t[0])})))}const i=window.location.href.indexOf("?"),o=window.location.href.substring(8,i>0?i:void 0).split("/");if(o.includes("browse")){const e=bn.findModelCatalogView("modelCatalog");return e&&(t.shell.v=e),bn.createModelCatalogView("Model Catalog","modelCatalog",wn)}if(o.includes("apps")){const e=bn.findModelCatalogView("modelCatalog");if(e)t.shell.v=e;else{const e=bn.createModelCatalogView("Model Catalog","modelCatalog",wn);t.shell.addView(e)}}}function Ln(t){const{reasonableMin:e,reasonableMax:n}=t;return t=>W({warnings:t<e||t>n?[`Minimum reasonable time is ${e}. Maximum reasonable time is ${n}`]:void 0,errors:t<0?["Time should be strictly positive"]:void 0})}function Vn(t){return(t,e)=>{const n=e.funcCall.inputs.ambTemp,i=e.funcCall.inputs.initTemp;return W({errors:[...t<n?[U(`Desired temperature cannot be less than ambient temperature (${n}). \n`,[{actionName:"Set desired equal to ambient",action:()=>e.funcCall.inputs.desiredTemp=n}])]:[],...t>i?[`Desired temperature cannot be higher than initial temperature (${i})`]:[]]})}}function Mn(t){return(t,e)=>{const n=e.funcCall.inputs.ambTemp;return W({errors:[...t<n?[`Initial temperature cannot be less than ambient temperature (${n}).`]:[]]})}}function Nn(t){return(t,e)=>{const n=e.funcCall.inputs.initTemp;return W({errors:[...t>n?[`Ambient temperature cannot be higher than initial temperature (${n})`]:[]]})}}function Dn(t){return(t,e)=>W({errors:[...t<=0?["Heat capacity must be greater than zero."]:[]],notifications:[U("Heat capacity is only dependent on the object material.",[{actionName:"Google it",action:()=>{window.open("http://google.com")}}])]})}function jn(t){const n=e.stringInput("Custom input","");return n.root.style.backgroundColor="aqua",n.input.style.backgroundColor="aqua",n}function $n(t){return Zt.historyInputJSON("Previous run","ObjectCooling")}})(),compute=i})();
|
|
3
2
|
//# sourceMappingURL=package.js.map
|